refactor: move buidling, bundling, ... scripts into a directory
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 26 Jul 2024 17:19:25 +0000 (19:19 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 26 Jul 2024 17:19:25 +0000 (19:19 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
.vscode/settings.json
package.json
scripts/build-requirements.js [moved from build-requirements.js with 94% similarity]
scripts/bundle.js [moved from bundle.js with 100% similarity]
scripts/prepare.js [moved from prepare.js with 100% similarity]
scripts/runtime.js [moved from utils/runtime.js with 100% similarity]
scripts/skip-preinstall.js [moved from skip-preinstall.js with 100% similarity]
tests/utils/Utils.test.ts

index ba2b6f57eecec94f1e340bd12d6791ec2395a268..3b13f1a855fb356f0624c0fe5d77fb9defd25620 100644 (file)
     "parens",
     "piment",
     "poolifier",
+    "postject",
     "preinstall",
     "rambda",
-    "Recurrency",
+    "recurrency",
     "RFID",
     "runtimes",
     "shutdowning",
index f5828d850483e4a9aa394bbc13939b21d6bd7efb..e12ea7a84e457abc9c7a04945ac9ac19a95cdca7 100644 (file)
@@ -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",
similarity index 94%
rename from build-requirements.js
rename to scripts/build-requirements.js
index 453e3d159969a8cca3a89f059cd9322e46197553..75617fd62a390cbfa5281ac6404728325ed29e55 100644 (file)
@@ -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'))
 
similarity index 100%
rename from bundle.js
rename to scripts/bundle.js
similarity index 100%
rename from prepare.js
rename to scripts/prepare.js
similarity index 100%
rename from utils/runtime.js
rename to scripts/runtime.js
index d7ab58f39ade182f6ae004799d63779122e51ced..3fe4684281f3e0a24ed34951740a309d0aabf18f 100644 (file)
@@ -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()', () => {