diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5306aa8..6740add 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,31 +26,3 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} name: "Build distribution bundle and publish to registry" - build-bundle: - permissions: write-all - runs-on: ubuntu-latest - env: - ANCA_CI: true - name: Build bundle - steps: - - uses: actions/checkout@v4 - name: Checkout repo - - uses: actions/setup-node@v4 - with: - node-version: 22.11.0 - name: Install Node.js - - run: npm ci - name: Install dependencies - - run: npm run build:bundle - name: Build bundle - - run: | - mv build/bundle/index.js build/bundle/${{ github.event.repository.name }}-${{ github.ref_name }}.js - shell: bash - name: Rename bundle - - uses: softprops/action-gh-release@v1 - with: - files: | - build/bundle/${{ github.event.repository.name }}-${{ github.ref_name }}.js - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Attach bundle to release diff --git a/anca.json b/anca.json index bdc7b2d..8c94252 100644 --- a/anca.json +++ b/anca.json @@ -1,4 +1,31 @@ { + "cinnabarMeta": { + "dataVersion": 0, + "version": { + "latest": "0.0.0", + "timestamp": 0 + }, + "files": [ + { + "path": "./package.json", + "type": "nodejs-package-json" + }, + { + "path": "./package-lock.json", + "type": "nodejs-package-lock-json" + }, + { + "path": "./src/cinnabar.ts", + "type": "typescript", + "updateBuild": true + } + ], + "repo": { + "type": "github", + "value": "cinnabar-forge/snapcrud" + }, + "updateChangelog": true + }, "development": { "nodejsOpenapi": { "modelsLocation": "./src/types/openapi.ts", diff --git a/package-lock.json b/package-lock.json index 8860efd..4b12255 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,12 +12,15 @@ "@cinnabar-forge/utils": "0.2.0", "clivo": "0.5.2", "dotenv": "16.4.5", - "express": "4.21.1", + "express": "4.21.2", "helmet": "8.0.0", "knex": "3.1.0", "mysql2": "3.11.4", "winston": "3.17.0" }, + "bin": { + "snapcrud": "bin/snapcrud.js" + }, "devDependencies": { "@cinnabar-forge/eslint-plugin": "0.7.3", "@cinnabar-forge/meta": "0.3.1", @@ -2520,9 +2523,9 @@ } }, "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "license": "MIT", "dependencies": { "accepts": "~1.3.8", @@ -2544,7 +2547,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -2559,6 +2562,10 @@ }, "engines": { "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/express/node_modules/debug": { @@ -3665,9 +3672,9 @@ "license": "MIT" }, "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "license": "MIT" }, "node_modules/pg-connection-string": { diff --git a/package.json b/package.json index 348072e..2055510 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@cinnabar-forge/utils": "0.2.0", "clivo": "0.5.2", "dotenv": "16.4.5", - "express": "4.21.1", + "express": "4.21.2", "helmet": "8.0.0", "knex": "3.1.0", "mysql2": "3.11.4", diff --git a/src/controllers/deleteTableEntity.ts b/src/controllers/deleteTableEntity.ts index 70f29dc..c50af9f 100644 --- a/src/controllers/deleteTableEntity.ts +++ b/src/controllers/deleteTableEntity.ts @@ -21,10 +21,7 @@ export default async function ( res: Response, ) { try { - const result: string = await deleteTableEntity( - req.params, - req.query, - ); + const result: string = await deleteTableEntity(req.params, req.query); res.status(200).contentType("text/html").send(result); } catch (error) { console.error(error); diff --git a/src/controllers/getTableCreateEntityPage.ts b/src/controllers/getTableCreateEntityPage.ts index e8b6876..eb95b2f 100644 --- a/src/controllers/getTableCreateEntityPage.ts +++ b/src/controllers/getTableCreateEntityPage.ts @@ -13,9 +13,7 @@ export default async function ( res: Response, ) { try { - const result: string = await getTableCreateEntityPage( - req.params, - ); + const result: string = await getTableCreateEntityPage(req.params); res.status(200).contentType("text/html").send(result); } catch (error) { console.error(error); diff --git a/src/services/deleteTableEntity.ts b/src/services/deleteTableEntity.ts index 4970934..783cdbc 100644 --- a/src/services/deleteTableEntity.ts +++ b/src/services/deleteTableEntity.ts @@ -22,9 +22,7 @@ export async function deleteTableEntity( } try { - const deletedRows = await knex(tableName) - .where(primaryKeys) - .del(); + const deletedRows = await knex(tableName).where(primaryKeys).del(); if (deletedRows === 0) { throw new Error("No rows deleted");