@pega/custom-dx-components 25.1.10-alpha-0.9 → 25.1.10-alpha-0.10

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.
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "25.1.10-alpha-0.9",
3
+ "version": "25.1.10-alpha-0.10",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
+ "keywords": [
7
+ "pega",
8
+ "custom-components"
9
+ ],
10
+ "license": "SEE LICENSE IN LICENSE",
11
+ "author": "Custom component dev",
12
+ "sideEffects": false,
13
+ "type": "module",
6
14
  "scripts": {
7
15
  "lint:es": "eslint .",
8
16
  "lint:format": "prettier -c .",
@@ -12,13 +20,11 @@
12
20
  "test:unit:local": "node --input-type=module --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand /tests/unit",
13
21
  "test:functional:local": "jest --runInBand /tests/functional --detectOpenHandles --coverage"
14
22
  },
15
- "type": "module",
16
- "sideEffects": false,
17
23
  "dependencies": {
18
- "@babel/core": "^7.27.1",
24
+ "@babel/core": "^7.28.0",
19
25
  "@babel/plugin-transform-class-properties": "^7.27.1",
20
26
  "@babel/preset-react": "^7.27.1",
21
- "@pega/auth": "^0.2.24",
27
+ "@pega/auth": "^0.2.27",
22
28
  "@pega/constellation-dx-components-build-utils": "^2.0.7",
23
29
  "@pega/inquirer-fuzzy-path": "^3.0.0",
24
30
  "ajv": "^8.17.1",
@@ -31,8 +37,8 @@
31
37
  "compression-webpack-plugin": "^11.1.0",
32
38
  "css-loader": "7.1.2",
33
39
  "css-minimizer-webpack-plugin": "^7.0.2",
34
- "eslint": "^9.27.0",
35
- "execa": "^9.5.2",
40
+ "eslint": "^9.31.0",
41
+ "execa": "^9.6.0",
36
42
  "file-loader": "6.2.0",
37
43
  "fs-extra": "^11.3.0",
38
44
  "gitignore": "^0.7.0",
@@ -46,9 +52,9 @@
46
52
  "node-stream-zip": "^1.15.0",
47
53
  "ora": "^8.2.0",
48
54
  "pascalcase": "^2.0.0",
49
- "postcss": "^8.5.3",
55
+ "postcss": "^8.5.6",
50
56
  "postcss-loader": "8.1.1",
51
- "postcss-preset-env": "10.1.6",
57
+ "postcss-preset-env": "10.2.4",
52
58
  "prop-types": "^15.8.1",
53
59
  "react": "^18.2.0",
54
60
  "react-dev-utils": "^12.0.1",
@@ -60,26 +66,20 @@
60
66
  "typescript": "~5.8.3",
61
67
  "unarchive": "^1.1.3",
62
68
  "url-loader": "4.1.1",
63
- "webpack": "5.99.8",
69
+ "webpack": "5.100.2",
64
70
  "webpack-cli": "^6.0.1"
65
71
  },
66
- "author": "Custom component dev",
67
- "license": "SEE LICENSE IN LICENSE",
68
- "keywords": [
69
- "pega",
70
- "custom-components"
71
- ],
72
72
  "devDependencies": {
73
- "@babel/preset-env": "^7.27.2",
74
- "@pega/configs": "^0.16.3",
75
- "@pega/prettier-config": "^0.16.3",
73
+ "@babel/preset-env": "^7.28.0",
74
+ "@pega/configs": "^0.17.0",
75
+ "@pega/prettier-config": "^0.17.0",
76
76
  "@types/jest": "^29.5.14",
77
77
  "babel-jest": "^29.7.0",
78
78
  "cspell": "^8.19.4",
79
79
  "jest": "^29.7.0",
80
80
  "jest-environment-jsdom": "^29.7.0",
81
81
  "jest-junit": "^16.0.0",
82
- "prettier": "3.5.3",
83
- "ts-jest": "^29.3.2"
82
+ "prettier": "3.6.2",
83
+ "ts-jest": "^29.4.0"
84
84
  }
85
85
  }
@@ -3,7 +3,7 @@ import fs from 'fs-extra';
3
3
  import webpack from 'webpack';
4
4
  import FileSizeReporter from 'react-dev-utils/FileSizeReporter.js';
5
5
  import printBuildError from 'react-dev-utils/printBuildError.js';
6
- import { getUseWebPackPromotion, addDebugLog} from '../../../util.js';
6
+ import { getUseWebPackPromotion, addDebugLog, emptyDirSync } from '../../../util.js';
7
7
 
8
8
 
9
9
 
@@ -44,7 +44,7 @@ let compilationErrors = null;
44
44
 
45
45
  // Create the build and print the deployment instructions.
46
46
  function build(config, previousFileSizes, showStats = true) {
47
- addDebugLog("bundle build", `config: ${JSON.stringify(config)}, \npreviousFileSizes: ${JSON.stringify(previousFileSizes)}, showStats: ${showStats}`, "");
47
+ addDebugLog("bundle build", `config: ${JSON.stringify(config)}, \npreviousFileSizes: ${JSON.stringify(previousFileSizes)}, showStats: ${showStats}`, "");
48
48
 
49
49
  if (showStats) {
50
50
  console.log(`Creating a ${Env} build...`);
@@ -55,14 +55,14 @@ addDebugLog("bundle build", `config: ${JSON.stringify(config)}, \npreviousFileSi
55
55
  return new Promise((resolve, reject) => {
56
56
  compiler.run((err, stats) => {
57
57
 
58
- if (err != null && typeof (err) == "object") {
59
- if (err.error != undefined) {
60
- //store and print elsewhere
61
- compilationErrors = err.error;
62
- //console.log("err:" + err);
63
- }
64
- }
65
- if (stats != null & typeof(stats) == "object") {
58
+ if (err != null && typeof (err) == "object") {
59
+ if (err.error != undefined) {
60
+ //store and print elsewhere
61
+ compilationErrors = err.error;
62
+ //console.log("err:" + err);
63
+ }
64
+ }
65
+ if (stats != null & typeof (stats) == "object") {
66
66
  if (stats.errors != undefined) {
67
67
  if (showStats) {
68
68
  console.log("stats:" + stats);
@@ -79,7 +79,7 @@ addDebugLog("bundle build", `config: ${JSON.stringify(config)}, \npreviousFileSi
79
79
 
80
80
  }
81
81
 
82
- }
82
+ }
83
83
 
84
84
 
85
85
  let messages;
@@ -118,7 +118,7 @@ addDebugLog("bundle build", `config: ${JSON.stringify(config)}, \npreviousFileSi
118
118
  console.log(
119
119
  chalk.yellow(
120
120
  '\nTreating warnings as errors because process.env.CI = true.\n' +
121
- 'Most CI servers set it automatically.\n'
121
+ 'Most CI servers set it automatically.\n'
122
122
  )
123
123
  );
124
124
  return reject(new Error(messages.warnings.join('\n\n')));
@@ -148,7 +148,7 @@ export default async ({
148
148
  // used by promote and revert webPack commands, do not change
149
149
  const configFactory = (
150
150
  await import(`${usePromoted ? `../../../../../../../webpack.config.js` : `./webpack.config.js`}`)
151
- ).default
151
+ ).default;
152
152
 
153
153
  // Generate configuration
154
154
  const config = configFactory(Env, {
@@ -170,7 +170,7 @@ export default async ({
170
170
  .then(previousFileSizes => {
171
171
  // Remove all content but keep the directory so that
172
172
  // if you're in it, you don't end up in Trash
173
- fs.emptyDirSync(paths.appBuild);
173
+ emptyDirSync(paths.appBuild);
174
174
  // Start the webpack build
175
175
  return build(config, previousFileSizes, showStats);
176
176
  })
@@ -202,7 +202,7 @@ export default async ({
202
202
 
203
203
  resolve('done emitting');
204
204
  },
205
- err => {
205
+ err => {
206
206
  reject();
207
207
  const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
208
208
  if (tscCompileOnError) {
@@ -373,7 +373,7 @@ addDebugLog("createAll", "", "+");
373
373
  data = data && JSON.parse(data);
374
374
 
375
375
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
376
- console.error(`${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`);
376
+ console.error(`${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`);
377
377
  process.exit(1);
378
378
  }
379
379
 
@@ -60,7 +60,7 @@ addDebugLog("getLaunchPadFilterQuestions", "", "");
60
60
 
61
61
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
62
62
  console.error(
63
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
63
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
64
64
  );
65
65
  process.exit(1);
66
66
  }
@@ -55,7 +55,7 @@ addDebugLog("getLaunchPadFilterQuestions", "", "");
55
55
 
56
56
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
57
57
  console.error(
58
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
58
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
59
59
  );
60
60
  process.exit(1);
61
61
  }
@@ -1,30 +1,25 @@
1
+
1
2
  import path from 'path';
2
3
  import fs from 'fs';
3
4
  import { fileURLToPath } from 'url';
4
5
  import { promisify } from 'util';
5
- import { exec } from 'child_process';
6
-
7
6
  import chalk from 'chalk';
8
7
  import { execa } from 'execa';
9
- import ncp from 'ncp';
10
8
  import { Listr } from 'listr2';
11
9
  import gitignore from 'gitignore';
12
10
  import inquirer from 'inquirer';
11
+ import { compileMustacheTemplate, isPascalCase, convertIntoPascalCase, sanitize } from '../../util.js';
12
+ import { getInitProjectQuestions } from './helper.js';
13
13
 
14
- import {
15
- compileMustacheTemplate,
16
- isPascalCase,
17
- convertIntoPascalCase,
18
- sanitize
19
- } from '../../util.js';
14
+ const writeGitignore = promisify(gitignore.writeFile);
20
15
 
21
- import { getInitProjectQuestions } from './helper.js';
22
16
 
23
- const execPromise = promisify(exec);
17
+ const copyProjectDir = async (src, dest) => {
18
+ if (typeof fs.cp === 'function') {
19
+ await fs.promises.cp(src, dest, { recursive: true, errorOnExist: false, force: false });
20
+ }
21
+ };
24
22
 
25
- const copy = promisify(ncp);
26
- const writeGitignore = promisify(gitignore.writeFile);
27
- const writeFile = promisify(fs.writeFile);
28
23
 
29
24
  const createGitignore = async options => {
30
25
  const file = fs.createWriteStream(path.join(options.targetDirectory, '.gitignore'), {
@@ -37,51 +32,54 @@ const createGitignore = async options => {
37
32
  };
38
33
 
39
34
  const createLicense = async options => {
35
+ // Write LICENSE file directly
40
36
  const targetPath = path.join(options.targetDirectory, 'LICENSE');
41
37
  const licenseContent = 'Enter license text here';
42
- return writeFile(targetPath, licenseContent, 'utf8');
38
+ await fs.promises.writeFile(targetPath, licenseContent, 'utf8');
43
39
  };
44
40
 
41
+
45
42
  const copyProjectTemplate = async options => {
46
- await copy(options.templateDirectory, options.targetDirectory, {
47
- clobber: false
48
- });
43
+ // Use fast copy
44
+ await copyProjectDir(options.templateDirectory, options.targetDirectory);
49
45
  const packageJsonPath = path.join(options.targetDirectory, 'package.json.mustache');
50
46
  const templateNPMRCPath = path.join(options.targetDirectory, 'templateNPMRC.txt');
51
47
 
52
48
  let { organization, projectName } = options;
53
-
54
49
  projectName = sanitize(projectName).toLowerCase();
55
-
56
50
  organization = sanitize(organization);
57
51
  if (!isPascalCase(organization)) {
58
52
  organization = convertIntoPascalCase(organization);
59
53
  }
54
+ options = { ...options, organization, projectName };
60
55
 
61
- options = {
62
- ...options,
63
- organization,
64
- projectName
65
- };
56
+ // Compile and write package.json in one go
66
57
  const output = compileMustacheTemplate(packageJsonPath, options);
67
- fs.writeFileSync(packageJsonPath, output);
68
- fs.renameSync(packageJsonPath, packageJsonPath.replace('.mustache', ''));
69
-
70
- // rename template NPMRC to .npmrc, need to do this because npmjs won't publish an .npmrc file
71
- fs.renameSync(templateNPMRCPath, templateNPMRCPath.replace('templateNPMRC.txt', '.npmrc'));
58
+ await fs.promises.writeFile(packageJsonPath, output);
59
+ await fs.promises.rename(packageJsonPath, packageJsonPath.replace('.mustache', ''));
60
+
61
+ // Rename templateNPMRC.txt to .npmrc if exists
62
+ try {
63
+ await fs.promises.rename(templateNPMRCPath, templateNPMRCPath.replace('templateNPMRC.txt', '.npmrc'));
64
+ } catch (e) {
65
+ // ignore if not present
66
+ }
72
67
 
73
68
  await createLicense(options);
74
69
  };
75
70
 
71
+
76
72
  const initGit = async options => {
73
+ // Use execa for async git init
77
74
  const result = await execa('git', ['init'], {
78
75
  cwd: options.targetDirectory
79
76
  });
80
77
  if (result.failed) {
81
- return Promise.reject(new Error('Failed to initialize git'));
78
+ throw new Error('Failed to initialize git');
82
79
  }
83
80
  };
84
81
 
82
+
85
83
  export default async options => {
86
84
  options.templateDirectory = path.resolve(
87
85
  path.dirname(fileURLToPath(import.meta.url)),
@@ -90,32 +88,30 @@ export default async options => {
90
88
  let projectName = 'test';
91
89
 
92
90
  const questions = getInitProjectQuestions();
91
+ const answers = await inquirer.prompt(questions);
92
+ projectName = sanitize(answers.projectName).toLowerCase();
93
+ options = { ...options, ...answers };
94
+
95
+ const projectDirectory = `./${projectName}`;
96
+ if (!fs.existsSync(projectDirectory)) {
97
+ fs.mkdirSync(projectDirectory);
98
+ } else {
99
+ console.log(chalk.bold.red(`A project with name ${projectName} already exists. Exiting...`));
100
+ process.exit();
101
+ }
93
102
 
94
- await inquirer.prompt(questions).then(async answers => {
95
- projectName = answers.projectName;
96
- projectName = sanitize(projectName).toLowerCase();
97
- options = { ...options, ...answers };
103
+ const targetDirectory = options.targetDirectory || process.cwd();
104
+ options.targetDirectory = path.join(targetDirectory, projectName);
105
+ options.componentDirectory = path.join(
106
+ options.targetDirectory,
107
+ 'node_modules/@pega/custom-dx-components'
108
+ );
98
109
 
99
- const projectDirectory = `./${projectName}`;
100
110
 
101
- if (!fs.existsSync(projectDirectory)) {
102
- fs.mkdirSync(projectDirectory);
103
- } else {
104
- console.log(chalk.bold.red(`A project with name ${projectName} already exists. Exiting...`));
105
- process.exit();
106
- }
107
-
108
- const targetDirectory = options.targetDirectory || process.cwd();
109
- options.targetDirectory = path.join(targetDirectory, projectName);
110
- options.componentDirectory = path.join(
111
- options.targetDirectory,
112
- 'node_modules/@pega/custom-dx-components'
113
- );
114
- options.componentLibraryUtilsDirectory = path.join(
115
- options.targetDirectory,
116
- 'node_modules/@pega/constellation-dx-components-build-utils'
117
- );
118
- });
111
+ options.componentLibraryUtilsDirectory = path.join(
112
+ options.targetDirectory,
113
+ 'node_modules/@pega/constellation-dx-components-build-utils'
114
+ );
119
115
 
120
116
  const installDependenciesText = `Installing dependencies. This will take a couple of minutes.`;
121
117
 
@@ -138,35 +134,48 @@ export default async options => {
138
134
  {
139
135
  title: installDependenciesText,
140
136
  task: () =>
141
- execPromise('npm i --force --production=false', { cwd: options.targetDirectory })
137
+ execa('npm', ['i', '--force', '--production=false'], { cwd: options.targetDirectory })
142
138
  },
143
139
  */
144
140
  {
145
141
  title: installDependenciesText,
146
142
  task: () =>
147
- execPromise('npm i --force --include=dev', { cwd: options.targetDirectory })
143
+ execa('npm', ['i', '--force', '--no-audit', '--no-fund', '--loglevel=error'], { cwd: options.targetDirectory })
148
144
  },
145
+
149
146
  /*
150
147
  {
151
148
  title: 'Installing tasks dependencies',
152
- task: () =>
153
- execPromise('npm i --force --production=false', { cwd: options.componentDirectory })
149
+ task: () => {
150
+ if (!fs.existsSync(options.componentDirectory)){
151
+ fs.mkdirSync(options.componentDirectory, { recursive: true });
152
+ };
153
+ execa('npm', ['i', '--force', '--no-audit', '--no-fund', '--loglevel=error'], { cwd: options.componentDirectory });
154
+ }
155
+
154
156
  },
155
157
  {
156
158
  title: 'Installing tasks library dependencies',
157
- task: () =>
158
- execPromise('npm i --force --production=false', {
159
+ task: () => {
160
+ if (!fs.existsSync(options.componentLibraryUtilsDirectory)){
161
+ fs.mkdirSync(options.componentLibraryUtilsDirectory, { recursive: true });
162
+ };
163
+ execa('npm', ['i', '--force', '--no-audit', '--no-fund', '--loglevel=error'], {
159
164
  cwd: options.componentLibraryUtilsDirectory
160
- })
165
+ });
166
+ }
167
+
161
168
  },
162
169
  */
170
+
163
171
  {
164
172
  title: 'Updating',
165
- task: () => execPromise('npm update --dev', { cwd: options.targetDirectory })
173
+ task: () => execa('npm', ['update', '--dev', '--no-audit', '--no-fund', '--loglevel=error'], { cwd: options.targetDirectory })
166
174
  }
175
+
167
176
  /* {
168
177
  title: 'Installing quick run',
169
- task: () => execPromise('npm i -g npm-quick-run', { cwd: options.targetDirectory })
178
+ task: () => execa('npm', ['i', '-g', 'npm-quick-run'], { cwd: options.targetDirectory })
170
179
  } */
171
180
  ],
172
181
  {
@@ -99,7 +99,6 @@
99
99
  "react-is": "^18.3.1",
100
100
  "react-redux": "^7.2.9",
101
101
  "serve": "^14.2.4",
102
- "shelljs": "^0.8.5",
103
102
  "styled-components": "^5.3.11",
104
103
  "ts-loader": "^9.5.2"
105
104
  },
@@ -108,7 +107,7 @@
108
107
  "@babel/preset-react": "^7.27.1",
109
108
  "@babel/preset-typescript": "^7.27.1",
110
109
  "@pega/configs": "^0.16.3",
111
- "@pega/custom-dx-components": "~25.1.10-alpha-0.9",
110
+ "@pega/custom-dx-components": "~25.1.10-alpha-0.10",
112
111
  "@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
113
112
  "@storybook/addon-actions": "^8.6.14",
114
113
  "@storybook/addon-essentials": "^8.6.14",
@@ -57,7 +57,7 @@ addDebugLog("getLaunchPadFilterQuestions", "", "");
57
57
 
58
58
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
59
59
  console.error(
60
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
60
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
61
61
  );
62
62
  process.exit(1);
63
63
  }
@@ -145,7 +145,7 @@ addDebugLog("listLibrary", "", "+");
145
145
  else {
146
146
  // No library with that name
147
147
  console.log(chalk.redBright(`No other library versions for ${libraryName} exist other than current library version.`));
148
- console.log(chalk.redBright(`To see contents for the currnet library version, enter 'npm run list'.`));
148
+ console.log(chalk.redBright(`To see contents for the current library version, enter 'npm run list'.`));
149
149
  addDebugLog("listLibrary", "END", "-");
150
150
  process.exit();
151
151
  }
@@ -29,7 +29,7 @@ addDebugLog("getServerLibraryVersions", `libraryName: ${libraryName}`, "");
29
29
  const tokenAndStaticServer = await getC11NB2STokenAndStaticServer();
30
30
 
31
31
  if (tokenAndStaticServer.C11NB2S === undefined) {
32
- console.log(chalk.redBright("Need to authenticate, missing services token.\nDeleting a library requires authentication to acquire a token to delete."));
32
+ console.log(chalk.redBright("Need to authenticate, missing services token."));
33
33
  process.exit(1);
34
34
  }
35
35
 
@@ -346,7 +346,7 @@ addDebugLog("move", "", "+");
346
346
 
347
347
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
348
348
  console.error(
349
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
349
+ `${chalk.red.bold('ERROR')} Unable find to components directory path in config.json`
350
350
  );
351
351
  process.exit(1);
352
352
  }
@@ -67,18 +67,18 @@ addDebugLog("updateConfig", `oldComponentKey: ${oldComponentKey}, newComponentKe
67
67
  configData.version = version;
68
68
  configData.description = (description != '') ? description : componentLabel;
69
69
 
70
- if (allowedApplications.trim() === '') {
71
- allowedApplications = [];
72
- } else {
73
- if (allowedApplications.indexOf(',') !== -1) {
74
- allowedApplications = allowedApplications.split(',');
75
- }
76
- allowedApplications = [].concat(allowedApplications);
77
- }
70
+ // if (allowedApplications.trim() === '') {
71
+ // allowedApplications = [];
72
+ // } else {
73
+ // if (allowedApplications.indexOf(',') !== -1) {
74
+ // allowedApplications = allowedApplications.split(',');
75
+ // }
76
+ // allowedApplications = [].concat(allowedApplications);
77
+ // }
78
78
 
79
- allowedApplications = allowedApplications.filter(el => !!el.trim()).map(el => el.trim());
79
+ // allowedApplications = allowedApplications.filter(el => !!el.trim()).map(el => el.trim());
80
80
 
81
- configData.allowedApplications = allowedApplications;
81
+ // configData.allowedApplications = allowedApplications;
82
82
 
83
83
  // stringify "4", makes the json string look like JSON in the file, formated instead of a single line
84
84
  fs.writeFileSync(join(targetDirectory, "/config.json"), JSON.stringify(configData, null, 4), { encoding: 'utf8' });
@@ -199,7 +199,7 @@ addDebugLog("rename", "", "+");
199
199
 
200
200
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
201
201
  console.error(
202
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
202
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
203
203
  );
204
204
  process.exit(1);
205
205
  }
@@ -323,12 +323,12 @@ addDebugLog("rename", "", "+");
323
323
  },
324
324
  when: () => !isLibraryBased
325
325
  },
326
- {
327
- name: 'allowedApplications',
328
- message: 'Please enter the application names to be supported (comma-separated). ',
329
- suffix: 'Keep empty for all applications',
330
- when: () => !isLibraryBased
331
- },
326
+ // {
327
+ // name: 'allowedApplications',
328
+ // message: 'Please enter the application names to be supported (comma-separated). ',
329
+ // suffix: 'Keep empty for all applications',
330
+ // when: () => !isLibraryBased
331
+ // },
332
332
  {
333
333
  name: 'description',
334
334
  message: 'Enter new description for the component (defaults to new label)',
@@ -267,7 +267,7 @@ addDebugLog("renameLibrary", "", "+");
267
267
 
268
268
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
269
269
  console.error(
270
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
270
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
271
271
  );
272
272
  process.exit(1);
273
273
  }
package/src/util.js CHANGED
@@ -278,7 +278,7 @@ if (showDebug) addDebugLog("checkPathAccess", "END", "-");
278
278
  else {
279
279
  if (showDebug) addDebugLog("checkPathAccess", "path: ".concat(path), "+");
280
280
  const message =
281
- errorMessage || `${chalk.red.bold('ERROR')} Could not able to access path - ${path}`;
281
+ errorMessage || `${chalk.red.bold('ERROR')} Unable to access path - ${path}`;
282
282
  console.error(message);
283
283
  if (showDebug) addDebugLog("checkPathAccess", "END", "-");
284
284
  process.exit(1);
@@ -307,7 +307,7 @@ if (showDebug) addDebugLog("getUseWebPackPromotion", "", "");
307
307
 
308
308
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
309
309
  console.error(
310
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
310
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
311
311
  );
312
312
  process.exit(1);
313
313
  }
@@ -335,7 +335,7 @@ if (showDebug) addDebugLog("updateUseWebPackPromotion", "", "");
335
335
 
336
336
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
337
337
  console.error(
338
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
338
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
339
339
  );
340
340
  process.exit(1);
341
341
  }
@@ -605,7 +605,7 @@ if (showDebug) addDebugLog("deleteLocalComponent", `componentKey: ${componentKey
605
605
 
606
606
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
607
607
  console.error(
608
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
608
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
609
609
  );
610
610
  process.exit(1);
611
611
  }
@@ -1257,7 +1257,7 @@ if (showDebug) addDebugLog("getComponentDirectoryPath", "", "+");
1257
1257
 
1258
1258
  if (!data[COMPONENTS_DIRECTORY_PATH]) {
1259
1259
  console.error(
1260
- `${chalk.red.bold('ERROR')} Could not able find components directory path in config.json`
1260
+ `${chalk.red.bold('ERROR')} Unable to find components directory path in config.json`
1261
1261
  );
1262
1262
  process.exit(1);
1263
1263
  }
@@ -1340,7 +1340,7 @@ export const showVersion = async () => {
1340
1340
  if (nodeMajorVersion < 22 && nodeMinorVersion < 15 ) {
1341
1341
  console.log(
1342
1342
  chalk.redBright(
1343
- `DX Component Builder - SDK requires node v20.15.0 or greater, current version: ${process.version}`
1343
+ `DX Component Builder - requires node v22.15.0 or greater, current version: ${process.version}`
1344
1344
  )
1345
1345
  );
1346
1346
  process.exit(1);
@@ -1363,7 +1363,7 @@ export const checkForBranch = async(rulesetName) => {
1363
1363
  if (rulesetName.toLowerCase().indexOf("_branch") >= 0) {
1364
1364
  console.log(
1365
1365
  chalk.redBright(
1366
- `Ruleset ${chalk.bold(`${rulesetName}`)} cannot be a branch ruleset.`
1366
+ `Ruleset ${chalk.bold(`${rulesetName}`)} is a branch ruleset.\nBranch rulesets are not supported.`
1367
1367
  )
1368
1368
  );
1369
1369
  process.exit(1);
@@ -1451,7 +1451,7 @@ if (showDebug) addDebugLog("deleteInfinityServerComponent", `componentKey: ${com
1451
1451
  if (!response.ok) {
1452
1452
  if (status === 401) {
1453
1453
  throw new Error(
1454
- 'Error occurred in authentication. Please regenerate using authenticate'
1454
+ 'Error occurred in authentication. Please regenerate using authenticate.'
1455
1455
  );
1456
1456
  // console.log(accessTokenUri, refreshToken);
1457
1457
  /* TODO - Handle refresh_token */
@@ -2843,5 +2843,10 @@ export const isComponentValidLength = (componentKey) => {
2843
2843
  return false;
2844
2844
  }
2845
2845
 
2846
+ export const emptyDirSync = dir => (
2847
+ fs.rmSync(dir, { recursive: true, force: true }),
2848
+ fs.mkdirSync(dir, { recursive: true })
2849
+ )
2850
+
2846
2851
  // init
2847
2852
  await forceDefaultsUpdate();