@grafana/sign-plugin 0.0.1 → 0.0.2-canary.136.52dfa24.0

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.
@@ -47,22 +47,23 @@ var manifest_1 = require("../utils/manifest");
47
47
  var getVersion_1 = require("../utils/getVersion");
48
48
  var sign = function (argv) { return __awaiter(void 0, void 0, void 0, function () {
49
49
  var pluginDistDir, signatureType, rootUrls, manifest, signedManifest, err_1;
50
- return __generator(this, function (_a) {
51
- switch (_a.label) {
50
+ var _a;
51
+ return __generator(this, function (_b) {
52
+ switch (_b.label) {
52
53
  case 0:
53
54
  pluginDistDir = path_1["default"].resolve('dist');
54
55
  signatureType = argv.signatureType;
55
- rootUrls = argv.rootUrls.split(',');
56
+ rootUrls = (_a = argv.rootUrls.split(',')) !== null && _a !== void 0 ? _a : [];
56
57
  if (!(0, fs_1.existsSync)(pluginDistDir)) {
57
58
  throw new Error('Plugin `dist` directory is missing. Did you build the plugin before attempting to sign?');
58
59
  }
59
- _a.label = 1;
60
+ _b.label = 1;
60
61
  case 1:
61
- _a.trys.push([1, 4, , 5]);
62
+ _b.trys.push([1, 4, , 5]);
62
63
  console.log('Building manifest...');
63
64
  return [4, (0, manifest_1.buildManifest)(pluginDistDir)];
64
65
  case 2:
65
- manifest = _a.sent();
66
+ manifest = _b.sent();
66
67
  console.log('Signing manifest...');
67
68
  if (signatureType) {
68
69
  manifest.signatureType = signatureType;
@@ -74,13 +75,13 @@ var sign = function (argv) { return __awaiter(void 0, void 0, void 0, function (
74
75
  manifest.signPlugin = { version: (0, getVersion_1.getVersion)() };
75
76
  return [4, (0, manifest_1.signManifest)(manifest)];
76
77
  case 3:
77
- signedManifest = _a.sent();
78
+ signedManifest = _b.sent();
78
79
  console.log('Saving signed manifest...');
79
80
  (0, manifest_1.saveManifest)(pluginDistDir, signedManifest);
80
81
  console.log('Signed successfully');
81
82
  return [3, 5];
82
83
  case 4:
83
- err_1 = _a.sent();
84
+ err_1 = _b.sent();
84
85
  console.warn(err_1);
85
86
  return [3, 5];
86
87
  case 5: return [2];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/sign-plugin",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-canary.136.52dfa24.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/sign-plugin",
@@ -41,5 +41,5 @@
41
41
  "engines": {
42
42
  "node": ">=16"
43
43
  },
44
- "gitHead": "ded867f4ea88599fb923a9d7c71514e1f6b85c00"
44
+ "gitHead": "52dfa24471838abe869be2233daa165ce2068f32"
45
45
  }
@@ -8,7 +8,7 @@ import { getVersion } from '../utils/getVersion';
8
8
  export const sign = async (argv: minimist.ParsedArgs) => {
9
9
  const pluginDistDir = path.resolve('dist');
10
10
  const signatureType: string = argv.signatureType;
11
- const rootUrls: string[] = argv.rootUrls.split(',');
11
+ const rootUrls: string[] = argv.rootUrls.split(',') ?? [];
12
12
 
13
13
  if (!existsSync(pluginDistDir)) {
14
14
  throw new Error('Plugin `dist` directory is missing. Did you build the plugin before attempting to sign?');