diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..68a543d --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,23 @@ +module.exports = { + root: true, + env: { + node: true, + es2022: true, + }, + extends: [ + 'eslint:recommended', + '@typescript-eslint/recommended', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 2022, + sourceType: 'module', + }, + plugins: ['@typescript-eslint'], + rules: { + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-unused-vars': 'error', + 'no-console': 'off', + }, + ignorePatterns: ['dist/', 'node_modules/', '*.js'], +}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3b95e0d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Test + run: npm test + + - name: Build + run: npm run build + + publish: + needs: test + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm run build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..29b9d1f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": true, + "printWidth": 100, + "tabWidth": 2, + "useTabs": false +} diff --git a/package.json b/package.json index 5598855..e78071e 100644 --- a/package.json +++ b/package.json @@ -56,12 +56,12 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/YOUR_ORG/opencode-filter.git" + "url": "https://github.com/karti-ai/opencode-filter.git" }, "bugs": { - "url": "https://github.com/YOUR_ORG/opencode-filter/issues" + "url": "https://github.com/karti-ai/opencode-filter/issues" }, - "homepage": "https://github.com/YOUR_ORG/opencode-filter#readme", + "homepage": "https://github.com/karti-ai/opencode-filter#readme", "devDependencies": { "@opencode-ai/plugin": "file:/home/metal/.opencode/node_modules/@opencode-ai/plugin", "@opencode-ai/sdk": "file:/home/metal/.opencode/node_modules/@opencode-ai/sdk",