create-powerapps-project 0.16.1 → 0.16.5
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/CHANGELOG.json +61 -1
- package/CHANGELOG.md +36 -4
- package/lib/createDataverseProject.js +10 -2
- package/lib/logger.js +4 -4
- package/lib/packageManager.js +5 -3
- package/lib/plop.js +2 -2
- package/lib/plopfile.js +28 -6
- package/package.json +1 -1
- package/plop-templates/pcf/{index.ts → index.ts.hbs} +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,67 @@
|
|
|
2
2
|
"name": "create-powerapps-project",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 14 Feb 2022 23:29:38 GMT",
|
|
6
|
+
"tag": "create-powerapps-project_v0.16.5",
|
|
7
|
+
"version": "0.16.5",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "derek.finlinson@journeyteam.com",
|
|
12
|
+
"package": "create-powerapps-project",
|
|
13
|
+
"commit": "361a315823b5558a96c191850c2fcf8863653e5b",
|
|
14
|
+
"comment": "Set class name from prompts"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 11 Feb 2022 16:59:23 GMT",
|
|
21
|
+
"tag": "create-powerapps-project_v0.16.4",
|
|
22
|
+
"version": "0.16.4",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "derek.finlinson@journeyteam.com",
|
|
27
|
+
"package": "create-powerapps-project",
|
|
28
|
+
"commit": "19a5d1442fef02d2f260e59d2779d6f85df51630",
|
|
29
|
+
"comment": "Comment out pcf plop for now"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Wed, 09 Feb 2022 16:19:05 GMT",
|
|
36
|
+
"tag": "create-powerapps-project_v0.16.3",
|
|
37
|
+
"version": "0.16.3",
|
|
38
|
+
"comments": {
|
|
39
|
+
"patch": [
|
|
40
|
+
{
|
|
41
|
+
"author": "derek.finlinson@journeyteam.com",
|
|
42
|
+
"package": "create-powerapps-project",
|
|
43
|
+
"commit": "cdab4698564ece9f40c5a45327a38270a6d1c16d",
|
|
44
|
+
"comment": "Catch errors on commands"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Tue, 08 Feb 2022 18:47:13 GMT",
|
|
51
|
+
"tag": "create-powerapps-project_v0.16.2",
|
|
52
|
+
"version": "0.16.2",
|
|
53
|
+
"comments": {
|
|
54
|
+
"patch": [
|
|
55
|
+
{
|
|
56
|
+
"author": "derek.finlinson@journeyteam.com",
|
|
57
|
+
"package": "create-powerapps-project",
|
|
58
|
+
"commit": "70380beb0078b8c1ab669bf5f3e4eacbbcd99ba7",
|
|
59
|
+
"comment": "Update symbols"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "Tue, 08 Feb 2022 18:13:53 GMT",
|
|
6
66
|
"tag": "create-powerapps-project_v0.16.1",
|
|
7
67
|
"version": "0.16.1",
|
|
8
68
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,49 @@
|
|
|
1
1
|
# Change Log - create-powerapps-project
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 14 Feb 2022 23:29:38 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.16.
|
|
7
|
+
## 0.16.5
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Mon, 14 Feb 2022 23:29:38 GMT
|
|
10
10
|
|
|
11
11
|
### Patches
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- Set class name from prompts (derek.finlinson@journeyteam.com)
|
|
14
14
|
|
|
15
|
+
## 0.16.4
|
|
16
|
+
|
|
17
|
+
Fri, 11 Feb 2022 16:59:23 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Comment out pcf plop for now (derek.finlinson@journeyteam.com)
|
|
22
|
+
|
|
23
|
+
## 0.16.3
|
|
24
|
+
|
|
25
|
+
Wed, 09 Feb 2022 16:19:05 GMT
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- Catch errors on commands (derek.finlinson@journeyteam.com)
|
|
30
|
+
|
|
31
|
+
## 0.16.2
|
|
32
|
+
|
|
33
|
+
Tue, 08 Feb 2022 18:47:13 GMT
|
|
34
|
+
|
|
35
|
+
### Patches
|
|
36
|
+
|
|
37
|
+
- Update symbols (derek.finlinson@journeyteam.com)
|
|
38
|
+
|
|
39
|
+
## 0.16.1
|
|
40
|
+
|
|
41
|
+
Tue, 08 Feb 2022 18:13:53 GMT
|
|
42
|
+
|
|
43
|
+
### Patches
|
|
44
|
+
|
|
45
|
+
- Fix logger and file paths (derek.finlinson@journeyteam.com)
|
|
46
|
+
|
|
15
47
|
## 0.16.0
|
|
16
48
|
|
|
17
49
|
Mon, 07 Feb 2022 22:02:33 GMT
|
|
@@ -54,10 +54,18 @@ exports.default = async (type) => {
|
|
|
54
54
|
const xrmVersions = await (0, nuget_1.getNugetPackageVersions)('JourneyTeam.Xrm');
|
|
55
55
|
config.xrmVersion = xrmVersions.shift();
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
else if (type === 'webresource') {
|
|
58
|
+
config.name = name;
|
|
59
|
+
}
|
|
58
60
|
const generator = await (0, plop_1.getGenerator)(type, name);
|
|
59
61
|
logger_1.logger.info(`run powerapps-project-${type} code generator`);
|
|
60
|
-
|
|
62
|
+
try {
|
|
63
|
+
await (0, plop_1.runGenerator)(generator, config);
|
|
64
|
+
}
|
|
65
|
+
catch (ex) {
|
|
66
|
+
logger_1.logger.error(ex.message);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
61
69
|
logger_1.logger.info('initialize project');
|
|
62
70
|
if (type !== 'pcf' || config.react) {
|
|
63
71
|
pkg.install(process.cwd(), type);
|
package/lib/logger.js
CHANGED
|
@@ -7,10 +7,10 @@ exports.logger = exports.icons = void 0;
|
|
|
7
7
|
const kleur_1 = __importDefault(require("kleur"));
|
|
8
8
|
const isTest = process.env.JEST_WORKER_ID !== undefined;
|
|
9
9
|
exports.icons = {
|
|
10
|
-
done: kleur_1.default.green('
|
|
11
|
-
info: kleur_1.default.cyan('
|
|
10
|
+
done: kleur_1.default.green('◉'),
|
|
11
|
+
info: kleur_1.default.cyan('◎'),
|
|
12
12
|
error: kleur_1.default.red('⨂'),
|
|
13
|
-
warn: kleur_1.default.yellow('
|
|
13
|
+
warn: kleur_1.default.yellow('⨁')
|
|
14
14
|
};
|
|
15
15
|
exports.logger = {
|
|
16
16
|
info(...args) {
|
|
@@ -30,7 +30,7 @@ exports.logger = {
|
|
|
30
30
|
},
|
|
31
31
|
done(...args) {
|
|
32
32
|
if (!isTest) {
|
|
33
|
-
console.info(exports.icons.
|
|
33
|
+
console.info(exports.icons.done, ...args);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
};
|
package/lib/packageManager.js
CHANGED
|
@@ -38,12 +38,14 @@ function getPackages(type) {
|
|
|
38
38
|
dependencies: [
|
|
39
39
|
'react',
|
|
40
40
|
'react-dom',
|
|
41
|
-
'@fluentui/react'
|
|
41
|
+
'@fluentui/react',
|
|
42
|
+
'@fluentui/font-icons-mdl2'
|
|
42
43
|
],
|
|
43
44
|
devDependencies: [
|
|
44
|
-
|
|
45
|
+
//`powerapps-project-${type}`,
|
|
45
46
|
'@types/react',
|
|
46
|
-
'@types/react-dom'
|
|
47
|
+
'@types/react-dom',
|
|
48
|
+
'@types/xrm'
|
|
47
49
|
]
|
|
48
50
|
};
|
|
49
51
|
}
|
package/lib/plop.js
CHANGED
|
@@ -21,11 +21,11 @@ exports.getGenerator = getGenerator;
|
|
|
21
21
|
const runGenerator = async (generator, args) => {
|
|
22
22
|
const results = await generator.runActions(args, {
|
|
23
23
|
onComment: (comment) => {
|
|
24
|
-
logger_1.logger.
|
|
24
|
+
logger_1.logger.info(comment);
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
if (results.failures && results.failures.length > 0) {
|
|
28
|
-
throw new Error(
|
|
28
|
+
throw new Error(results.failures[0].error);
|
|
29
29
|
}
|
|
30
30
|
// do something after the actions have run
|
|
31
31
|
for (const change of results.changes) {
|
package/lib/plopfile.js
CHANGED
|
@@ -6,13 +6,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const didSucceed = (code) => `${code}` === '0';
|
|
9
10
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
11
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
11
12
|
exports.default = (plop) => {
|
|
12
13
|
plop.setActionType('signAssembly', (answers) => {
|
|
13
14
|
const keyPath = path_1.default.resolve(process.cwd(), `${answers.name}.snk`);
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
if (process.env.JEST_WORKER_ID !== undefined) {
|
|
17
|
+
resolve('Testing so no need to sign');
|
|
18
|
+
}
|
|
19
|
+
const sign = (0, child_process_1.spawn)(path_1.default.resolve(__dirname, '../', 'bin', 'sn.exe'), ['-q', '-k', keyPath], { stdio: 'inherit' });
|
|
20
|
+
sign.on('close', (code) => {
|
|
21
|
+
if (didSucceed(code)) {
|
|
22
|
+
resolve('signed assembly');
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
reject('Failed to sign assembly');
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
16
29
|
});
|
|
17
30
|
plop.setActionType('runPcf', (answers) => {
|
|
18
31
|
const args = ['pcf', 'init', '-ns', answers.namespace, '-n', answers.name, '-t', answers.template];
|
|
@@ -23,15 +36,24 @@ exports.default = (plop) => {
|
|
|
23
36
|
if (process.env.JEST_WORKER_ID !== undefined) {
|
|
24
37
|
args.push('-npm', 'false');
|
|
25
38
|
}
|
|
26
|
-
(
|
|
27
|
-
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const pac = (0, child_process_1.spawn)('pac', args, { stdio: 'inherit' });
|
|
41
|
+
pac.on('close', (code) => {
|
|
42
|
+
if (didSucceed(code)) {
|
|
43
|
+
resolve('pcf project created');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
reject('Ensure the Power Platform CLI is installed. Command must be run from within VS Code if using the Power Platform Extension');
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
28
50
|
});
|
|
29
|
-
plop.setActionType('addGenScript', () => {
|
|
51
|
+
plop.setActionType('addGenScript', async () => {
|
|
30
52
|
const packagePath = path_1.default.resolve(process.cwd(), 'package.json');
|
|
31
53
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
32
54
|
const packageJson = require(packagePath);
|
|
33
55
|
packageJson.scripts.gen = 'plop';
|
|
34
|
-
fs_1.default.
|
|
56
|
+
await fs_1.default.promises.writeFile(packagePath, JSON.stringify(packageJson, null, 4), 'utf8');
|
|
35
57
|
return 'added plop script to package.json';
|
|
36
58
|
});
|
|
37
59
|
plop.setGenerator('webresource', {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import { initializeIcons } from '@fluentui/font-icons-mdl2';
|
|
|
5
5
|
|
|
6
6
|
import { App } from './App';
|
|
7
7
|
|
|
8
|
-
export class
|
|
8
|
+
export class {{name}} implements ComponentFramework.StandardControl<IInputs, IOutputs> {
|
|
9
9
|
container: HTMLDivElement;
|
|
10
10
|
context: ComponentFramework.Context<IInputs>;
|
|
11
11
|
isTestHarness: boolean;
|