@tywalk/pcf-helper-run 1.1.22 → 1.1.24

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.
@@ -1,7 +1,41 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  const child_process_1 = require("child_process");
4
37
  const package_json_1 = require("../package.json");
38
+ const tasks = __importStar(require("@tywalk/pcf-helper"));
5
39
  test('displays version', (done) => {
6
40
  const task = (0, child_process_1.spawn)('node', ['./dist/index.js', '-v']);
7
41
  let output = '';
@@ -45,3 +79,7 @@ test('errors if incorrect command is provided', (done) => {
45
79
  done();
46
80
  });
47
81
  });
82
+ test('runBuild exists', () => {
83
+ const exists = typeof (tasks === null || tasks === void 0 ? void 0 : tasks.runBuild) === 'function';
84
+ expect(exists).toBe(true);
85
+ });
package/dist/index.js CHANGED
@@ -1,11 +1,41 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
6
36
  var _a, _b, _c;
7
37
  Object.defineProperty(exports, "__esModule", { value: true });
8
- const pcf_helper_1 = __importDefault(require("@tywalk/pcf-helper"));
38
+ const tasks = __importStar(require("@tywalk/pcf-helper"));
9
39
  const color_logger_1 = require("@tywalk/color-logger");
10
40
  const package_json_1 = require("./package.json");
11
41
  const performanceUtil_1 = require("./util/performanceUtil");
@@ -46,17 +76,17 @@ if (env === '' && !runInit) {
46
76
  }
47
77
  function executeTasks() {
48
78
  if (commandArgument === 'upgrade' || runAll) {
49
- const upgradeResult = pcf_helper_1.default.runUpgrade(path, isVerbose);
79
+ const upgradeResult = tasks.runUpgrade(path, isVerbose);
50
80
  if (upgradeResult === 1)
51
81
  return 1;
52
82
  }
53
83
  if (commandArgument === 'build' || runAll) {
54
- const buildResult = pcf_helper_1.default.runBuild(path, isVerbose);
84
+ const buildResult = tasks.runBuild(path, isVerbose);
55
85
  if (buildResult === 1)
56
86
  return 1;
57
87
  }
58
88
  if (commandArgument === 'import' || runAll) {
59
- const importResult = pcf_helper_1.default.runImport(path, env, isVerbose);
89
+ const importResult = tasks.runImport(path, env, isVerbose);
60
90
  if (importResult === 1)
61
91
  return 1;
62
92
  }
@@ -64,6 +94,7 @@ function executeTasks() {
64
94
  const name = (0, argumentUtil_1.getArgValue)(args, ['-n', '--name']);
65
95
  const publisherName = (0, argumentUtil_1.getArgValue)(args, ['-pn', '--publisher-name']);
66
96
  const publisherPrefix = (0, argumentUtil_1.getArgValue)(args, ['-pp', '--publisher-prefix']);
97
+ const npm = (0, argumentUtil_1.getArgValue)(args, ['-npm', '--run-npm-install'], 'true');
67
98
  if (typeof name === 'undefined') {
68
99
  logger.error('Name argument is required. Use --name to specify the name of the control.');
69
100
  process.exit(1);
@@ -76,7 +107,7 @@ function executeTasks() {
76
107
  logger.error('Publisher Prefix argument is required. Use --publisher-prefix to specify the name of the control.');
77
108
  process.exit(1);
78
109
  }
79
- const initResult = pcf_helper_1.default.runInit(path, name, publisherName, publisherPrefix, isVerbose);
110
+ const initResult = tasks.runInit(path, name, publisherName, publisherPrefix, npm === 'true', isVerbose);
80
111
  if (initResult === 1)
81
112
  return 1;
82
113
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tywalk/pcf-helper-run",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "A simple command-line utility for building and publishing PCF controls to Dataverse.",
5
5
  "types": "./types/",
6
6
  "files": [
@@ -14,7 +14,7 @@
14
14
  "test": "jest",
15
15
  "build": "tsc",
16
16
  "upgrade": "npm version patch --no-git-tag-version",
17
- "ready": "npm run upgrade && npm run build"
17
+ "ready": "npm run upgrade"
18
18
  },
19
19
  "keywords": [
20
20
  "pcf"
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@tywalk/color-logger": "^1.0.3",
28
- "@tywalk/pcf-helper": "^1.4.20"
28
+ "@tywalk/pcf-helper": "^1.4.21"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/jest": "^29.5.14",
@@ -9,11 +9,12 @@ function getArg(args, arg) {
9
9
  }
10
10
  return undefined;
11
11
  }
12
- function getArgValue(args, argOpts) {
12
+ function getArgValue(args, argOpts, defaultIfExists) {
13
+ var _a;
13
14
  const arg = args.find(a => argOpts.includes(a));
14
15
  if (typeof arg === 'undefined') {
15
16
  return undefined;
16
17
  }
17
18
  const argIndex = args.indexOf(arg) + 1;
18
- return args.at(argIndex);
19
+ return (_a = args.at(argIndex)) !== null && _a !== void 0 ? _a : defaultIfExists;
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tywalk/pcf-helper-run",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "A simple command-line utility for building and publishing PCF controls to Dataverse.",
5
5
  "types": "./types/",
6
6
  "files": [
@@ -14,7 +14,7 @@
14
14
  "test": "jest",
15
15
  "build": "tsc",
16
16
  "upgrade": "npm version patch --no-git-tag-version",
17
- "ready": "npm run upgrade && npm run build"
17
+ "ready": "npm run upgrade"
18
18
  },
19
19
  "keywords": [
20
20
  "pcf"
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@tywalk/color-logger": "^1.0.3",
28
- "@tywalk/pcf-helper": "^1.4.20"
28
+ "@tywalk/pcf-helper": "^1.4.21"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/jest": "^29.5.14",
@@ -1,2 +1,2 @@
1
1
  export declare function getArg(args: string[], arg: string): string | undefined;
2
- export declare function getArgValue(args: string[], argOpts: string[]): string | undefined;
2
+ export declare function getArgValue(args: string[], argOpts: string[], defaultIfExists?: any): string | undefined;