diff --git a/.editorconfig b/.editorconfig index f32455a..9257a36 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,6 @@ trim_trailing_whitespace = true [*.md] indent_style = space trim_trailing_whitespace = false + +[*.yaml] +indent_style = space diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..86479ed --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,38 @@ +name: ci +on: + push: + branches: ["main"] + pull_request: + branches: ["*"] + paths-ignore: + - "docs/**" + - ".vscode/**" + - "README.md" + - ".gitignore" + - "LICENSE" + +jobs: + coverage: + name: "Coverage" + runs-on: ubuntu-latest + needs: [main] + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 10 + - run: pnpm install + - run: pnpm run test:coverage + + main: + name: "Main" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 10 + - run: pnpm install + - run: pnpm run build + - run: pnpm run lint + - run: pnpm run format diff --git a/biome.json b/biome.json index eb4b9ff..ab78d84 100644 --- a/biome.json +++ b/biome.json @@ -1,7 +1,13 @@ { "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "files": { - "ignore": ["coverage/**", "dist/**", "node_modules/**"] + "ignore": [ + "coverage/**", + "dist/**", + "examples/iife/snowflake.min.js", + "examples/worker/snowflake.min.js", + "node_modules/**" + ] }, "formatter": { "enabled": true, diff --git a/examples/browser/tsconfig.node.json b/examples/browser/tsconfig.node.json index 099658c..eca6668 100644 --- a/examples/browser/tsconfig.node.json +++ b/examples/browser/tsconfig.node.json @@ -1,10 +1,10 @@ { - "compilerOptions": { - "composite": true, - "skipLibCheck": true, - "module": "ESNext", - "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true - }, - "include": ["vite.config.ts"] -} \ No newline at end of file + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/package.json b/package.json index 90d7ae9..b1bc8d8 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,7 @@ "name": "@tknf/snowflake", "version": "1.0.1", "description": "A zero-dependency TypeScript library for generating sortable unique IDs for distributed systems", - "keywords": [ - "id", - "snowflake", - "distributed", - "typescript", - "uuid", - "generator" - ], + "keywords": ["id", "snowflake", "distributed", "typescript", "uuid", "generator"], "repository": { "type": "git", "url": "https://github.com/tknf/snowflake.git" @@ -40,9 +33,7 @@ "require": "./dist/browser.cjs" } }, - "files": [ - "dist" - ], + "files": ["dist"], "unpkg": "./dist/snowflake.min.js", "jsdelivr": "./dist/snowflake.min.js", "scripts": {