@tywalk/pcf-helper 1.2.0 → 1.3.1
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 +4 -4
- package/bin/deploy.js +0 -6
- package/package.json +2 -2
- package/tasks/build-pcf.js +2 -2
- package/tasks/import-pcf.js +12 -3
- package/tasks/upgrade-pcf.js +2 -2
- package/test.js +9 -0
package/README.md
CHANGED
|
@@ -18,9 +18,9 @@ This tool requires the following:
|
|
|
18
18
|
|
|
19
19
|
```json
|
|
20
20
|
"scripts": {
|
|
21
|
-
"upgrade": "pcf-helper-upgrade",
|
|
22
|
-
"build": "pcf-helper-build",
|
|
23
|
-
"import": "pcf-helper-import",
|
|
24
|
-
"deploy": "pcf-helper-deploy"
|
|
21
|
+
"upgrade": "pcf-helper-upgrade --path <path to pcf project folder>",
|
|
22
|
+
"build": "pcf-helper-build --path <path to pcf project folder>",
|
|
23
|
+
"import": "pcf-helper-import --path <path to pcf project folder> --environment <environment guid or url>",
|
|
24
|
+
"deploy": "pcf-helper-deploy --path <path to pcf project folder> --environment <environment guid or url>"
|
|
25
25
|
},
|
|
26
26
|
```
|
package/bin/deploy.js
CHANGED
|
@@ -19,12 +19,6 @@ if (typeof path === 'undefined') {
|
|
|
19
19
|
return 0;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const zipDirPath = join(path, '/bin/release');
|
|
23
|
-
// const zipDirPath = join(path, '');
|
|
24
|
-
const zipDirFiles = fs.readdirSync(zipDirPath);
|
|
25
|
-
const zipFile = zipDirFiles.find(file => extname(file).toLowerCase() === '.zip');
|
|
26
|
-
console.log(join(zipDirPath, zipFile));
|
|
27
|
-
|
|
28
22
|
const envArgument = args.find(a => ['-env', '--environment'].includes(a));
|
|
29
23
|
let envIndex = args.indexOf(envArgument) + 1;
|
|
30
24
|
let env = '';
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tywalk/pcf-helper",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Command line helper for building and publishing PCF controls to Dataverse.",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"
|
|
6
|
+
"test": "node test.js"
|
|
7
7
|
},
|
|
8
8
|
"keywords": [
|
|
9
9
|
"pcf"
|
package/tasks/build-pcf.js
CHANGED
|
@@ -2,9 +2,9 @@ const { spawnSync } = require('child_process');
|
|
|
2
2
|
|
|
3
3
|
function run(path) {
|
|
4
4
|
const task = spawnSync('dotnet build', ['--restore', '-c', 'Release', path], {
|
|
5
|
-
cwd: process.cwd,
|
|
6
|
-
detached: true,
|
|
5
|
+
cwd: process.cwd(),
|
|
7
6
|
stdio: 'inherit',
|
|
7
|
+
shell: true
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
console.log('Build complete!: ', task.status);
|
package/tasks/import-pcf.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
const { spawnSync } = require('child_process');
|
|
2
|
+
const { join, extname } = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
2
4
|
|
|
3
5
|
function run(path, env) {
|
|
4
6
|
if (!env) {
|
|
5
7
|
console.warn('Path argument not provided. Assuming active auth profile organization.');
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
const zipDirPath = join(path, '/bin/release');
|
|
11
|
+
// const zipDirPath = join(path, '');
|
|
12
|
+
const zipDirFiles = fs.readdirSync(zipDirPath);
|
|
13
|
+
const zipFile = zipDirFiles.find(file => extname(file).toLowerCase() === '.zip');
|
|
14
|
+
const zipFilePath = join(zipDirPath, zipFile);
|
|
15
|
+
|
|
16
|
+
const task = spawnSync('pac solution import', ['-env', env, '-p', zipFilePath, '-pc'], {
|
|
17
|
+
cwd: process.cwd(),
|
|
10
18
|
stdio: 'inherit',
|
|
19
|
+
shell: true
|
|
11
20
|
});
|
|
12
21
|
|
|
13
22
|
console.log('Import complete!: ', task.status);
|
package/tasks/upgrade-pcf.js
CHANGED
|
@@ -2,9 +2,9 @@ const { spawnSync } = require('child_process');
|
|
|
2
2
|
|
|
3
3
|
function run(path) {
|
|
4
4
|
const task = spawnSync(`pac solution version -s Solution -sp ${path} && pac pcf version -s Manifest && npm version patch`, {
|
|
5
|
-
cwd: process.cwd,
|
|
6
|
-
detached: true,
|
|
5
|
+
cwd: process.cwd(),
|
|
7
6
|
stdio: 'inherit',
|
|
7
|
+
shell: true
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
console.log('Upgrade complete!: ', task.status);
|