Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit b6e1736

Browse files
fix: build & import issues (#32)
fixes #30 fixes #31
1 parent ce7b796 commit b6e1736

31 files changed

+10465
-9353
lines changed

.eslintrc.cjs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
module.exports = {
2+
extends: [
3+
"airbnb-base",
4+
"eslint:recommended",
5+
"prettier",
6+
"plugin:@typescript-eslint/recommended",
7+
],
8+
parserOptions: {
9+
ecmaVersion: 12,
10+
parser: "@typescript-eslint/parser",
11+
project: ["./tsconfig.json", "./tsconfig.examples.json", "./tsconfig.tests.json"],
12+
sourceType: "module",
13+
},
14+
plugins: ["@typescript-eslint", "no-instanceof", "eslint-plugin-vitest"],
15+
ignorePatterns: [
16+
".eslintrc.cjs",
17+
"scripts",
18+
"node_modules",
19+
"dist",
20+
"dist-cjs",
21+
"*.js",
22+
"*.cjs",
23+
"*.d.ts",
24+
],
25+
rules: {
26+
"no-instanceof/no-instanceof": 2,
27+
"@typescript-eslint/explicit-module-boundary-types": 0,
28+
"@typescript-eslint/no-empty-function": 0,
29+
"@typescript-eslint/no-shadow": 0,
30+
"@typescript-eslint/no-empty-interface": 0,
31+
"@typescript-eslint/no-use-before-define": ["error", "nofunc"],
32+
"@typescript-eslint/no-unused-vars": ["warn", { args: "none" }],
33+
"@typescript-eslint/no-floating-promises": "error",
34+
"@typescript-eslint/no-misused-promises": "error",
35+
"arrow-body-style": 0,
36+
camelcase: 0,
37+
"class-methods-use-this": 0,
38+
"import/extensions": [2, "ignorePackages"],
39+
"import/no-extraneous-dependencies": [
40+
"error",
41+
{ devDependencies: ["**/*.test.ts", "examples/**/*.ts"] },
42+
],
43+
"import/no-unresolved": 0,
44+
"import/prefer-default-export": 0,
45+
'vitest/no-focused-tests': 'error',
46+
"keyword-spacing": "error",
47+
"max-classes-per-file": 0,
48+
"max-len": 0,
49+
"no-await-in-loop": 0,
50+
"no-bitwise": 0,
51+
"no-console": 0,
52+
"no-empty-function": 0,
53+
"no-restricted-syntax": 0,
54+
"no-shadow": 0,
55+
"no-continue": 0,
56+
"no-void": 0,
57+
"no-underscore-dangle": 0,
58+
"no-use-before-define": 0,
59+
"no-useless-constructor": 0,
60+
"no-return-await": 0,
61+
"consistent-return": 0,
62+
"no-else-return": 0,
63+
"func-names": 0,
64+
"no-lonely-if": 0,
65+
"prefer-rest-params": 0,
66+
"new-cap": ["error", { properties: false, capIsNew: false }],
67+
},
68+
};

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
uses: actions/setup-node@v4
1818
with:
1919
node-version: '20'
20-
cache: 'npm'
20+
cache: 'yarn'
2121

2222
- name: Install dependencies
23-
run: npm ci
23+
run: yarn install --immutable
2424

2525
- name: Lint
26-
run: npm run lint
26+
run: yarn lint
2727

2828
- name: Build
29-
run: npm run build
29+
run: yarn build
3030

3131
- name: Run tests
32-
run: npm test
32+
run: yarn test
3333

3434
coverage:
3535
name: Coverage
@@ -42,13 +42,13 @@ jobs:
4242
uses: actions/setup-node@v4
4343
with:
4444
node-version: '20'
45-
cache: 'npm'
45+
cache: 'yarn'
4646

4747
- name: Install dependencies
48-
run: npm ci
48+
run: yarn install --immutable
4949

5050
- name: Generate coverage report
51-
run: npm test -- --coverage
51+
run: yarn test -- --coverage
5252

5353
- name: Upload coverage to Codecov
5454
uses: codecov/codecov-action@v3

.github/workflows/npm-publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ jobs:
2828
with:
2929
node-version: '20'
3030
registry-url: 'https://registry.npmjs.org'
31-
cache: 'npm'
31+
cache: 'yarn'
3232

3333
- name: Install dependencies
34-
run: npm ci
34+
run: yarn install --immutable
3535

3636
- name: Run tests
37-
run: npm test
37+
run: yarn test
3838

3939
- name: Build
40-
run: npm run build
40+
run: yarn build
4141

4242
- name: Configure Git
4343
run: |
@@ -78,7 +78,7 @@ jobs:
7878
echo "Final version to publish: $FINAL_VERSION"
7979
8080
- name: Publish to npm
81-
run: npm publish --access public
81+
run: yarn npm publish --access public
8282
env:
8383
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8484

.github/workflows/pr-validation.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
uses: actions/setup-node@v4
1818
with:
1919
node-version: '20'
20-
cache: 'npm'
20+
cache: 'yarn'
2121

2222
- name: Install dependencies
23-
run: npm ci
23+
run: yarn install --immutable
2424

2525
- name: Lint
26-
run: npm run lint
26+
run: yarn lint
2727

2828
- name: Type check
29-
run: npm run build --noEmit
29+
run: yarn build
3030

3131
- name: Run tests
32-
run: npm test
32+
run: yarn test
3333

3434
format-check:
3535
name: Format Check
@@ -42,10 +42,10 @@ jobs:
4242
uses: actions/setup-node@v4
4343
with:
4444
node-version: '20'
45-
cache: 'npm'
45+
cache: 'yarn'
4646

4747
- name: Install dependencies
48-
run: npm ci
48+
run: yarn install --immutable
4949

5050
- name: Check formatting
5151
run: npx prettier --check "src/**/*.ts" "examples/**/*.ts"

.gitignore

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,7 @@
1-
# Dependency directories
2-
node_modules/
3-
.pnp/
4-
.pnp.js
5-
.cursor
6-
7-
# Build outputs
8-
dist/
9-
build/
10-
*.tsbuildinfo
11-
.env
12-
mcp.json
13-
14-
# Coverage directory
15-
coverage/
16-
17-
# Environment files
18-
.env
19-
.env.local
20-
.env.development.local
21-
.env.test.local
22-
.env.production.local
23-
24-
# Logs
25-
logs
26-
*.log
27-
npm-debug.log*
28-
yarn-debug.log*
29-
yarn-error.log*
30-
31-
# Editor directories and files
32-
.idea/
33-
.vscode/
34-
*.swp
35-
*.swo
36-
.DS_Store
37-
38-
# Python
39-
__pycache__/
40-
*.py[cod]
41-
*$py.class
42-
*.so
43-
.Python
44-
env/
45-
venv/
46-
ENV/
47-
.env
48-
.venv
49-
.python-version
50-
51-
# Misc
52-
.cache/
53-
.temp/
54-
.tmp/
1+
index.cjs
2+
index.js
3+
index.d.ts
4+
index.d.cts
5+
node_modules
6+
dist
7+
.yarn

.prettierrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"printWidth": 80,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"semi": true,
7+
"singleQuote": false,
8+
"quoteProps": "as-needed",
9+
"jsxSingleQuote": false,
10+
"trailingComma": "es5",
11+
"bracketSpacing": true,
12+
"arrowParens": "always",
13+
"requirePragma": false,
14+
"insertPragma": false,
15+
"proseWrap": "preserve",
16+
"htmlWhitespaceSensitivity": "css",
17+
"vueIndentScriptAndStyle": false,
18+
"endOfLine": "lf"
19+
}

.yarn/install-state.gz

792 KB
Binary file not shown.

.yarn/plugins/@yarnpkg/plugin-typescript.cjs

Lines changed: 9 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.5.1.cjs

Lines changed: 873 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
5+
spec: "@yarnpkg/plugin-typescript"
6+
7+
yarnPath: .yarn/releases/yarn-3.5.1.cjs

0 commit comments

Comments
 (0)