From 3913b2932955f6287defcb1080c93b275b6b54cd Mon Sep 17 00:00:00 2001 From: raj pandey Date: Mon, 18 Nov 2024 12:30:14 +0530 Subject: [PATCH] change the installation command --- package-lock.json | 66 ++++++++++++++----- packages/contentstack-migration/README.md | 2 +- packages/contentstack-migration/package.json | 2 +- .../src/utils/modules.js | 7 +- packages/contentstack/package.json | 2 +- pnpm-lock.yaml | 2 +- 6 files changed, 56 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index f884d4ebc6..4c753dab12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2391,12 +2391,12 @@ } }, "node_modules/@oclif/plugin-plugins": { - "version": "5.4.15", - "resolved": "https://registry.npmjs.org/@oclif/plugin-plugins/-/plugin-plugins-5.4.15.tgz", - "integrity": "sha512-0cnTFaRWdXkWgKTrwgjoggcq/A3MaIl1GkDs3BFFjesYlFEs5Fb2HcN42rY+2ja4jBkXrjXBkLS+9faAtdCH6A==", + "version": "5.4.17", + "resolved": "https://registry.npmjs.org/@oclif/plugin-plugins/-/plugin-plugins-5.4.17.tgz", + "integrity": "sha512-V5W5jiGfWYEFS1v6j0+l0sTkRdvuHpZm9zKyEzC1i6IFFx4S4oR2IMjTwJRopyGH2TZDNVQOGilp3Cxu73pbsQ==", "license": "MIT", "dependencies": { - "@oclif/core": "^4.0.28", + "@oclif/core": "^4.0.32", "ansis": "^3.3.2", "debug": "^4.3.7", "npm": "^10.9.0", @@ -2550,9 +2550,9 @@ } }, "node_modules/@oclif/test": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@oclif/test/-/test-4.1.0.tgz", - "integrity": "sha512-2ugir6NhRsWJqHM9d2lMEWNiOTD678Jlx5chF/fg6TCAlc7E6E/6+zt+polrCTnTIpih5P/HxOtDekgtjgARwQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@oclif/test/-/test-4.1.1.tgz", + "integrity": "sha512-eltLnzdRKXaCQbwl7fSWHUHaHGvYNld0gpKjav6QHvM03w7NV7k4jYMEwQXwf+qmh9LuaFyADDi/tpZfrWNQVQ==", "license": "MIT", "dependencies": { "ansis": "^3.3.2", @@ -5043,6 +5043,21 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, + "node_modules/body-parser/node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -7197,9 +7212,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.58", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.58.tgz", - "integrity": "sha512-al2l4r+24ZFL7WzyPTlyD0fC33LLzvxqLCwurtBibVPghRGO9hSTl+tis8t1kD7biPiH/en4U0I7o/nQbYeoVA==", + "version": "1.5.62", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.62.tgz", + "integrity": "sha512-t8c+zLmJHa9dJy96yBZRXGQYoiCEnHYgFwn1asvSPZSUdVxnB62A4RASd7k41ytG3ErFBA0TpHlKg9D9SQBmLg==", "dev": true, "license": "ISC" }, @@ -7352,9 +7367,9 @@ } }, "node_modules/es-abstract": { - "version": "1.23.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.4.tgz", - "integrity": "sha512-HR1gxH5OaiN7XH7uiWH0RLw0RcFySiSoW1ctxmD1ahTw3uGBtkmm/ng0tDU1OtYx5OK6EOL5Y6O21cDflG3Jcg==", + "version": "1.23.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.5.tgz", + "integrity": "sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==", "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", @@ -9008,6 +9023,21 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, + "node_modules/express/node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -21059,9 +21089,9 @@ "license": "MIT" }, "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.6" @@ -26594,7 +26624,7 @@ "@contentstack/cli-command": "~1.3.2", "@contentstack/cli-config": "~1.8.0", "@contentstack/cli-launch": "~1.2.3", - "@contentstack/cli-migration": "~1.6.3", + "@contentstack/cli-migration": "~1.6.4", "@contentstack/cli-utilities": "~1.8.0", "@contentstack/cli-variants": "~1.1.2", "@contentstack/management": "~1.18.3", @@ -28613,7 +28643,7 @@ }, "packages/contentstack-migration": { "name": "@contentstack/cli-migration", - "version": "1.6.3", + "version": "1.6.4", "license": "MIT", "dependencies": { "@contentstack/cli-command": "~1.3.2", diff --git a/packages/contentstack-migration/README.md b/packages/contentstack-migration/README.md index f30eab7c23..7f353c0e94 100644 --- a/packages/contentstack-migration/README.md +++ b/packages/contentstack-migration/README.md @@ -21,7 +21,7 @@ $ npm install -g @contentstack/cli-migration $ csdx COMMAND running command... $ csdx (--version) -@contentstack/cli-migration/1.6.3 darwin-arm64 node-v22.2.0 +@contentstack/cli-migration/1.6.4 darwin-arm64 node-v22.8.0 $ csdx --help [COMMAND] USAGE $ csdx COMMAND diff --git a/packages/contentstack-migration/package.json b/packages/contentstack-migration/package.json index 2fc48bf895..b7e0338b14 100644 --- a/packages/contentstack-migration/package.json +++ b/packages/contentstack-migration/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/cli-migration", - "version": "1.6.3", + "version": "1.6.4", "author": "@contentstack", "bugs": "https://github.com/contentstack/cli/issues", "dependencies": { diff --git a/packages/contentstack-migration/src/utils/modules.js b/packages/contentstack-migration/src/utils/modules.js index 7144d81b61..6b460114b3 100644 --- a/packages/contentstack-migration/src/utils/modules.js +++ b/packages/contentstack-migration/src/utils/modules.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const { execFileSync } = require('child_process'); +const { spawnSync } = require('child_process'); const path = require('path'); const { sanitizePath } = require('@contentstack/cli-utilities'); const os = require('os'); @@ -72,7 +72,9 @@ function executeShellCommand(command, directory = '') { try { if (command.startsWith('npm i')) { const [cmd, ...args] = command.split(' '); - execFileSync(cmd, args, { stdio: 'inherit', cwd: directory }); + const result = spawnSync(cmd, args, { stdio: 'inherit', cwd: directory, shell: true }); + + if (result.error) throw result.error; console.log(`Command executed successfully: ${command}`); } else { console.log(`Command should only be 'npm i '`); @@ -81,7 +83,6 @@ function executeShellCommand(command, directory = '') { console.error(`Command execution failed. Error: ${error.message}`); } } - async function installModules(filePath, multiple) { const files = multiple ? [] : [path.basename(filePath)]; const dirPath = multiple ? filePath : path.dirname(filePath); diff --git a/packages/contentstack/package.json b/packages/contentstack/package.json index c3690e5fbe..9b0a06d856 100755 --- a/packages/contentstack/package.json +++ b/packages/contentstack/package.json @@ -36,7 +36,7 @@ "@contentstack/cli-command": "~1.3.2", "@contentstack/cli-config": "~1.8.0", "@contentstack/cli-launch": "~1.2.3", - "@contentstack/cli-migration": "~1.6.3", + "@contentstack/cli-migration": "~1.6.4", "@contentstack/cli-utilities": "~1.8.0", "@contentstack/management": "~1.18.3", "@contentstack/cli-variants": "~1.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 156d96cb62..d1c2d84774 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,7 +24,7 @@ importers: '@contentstack/cli-command': ~1.3.2 '@contentstack/cli-config': ~1.8.0 '@contentstack/cli-launch': ~1.2.3 - '@contentstack/cli-migration': ~1.6.3 + '@contentstack/cli-migration': ~1.6.4 '@contentstack/cli-utilities': ~1.8.0 '@contentstack/cli-variants': ~1.1.2 '@contentstack/management': ~1.18.3