diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..09df2dc --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,29 @@ +name: Publish +on: + push: + branches: + - main + +jobs: + npm_publish: + name: Publish to npm + runs-on: ubuntu-latest + needs: [release-please] + environment: + name: publish + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + - name: Install dependencies + run: | + npm ci + npm run build + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index c5520dc..01b3577 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -16,24 +16,4 @@ jobs: - uses: google-github-actions/release-please-action@v3 with: release-type: node - package-name: kycli - npm_publish: - name: Publish to npm - runs-on: ubuntu-latest - needs: [release-please] - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '18' - registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: | - npm ci - npm run build - - name: Publish to npm - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + package-name: kyseline diff --git a/.kyselinecfg.json b/.kyselinecfg.json new file mode 100644 index 0000000..8920010 --- /dev/null +++ b/.kyselinecfg.json @@ -0,0 +1,3 @@ +{ + "migrationDir": "./migrations" +} diff --git a/src/config-file/ConfigParser.ts b/src/config-file/ConfigParser.ts index 4e2237e..f0633df 100644 --- a/src/config-file/ConfigParser.ts +++ b/src/config-file/ConfigParser.ts @@ -13,7 +13,7 @@ export class ConfigParser { } #readConfigFile = () => { - const configPath = path.resolve(process.cwd() + '/.kyselycli.json') + const configPath = path.resolve(process.cwd() + '/.kyselinecfg.json') if (!fs.existsSync(configPath)) { console.error("Couldn't find .kyselycli.json file") diff --git a/src/index.ts b/src/index.ts index e7500b3..6cd362d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import createMigrationHandler from './handlers/migrationHandler' const program = new Command() -program.name('kysely-cli').description('Cli tool for kysely').version('0.0.1') +program.name('kyseline').description('Cli tool for kysely').version('0.0.1') program .command('migration') @@ -13,13 +13,13 @@ program console.log(` MAKE: To create a new table: - $ kycli migration:make create_foo_table foo:string bar:integer + $ kyseline migration:make create_foo_table foo:string bar:integer To add fields to an existing table: - $ kycli migration:make add_foo_from_foo_table foo:string bar:integer + $ kyseline migration:make add_foo_from_foo_table foo:string bar:integer To remove fields from an existing table: - $ kycli migration:make remove_foo_from_footable foo + $ kyseline migration:make remove_foo_from_footable foo `) }) .action((cmdObj) => {