Skip to content

Commit

Permalink
Merge pull request #121 from xtremespb/core_250521
Browse files Browse the repository at this point in the history
Fix: build system now respects NPM module versions
  • Loading branch information
xtremespb committed May 26, 2021
2 parents 45b9b6d + 41b0f94 commit a1cfa81
Show file tree
Hide file tree
Showing 8 changed files with 2,440 additions and 1,142 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ typings/
/backup
/update
package.json.bak
package-update.json
/src/shared/marko/zoia/index.marko
2 changes: 2 additions & 0 deletions dev/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ const loadingAnimation = () => {
};

(async () => {
const packageJson = require(path.resolve(`${__dirname}/../package.json`));
console.log(`ZOIA Build Script, mode: ${buildMode}, version: ${packageJson.version}\nStart date: ${new Date()}\n`);
const timestampStart = new Date().getTime() / 1000;
const loading = loadingAnimation();
const dir = command === "update" ? "update" : "zoia";
Expand Down
16 changes: 12 additions & 4 deletions dev/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,14 @@ const installRequiredPackages = async (moduleDirs, argv) => {
const packageJsonCore = require(path.resolve(`${__dirname}/../package-core.json`));
packageJsonMain.dependencies = packageJsonCore.dependencies;
packageJsonMain.devDependencies = packageJsonCore.devDependencies;
await fs.writeJSON(path.resolve(`${__dirname}/../package.json`), packageJsonMain, {
await fs.writeJSON(path.resolve(`${__dirname}/../package-update.json`), packageJsonMain, {
spaces: "\t"
});
await fs.copy(path.resolve(`${__dirname}/../package-update.json`), path.resolve(`${__dirname}/../package.json`), {
overwrite: true,
errorOnExist: false
});
await fs.remove(path.resolve(`${__dirname}/../package-update.json`));
for (const dir of moduleDirs) {
let npmData;
try {
Expand All @@ -177,9 +182,12 @@ const installRequiredPackages = async (moduleDirs, argv) => {
if (!packageJsonCore.dependencies[m] || packageJsonCore.dependencies[m] !== npmData[m] || !packageJsonCore.devDependencies[m] || packageJsonCore.devDependencies[m] !== npmData[m]) {
try {
require(m);
return null;
} catch (e) {
console.log(e.message);
const modulePackageJson = require(`${__dirname}/../node_modules/${m}/package.json`);
if (modulePackageJson.version === npmData[m].replace(/[^0-9.]/gm, "")) {
return null;
}
} catch {
// Ignore
}
return `${m}@${npmData[m]}`;
}
Expand Down
174 changes: 87 additions & 87 deletions package-core.json
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
{
"dependencies": {
"@node-minify/core": "^6.2.0",
"@node-minify/csso": "^6.2.0",
"@node-minify/html-minifier": "^6.2.0",
"@node-minify/terser": "^6.2.0",
"activedirectory": "^0.7.2",
"archiver": "^5.3.0",
"axios": "^0.21.1",
"busboy": "^0.3.1",
"colors": "^1.4.0",
"command-line-args": "^5.1.1",
"date-fns": "^2.21.3",
"extract-zip": "^2.0.1",
"fastify": "^3.15.1",
"fastify-cookie": "^5.3.1",
"fastify-cors": "^6.0.1",
"fastify-formbody": "^5.0.0",
"fastify-jwt": "^2.5.0",
"fastify-mongodb": "^2.0.1",
"fastify-plugin": "^3.0.0",
"fastify-static": "^4.2.2",
"fastify-url-data": "^3.0.3",
"fs-extra": "^10.0.0",
"html-to-text": "^7.1.1",
"inquirer": "^8.1.0",
"ioredis": "^4.27.3",
"jimp": "^0.16.1",
"js-beautify": "^1.13.13",
"lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"marko": "^5.10.4",
"mime-types": "^2.1.30",
"mongodb": "^3.6.8",
"nodemailer": "^6.6.1",
"pino": "^6.11.3",
"pm2": "^4.5.6",
"socket.io": "^4.1.2",
"socket.io-client": "^4.1.2",
"socket.io-redis": "^6.1.1",
"telegraf": "^4.3.0",
"tippy.js": "^6.3.1",
"uuid": "^8.3.2"
},
"devDependencies": {
"ace-builds": "^1.4.12",
"@ckeditor/ckeditor5-build-classic": "^27.1.0",
"@babel/code-frame": "^7.12.13",
"@babel/core": "^7.14.3",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-object-rest-spread": "^7.14.2",
"@babel/plugin-transform-async-to-generator": "^7.13.0",
"@babel/plugin-transform-runtime": "^7.14.3",
"@babel/preset-env": "^7.14.2",
"@marko/compiler": "^5.10.2",
"@marko/webpack": "^9.0.2",
"@mdi/font": "^5.9.55",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"bulma": "^0.9.2",
"chai": "^4.3.4",
"core-js": "^3.12.1",
"css-loader": "^5.2.5",
"css-minimizer-webpack-plugin": "^3.0.0",
"eslint": "^7.27.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.23.3",
"file-loader": "^6.2.0",
"imask": "^6.0.7",
"mini-css-extract-plugin": "^1.6.0",
"postcss": "^8.3.0",
"postcss-url": "^10.1.3",
"postcss-loader": "^5.3.0",
"postcss-preset-env": "^5.3.0",
"pretty-checkbox": "^3.0.3",
"puppeteer": "^9.1.1",
"router5": "^8.0.1",
"router5-plugin-browser": "^8.0.1",
"sass": "^1.34.0",
"sass-loader": "^11.1.1",
"semantic-release": "^17.4.3",
"svg-url-loader": "^7.1.1",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0",
"webpack-fix-style-only-entries": "^0.6.1"
}
"@node-minify/core": "^6.2.0",
"@node-minify/csso": "^6.2.0",
"@node-minify/html-minifier": "^6.2.0",
"@node-minify/terser": "^6.2.0",
"activedirectory": "^0.7.2",
"archiver": "^5.3.0",
"axios": "^0.21.1",
"busboy": "^0.3.1",
"colors": "^1.4.0",
"command-line-args": "^5.1.1",
"date-fns": "^2.21.3",
"extract-zip": "^2.0.1",
"fastify": "^3.16.2",
"fastify-cookie": "^5.3.1",
"fastify-cors": "^6.0.1",
"fastify-formbody": "^5.0.0",
"fastify-jwt": "^2.5.0",
"fastify-mongodb": "^2.0.1",
"fastify-plugin": "^3.0.0",
"fastify-static": "^4.2.2",
"fastify-url-data": "^3.0.3",
"fs-extra": "^10.0.0",
"html-to-text": "^7.1.1",
"inquirer": "^8.1.0",
"ioredis": "^4.27.3",
"jimp": "^0.16.1",
"js-beautify": "^1.13.13",
"lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"marko": "^5.10.4",
"mime-types": "^2.1.30",
"mongodb": "^3.6.8",
"nodemailer": "^6.6.1",
"pino": "^6.11.3",
"pm2": "^4.5.6",
"socket.io": "^4.1.2",
"socket.io-client": "^4.1.2",
"socket.io-redis": "^6.1.1",
"telegraf": "^4.3.0",
"tippy.js": "^6.3.1",
"uuid": "^8.3.2"
},
"devDependencies": {
"@babel/code-frame": "^7.12.13",
"@babel/core": "^7.14.3",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-object-rest-spread": "^7.14.2",
"@babel/plugin-transform-async-to-generator": "^7.13.0",
"@babel/plugin-transform-runtime": "^7.14.3",
"@babel/preset-env": "^7.14.2",
"@ckeditor/ckeditor5-build-classic": "^27.1.0",
"@marko/compiler": "^5.10.2",
"@marko/webpack": "^9.0.2",
"@mdi/font": "^5.9.55",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"ace-builds": "^1.4.12",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"bulma": "^0.9.2",
"chai": "^4.3.4",
"core-js": "^3.13.0",
"css-loader": "^5.2.6",
"css-minimizer-webpack-plugin": "^3.0.0",
"eslint": "^7.27.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.23.3",
"file-loader": "^6.2.0",
"imask": "^6.0.7",
"mini-css-extract-plugin": "^1.6.0",
"postcss": "^8.3.0",
"postcss-loader": "^5.3.0",
"postcss-preset-env": "^6.7.0",
"postcss-url": "^10.1.3",
"pretty-checkbox": "^3.0.3",
"puppeteer": "^9.1.1",
"router5": "^8.0.1",
"router5-plugin-browser": "^8.0.1",
"sass": "^1.34.0",
"sass-loader": "^11.1.1",
"semantic-release": "^17.4.3",
"svg-url-loader": "^7.1.1",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0",
"webpack-fix-style-only-entries": "^0.6.1"
}
}
Loading

0 comments on commit a1cfa81

Please sign in to comment.