-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore (cli): extract cli to separate package (#1317)
This PR extracts the CLI out of the `electric-sql` package and into its own `@electric-sql/cli` package. TODO: - We may want to add `.js` extension to every import to avoid having to run the `fix-imports.js` script.
- Loading branch information
Showing
73 changed files
with
1,428 additions
and
2,009 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"fixed": [["@electric-sql/cli", "electric-sql"]], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "main", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"electric-sql": patch | ||
"@electric-sql/cli": patch | ||
--- | ||
|
||
Extract CLI to a separate package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: CLI / Tests | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- 'pnpm-lock.yaml' | ||
- 'components/cli/**' | ||
- '!components/cli/**.md' | ||
|
||
defaults: | ||
run: | ||
working-directory: components/cli | ||
|
||
concurrency: | ||
group: cli-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
verify_formatting: | ||
name: Check formatting & linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: pnpm | ||
- run: make deps | ||
- run: pnpm run check-styleguide | ||
check_types: | ||
name: Check types | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: pnpm | ||
- run: make deps | ||
- run: pnpm run typecheck | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [16, 18, 20] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
- name: Install | ||
run: make deps | ||
- name: Build | ||
run: make build | ||
- name: Run tests | ||
run: make tests | ||
maybe_publish: | ||
runs-on: ubuntu-latest | ||
needs: [test, check_types, verify_formatting] | ||
if: ${{ github.ref_name == 'main' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
- run: make deps | ||
- run: pnpm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}" | ||
- run: make publish-canary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,2 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
root: true, | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', // or "error" | ||
{ | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
caughtErrorsIgnorePattern: '^_', | ||
}, | ||
], | ||
'@typescript-eslint/no-inferrable-types': 'off', // always allow explicit typings | ||
'@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }], | ||
'@typescript-eslint/ban-ts-comment': [ | ||
'error', | ||
{ 'ts-ignore': 'allow-with-description' }, | ||
], | ||
'no-constant-condition': ['error', { checkLoops: false }], | ||
eqeqeq: ['error'], | ||
}, | ||
ignorePatterns: [ | ||
'**/*/mock.ts', | ||
'**/*/prismaClient.d.ts', | ||
'**/*/_generated/**', | ||
'**/node_modules/**', | ||
'**/dist/**', | ||
], | ||
} | ||
const config = require('../../common/.eslintrc.cjs') | ||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const config = require('../../common/.prettierrc.cjs') | ||
module.exports = config |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.