From 908a0734d67ce429ca7aba1b7b5039ebac8e21aa Mon Sep 17 00:00:00 2001 From: Ifycode Date: Sat, 11 Apr 2026 15:59:41 +0100 Subject: [PATCH 1/4] Fix: Windows OS error fixed i.e. compatibility added --- bin/pkg.internal.cli.js | 21 +++++++++++++++++---- config.root/root.js | 10 +++++++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/bin/pkg.internal.cli.js b/bin/pkg.internal.cli.js index 051086b..79ce41b 100755 --- a/bin/pkg.internal.cli.js +++ b/bin/pkg.internal.cli.js @@ -4,7 +4,13 @@ import { path, spawn, execSync } from '../config.root/external.packages.js'; import { blocksTerminalLogger } from '../config.root/blocks.packages.js'; //- -import { require, __dirname, internalPkgJSON } from '../config.root/root.js'; +import { + require, + __dirname, + internalPkgJSON, + isWindowsOS, + windowsCmdextension, +} from '../config.root/root.js'; //- import { renameRootTypeFileInBuildOutputFolder } from './helper/rename-root-type.js'; //- @@ -16,7 +22,9 @@ const userAppArg = { const args_ = process.argv.slice(2); -const pkgArgDetected = args_.length === 1 && (args_[0] === userAppArg.devBuild || args_[0] === userAppArg.prodBuild); +const pkgArgDetected = + args_.length === 1 && + (args_[0] === userAppArg.devBuild || args_[0] === userAppArg.prodBuild); if (pkgArgDetected) { const isProd = args_[0] === userAppArg.prodBuild; @@ -93,7 +101,9 @@ if (pkgArgDetected) { spawnChildProcess.on('exit', (code) => { if (code === 0 && isProd) { console.log('============================================\n'); - console.log('[PROD] Bundling complete.\n[PROD] Generating type definitions...'); + console.log( + '[PROD] Bundling complete.\n[PROD] Generating type definitions...', + ); try { // -------------------------------------------------------------- // Execute the ENGINE'S internal tsc relative to the user project @@ -101,7 +111,10 @@ if (pkgArgDetected) { // Run tsc to generate .d.ts files into the 'build' folder // Using the user app's local tsc // ------------------------------------------------------- - execSync(`${tscPath} --emitDeclarationOnly`, { + const tscPathForRelevantOS = isWindowsOS + ? `tsc${windowsCmdextension}` + : tscPath; // This check makes it compatible with Windows OS (in production) + execSync(`${tscPathForRelevantOS} --emitDeclarationOnly`, { stdio: 'inherit', env: { ...process.env, diff --git a/config.root/root.js b/config.root/root.js index ade9973..2ccb8b9 100644 --- a/config.root/root.js +++ b/config.root/root.js @@ -9,7 +9,12 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const internalProjectRoot = path.join(__dirname, '../', 'package.json'); -const internalPkgJSON = JSON.parse(fs.readFileSync(internalProjectRoot, 'utf-8')); +const internalPkgJSON = JSON.parse( + fs.readFileSync(internalProjectRoot, 'utf-8'), +); + +const isWindowsOS = process.platform === 'win32'; +const windowsCmdextension = '.cmd'; export { //------------------------------- @@ -21,4 +26,7 @@ export { //- internalProjectRoot, internalPkgJSON, + //- + isWindowsOS, + windowsCmdextension, }; From 7f676bb3210560a64dc898c2b6d676700b385626 Mon Sep 17 00:00:00 2001 From: Ifycode Date: Sat, 11 Apr 2026 16:01:56 +0100 Subject: [PATCH 2/4] Minor fix: Prettier formatting restored --- bin/pkg.internal.cli.js | 20 ++++---------------- config.root/root.js | 4 +--- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/bin/pkg.internal.cli.js b/bin/pkg.internal.cli.js index 79ce41b..c8ed2c8 100755 --- a/bin/pkg.internal.cli.js +++ b/bin/pkg.internal.cli.js @@ -4,13 +4,7 @@ import { path, spawn, execSync } from '../config.root/external.packages.js'; import { blocksTerminalLogger } from '../config.root/blocks.packages.js'; //- -import { - require, - __dirname, - internalPkgJSON, - isWindowsOS, - windowsCmdextension, -} from '../config.root/root.js'; +import { require, __dirname, internalPkgJSON, isWindowsOS, windowsCmdextension } from '../config.root/root.js'; //- import { renameRootTypeFileInBuildOutputFolder } from './helper/rename-root-type.js'; //- @@ -22,9 +16,7 @@ const userAppArg = { const args_ = process.argv.slice(2); -const pkgArgDetected = - args_.length === 1 && - (args_[0] === userAppArg.devBuild || args_[0] === userAppArg.prodBuild); +const pkgArgDetected = args_.length === 1 && (args_[0] === userAppArg.devBuild || args_[0] === userAppArg.prodBuild); if (pkgArgDetected) { const isProd = args_[0] === userAppArg.prodBuild; @@ -101,9 +93,7 @@ if (pkgArgDetected) { spawnChildProcess.on('exit', (code) => { if (code === 0 && isProd) { console.log('============================================\n'); - console.log( - '[PROD] Bundling complete.\n[PROD] Generating type definitions...', - ); + console.log('[PROD] Bundling complete.\n[PROD] Generating type definitions...'); try { // -------------------------------------------------------------- // Execute the ENGINE'S internal tsc relative to the user project @@ -111,9 +101,7 @@ if (pkgArgDetected) { // Run tsc to generate .d.ts files into the 'build' folder // Using the user app's local tsc // ------------------------------------------------------- - const tscPathForRelevantOS = isWindowsOS - ? `tsc${windowsCmdextension}` - : tscPath; // This check makes it compatible with Windows OS (in production) + const tscPathForRelevantOS = isWindowsOS ? `tsc${windowsCmdextension}` : tscPath; // This check makes it compatible with Windows OS (in production) execSync(`${tscPathForRelevantOS} --emitDeclarationOnly`, { stdio: 'inherit', env: { diff --git a/config.root/root.js b/config.root/root.js index 2ccb8b9..a1a658a 100644 --- a/config.root/root.js +++ b/config.root/root.js @@ -9,9 +9,7 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const internalProjectRoot = path.join(__dirname, '../', 'package.json'); -const internalPkgJSON = JSON.parse( - fs.readFileSync(internalProjectRoot, 'utf-8'), -); +const internalPkgJSON = JSON.parse(fs.readFileSync(internalProjectRoot, 'utf-8')); const isWindowsOS = process.platform === 'win32'; const windowsCmdextension = '.cmd'; From ebf8842f3b30ad7b1b0d78e6288632f2764115f7 Mon Sep 17 00:00:00 2001 From: Ifycode Date: Sat, 11 Apr 2026 16:54:50 +0100 Subject: [PATCH 3/4] Fix: Related doc fixes to PR --- README.md | 29 +++++++++++++++++++---------- docs.release/README.md | 16 ---------------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 532a1ae..fe422b4 100644 --- a/README.md +++ b/README.md @@ -74,18 +74,27 @@ #### 3. Update your project's package.json -- **Add dev and build scripts:** In your web project's `package.json` file, add the `dev` and `build` scripts: +- **Add dev and build scripts:** In your web project's `package.json` file, add the `dev` and `build` scripts. - ```` - "scripts": { - "dev": "npx @build-in-blocks/dev.build@1.0.4 dev:build", - "build": "npx @build-in-blocks/dev.build@1.0.4 prod:build" - // your other npm scripts in your project goes here as usual - }, - ```` + - For `macOS` and `linux`, use: + + ```` + "scripts": { + "dev": "blocks.pkg.dev.build dev:build", + "build": "blocks.pkg.dev.build prod:build" + // your other npm scripts in your project goes here as usual + }, + ```` + + - For `windows OS`, use: - > [!IMPORTANT] - > About `@build-in-blocks/dev.build@[VERSION_NUMBER_HERE]` in the scripts: Make sure the version number used your in your `dev` and `build` scripts is the same as the version of the `@build-in-blocks/dev.build` package in your `package.json` file's `devDependencies`. + ```` + "scripts": { + "dev": "blocks.pkg.dev.build.cmd dev:build", + "build": "blocks.pkg.dev.build.cmd prod:build" + // your other npm scripts in your project goes here as usual + }, + ```` - **You need this too:** Add these in the your web project's `package.json` file too: diff --git a/docs.release/README.md b/docs.release/README.md index dee8be7..682573f 100644 --- a/docs.release/README.md +++ b/docs.release/README.md @@ -11,26 +11,10 @@ # -#### This library - -- In the **root README**, always remember to change `@build-in-blocks/dev.build@[VERSION_NUMBER]` for the npm scripts part of the docs too, as you bump up the `package.json` version. - -# - #### Connected user apps - The "user app" built with this library requires you to build/generate a new bundle for consumption - Don't forget to run the `build` script command before publishing. -- Before release (of your "user app" - e.g. dom.autoquery in this case), you always have to check that npx is referencing the correct/updated version in the scripts section of the package.json e.g. @1.0.0 in this case. - - ```` - "scripts": { - "dev": "npx @build-in-blocks/dev.build@1.0.0 dev:build", - "build": "npx @build-in-blocks/dev.build@1.0.0 prod:build" - // your other npm scripts in your project goes here as usual - }, - ```` - # #### Build in blocks libraries in general From dee4a0a79d29ad42044fd704b076bf151f29521c Mon Sep 17 00:00:00 2001 From: Ifycode Date: Sat, 11 Apr 2026 16:56:11 +0100 Subject: [PATCH 4/4] Fix: Version bump to v1.0.5, lock file regeneration --- package-lock.json | 42 +++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 403b37d..9052eea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@build-in-blocks/dev.build", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@build-in-blocks/dev.build", - "version": "1.0.4", + "version": "1.0.5", "license": "AGPL-3.0", "dependencies": { "html-webpack-plugin": "^5.6.6", @@ -1055,13 +1055,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "25.5.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.2.tgz", - "integrity": "sha512-tO4ZIRKNC+MDWV4qKVZe3Ql/woTnmHDr5JD8UI5hn2pwBrHEwOEMZK7WlNb5RKB6EoJ02gwmQS9OrjuFnZYdpg==", + "version": "25.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz", + "integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==", "license": "MIT", "peer": true, "dependencies": { - "undici-types": "~7.18.0" + "undici-types": "~7.19.0" } }, "node_modules/@types/qs": { @@ -1781,9 +1781,9 @@ } }, "node_modules/baseline-browser-mapping": { - "version": "2.10.17", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.17.tgz", - "integrity": "sha512-HdrkN8eVG2CXxeifv/VdJ4A4RSra1DTW8dc/hdxzhGHN8QePs6gKaWM9pHPcpCoxYZJuOZ8drHmbdpLHjCYjLA==", + "version": "2.10.18", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.18.tgz", + "integrity": "sha512-VSnGQAOLtP5mib/DPyg2/t+Tlv65NTBz83BJBJvmLVHHuKJVaDOBvJJykiT5TR++em5nfAySPccDZDa4oSrn8A==", "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.cjs" @@ -2551,9 +2551,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.334", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.334.tgz", - "integrity": "sha512-mgjZAz7Jyx1SRCwEpy9wefDS7GvNPazLthHg8eQMJ76wBdGQQDW33TCrUTvQ4wzpmOrv2zrFoD3oNufMdyMpog==", + "version": "1.5.335", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.335.tgz", + "integrity": "sha512-q9n5T4BR4Xwa2cwbrwcsDJtHD/enpQ5S1xF1IAtdqf5AAgqDFmR/aakqH3ChFdqd/QXJhS3rnnXFtexU7rax6Q==", "license": "ISC" }, "node_modules/emoji-regex": { @@ -4604,9 +4604,9 @@ } }, "node_modules/prettier": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.1.tgz", - "integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.2.tgz", + "integrity": "sha512-8c3mgTe0ASwWAJK+78dpviD+A8EqhndQPUBpNUIPt6+xWlIigCwfN01lWr9MAede4uqXGTEKeQWTvzb3vjia0Q==", "dev": true, "license": "MIT", "bin": { @@ -5815,9 +5815,9 @@ } }, "node_modules/undici-types": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", - "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "version": "7.19.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz", + "integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==", "license": "MIT" }, "node_modules/unpipe": { @@ -5937,9 +5937,9 @@ } }, "node_modules/webpack": { - "version": "5.106.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.106.0.tgz", - "integrity": "sha512-Pkx5joZ9RrdgO5LBkyX1L2ZAJeK/Taz3vqZ9CbcP0wS5LEMx5QkKsEwLl29QJfihZ+DKRBFldzy1O30pJ1MDpA==", + "version": "5.106.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.106.1.tgz", + "integrity": "sha512-EW8af29ak8Oaf4T8k8YsajjrDBDYgnKZ5er6ljWFJsXABfTNowQfvHLftwcepVgdz+IoLSdEAbBiM9DFXoll9w==", "license": "MIT", "peer": true, "dependencies": { diff --git a/package.json b/package.json index 89afe04..9a72990 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@build-in-blocks/dev.build", - "version": "1.0.4", + "version": "1.0.5", "description": "Production and development bundler build setup for your typescript web-related projects.", "type": "module", "bin": {