Skip to content

Commit cb615db

Browse files
committed
0.1.0
1 parent 2ae0432 commit cb615db

File tree

11 files changed

+4102
-1
lines changed

11 files changed

+4102
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build and publish package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
actions: write
12+
checks: write
13+
contents: write
14+
deployments: write
15+
issues: write
16+
packages: write
17+
pull-requests: write
18+
repository-projects: write
19+
security-events: write
20+
statuses: write
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
28+
- name: Update package.json version
29+
uses: jossef/action-set-json-field@v1
30+
with:
31+
file: ./package.json
32+
field: version
33+
value: ${{ github.event.release.name }}
34+
35+
- name: Package install
36+
run: npm install
37+
38+
- name: Publish package
39+
run: npm publish --access public
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Run Test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
cache: npm
20+
21+
- name: NPM install
22+
run: npm install
23+
24+
- name: Run build
25+
run: npm run build
26+
27+
- name: Run Test
28+
run: npm run test

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env*.local
29+
30+
# vercel
31+
.vercel
32+
33+
# typescript
34+
*.tsbuildinfo
35+
next-env.d.ts
36+
37+
# IDE
38+
.idea
39+
40+
# generated
41+
src/.openapi-generator
42+
src/.openapi-generator-ignore
43+
openapitools.json
44+
45+
# build
46+
dist

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
# snowflake
1+
# snowflake
2+
3+
## How to use
4+
```ts
5+
const generator = new Snowflake(1);
6+
const id = generator.generateId();
7+
```

0 commit comments

Comments
 (0)