From: Jérôme Benoit Date: Fri, 26 Jul 2024 17:19:25 +0000 (+0200) Subject: refactor: move buidling, bundling, ... scripts into a directory X-Git-Tag: ocpp-server@v1.5.1~9 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bf30bb229a6296e16bd4aab4cf7285f7dd187288;p=e-mobility-charging-stations-simulator.git refactor: move buidling, bundling, ... scripts into a directory Signed-off-by: Jérôme Benoit --- diff --git a/.vscode/settings.json b/.vscode/settings.json index ba2b6f57..3b13f1a8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -48,9 +48,10 @@ "parens", "piment", "poolifier", + "postject", "preinstall", "rambda", - "Recurrency", + "recurrency", "RFID", "runtimes", "shutdowning", diff --git a/package.json b/package.json index f5828d85..e12ea7a8 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ "useTsNode": true }, "scripts": { - "prepare": "node prepare.js", - "build-requirements": "node build-requirements.js", + "prepare": "node scripts/prepare.js", + "build-requirements": "node scripts/build-requirements.js", "start": "pnpm build && cross-env NODE_ENV=production node dist/start.js", "start:dev": "pnpm build:dev && cross-env NODE_ENV=development node --enable-source-maps dist/start.js", "start:dev:debug": "pnpm build:dev && cross-env NODE_ENV=development node --enable-source-maps --inspect dist/start.js", @@ -56,7 +56,7 @@ "start:flameprof": "cross-env NODE_ENV=production clinic flame -- node --enable-source-maps dist/start.js", "start:bubbleprof": "cross-env NODE_ENV=production clinic bubbleprof -- node --enable-source-maps dist/start.js", "start:heapprofiler": "cross-env NODE_ENV=production clinic heapprofiler -- node --enable-source-maps dist/start.js", - "esbuild": "pnpm build-requirements && node bundle.js", + "esbuild": "pnpm build-requirements && node scripts/bundle.js", "build": "pnpm esbuild", "build:dev": "cross-env BUILD=development pnpm esbuild", "build:cf": "pnpm clean:node_modules && pnpm exec cross-env SKIP_PREINSTALL=1 npm install && pnpm build", @@ -64,9 +64,9 @@ "build:entities": "tsc -p tsconfig-mikro-orm.json", "clean:dist": "pnpm exec rimraf dist", "clean:node_modules": "pnpm exec rimraf node_modules", - "lint": "cross-env TIMING=1 eslint --cache src tests utils ./*.js ./*.ts", - "lint:fix": "cross-env TIMING=1 eslint --cache --fix src tests utils ./*.js ./*.ts", - "format": "prettier --cache --write .; eslint --cache --fix src tests utils ./*.js ./*.ts", + "lint": "cross-env TIMING=1 eslint --cache src tests scripts ./*.js ./*.ts", + "lint:fix": "cross-env TIMING=1 eslint --cache --fix src tests scripts ./*.js ./*.ts", + "format": "prettier --cache --write .; eslint --cache --fix src tests scripts ./*.js ./*.ts", "test": "glob -c \"c8 node --import tsx --test\" \"tests/**/*.test.ts\"", "test:debug": "glob -c \"node --import tsx --test --inspect\" \"tests/**/*.test.ts\"", "coverage": "c8 report --reporter=lcov", diff --git a/build-requirements.js b/scripts/build-requirements.js similarity index 94% rename from build-requirements.js rename to scripts/build-requirements.js index 453e3d15..75617fd6 100644 --- a/build-requirements.js +++ b/scripts/build-requirements.js @@ -5,7 +5,7 @@ import chalk from 'chalk' // eslint-disable-next-line n/no-unpublished-import import { satisfies } from 'semver' -import { runtime, runtimes } from './utils/runtime.js' +import { runtime, runtimes } from './runtime.js' const packageJson = JSON.parse(readFileSync('./package.json', 'utf8')) diff --git a/bundle.js b/scripts/bundle.js similarity index 100% rename from bundle.js rename to scripts/bundle.js diff --git a/prepare.js b/scripts/prepare.js similarity index 100% rename from prepare.js rename to scripts/prepare.js diff --git a/utils/runtime.js b/scripts/runtime.js similarity index 100% rename from utils/runtime.js rename to scripts/runtime.js diff --git a/skip-preinstall.js b/scripts/skip-preinstall.js similarity index 100% rename from skip-preinstall.js rename to scripts/skip-preinstall.js diff --git a/tests/utils/Utils.test.ts b/tests/utils/Utils.test.ts index d7ab58f3..3fe46842 100644 --- a/tests/utils/Utils.test.ts +++ b/tests/utils/Utils.test.ts @@ -7,6 +7,7 @@ import { expect } from 'expect' import { CircularBuffer } from 'mnemonist' import { satisfies } from 'semver' +import { runtime, runtimes } from '../../scripts/runtime.js' import type { TimestampedData } from '../../src/types/index.js' import { Constants } from '../../src/utils/Constants.js' import { @@ -33,7 +34,6 @@ import { sleep, validateUUID, } from '../../src/utils/Utils.js' -import { runtime, runtimes } from '../../utils/runtime.js' await describe('Utils test suite', async () => { await it('Verify generateUUID()/validateUUID()', () => {