Skip to content

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
takecchi committed Sep 27, 2023
1 parent 2ae0432 commit cb615db
Show file tree
Hide file tree
Showing 11 changed files with 4,102 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/build-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build and publish package

on:
release:
types: [created]

jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
actions: write
checks: write
contents: write
deployments: write
issues: write
packages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Update package.json version
uses: jossef/action-set-json-field@v1
with:
file: ./package.json
field: version
value: ${{ github.event.release.name }}

- name: Package install
run: npm install

- name: Publish package
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- name: NPM install
run: npm install

- name: Run build
run: npm run build

- name: Run Test
run: npm run test
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# IDE
.idea

# generated
src/.openapi-generator
src/.openapi-generator-ignore
openapitools.json

# build
dist
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# snowflake
# snowflake

## How to use
```ts
const generator = new Snowflake(1);
const id = generator.generateId();
```
Loading

0 comments on commit cb615db

Please sign in to comment.