@pega/custom-dx-components 0.23.5 → 0.23.6
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
package/src/tasks/init/index.js
CHANGED
|
@@ -11,12 +11,7 @@ import Listr from 'listr';
|
|
|
11
11
|
import gitignore from 'gitignore';
|
|
12
12
|
import inquirer from 'inquirer';
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
compileMustacheTemplate,
|
|
16
|
-
isPascalCase,
|
|
17
|
-
convertIntoPascalCase,
|
|
18
|
-
sanitize
|
|
19
|
-
} from '../../util.js';
|
|
14
|
+
import { compileMustacheTemplate, isPascalCase, convertIntoPascalCase, sanitize } from '../../util.js';
|
|
20
15
|
|
|
21
16
|
import { getInitProjectQuestions } from './helper.js';
|
|
22
17
|
|
|
@@ -26,7 +21,7 @@ const copy = promisify(ncp);
|
|
|
26
21
|
const writeGitignore = promisify(gitignore.writeFile);
|
|
27
22
|
const writeFile = promisify(fs.writeFile);
|
|
28
23
|
|
|
29
|
-
const createGitignore = async options => {
|
|
24
|
+
const createGitignore = async (options) => {
|
|
30
25
|
const file = fs.createWriteStream(path.join(options.targetDirectory, '.gitignore'), {
|
|
31
26
|
flags: 'a'
|
|
32
27
|
});
|
|
@@ -36,13 +31,13 @@ const createGitignore = async options => {
|
|
|
36
31
|
});
|
|
37
32
|
};
|
|
38
33
|
|
|
39
|
-
const createLicense = async options => {
|
|
34
|
+
const createLicense = async (options) => {
|
|
40
35
|
const targetPath = path.join(options.targetDirectory, 'LICENSE');
|
|
41
36
|
const licenseContent = 'Enter license text here';
|
|
42
37
|
return writeFile(targetPath, licenseContent, 'utf8');
|
|
43
38
|
};
|
|
44
39
|
|
|
45
|
-
const copyProjectTemplate = async options => {
|
|
40
|
+
const copyProjectTemplate = async (options) => {
|
|
46
41
|
await copy(options.templateDirectory, options.targetDirectory, {
|
|
47
42
|
clobber: false
|
|
48
43
|
});
|
|
@@ -73,7 +68,7 @@ const copyProjectTemplate = async options => {
|
|
|
73
68
|
await createLicense(options);
|
|
74
69
|
};
|
|
75
70
|
|
|
76
|
-
const initGit = async options => {
|
|
71
|
+
const initGit = async (options) => {
|
|
77
72
|
const result = await execa('git', ['init'], {
|
|
78
73
|
cwd: options.targetDirectory
|
|
79
74
|
});
|
|
@@ -82,16 +77,13 @@ const initGit = async options => {
|
|
|
82
77
|
}
|
|
83
78
|
};
|
|
84
79
|
|
|
85
|
-
export default async options => {
|
|
86
|
-
options.templateDirectory = path.resolve(
|
|
87
|
-
path.dirname(fileURLToPath(import.meta.url)),
|
|
88
|
-
'template'
|
|
89
|
-
);
|
|
80
|
+
export default async (options) => {
|
|
81
|
+
options.templateDirectory = path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'template');
|
|
90
82
|
let projectName = 'test';
|
|
91
83
|
|
|
92
84
|
const questions = getInitProjectQuestions();
|
|
93
85
|
|
|
94
|
-
await inquirer.prompt(questions).then(async answers => {
|
|
86
|
+
await inquirer.prompt(questions).then(async (answers) => {
|
|
95
87
|
projectName = answers.projectName;
|
|
96
88
|
projectName = sanitize(projectName).toLowerCase();
|
|
97
89
|
options = { ...options, ...answers };
|
|
@@ -107,6 +99,7 @@ export default async options => {
|
|
|
107
99
|
|
|
108
100
|
const targetDirectory = options.targetDirectory || process.cwd();
|
|
109
101
|
options.targetDirectory = path.join(targetDirectory, projectName);
|
|
102
|
+
options.componentDirectory = path.join(options.targetDirectory, 'node_modules/@pega/custom-dx-components');
|
|
110
103
|
});
|
|
111
104
|
|
|
112
105
|
const installDependenciesText = `Installing dependencies. This will take a couple of minutes.`;
|
|
@@ -128,8 +121,11 @@ export default async options => {
|
|
|
128
121
|
},
|
|
129
122
|
{
|
|
130
123
|
title: installDependenciesText,
|
|
131
|
-
task: () =>
|
|
132
|
-
|
|
124
|
+
task: () => execPromise('npm i --force --production=false', { cwd: options.targetDirectory })
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
title: 'Installing components dependencies',
|
|
128
|
+
task: () => execPromise('npm i --force --production=false', { cwd: options.componentDirectory })
|
|
133
129
|
}
|
|
134
130
|
],
|
|
135
131
|
{
|
|
@@ -139,9 +135,7 @@ export default async options => {
|
|
|
139
135
|
|
|
140
136
|
await tasks.run();
|
|
141
137
|
console.log('\n');
|
|
142
|
-
console.log(
|
|
143
|
-
`${chalk.green('Success!!')} Project created at ${chalk.blueBright(options.targetDirectory)}`
|
|
144
|
-
);
|
|
138
|
+
console.log(`${chalk.green('Success!!')} Project created at ${chalk.blueBright(options.targetDirectory)}`);
|
|
145
139
|
console.log(
|
|
146
140
|
'\n',
|
|
147
141
|
`Inside that directory, you can run several commands:`,
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@pega/configs": "^0.5.3",
|
|
67
|
-
"@pega/custom-dx-components": "^0.23.
|
|
67
|
+
"@pega/custom-dx-components": "^0.23.6",
|
|
68
68
|
"@pega/eslint-config": "^0.3.2",
|
|
69
69
|
"@storybook/addon-actions": "^6.5.12",
|
|
70
70
|
"@storybook/addon-essentials": "^6.5.12",
|