Compare commits

...

37 Commits
v1.1.6 ... main

Author SHA1 Message Date
Thomas A. Christensen II d7b44e949d
Bump version again
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II 38799ef3a3
Update publishing workflow
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II 3e64306429
Bump version number
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II 5c0b7046b7
Bump version number
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II 8822e5ee5f
Add package generation workflow
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II 1495857146
Add config to allow publishing to Github packages
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II 47014198e4
Change package scope to `MillironX`
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II edd49b855d
Update package-lock to Node 16
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II 24dfd282a2
Fix broken tests
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II d94d76c840
Apply Prettier formatting to tests
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Thomas A. Christensen II d66bab11a7
Merge remote-tracking branch 'upstream/main' 2 years ago
Thomas A. Christensen II c3fb34c758
Merge pull request #3 from criblio/main 2 years ago
Thomas A. Christensen II d5f6b82af2 Merge branch 'criblio-main' 2 years ago
Thomas A. Christensen II fca8ecb995
Merge branch 'main' of https://github.com/criblio/docker-names into criblio-main
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Eric Bond f1f173a7ed Update index.ts (#32)
Time for bondo to join the fun
2 years ago
Declan Shanaghy 3a33ac2b71 1.1.4 2 years ago
Declan Shanaghy fb9e881be2 1.1.3 2 years ago
declanshanaghy 262d463708
Add Tom & Russ. Fix some typos (#30)
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2 years ago
Declan Shanaghy 35fd621ab4 1.1.2 2 years ago
Declan Shanaghy d370e05cd7 1.1.1 2 years ago
declanshanaghy 184bf3ded2 1.1.0 (#27) 2 years ago
Thomas A. Christensen II 2b91472424
Update generation examples 3 years ago
Thomas A. Christensen II 1678367efb
Change the delimiter to an underscore when adding extra data (date or number) 3 years ago
Thomas A. Christensen II 95d7587408 Merge branch 'criblio-main' 3 years ago
Thomas A. Christensen II 40711973af
Merge branch 'main' of https://github.com/criblio/docker-names into criblio-main 3 years ago
MillironX 46ef3d4dd5
Add governors of Wyoming 3 years ago
MillironX 7f3d0c0235
Add governors of Kansas 3 years ago
MillironX e877672b65
Added Stefan Karpinski 3 years ago
MillironX 5359911c84
Personalize README.md 3 years ago
MillironX 3bd03f0d99
Add date optional function 3 years ago
MillironX 29c2344622
Change dash back to underscore 3 years ago
MillironX fa5c207540
Add Ernest Thiele 3 years ago
MillironX 7ecd696db4
Add Octave Levenspiel 3 years ago
MillironX 56d791884e
Add Robert Hungate 3 years ago
MillironX 33dc59d6c9
Add Baxter Black 3 years ago
MillironX 9048df37aa
Add Charles Henderson 3 years ago
MillironX fb1432c303
Add Jay Lush 3 years ago

@ -0,0 +1,21 @@
name: Build and Publish
on:
push:
tags:
- "v[0-9]+.*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com
scope: "@MillironX"
- run: npm install
- run: npm test
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@ -1,13 +1,25 @@
# Docker Names
An implementation of [docker-names](https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go) in TypeScript. This package unlike the normal docker name generator, generates with a `-` instead of an `_`.
An implementation of [docker-names](https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go) in TypeScript. Forked from <https://github.com/criblio/docker-names>.
## Changes
1. Added more names of scientists related to
- chemical engineering
- animal breeding
- rumen science
- among others...
2. Changed the delimiter to an underscore when adding extra data (date or number)
3. Added an identifier that starts with a date (useful where identifiers have to be sorted chronologically).
## Usage
Maybe this stuff will still work? :shrug: I just replaced everything with my name and code, but I personally transpile to JavaScript rather than use TypeScript directly.
### Generate Name
```typescript
import {generateName} from '@criblinc/docker-names'
import {generateName} from '@millironx/docker-names'
const dockerName = generateName();
@ -18,23 +30,34 @@ console.log(dockerName);
### Generate Name With Number
```typescript
import {generateNameWithNumber} from '@criblinc/docker-names'
import {generateNameWithNumber} from '@millironx/docker-names'
const dockerName = generateNameWithNumber();
console.log(dockerName);
//Outputs goofy-panini-4
//Outputs goofy-panini_4
```
## Words
### Generate Name With Date
```typescript
import {generateNameWithDate} from '@millironx/docker-names'
const dockerName = generateNameWithDate();
console.log(dockerName);
//Outputs 20210720_goofy-panini
```
## Words
The words can also be imported from the package if need be.
```typescript
import {left,right} from '@criblinc/docker-names'
import {left,right} from '@millironx/docker-names'
console.log(left);
@ -43,6 +66,4 @@ console.log(left);
console.log(right)
//Outputs [albattani,allen, etc...]
```
```

9442
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "@criblinc/docker-names",
"version": "1.1.4",
"name": "@millironx/docker-names",
"version": "1.1.8",
"description": "Fork of docker names for javascript",
"files": [
"lib/**/*"
@ -15,10 +15,11 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/criblio/docker-names.git"
"url": "git+https://github.com/MillironX/docker-names.git"
},
"publishConfig": {
"access": "public"
"access": "public",
"registry": "https://npm.pkg.github.com"
},
"keywords": [
"docker",
@ -28,12 +29,12 @@
"docker-names",
"docker-name"
],
"author": "Cribl",
"author": "MillironX",
"license": "ISC",
"bugs": {
"url": "https://github.com/criblio/docker-names/issues"
"url": "https://github.com/MillironX/docker-names/issues"
},
"homepage": "https://github.com/criblio/docker-names#readme",
"homepage": "https://github.com/MillironX/docker-names#readme",
"devDependencies": {
"@types/jest": "^26.0.22",
"jest": "^26.6.3",

@ -1,21 +1,21 @@
import {generateName, generateNameWithNumber, left, right} from "../index";
import { generateName, generateNameWithNumber, left, right } from "../index";
describe('Docker names', () => {
test('should generate a random name', () => {
describe("Docker names", () => {
test("should generate a random name", () => {
const name = generateName();
const parts = name.split('-');
const parts = name.split("-");
expect(parts).toHaveLength(2);
expect(left).toContain(parts[0]);
expect(right).toContain(parts[1]);
})
});
test("should generate a random name with a number", () => {
const nameWithNumber = generateNameWithNumber();
const parts = nameWithNumber.split('-');
expect(parts).toHaveLength(3);
expect(left).toContain(parts[0]);
expect(right).toContain(parts[1]);
expect(parseInt(parts[2])).toBeGreaterThan(0);
})
})
const parts = nameWithNumber.split("_");
expect(parts).toHaveLength(2);
const nameparts = parts[0].split("-");
expect(left).toContain(nameparts[0]);
expect(right).toContain(nameparts[1]);
expect(parseInt(parts[1])).toBeGreaterThan(0);
});
});

@ -2,6 +2,7 @@ export const left = [
"admiring",
"adoring",
"affectionate",
"agitated",
"amazing",
"awesome",
"beautiful",
@ -9,6 +10,7 @@ export const left = [
"blissful",
"bold",
"brave",
"busy",
"caprine",
"charming",
"clever",
@ -18,6 +20,7 @@ export const left = [
"confident",
"dazzling",
"determined",
"distracted",
"dreamy",
"eager",
"ecstatic",
@ -40,8 +43,11 @@ export const left = [
"gracious",
"great",
"happy",
"hardcore",
"heuristic",
"hircine",
"hopeful",
"hungry",
"infallible",
"inspiring",
"interesting",
@ -56,6 +62,7 @@ export const left = [
"mystifying",
"modest",
"musing",
"nervous",
"nice",
"nifty",
"nostalgic",
@ -71,11 +78,16 @@ export const left = [
"relaxed",
"reverent",
"ruminant",
"sad",
"serene",
"sharp",
"silly",
"sleepy",
"stoic",
"strange",
"sweet",
"tender",
"thirsty",
"trusting",
"unruffled",
"upbeat",
@ -148,6 +160,9 @@ export const right = [
// Bhaskara II - Ancient Indian mathematician-astronomer whose work on calculus predates Newton and Leibniz by over half a millennium - https://en.wikipedia.org/wiki/Bh%C4%81skara_II#Calculus
"bhaskara",
// Baxter Black - Veterinarian, humorist and all-around cowboy philosopher - https://en.wikipedia.org/wiki/Baxter_Black
"black",
// Elizabeth Helen Blackburn - Australian-American Nobel laureate; best known for co-discovering telomerase. https://en.wikipedia.org/wiki/Elizabeth_Blackburn
"blackburn",
@ -378,6 +393,9 @@ export const right = [
// Werner Heisenberg was a founding father of quantum mechanics. https://en.wikipedia.org/wiki/Werner_Heisenberg
"heisenberg",
// Charles Roy Henderson - Developer of BLUP as the solution of linear mixed models commonly used in breeding value calculations. - https://en.wikipedia.org/wiki/Charles_Roy_Henderson
"henderson",
// Grete Hermann was a German philosopher noted for her philosophical work on the foundations of quantum mechanics. https://en.wikipedia.org/wiki/Grete_Hermann
"hermann",
@ -405,6 +423,9 @@ export const right = [
// Frances Hugle, she was an American scientist, engineer, and inventor who contributed to the understanding of semiconductors, integrated circuitry, and the unique electrical principles of microscopic materials. https://en.wikipedia.org/wiki/Frances_Hugle
"hugle",
// Robert Hungate - Creator of anaerobic bacterial culture methods for use in rumen microbiology - https://en.wikipedia.org/wiki/Robert_Hungate
"hungate",
// Hypatia - Greek Alexandrine Neoplatonist philosopher in Egypt who was one of the earliest mothers of mathematics - https://en.wikipedia.org/wiki/Hypatia
"hypatia",
@ -414,6 +435,9 @@ export const right = [
// Mary Jackson, American mathematician and aerospace engineer who earned the highest title within NASA's engineering department - https://en.wikipedia.org/wiki/Mary_Jackson_(engineer)
"jackson",
// Yeong-Sil Jang was a Korean scientist and astronomer during the Joseon Dynasty; he invented the first metal printing press and water gauge. https://en.wikipedia.org/wiki/Jang_Yeong-sil
"jang",
// Mae Carol Jemison - is an American engineer, physician, and former NASA astronaut. She became the first black woman to travel in space when she served as a mission specialist aboard the Space Shuttle Endeavour - https://en.wikipedia.org/wiki/Mae_Jemison
"jemison",
@ -441,6 +465,9 @@ export const right = [
// Susan Kare, created the icons and many of the interface elements for the original Apple Macintosh in the 1980s, and was an original employee of NeXT, working as the Creative Director. https://en.wikipedia.org/wiki/Susan_Kare
"kare",
// Stefan Karpinski - co-creator of the Julia programming language. Recognizable on most web forums by his awesome Viking helmet. - https://en.wikipedia.org/wiki/Stefan_Karpinski
"karpinski",
// Mstislav Keldysh - a Soviet scientist in the field of mathematics and mechanics, academician of the USSR Academy of Sciences (1946), President of the USSR Academy of Sciences (19611975), three times Hero of Socialist Labor (1956, 1961, 1971), fellow of the Royal Society of Edinburgh (1968). https://en.wikipedia.org/wiki/Mstislav_Keldysh
"keldysh",
@ -489,6 +516,9 @@ export const right = [
// Inge Lehmann - Danish seismologist and geophysicist. Known for discovering in 1936 that the Earth has a solid inner core inside a molten outer core. https://en.wikipedia.org/wiki/Inge_Lehmann
"lehmann",
// Octave Levenspiel - Chemical engineer specializing in reaction engineering. Reactor volume plots and GNU's implementation of Matlab are named after him. - https://en.wikipedia.org/wiki/Octave_Levenspiel
"levenspiel",
// Daniel Lewin - Mathematician, Akamai co-founder, soldier, 9/11 victim-- Developed optimization techniques for routing traffic on the internet. Died attempting to stop the 9-11 hijackers. https://en.wikipedia.org/wiki/Daniel_Lewin
"lewin",
@ -504,6 +534,9 @@ export const right = [
// Auguste and Louis Lumière - the first filmmakers in history - https://en.wikipedia.org/wiki/Auguste_and_Louis_Lumi%C3%A8re
"lumiere",
// Jay Laurence Lush - the father of animal breeding - https://en.wikipedia.org/wiki/Jay_Laurence_Lush
"lush",
// Mahavira - Ancient Indian mathematician during 9th century AD who discovered basic algebraic identities - https://en.wikipedia.org/wiki/Mah%C4%81v%C4%ABra_(mathematician)
"mahavira",
@ -723,6 +756,9 @@ export const right = [
// Marie Tharp - American geologist and oceanic cartographer who co-created the first scientific map of the Atlantic Ocean floor. Her work led to the acceptance of the theories of plate tectonics and continental drift. https://en.wikipedia.org/wiki/Marie_Tharp
"tharp",
// Ernest Thiele - Chemical engineer who developed a method for finding number of required trays in a distallation column (the McCabe/Thiele method) and for quantifying the relationship between reaction rates and transport rates in diffusive reactors (the Thiele modulus). - https://en.wikipedia.org/wiki/Ernest_Thiele
"thiele",
// Ken Thompson - co-creator of UNIX and the C programming language - https://en.wikipedia.org/wiki/Ken_Thompson
"thompson",
@ -832,6 +868,100 @@ export const right = [
// Tim VanDoren - Sr Frontend Engineer
// Trevor VanDoren - Software Engineer
"wilkins", // Jacob Wilkins - Principal DevSecOps Engineer
// Governors of Kansas - https://en.wikipedia.org/wiki/List_of_governors_of_Kansas
"reeder",
"shannon",
"geary",
"walker",
"denver",
"medary",
"robinson",
"carney",
"crawford",
"green",
"harvey",
"osborn",
"anthony",
"john",
"glick",
"martin",
"humphrey",
"lewelling",
"morrill",
"leedy",
"stanley",
"bailey",
"hoch",
"stubbs",
"hodges",
"capper",
"allen",
"davis",
"paulen",
"reed",
"woodring",
"landon",
"huxman",
"ratner",
"schoeppel",
"carlson",
"hagaman",
"arn",
"hall",
"mccuish",
"docking",
"anderson",
"avery",
"docking",
"bennett",
"carlin",
"hayden",
"finney",
"graves",
"sebelius",
"parkinson",
"brownback",
"colyer",
"kelly",
// Governors of Wyoming - https://en.wikipedia.org/wiki/List_of_governors_of_Wyoming
"campbell",
"thayer",
"hoyt",
"hale",
"morgan",
"warren",
"baxter",
"moonlight",
"barber",
"osborne",
"richards",
"chatterton",
"brooks",
"carey",
"kendrick",
"houx",
"ross",
"lucas",
"emerson",
"clark",
"miller",
"smith",
"hunt",
"crane",
"barrett",
"simpson",
"hickey",
"gage",
"hansen",
"hathaway",
"herschler",
"sullivan",
"geringer",
"freudenthal",
"mead",
"gordon"
]
/**
@ -849,5 +979,16 @@ export function generateName(): string {
* @returns {string}
*/
export function generateNameWithNumber() {
return `${generateName()}-${Math.floor(Math.random() * 6) + 1}`
return `${generateName()}_${Math.floor(Math.random() * 6) + 1}`
}
/**
* Generates a name prepended by today's date in the format YYYYMMDD
* @returns {string}
*/
export function generateNameWithDate() {
var today = new Date();
today.setMinutes(today.getMinutes() - today.getTimezoneOffset());
const todayText = today.toISOString().slice(0,10).replace(/-/g,"");
return `${todayText}_${generateName()}`
}

Loading…
Cancel
Save