@tywalk/pcf-helper 1.3.2 → 1.3.3

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/bin/build.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const task = require('../../../tasks/build-pcf');
2
+ const task = require('../tasks/build-pcf');
3
3
  const [, , ...args] = process.argv;
4
4
 
5
5
  const pathArgument = args.find(a => ['-p', '--path'].includes(a));
package/bin/deploy.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- const upgradeTask = require('../../../tasks/upgrade-pcf');
3
- const buildTask = require('../../../tasks/build-pcf');
4
- const importTask = require('../../../tasks/import-pcf');
2
+ const upgradeTask = require('../tasks/upgrade-pcf');
3
+ const buildTask = require('../tasks/build-pcf');
4
+ const importTask = require('../tasks/import-pcf');
5
5
  const [, , ...args] = process.argv;
6
6
 
7
7
  const pathArgument = args.find(a => ['-p', '--path'].includes(a));
package/bin/import.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const task = require('../../../tasks/import-pcf');
2
+ const task = require('../tasks/import-pcf');
3
3
  const [, , ...args] = process.argv;
4
4
 
5
5
  const pathArgument = args.find(a => ['-p', '--path'].includes(a));
package/bin/upgrade.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const task = require('../../../tasks/upgrade-pcf');
2
+ const task = require('../tasks/upgrade-pcf');
3
3
  const [, , ...args] = process.argv;
4
4
 
5
5
  const pathArgument = args.find(a => ['-p', '--path'].includes(a));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tywalk/pcf-helper",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Command line helper for building and publishing PCF controls to Dataverse.",
5
5
  "scripts": {
6
6
  "test": "node test.js"
@@ -0,0 +1,13 @@
1
+ const { spawnSync } = require('child_process');
2
+
3
+ function run(path) {
4
+ const task = spawnSync('dotnet build', ['--restore', '-c', 'Release', path], {
5
+ cwd: process.cwd(),
6
+ stdio: 'inherit',
7
+ shell: true
8
+ });
9
+
10
+ console.log('Build complete!: ', task.status);
11
+ }
12
+
13
+ exports.run = run;
@@ -0,0 +1,25 @@
1
+ const { spawnSync } = require('child_process');
2
+ const { join, extname } = require('path');
3
+ const fs = require('fs');
4
+
5
+ function run(path, env) {
6
+ if (!env) {
7
+ console.warn('Path argument not provided. Assuming active auth profile organization.');
8
+ }
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(),
18
+ stdio: 'inherit',
19
+ shell: true
20
+ });
21
+
22
+ console.log('Import complete!: ', task.status);
23
+ }
24
+
25
+ exports.run = run;
@@ -0,0 +1,13 @@
1
+ const { spawnSync } = require('child_process');
2
+
3
+ function run(path) {
4
+ const task = spawnSync(`pac solution version -s Solution -sp ${path} && pac pcf version -s Manifest && npm version patch`, {
5
+ cwd: process.cwd(),
6
+ stdio: 'inherit',
7
+ shell: true
8
+ });
9
+
10
+ console.log('Upgrade complete!: ', task.status);
11
+ }
12
+
13
+ exports.run = run;