create-powerapps-project 0.16.6 → 0.17.2
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/lib/getEnvInfo.js +0 -1
- package/lib/index.js +11 -16
- package/lib/nuget.js +0 -2
- package/lib/plopfile.js +171 -22
- package/package.json +4 -7
- package/plop-templates/assembly/package.json.hbs +1 -0
- package/plop-templates/pcf/index.ts.hbs +1 -1
- package/plop-templates/webresource/package.json.hbs +1 -0
- package/CHANGELOG.json +0 -949
- package/CHANGELOG.md +0 -474
- package/lib/createDataverseProject.js +0 -220
- package/lib/logger.js +0 -36
- package/lib/plop.js +0 -37
- package/plop-templates/assembly/.gitignore +0 -362
- package/plop-templates/webresource/.gitignore +0 -43
package/lib/getEnvInfo.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -4,20 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.
|
|
18
|
-
(0, createDataverseProject_1.default)(type);
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const plop_1 = require("plop");
|
|
9
|
+
plop_1.Plop.launch({
|
|
10
|
+
cwd: process.cwd(),
|
|
11
|
+
configPath: node_path_1.default.join(__dirname, 'plopfile.js')
|
|
12
|
+
}, env => {
|
|
13
|
+
const options = {
|
|
14
|
+
...env,
|
|
15
|
+
dest: process.cwd() // this will make the destination path to be based on the cwd when calling the wrapper
|
|
16
|
+
};
|
|
17
|
+
return (0, plop_1.run)(options, undefined, true);
|
|
19
18
|
});
|
|
20
|
-
program.parse(process.argv);
|
|
21
|
-
if (!process.argv.slice(1).length) {
|
|
22
|
-
program.outputHelp();
|
|
23
|
-
}
|
package/lib/nuget.js
CHANGED
|
@@ -37,12 +37,10 @@ const install = (project, sdkVersion, xrmVersion) => {
|
|
|
37
37
|
stdio: 'inherit'
|
|
38
38
|
});
|
|
39
39
|
// Install nuget packages
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
41
40
|
(0, child_process_1.spawnSync)('dotnet', ['add', 'package', 'Microsoft.CrmSdk.Workflow', '-v', sdkVersion, '-n'], {
|
|
42
41
|
cwd: process.cwd(),
|
|
43
42
|
stdio: 'inherit'
|
|
44
43
|
});
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
44
|
(0, child_process_1.spawnSync)('dotnet', ['add', 'package', 'JourneyTeam.Xrm', '-v', xrmVersion, '-n'], {
|
|
47
45
|
cwd: process.cwd(),
|
|
48
46
|
stdio: 'inherit'
|
package/lib/plopfile.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
@@ -6,10 +25,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
25
|
const path_1 = __importDefault(require("path"));
|
|
7
26
|
const child_process_1 = require("child_process");
|
|
8
27
|
const fs_1 = __importDefault(require("fs"));
|
|
28
|
+
const nuget = __importStar(require("./nuget"));
|
|
29
|
+
const pkg = __importStar(require("./packageManager"));
|
|
30
|
+
const getEnvInfo_1 = require("./getEnvInfo");
|
|
9
31
|
const didSucceed = (code) => `${code}` === '0';
|
|
10
32
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
12
33
|
exports.default = (plop) => {
|
|
34
|
+
void (0, getEnvInfo_1.initialize)();
|
|
13
35
|
plop.setActionType('signAssembly', (answers) => {
|
|
14
36
|
const keyPath = path_1.default.resolve(process.cwd(), `${answers.name}.snk`);
|
|
15
37
|
return new Promise((resolve, reject) => {
|
|
@@ -22,9 +44,12 @@ exports.default = (plop) => {
|
|
|
22
44
|
resolve('signed assembly');
|
|
23
45
|
}
|
|
24
46
|
else {
|
|
25
|
-
reject('
|
|
47
|
+
reject('failed to sign assembly');
|
|
26
48
|
}
|
|
27
49
|
});
|
|
50
|
+
sign.on('error', () => {
|
|
51
|
+
reject('failed to sign assembly');
|
|
52
|
+
});
|
|
28
53
|
});
|
|
29
54
|
});
|
|
30
55
|
plop.setActionType('runPcf', (answers) => {
|
|
@@ -46,6 +71,9 @@ exports.default = (plop) => {
|
|
|
46
71
|
reject('Ensure the Power Platform CLI is installed. Command must be run from within VS Code if using the Power Platform Extension');
|
|
47
72
|
}
|
|
48
73
|
});
|
|
74
|
+
pac.on('error', () => {
|
|
75
|
+
reject('Ensure the Power Platform CLI is installed. Command must be run from within VS Code if using the Power Platform Extension');
|
|
76
|
+
});
|
|
49
77
|
});
|
|
50
78
|
});
|
|
51
79
|
plop.setActionType('addGenScript', async () => {
|
|
@@ -56,18 +84,132 @@ exports.default = (plop) => {
|
|
|
56
84
|
await fs_1.default.promises.writeFile(packagePath, JSON.stringify(packageJson, null, 4), 'utf8');
|
|
57
85
|
return 'added plop script to package.json';
|
|
58
86
|
});
|
|
59
|
-
plop.
|
|
87
|
+
plop.setActionType('nugetInstall', async (answers) => {
|
|
88
|
+
const xrmVersions = await nuget.getNugetPackageVersions('JourneyTeam.Xrm');
|
|
89
|
+
const xrmVersion = xrmVersions.shift();
|
|
90
|
+
nuget.install(answers.name, answers.sdkVersion, xrmVersion);
|
|
91
|
+
return 'installed nuget packages';
|
|
92
|
+
});
|
|
93
|
+
plop.setActionType('npmInstall', (_answers, config) => {
|
|
94
|
+
if (config?.projectType) {
|
|
95
|
+
pkg.install(process.cwd(), config.projectType);
|
|
96
|
+
}
|
|
97
|
+
return 'installed npm packages';
|
|
98
|
+
});
|
|
99
|
+
const connectionQuestions = [
|
|
100
|
+
{
|
|
101
|
+
type: 'input',
|
|
102
|
+
name: 'server',
|
|
103
|
+
message: 'enter dataverse url (https://org.crm.dynamics.com):'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: 'input',
|
|
107
|
+
name: 'tenant',
|
|
108
|
+
message: 'enter azure ad tenant (org.onmicrosoft.com):',
|
|
109
|
+
default: 'common'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: 'input',
|
|
113
|
+
name: 'solution',
|
|
114
|
+
message: 'dataverse solution unique name:'
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
plop.setGenerator('assembly', {
|
|
118
|
+
description: 'generate dataverse assembly project',
|
|
119
|
+
prompts: [
|
|
120
|
+
{
|
|
121
|
+
type: 'list',
|
|
122
|
+
name: 'sdkVersion',
|
|
123
|
+
message: 'select sdk version',
|
|
124
|
+
choices: async () => {
|
|
125
|
+
const versions = await nuget.getNugetPackageVersions('Microsoft.CrmSdk.Workflow');
|
|
126
|
+
return versions.map(v => ({ name: v, value: v }));
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
type: 'input',
|
|
131
|
+
name: 'name',
|
|
132
|
+
message: 'default C# namespace (Company.Crm.Plugins):'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: 'list',
|
|
136
|
+
name: 'isolation',
|
|
137
|
+
message: 'select isolation mode',
|
|
138
|
+
default: 2,
|
|
139
|
+
choices: [
|
|
140
|
+
{
|
|
141
|
+
name: 'sandbox',
|
|
142
|
+
value: 2
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'none',
|
|
146
|
+
value: 1
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
...connectionQuestions,
|
|
151
|
+
],
|
|
60
152
|
actions: [
|
|
153
|
+
{
|
|
154
|
+
type: 'add',
|
|
155
|
+
templateFile: '../plop-templates/assembly/assembly.csproj.hbs',
|
|
156
|
+
path: path_1.default.resolve(process.cwd(), '{{name}}.csproj'),
|
|
157
|
+
},
|
|
61
158
|
{
|
|
62
159
|
type: 'addMany',
|
|
63
|
-
templateFiles: [
|
|
64
|
-
|
|
160
|
+
templateFiles: [
|
|
161
|
+
'../plop-templates/assembly/*.json.hbs',
|
|
162
|
+
'../plop-templates/assembly/*.js',
|
|
163
|
+
'../plop-templates/assembly/*.ts.hbs',
|
|
164
|
+
'../plop-templates/assembly/.gitignore',
|
|
165
|
+
'../plop-templates/assembly/Entities/EarlyBoundGenerator.xml',
|
|
166
|
+
'../plop-templates/assembly/.vscode/tasks.json',
|
|
167
|
+
'../plop-templates/assembly/.editorconfig'
|
|
168
|
+
],
|
|
169
|
+
base: '../plop-templates/assembly',
|
|
65
170
|
destination: process.cwd(),
|
|
66
171
|
force: true
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'signAssembly'
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: 'nugetInstall'
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'npmInstall',
|
|
181
|
+
projectType: 'assembly'
|
|
67
182
|
}
|
|
68
183
|
]
|
|
69
184
|
});
|
|
70
185
|
plop.setGenerator('pcf', {
|
|
186
|
+
description: 'generate dataverse pcf project',
|
|
187
|
+
prompts: [
|
|
188
|
+
{
|
|
189
|
+
type: 'list',
|
|
190
|
+
name: 'template',
|
|
191
|
+
message: 'template',
|
|
192
|
+
choices: [
|
|
193
|
+
{ name: 'field', value: 'field' },
|
|
194
|
+
{ name: 'dataset', value: 'dataset' }
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
type: 'input',
|
|
199
|
+
name: 'namespace',
|
|
200
|
+
message: 'namespace'
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
type: 'input',
|
|
204
|
+
name: 'name',
|
|
205
|
+
message: 'name'
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
type: 'confirm',
|
|
209
|
+
name: 'react',
|
|
210
|
+
message: 'use react?'
|
|
211
|
+
}
|
|
212
|
+
],
|
|
71
213
|
actions: [
|
|
72
214
|
{
|
|
73
215
|
type: 'runPcf'
|
|
@@ -101,37 +243,44 @@ exports.default = (plop) => {
|
|
|
101
243
|
}
|
|
102
244
|
},
|
|
103
245
|
{
|
|
104
|
-
type: '
|
|
246
|
+
type: 'npmInstall',
|
|
247
|
+
projectType: 'pcf',
|
|
105
248
|
skip: (answers) => {
|
|
106
249
|
return !answers.react;
|
|
107
250
|
}
|
|
108
251
|
}
|
|
109
252
|
]
|
|
110
253
|
});
|
|
111
|
-
plop.setGenerator('
|
|
112
|
-
|
|
254
|
+
plop.setGenerator('webresource', {
|
|
255
|
+
description: 'generate dataverse web resource project',
|
|
256
|
+
prompts: [
|
|
113
257
|
{
|
|
114
|
-
type: '
|
|
115
|
-
|
|
116
|
-
|
|
258
|
+
type: 'input',
|
|
259
|
+
name: 'name',
|
|
260
|
+
message: 'project name',
|
|
261
|
+
default: path_1.default.basename(process.cwd())
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
type: 'input',
|
|
265
|
+
name: 'namespace',
|
|
266
|
+
message: 'namespace for form and ribbon scripts:'
|
|
117
267
|
},
|
|
268
|
+
...connectionQuestions
|
|
269
|
+
],
|
|
270
|
+
actions: [
|
|
118
271
|
{
|
|
119
272
|
type: 'addMany',
|
|
120
|
-
templateFiles: [
|
|
121
|
-
|
|
122
|
-
'../plop-templates/assembly/*.js',
|
|
123
|
-
'../plop-templates/assembly/*.ts.hbs',
|
|
124
|
-
'../plop-templates/assembly/.gitignore',
|
|
125
|
-
'../plop-templates/assembly/Entities/EarlyBoundGenerator.xml',
|
|
126
|
-
'../plop-templates/assembly/.vscode/tasks.json',
|
|
127
|
-
'../plop-templates/assembly/.editorconfig'
|
|
128
|
-
],
|
|
129
|
-
base: '../plop-templates/assembly',
|
|
273
|
+
templateFiles: ['../plop-templates/webresource/*', '../plop-templates/webresource/.*'],
|
|
274
|
+
base: '../plop-templates/webresource',
|
|
130
275
|
destination: process.cwd(),
|
|
131
276
|
force: true
|
|
132
277
|
},
|
|
133
278
|
{
|
|
134
|
-
type: '
|
|
279
|
+
type: 'npmInstall',
|
|
280
|
+
projectType: 'webresource',
|
|
281
|
+
skip: (answers) => {
|
|
282
|
+
return !answers.react;
|
|
283
|
+
}
|
|
135
284
|
}
|
|
136
285
|
]
|
|
137
286
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-powerapps-project",
|
|
3
3
|
"description": "💧 plop generator for Dataverse development",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.17.2",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
6
7
|
"main": "lib/index.js",
|
|
7
8
|
"bin": {
|
|
8
9
|
"create-powerapps-project": "lib/index.js"
|
|
@@ -22,15 +23,11 @@
|
|
|
22
23
|
"clean": "rimraf lib"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"commander": "^8.3.0",
|
|
26
26
|
"envinfo": "^7.8.1",
|
|
27
|
-
"
|
|
28
|
-
"node-plop": "^0.26.3",
|
|
29
|
-
"prompts": "^2.4.2"
|
|
27
|
+
"plop": "^2.7.6"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
32
30
|
"@types/envinfo": "^7.8.1",
|
|
33
|
-
"@types/node": "^14.14.21"
|
|
34
|
-
"@types/prompts": "^2.0.14"
|
|
31
|
+
"@types/node": "^14.14.21"
|
|
35
32
|
}
|
|
36
33
|
}
|