igniteui-cli 14.6.5 → 14.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,11 +40,16 @@ const path = __importStar(require("path"));
40
40
  const resolve = __importStar(require("resolve"));
41
41
  const build_1 = __importDefault(require("./build"));
42
42
  const execSyncNpmStart = (port, options) => {
43
+ const args = ['start'];
43
44
  if (port) {
44
- cli_core_1.Util.execSync(`npm start -- --port=${port}`, options);
45
- return;
45
+ // Validate port is a number to prevent command injection
46
+ if (!Number.isInteger(port) || port < 0 || port > 65535) {
47
+ cli_core_1.Util.error(`Invalid port number: ${port}`, "red");
48
+ return;
49
+ }
50
+ args.push('--', `--port=${port}`);
46
51
  }
47
- cli_core_1.Util.execSync(`npm start`, options);
52
+ cli_core_1.Util.spawnSync('npm', args, options);
48
53
  };
49
54
  const command = {
50
55
  command: "start",
@@ -114,8 +114,9 @@ class ReactTemplate {
114
114
  // tslint:disable:no-submodule-imports
115
115
  const components = require("@igniteui/cli-core/packages/components");
116
116
  const igResPath = path.join(projectPath, this.igniteResources);
117
- if (fs.existsSync(igResPath)) {
118
- let igniteuiResFile = fs.readFileSync(igResPath, "utf8");
117
+ try {
118
+ const fd = fs.openSync(igResPath, fs.constants.O_RDWR | fs.constants.O_CREAT);
119
+ let igniteuiResFile = fs.readFileSync(fd, "utf8");
119
120
  const freeVersionPath = "ignite-ui/";
120
121
  const fullVersionPath = "@infragistics/ignite-ui-full/en/";
121
122
  const dvPath = "@infragistics/ignite-ui-full/en/js/infragistics.dv.js";
@@ -126,15 +127,18 @@ class ReactTemplate {
126
127
  igniteuiResFile = igniteuiResFile.replace(freeVersionPath, fullVersionPath);
127
128
  igniteuiResFile = igniteuiResFile.replace("-lite", "");
128
129
  }
129
- fs.writeFileSync(igResPath, igniteuiResFile);
130
+ fs.ftruncateSync(fd, 0);
131
+ fs.writeSync(fd, igniteuiResFile, 0);
130
132
  }
131
133
  if (dvDep && !igniteuiResFile.includes(dvPath)) {
132
- fs.appendFileSync(igResPath, `${'\r\n// Ignite UI Charts Required JavaScript File\r\nimport "'
133
- + dvPath + '";\r\n'}`);
134
+ const endPos = fs.fstatSync(fd).size;
135
+ fs.writeSync(fd, `\r\n// Ignite UI Charts Required JavaScript File\r\nimport "${dvPath}";\r\n`, endPos);
134
136
  }
137
+ fs.closeSync(fd);
135
138
  }
136
- else {
137
- cli_core_1.Util.log(`igniteuiResources.js file NOT found!`);
139
+ catch (err) {
140
+ cli_core_1.Util.error(`Error while updating igniteuiResources.js: ${err.message}`);
141
+ throw err;
138
142
  }
139
143
  }
140
144
  getNavText(name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-cli",
3
- "version": "14.6.5",
3
+ "version": "14.7.0",
4
4
  "description": "CLI tool for creating Ignite UI projects",
5
5
  "keywords": [
6
6
  "CLI",
@@ -70,9 +70,9 @@
70
70
  "all": true
71
71
  },
72
72
  "dependencies": {
73
- "@igniteui/angular-templates": "~20.1.1465",
74
- "@igniteui/cli-core": "~14.6.5",
75
- "@inquirer/prompts": "^5.4.0",
73
+ "@igniteui/angular-templates": "~20.1.1470",
74
+ "@igniteui/cli-core": "~14.7.0",
75
+ "@inquirer/prompts": "^7.9.0",
76
76
  "@types/yargs": "^17.0.33",
77
77
  "chalk": "^5.3.0",
78
78
  "glob": "^11.0.0",
@@ -39,7 +39,7 @@ jobs:
39
39
  find ./dist/assets -type f -name "*.js" -exec sed -i 's|src/assets|${{ github.event.repository.name }}/assets|g' {} +;
40
40
  find ./dist/assets -type f -name "*.js" -exec sed -i 's|/static-data/|/${{ github.event.repository.name }}/static-data/|g' {} +
41
41
  - name: Copy Resources to dist
42
- run: mkdir -p ./dist/assets && cp -R ./src/assets/* ./dist/assets/
42
+ run: if [ -d "./src/assets" ]; then mkdir -p ./dist/assets && cp -R ./src/assets/* ./dist/assets/; fi
43
43
  - name: SPA routing handling
44
44
  run: cp ./dist/index.html ./dist/404.html
45
45
  - name: Upload build artifact to GitHub Pages
@@ -1,4 +1,3 @@
1
- import 'vitest-canvas-mock'
2
1
  import ResizeObserver from 'resize-observer-polyfill'
3
2
  import {vi} from 'vitest'
4
3
 
@@ -18,6 +18,7 @@ export default defineConfig({
18
18
  },
19
19
  ],
20
20
  },
21
+ setupFiles: ['./src/setupTests.ts']
21
22
  },
22
23
  resolve: {
23
24
  mainFields: ['module'],