@pega/custom-dx-components 8.8.2 → 8.8.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": "8.8.2",
3
+ "version": "8.8.4",
4
4
  "description": "Utility for building custom UI components",
5
5
  "bin": "./bin/index.js",
6
6
  "scripts": {
@@ -62,7 +62,7 @@
62
62
  "custom-components"
63
63
  ],
64
64
  "devDependencies": {
65
- "@pega/configs": "^0.3.3",
65
+ "@pega/configs": "^0.5.3",
66
66
  "cspell": "^6.9.0",
67
67
  "prettier": "2.7.1"
68
68
  }
@@ -10,8 +10,7 @@ import {
10
10
  constructCompleteUrl,
11
11
  getComponentDirectoryPath,
12
12
  getComponents,
13
- getPegaServerConfig,
14
- validateRulesetVersion
13
+ getPegaServerConfig
15
14
  } from '../../util.js';
16
15
  import { PUBLISH_COMPONENT_SERVICE_REST_ENDPOINT, TOKEN_PATH } from '../../constants.js';
17
16
 
@@ -6,7 +6,7 @@ import validate from '../validator/index.js';
6
6
 
7
7
  import bundleComponent from '../bundle/index.js';
8
8
  import lintComponent from '../linter/index.js';
9
- import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
9
+ import { getPublishComponentQuestions } from './helper.js';
10
10
  import { getComponentDirectoryPath, showVersion } from '../../util.js';
11
11
 
12
12
  export default async options => {
@@ -60,6 +60,7 @@ export const zipComponent = async (componentKey) => {
60
60
  const zipContent = zip.toBuffer().toString('base64');
61
61
 
62
62
  const configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
63
+ // clean up now happens in function cleanUp
63
64
  // fs.rmd('dist/components', { recursive: true }, err => {
64
65
  // if (err) {
65
66
  // throw err;
@@ -125,24 +125,11 @@ const validateCompile = async (
125
125
  }
126
126
 
127
127
  const templateDir = `./templates/${framework}/${type}/${sSubType}`;
128
- //const templateDirectory = fileURLToPath(new URL('./template', import.meta.url));
129
128
  const templateDirectory = fileURLToPath(new URL(templateDir, import.meta.url));
130
129
 
131
-
132
- //console.log("temp dir:" + templateDirectory);
133
130
  const { organization } = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8'));
134
131
 
135
132
  const componentKey = `${organization}_${library}_${componentName}`;
136
- /*
137
- if (!isPascalCase(componentKey)) {
138
- console.log(
139
- chalk.yellowBright(
140
- `${componentKey} is not in Pascal Case. Attempting to create component in Pascal Case !!`
141
- )
142
- );
143
- componentKey = convertIntoPascalCase(componentKey);
144
- } */
145
-
146
133
  const targetDirectory = await getComponentDirectoryPath(componentKey);
147
134
 
148
135
  const components = await getComponents();
@@ -10,7 +10,6 @@ import chalk from 'chalk';
10
10
 
11
11
  import { checkPathAccess, showVersion } from '../../util.js';
12
12
 
13
-
14
13
  export const DXCB_CONFIG_INTERNAL_JSON_FILENAME = 'src/dxcb.config.json';
15
14
 
16
15
  import {
@@ -32,7 +31,6 @@ import {
32
31
  } from '../../constants.js';
33
32
 
34
33
  const pegaConfigJsonPath = path.join(path.resolve(), TASKS_CONFIG_JSON_FILENAME);
35
- //const pegaConfigInternalJsonPath = path.join(path.resolve(), DXCB_CONFIG_INTERNAL_JSON_FILENAME);
36
34
 
37
35
  const copy = promisify(ncp);
38
36
 
@@ -2,14 +2,12 @@ import chalk from 'chalk';
2
2
  import inquirer from 'inquirer';
3
3
  import ora from 'ora';
4
4
 
5
- import { LIST_COMPONENT_SERVICE_REST_ENDPOINT } from '../../constants.js';
5
+
6
6
  import {
7
- constructCompleteUrl,
8
7
  deleteLocalComponent,
9
8
  deleteServerComponent,
10
9
  getComponents,
11
- getPegaServerConfig,
12
- nodeFetch
10
+ getPegaServerConfig
13
11
  } from '../../util.js';
14
12
  import { getComponentsFromServer } from '../list/helper.js';
15
13
 
@@ -2,15 +2,12 @@ import chalk from 'chalk';
2
2
  import inquirer from 'inquirer';
3
3
  import ora from 'ora';
4
4
 
5
- import { LIST_COMPONENT_SERVICE_REST_ENDPOINT } from '../../constants.js';
6
5
  import {
7
- constructCompleteUrl,
8
6
  deleteLocalComponent,
9
7
  deleteServerComponent,
10
8
  getComponents,
11
9
  getPegaServerConfig,
12
- validateRulesetVersion,
13
- nodeFetch
10
+ validateRulesetVersion
14
11
  } from '../../util.js';
15
12
  import { getComponentsFromServer } from '../list/helper.js';
16
13
 
@@ -142,25 +139,6 @@ export const deleteServerComponents = async (sourceOfComponents, answers) => {
142
139
  }
143
140
  }
144
141
 
145
- /*
146
- const answers = await inquirer.prompt({
147
- name: 'componentToDelete',
148
- type: 'rawlist',
149
- pageSize: 10,
150
- message: `Select component to delete \n ${standardizeStr('Rule name', 48)} ${standardizeStr(
151
- 'Ruleset name',
152
- 30
153
- )} ${standardizeStr('Ruleset version', 22)}`,
154
- choices: choicesArr
155
- });
156
- */
157
-
158
-
159
-
160
- /*
161
- await deleteServerComponent(answers.componentToDelete);
162
- await deleteFromComponentMap(answers.componentToDelete.split("~")[0]);
163
- */
164
142
 
165
143
  } else {
166
144
  console.log(chalk.bold.redBright(`No custom components in ${sourceOfComponents}`));
@@ -56,8 +56,8 @@
56
56
  "styled-components": "^5.3.5"
57
57
  },
58
58
  "devDependencies": {
59
- "@pega/configs": "^0.3.4",
60
- "@pega/custom-dx-components": "^8.8.2",
59
+ "@pega/configs": "^0.5.3",
60
+ "@pega/custom-dx-components": "^8.8.4",
61
61
  "@pega/eslint-config": "^0.3.2",
62
62
  "@storybook/addon-actions": "^6.5.12",
63
63
  "@storybook/addon-essentials": "^6.5.12",
@@ -75,11 +75,13 @@ export const zipComponent = async componentKey => {
75
75
  const zipContent = zip.toBuffer().toString('base64');
76
76
 
77
77
  const configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
78
+
78
79
  fs.rmdir('dist', { recursive: true }, err => {
79
80
  if (err) {
80
81
  throw err;
81
82
  }
82
83
  });
84
+
83
85
  return { zipContent, configContent };
84
86
  };
85
87
 
@@ -69,6 +69,7 @@ export const zipComponent = async componentKey => {
69
69
  const zipContent = zip.toBuffer().toString('base64');
70
70
 
71
71
  const configContent = Buffer.from(fs.readFileSync(`${srcDirectory}/config.json`)).toString();
72
+ // clean up now happens in function cleanUp
72
73
  //fs.rmdir('dist', { recursive: true }, err => {
73
74
  // if (err) {
74
75
  // throw err;
@@ -1,5 +1,4 @@
1
1
  import path from 'path';
2
- import { URL, fileURLToPath } from 'url';
3
2
  import fs from 'fs';
4
3
  import { promisify } from 'util';
5
4
  import { join } from 'path';
package/src/util.js CHANGED
@@ -16,13 +16,7 @@ import {
16
16
  TOKEN_PATH,
17
17
  OOTB_COMPONENT_SERVICE_REST_ENDPOINT,
18
18
  DELETE_COMPONENT_SERVICE_REST_ENDPOINT,
19
- OOTB_COMPONENTS,
20
- FIELD_PATH,
21
- WIDGET_PATH,
22
- TEMPLATE_PATH,
23
- COMPONENT_PREFIX_FIELD_PATH,
24
- COMPONENT_PREFIX_TEMPLATE_PATH,
25
- COMPONENT_PREFIX_WIDGET_PATH
19
+ OOTB_COMPONENTS
26
20
  } from './constants.js';
27
21
 
28
22
  const access = promisify(fs.access);