@pega/custom-dx-components 26.1.12-alpha.0.3 → 26.1.12-alpha.0.4

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/custom-dx-components",
3
- "version": "26.1.12-alpha.0.3",
3
+ "version": "26.1.12-alpha.0.4",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": {
6
6
  "custom-dx-components": "./bin/index.js"
@@ -27,6 +27,7 @@ import {
27
27
  getStandaloneMaxLibraryCount,
28
28
  getStandaloneMaxComponentNameCount,
29
29
  getStandaloneMaxLibraryFromPrefixCount,
30
+ normalizeOrganization,
30
31
  } from '../../util.js';
31
32
  import { COMPONENT_SCHEMA, SHARED_FILE_NAMES } from '../../constants.js';
32
33
 
@@ -203,6 +204,7 @@ const validateCompile = async ({ componentName, componentLabel, library, version
203
204
  if (organization == null) {
204
205
  ({ organization } = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')));
205
206
  }
207
+ organization = normalizeOrganization(organization);
206
208
 
207
209
  const componentKey = `${organization}_${library}_${componentName}`;
208
210
  const targetDirectory = await getComponentDirectoryPath(componentKey);
@@ -5,7 +5,7 @@ import chalk from 'chalk';
5
5
  import { execa } from 'execa';
6
6
  import { Listr, PRESET_TIMER } from 'listr2';
7
7
  import inquirer from 'inquirer';
8
- import { compileMustacheTemplate, isPascalCase, convertIntoPascalCase, sanitize } from '../../util.js';
8
+ import { compileMustacheTemplate, normalizeOrganization, sanitize } from '../../util.js';
9
9
  import { getInitProjectQuestions } from './helper.js';
10
10
  import { enableAgentFiles } from '../../ai/index.js';
11
11
 
@@ -37,10 +37,7 @@ const copyProjectTemplate = async (options) => {
37
37
 
38
38
  let { organization, projectName } = options;
39
39
  projectName = sanitize(projectName).toLowerCase();
40
- organization = sanitize(organization);
41
- if (!isPascalCase(organization)) {
42
- organization = convertIntoPascalCase(organization);
43
- }
40
+ organization = normalizeOrganization(organization);
44
41
  options = { ...options, organization, projectName };
45
42
 
46
43
  // Compile and write package.json in one go
@@ -10,6 +10,10 @@ export default defineConfig([
10
10
  eslintReact.configs['recommended-typescript'],
11
11
  globalIgnores([
12
12
  '**/node_modules',
13
+ // generated by jest --coverage, not source
14
+ '**/coverage/**',
15
+ // buildAllComponents writes bundles to <org>_<library>/ at the project root
16
+ '*_*/**',
13
17
  // agent skills ship sample assets that are not part of the TypeScript project
14
18
  '.claude/**',
15
19
  'packages/*/lib',
@@ -22,7 +22,7 @@
22
22
  "devDependencies": {
23
23
  "@eslint-react/eslint-plugin": "^5.22.1",
24
24
  "@eslint/js": "^10.0.1",
25
- "@pega/custom-dx-components": "~26.1.12-alpha.0.3",
25
+ "@pega/custom-dx-components": "26.1.12-alpha.0.4",
26
26
  "@pega/pcore-pconnect-typedefs": "^5.1.0",
27
27
  "@storybook/addon-links": "^10.6.0",
28
28
  "@storybook/react": "^10.6.0",
@@ -83,7 +83,7 @@
83
83
  "devDependencies": {
84
84
  "@eslint-react/eslint-plugin": "^5.22.1",
85
85
  "@eslint/js": "^10.0.1",
86
- "@pega/custom-dx-components": "~26.1.12-alpha.0.3",
86
+ "@pega/custom-dx-components": "26.1.12-alpha.0.4",
87
87
  "@pega/pcore-pconnect-typedefs": "^5.1.0",
88
88
  "@storybook/addon-links": "^10.6.0",
89
89
  "@storybook/react": "^10.6.0",
package/src/util.js CHANGED
@@ -1205,6 +1205,12 @@ export const convertIntoPascalCase = (string) => {
1205
1205
  return pascalCase(string);
1206
1206
  };
1207
1207
 
1208
+ // Shared by init and create so both write the same organization into package.json and component keys.
1209
+ export const normalizeOrganization = (organization) => {
1210
+ const sanitized = sanitize(organization);
1211
+ return isPascalCase(sanitized) ? sanitized : convertIntoPascalCase(sanitized);
1212
+ };
1213
+
1208
1214
  export const constructCompleteUrl = (baseServer, endPoint) => {
1209
1215
  if (showDebug)
1210
1216
  addDebugLog('constructCompleteUrl', `url: ${baseServer.endsWith('/') ? `${baseServer}${endPoint}` : `${baseServer}/${endPoint}`}`, '');