create-powerapps-project 0.14.1 → 0.14.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/README.md CHANGED
@@ -1,36 +1,36 @@
1
- # create-powerapps-project
2
- | NPM |
3
- | --- |
4
- | [![npm](https://img.shields.io/npm/v/create-powerapps-project.svg?style=flat-square)](https://www.npmjs.com/package/create-powerapps-project) |
5
-
6
- Project generator for Dataverse development
7
-
8
- # Generators
9
-
10
- * Web resource project scaffolding
11
- * [Typescript](https://www.typescriptlang.org/index.html) for JavaScript files
12
- * [Webpack](https://webpack.js.org/) for bundling
13
- * [Babel](https://babeljs.io/) for polyfills and compiling ES2015+
14
- * Unit tests using [xrm-mock](https://github.com/camelCaseDave/xrm-mock) and [Jest](https://jestjs.io/)
15
- * Deploy web resources
16
- * Plugin project scaffolding
17
- * Base plugin classes
18
- * No ILMerge needed
19
- * Deploy plugin assemblies and types
20
- * Deploy plugin steps
21
- * Workflow project scaffolding
22
- * Workflow activity base class
23
- * No ILMerge needed
24
- * Deploy workflow assemblies and types
25
-
26
- # Create project
27
-
28
- ```sh
29
- npm init powerapps-project
30
- ```
31
-
32
- # Add files to project
33
-
34
- ```sh
35
- npm run gen
1
+ # create-powerapps-project
2
+ | NPM |
3
+ | --- |
4
+ | [![npm](https://img.shields.io/npm/v/create-powerapps-project.svg?style=flat-square)](https://www.npmjs.com/package/create-powerapps-project) |
5
+
6
+ Project generator for Dataverse development
7
+
8
+ # Generators
9
+
10
+ * Web resource project scaffolding
11
+ * [Typescript](https://www.typescriptlang.org/index.html) for JavaScript files
12
+ * [Webpack](https://webpack.js.org/) for bundling
13
+ * [Babel](https://babeljs.io/) for polyfills and compiling ES2015+
14
+ * Unit tests using [xrm-mock](https://github.com/camelCaseDave/xrm-mock) and [Jest](https://jestjs.io/)
15
+ * Deploy web resources
16
+ * Plugin project scaffolding
17
+ * Base plugin classes
18
+ * No ILMerge needed
19
+ * Deploy plugin assemblies and types
20
+ * Deploy plugin steps
21
+ * Workflow project scaffolding
22
+ * Workflow activity base class
23
+ * No ILMerge needed
24
+ * Deploy workflow assemblies and types
25
+
26
+ # Create project
27
+
28
+ ```sh
29
+ npm init powerapps-project
30
+ ```
31
+
32
+ # Add files to project
33
+
34
+ ```sh
35
+ npm run gen
36
36
  ```
@@ -30,12 +30,12 @@ const pkg = __importStar(require("./packageManager"));
30
30
  const just_scripts_utils_1 = require("just-scripts-utils");
31
31
  const getEnvInfo_1 = require("./getEnvInfo");
32
32
  async function create(argv) {
33
- await getEnvInfo_1.initialize();
33
+ await (0, getEnvInfo_1.initialize)();
34
34
  argv.name = path_1.default.basename(process.cwd());
35
35
  if (!argv.type || (argv.type !== 'webresource' && argv.type !== 'assembly')) {
36
36
  const invalid = argv.type !== undefined && argv.type !== 'webresource' && argv.type !== 'assembly';
37
37
  const invalidMessage = invalid ? `${argv.type} is not a valid project type.` : '';
38
- const { type } = await prompts_1.default({
38
+ const { type } = await (0, prompts_1.default)({
39
39
  type: 'select',
40
40
  name: 'type',
41
41
  message: `${invalidMessage} Select dataverse project to create?`,
@@ -47,20 +47,20 @@ async function create(argv) {
47
47
  argv.type = type;
48
48
  }
49
49
  const questions = await getAnswers(argv.type);
50
- const config = (await prompts_1.default(questions));
50
+ const config = (await (0, prompts_1.default)(questions));
51
51
  if (argv.type === 'assembly') {
52
- const xrmVersions = await nuget_1.getNugetPackageVersions('JourneyTeam.Xrm');
52
+ const xrmVersions = await (0, nuget_1.getNugetPackageVersions)('JourneyTeam.Xrm');
53
53
  config.xrmVersion = xrmVersions.shift();
54
54
  }
55
55
  just_scripts_utils_1.logger.info('get plop generator');
56
- const generator = plop_1.getGenerator(argv);
56
+ const generator = await (0, plop_1.getGenerator)(argv);
57
57
  just_scripts_utils_1.logger.info(`run powerapps-project-${argv.type} code generator`);
58
- await plop_1.runGenerator(generator, config);
58
+ await (0, plop_1.runGenerator)(generator, config);
59
59
  just_scripts_utils_1.logger.info('initialize project');
60
60
  pkg.install(process.cwd(), argv.type);
61
61
  if (argv.type === 'assembly') {
62
62
  just_scripts_utils_1.logger.info('add nuget packages');
63
- nuget_1.install(config.name, config.sdkVersion, config.xrmVersion);
63
+ (0, nuget_1.install)(config.name, config.sdkVersion, config.xrmVersion);
64
64
  }
65
65
  done(argv);
66
66
  }
@@ -75,7 +75,7 @@ async function getAnswers(type) {
75
75
  });
76
76
  }
77
77
  else {
78
- const versions = await nuget_1.getNugetPackageVersions('Microsoft.CrmSdk.Workflow');
78
+ const versions = await (0, nuget_1.getNugetPackageVersions)('Microsoft.CrmSdk.Workflow');
79
79
  questions = [
80
80
  {
81
81
  type: 'select',
@@ -148,5 +148,5 @@ function done(argv) {
148
148
  run code generator with this command:
149
149
  ${pkg.getYarn() ? 'yarn' : 'npm run'} gen
150
150
  `;
151
- just_scripts_utils_1.logger.info(just_scripts_utils_1.prettyPrintMarkdown(message));
151
+ just_scripts_utils_1.logger.info((0, just_scripts_utils_1.prettyPrintMarkdown)(message));
152
152
  }
package/lib/index.js CHANGED
@@ -13,4 +13,4 @@ const options = {
13
13
  describe: 'Create new dataverse project',
14
14
  handler: createDataverseProject_1.default
15
15
  };
16
- yargs_1.command(options).help().argv;
16
+ (0, yargs_1.command)(options).help().argv;
package/lib/nuget.js CHANGED
@@ -28,26 +28,26 @@ const getNugetPackageVersions = (name) => {
28
28
  exports.getNugetPackageVersions = getNugetPackageVersions;
29
29
  const install = (project, sdkVersion, xrmVersion) => {
30
30
  // Add solution
31
- child_process_1.spawnSync('dotnet', ['new', 'sln', '-n', project], {
31
+ (0, child_process_1.spawnSync)('dotnet', ['new', 'sln', '-n', project], {
32
32
  cwd: process.cwd(),
33
33
  stdio: 'inherit'
34
34
  });
35
- child_process_1.spawnSync('dotnet', ['sln', 'add', `${project}.csproj`], {
35
+ (0, child_process_1.spawnSync)('dotnet', ['sln', 'add', `${project}.csproj`], {
36
36
  cwd: process.cwd(),
37
37
  stdio: 'inherit'
38
38
  });
39
39
  // Install nuget packages
40
40
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
41
- child_process_1.spawnSync('dotnet', ['add', 'package', 'Microsoft.CrmSdk.Workflow', '-v', sdkVersion, '-n'], {
41
+ (0, child_process_1.spawnSync)('dotnet', ['add', 'package', 'Microsoft.CrmSdk.Workflow', '-v', sdkVersion, '-n'], {
42
42
  cwd: process.cwd(),
43
43
  stdio: 'inherit'
44
44
  });
45
45
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
46
- child_process_1.spawnSync('dotnet', ['add', 'package', 'JourneyTeam.Xrm', '-v', xrmVersion, '-n'], {
46
+ (0, child_process_1.spawnSync)('dotnet', ['add', 'package', 'JourneyTeam.Xrm', '-v', xrmVersion, '-n'], {
47
47
  cwd: process.cwd(),
48
48
  stdio: 'inherit'
49
49
  });
50
- child_process_1.spawnSync('dotnet', ['restore'], {
50
+ (0, child_process_1.spawnSync)('dotnet', ['restore'], {
51
51
  cwd: process.cwd(),
52
52
  stdio: 'inherit'
53
53
  });
@@ -5,26 +5,26 @@ exports.install = exports.getYarn = void 0;
5
5
  const child_process_1 = require("child_process");
6
6
  const getEnvInfo_1 = require("./getEnvInfo");
7
7
  const getYarn = () => {
8
- const yarnInfo = getEnvInfo_1.getEnvInfo().Binaries.Yarn;
8
+ const yarnInfo = (0, getEnvInfo_1.getEnvInfo)().Binaries.Yarn;
9
9
  return yarnInfo && yarnInfo.path;
10
10
  };
11
11
  exports.getYarn = getYarn;
12
12
  const getNpm = () => {
13
- const npmInfo = getEnvInfo_1.getEnvInfo().Binaries.npm;
13
+ const npmInfo = (0, getEnvInfo_1.getEnvInfo)().Binaries.npm;
14
14
  return npmInfo && npmInfo.path;
15
15
  };
16
16
  const install = (cwd, type) => {
17
17
  const packages = getPackages(type);
18
- if (exports.getYarn()) {
19
- child_process_1.spawnSync(exports.getYarn(), ['add', ...packages.devDependencies], { stdio: 'inherit', cwd });
18
+ if ((0, exports.getYarn)()) {
19
+ (0, child_process_1.spawnSync)((0, exports.getYarn)(), ['add', ...packages.devDependencies], { stdio: 'inherit', cwd });
20
20
  if (packages.dependencies) {
21
- child_process_1.spawnSync(exports.getYarn(), ['add', ...packages.dependencies], { stdio: 'inherit', cwd });
21
+ (0, child_process_1.spawnSync)((0, exports.getYarn)(), ['add', ...packages.dependencies], { stdio: 'inherit', cwd });
22
22
  }
23
23
  }
24
24
  else {
25
- child_process_1.spawnSync(getNpm(), ['add', ...packages.devDependencies], { stdio: 'inherit', cwd });
25
+ (0, child_process_1.spawnSync)(getNpm(), ['add', ...packages.devDependencies], { stdio: 'inherit', cwd });
26
26
  if (packages.dependencies) {
27
- child_process_1.spawnSync(getNpm(), ['add', ...packages.dependencies], { stdio: 'inherit', cwd });
27
+ (0, child_process_1.spawnSync)(getNpm(), ['add', ...packages.dependencies], { stdio: 'inherit', cwd });
28
28
  }
29
29
  }
30
30
  };
package/lib/plop.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PlopGenerator } from 'node-plop';
2
2
  import yargs from 'yargs';
3
3
  import { Config } from './createDataverseProject';
4
- export declare const getGenerator: (argv: yargs.Arguments) => PlopGenerator;
4
+ export declare const getGenerator: (argv: yargs.Arguments) => Promise<PlopGenerator>;
5
5
  export declare const runGenerator: (generator: PlopGenerator, args: Config) => Promise<void>;
package/lib/plop.js CHANGED
@@ -8,9 +8,9 @@ const node_plop_1 = __importDefault(require("node-plop"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const just_scripts_utils_1 = require("just-scripts-utils");
10
10
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
- const getGenerator = (argv) => {
11
+ const getGenerator = async (argv) => {
12
12
  const plopFile = path_1.default.resolve(__dirname, 'plopfile.js');
13
- const plop = node_plop_1.default(plopFile, { destBasePath: argv.destination, force: false });
13
+ const plop = await (0, node_plop_1.default)(plopFile, { destBasePath: argv.destination, force: false });
14
14
  const generator = plop.getGenerator(argv.type);
15
15
  return generator;
16
16
  };
package/lib/plopfile.js CHANGED
@@ -10,7 +10,7 @@ const child_process_1 = require("child_process");
10
10
  exports.default = (plop) => {
11
11
  plop.setActionType('signAssembly', (answers) => {
12
12
  const keyPath = path_1.default.resolve(process.cwd(), `${answers.name}.snk`);
13
- child_process_1.spawnSync(path_1.default.resolve(__dirname, '../', 'bin', 'sn.exe'), ['-q', '-k', keyPath], { stdio: 'inherit' });
13
+ (0, child_process_1.spawnSync)(path_1.default.resolve(__dirname, '../', 'bin', 'sn.exe'), ['-q', '-k', keyPath], { stdio: 'inherit' });
14
14
  return 'signed assembly';
15
15
  });
16
16
  plop.setGenerator('webresource', {
package/license ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Derek Finlinson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-powerapps-project",
3
- "version": "0.14.1",
3
+ "version": "0.14.5",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -22,15 +22,15 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "envinfo": "^7.8.1",
25
- "node-plop": "^0.26.2",
26
- "prompts": "^2.4.0",
27
- "just-scripts-utils": "^1.1.1",
28
- "yargs": "^16.2.0"
25
+ "node-plop": "^0.30.0",
26
+ "prompts": "^2.4.2",
27
+ "just-scripts-utils": "^1.1.4",
28
+ "yargs": "^17.3.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/envinfo": "^7.8.0",
31
+ "@types/envinfo": "^7.8.1",
32
32
  "@types/node": "^14.14.21",
33
- "@types/prompts": "^2.0.9",
34
- "@types/yargs": "^15.0.12"
33
+ "@types/prompts": "^2.0.14",
34
+ "@types/yargs": "^17.0.7"
35
35
  }
36
36
  }
@@ -1,25 +1,25 @@
1
- {
2
- // See https://go.microsoft.com/fwlink/?LinkId=733558
3
- // for the documentation about the tasks.json format
4
- "version": "2.0.0",
5
- "tasks": [
6
- {
7
- "label": "build",
8
- "command": "dotnet",
9
- "type": "shell",
10
- "args": [
11
- "build",
12
- "/property:GenerateFullPaths=true",
13
- "/consoleloggerparameters:NoSummary"
14
- ],
15
- "group": {
16
- "kind": "build",
17
- "isDefault": true
18
- },
19
- "presentation": {
20
- "reveal": "silent"
21
- },
22
- "problemMatcher": "$msCompile"
23
- }
24
- ]
1
+ {
2
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
3
+ // for the documentation about the tasks.json format
4
+ "version": "2.0.0",
5
+ "tasks": [
6
+ {
7
+ "label": "build",
8
+ "command": "dotnet",
9
+ "type": "shell",
10
+ "args": [
11
+ "build",
12
+ "/property:GenerateFullPaths=true",
13
+ "/consoleloggerparameters:NoSummary"
14
+ ],
15
+ "group": {
16
+ "kind": "build",
17
+ "isDefault": true
18
+ },
19
+ "presentation": {
20
+ "reveal": "silent"
21
+ },
22
+ "problemMatcher": "$msCompile"
23
+ }
24
+ ]
25
25
  }
@@ -2,9 +2,9 @@
2
2
  "version": "1.0.0",
3
3
  "name": "{{kebabCase name}}",
4
4
  "private": true,
5
+ "type": "commonjs",
5
6
  "scripts": {
6
7
  "gen": "plop",
7
- "auth": "dataverse-deploy auth",
8
- "deploy": "npm run auth && dataverse-deploy deploy assembly"
8
+ "deploy": "dataverse-utils deploy assembly"
9
9
  }
10
10
  }
@@ -1,3 +1,3 @@
1
- module.exports = function (plop) {
2
- plop.load('powerapps-project-assembly/plopfile.js');
1
+ export default function (plop) {
2
+ plop.load('powerapps-project-assembly');
3
3
  }
@@ -2,12 +2,12 @@
2
2
  "version": "1.0.0",
3
3
  "name": "{{kebabCase name}}",
4
4
  "private": true,
5
+ "type": "commonjs",
5
6
  "scripts": {
6
7
  "build": "webpack --mode=production",
7
8
  "start": "webpack --mode=development --watch",
8
9
  "gen": "plop",
9
- "auth": "dataverse-utils auth",
10
- "deploy": "npm run auth && dataverse-utils deploy webresource",
11
- "generate": "npm run auth && dataverse-utils generate"
10
+ "deploy": "dataverse-utils deploy webresource",
11
+ "generate": "dataverse-utils generate"
12
12
  }
13
13
  }
@@ -1,3 +1,3 @@
1
- module.exports = function (plop) {
2
- plop.load('powerapps-project-webresource/plopfile.js');
1
+ export default function (plop) {
2
+ plop.load('powerapps-project-webresource');
3
3
  }