@grafana/create-plugin 1.2.0 → 1.3.0-canary.226.129a5b7.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.
@@ -12,12 +12,14 @@ exports.__esModule = true;
12
12
  exports.printGenerateSuccessMessage = void 0;
13
13
  var utils_console_1 = require("../../utils/utils.console");
14
14
  var utils_handlebars_1 = require("../../utils/utils.handlebars");
15
+ var utils_npm_1 = require("../../utils/utils.npm");
15
16
  function printGenerateSuccessMessage(answers) {
16
17
  var directory = (0, utils_handlebars_1.normalizeId)(answers.pluginName, answers.orgName, answers.pluginType);
18
+ var packageManager = (0, utils_npm_1.getPackageManager)();
17
19
  var commands = __spreadArray(__spreadArray([
18
20
  "- `cd ./".concat(directory, "`"),
19
- '- `yarn install` to install frontend dependencies.',
20
- '- `yarn dev` to build (and watch) the plugin frontend code.'
21
+ "- `".concat(packageManager, " install` to install frontend dependencies."),
22
+ "- `".concat(packageManager, " run dev` to build (and watch) the plugin frontend code.")
21
23
  ], (answers.hasBackend
22
24
  ? [
23
25
  '- `mage -v build:linux` to build the plugin backend code. Rerun this command every time you edit your backend files.',
@@ -23,14 +23,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  exports.__esModule = true;
26
+ var fs_1 = __importDefault(require("fs"));
26
27
  var glob_1 = __importDefault(require("glob"));
27
28
  var path_1 = __importDefault(require("path"));
28
- var fs_1 = __importDefault(require("fs"));
29
- var utils_handlebars_1 = require("../utils/utils.handlebars");
30
29
  var constants_1 = require("../constants");
30
+ var utils_handlebars_1 = require("../utils/utils.handlebars");
31
+ var utils_path_1 = require("../utils/utils.path");
31
32
  var print_success_message_1 = require("./generate-actions/print-success-message");
32
33
  var update_go_sdk_and_packages_1 = require("./generate-actions/update-go-sdk-and-packages");
33
- var utils_path_1 = require("../utils/utils.path");
34
34
  function default_1(plop) {
35
35
  plop.setHelper('if_eq', utils_handlebars_1.ifEq);
36
36
  plop.setHelper('normalize_id', utils_handlebars_1.normalizeId);
@@ -167,6 +167,9 @@ function getActionsForTemplateFolder(_a) {
167
167
  function getExportPath(f) {
168
168
  return path_1["default"].relative(folderPath, path_1["default"].dirname(f));
169
169
  }
170
+ if (constants_1.EXTRA_TEMPLATE_VARIABLES.packageManager !== 'pnpm') {
171
+ files.filter(function (file) { return path_1["default"].basename(file) === 'npmrc'; });
172
+ }
170
173
  return files.filter(isFile).map(function (f) { return ({
171
174
  type: 'add',
172
175
  templateFile: f,
package/dist/constants.js CHANGED
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  exports.__esModule = true;
6
6
  exports.TEXT = exports.UDPATE_CONFIG = exports.MIGRATION_CONFIG = exports.GRAFANA_FE_PACKAGES = exports.EXTRA_TEMPLATE_VARIABLES = exports.PLUGIN_TYPES = exports.TEMPLATE_PATHS = exports.FIXTURES_PATH = exports.PARTIALS_DIR = exports.TEMPLATES_DIR = exports.DIST_DIR = exports.EXPORT_PATH_PREFIX = exports.DEV_EXPORT_DIR = exports.IS_DEV = void 0;
7
7
  var path_1 = __importDefault(require("path"));
8
+ var utils_npm_1 = require("./utils/utils.npm");
8
9
  exports.IS_DEV = process.env.CREATE_PLUGIN_DEV !== undefined;
9
10
  exports.DEV_EXPORT_DIR = path_1["default"].join(__dirname, '..', 'generated');
10
11
  exports.EXPORT_PATH_PREFIX = exports.IS_DEV ? exports.DEV_EXPORT_DIR : process.cwd();
@@ -29,8 +30,12 @@ var PLUGIN_TYPES;
29
30
  PLUGIN_TYPES["datasource"] = "datasource";
30
31
  PLUGIN_TYPES["secretsmanager"] = "secretsmanager";
31
32
  })(PLUGIN_TYPES = exports.PLUGIN_TYPES || (exports.PLUGIN_TYPES = {}));
33
+ var PACKAGE_MANAGER = (0, utils_npm_1.getPackageManager)();
34
+ var PACKAGE_MANAGER_INSTALL_CMD = (0, utils_npm_1.getInstallCmd)(PACKAGE_MANAGER);
32
35
  exports.EXTRA_TEMPLATE_VARIABLES = {
33
- grafanaVersion: '9.3.8'
36
+ grafanaVersion: '9.3.8',
37
+ packageManager: PACKAGE_MANAGER,
38
+ packageManagerInstallCmd: PACKAGE_MANAGER_INSTALL_CMD
34
39
  };
35
40
  exports.GRAFANA_FE_PACKAGES = [
36
41
  '@grafana/data',
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  exports.__esModule = true;
17
- exports.cleanUpPackageJson = exports.updateNpmScripts = exports.removeNpmDependencies = exports.getRemovableNpmDependencies = exports.getUpdatableNpmDependencies = exports.getPackageJsonUpdates = exports.updateNpmDependencies = exports.updatePackageJson = exports.hasNpmDependenciesToUpdate = exports.getPackageJsonUpdatesAsText = exports.getNpmDependencyUpdatesAsText = exports.writePackageJson = exports.getLatestPackageJson = exports.getPackageJson = void 0;
17
+ exports.getInstallCmd = exports.getPackageManager = exports.cleanUpPackageJson = exports.updateNpmScripts = exports.removeNpmDependencies = exports.getRemovableNpmDependencies = exports.getUpdatableNpmDependencies = exports.getPackageJsonUpdates = exports.updateNpmDependencies = exports.updatePackageJson = exports.hasNpmDependenciesToUpdate = exports.getPackageJsonUpdatesAsText = exports.getNpmDependencyUpdatesAsText = exports.writePackageJson = exports.getLatestPackageJson = exports.getPackageJson = void 0;
18
18
  var path_1 = __importDefault(require("path"));
19
19
  var fs_1 = __importDefault(require("fs"));
20
20
  var semver_1 = __importDefault(require("semver"));
@@ -218,3 +218,39 @@ function sortKeysAlphabetically(obj) {
218
218
  return acc;
219
219
  }, {});
220
220
  }
221
+ function getPackageManager() {
222
+ var agent = process.env.npm_config_user_agent;
223
+ if (!agent) {
224
+ var parent_1 = process.env._;
225
+ if (!parent_1) {
226
+ return 'npm';
227
+ }
228
+ if (parent_1.endsWith('pnpx') || parent_1.endsWith('pnpm')) {
229
+ return 'pnpm';
230
+ }
231
+ if (parent_1.endsWith('yarn')) {
232
+ return 'yarn';
233
+ }
234
+ return 'npm';
235
+ }
236
+ var program = agent.split('/')[0];
237
+ if (program === 'yarn') {
238
+ return 'yarn';
239
+ }
240
+ if (program === 'pnpm') {
241
+ return 'pnpm';
242
+ }
243
+ return 'npm';
244
+ }
245
+ exports.getPackageManager = getPackageManager;
246
+ function getInstallCmd(packageManager) {
247
+ switch (packageManager) {
248
+ case 'yarn':
249
+ return 'yarn install --immutable --prefer-offline';
250
+ case 'pnpm':
251
+ return 'pnpm install --frozen-lockfile --prefer-offline';
252
+ default:
253
+ return 'npm ci';
254
+ }
255
+ }
256
+ exports.getInstallCmd = getInstallCmd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "1.2.0",
3
+ "version": "1.3.0-canary.226.129a5b7.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/create-plugin",
@@ -63,5 +63,5 @@
63
63
  "engines": {
64
64
  "node": ">=16"
65
65
  },
66
- "gitHead": "286c9962e8625f004f8915f860b8145f633cf215"
66
+ "gitHead": "129a5b7f313dd3e748f625822fdf7529b135b174"
67
67
  }
@@ -1,14 +1,15 @@
1
1
  import { displayAsMarkdown } from '../../utils/utils.console';
2
2
  import { normalizeId } from '../../utils/utils.handlebars';
3
+ import { getPackageManager } from '../../utils/utils.npm';
3
4
  import { CliArgs } from '../types';
4
5
 
5
6
  export function printGenerateSuccessMessage(answers: CliArgs) {
6
7
  const directory = normalizeId(answers.pluginName, answers.orgName, answers.pluginType);
7
-
8
+ const packageManager = getPackageManager();
8
9
  const commands = [
9
10
  `- \`cd ./${directory}\``,
10
- '- `yarn install` to install frontend dependencies.',
11
- '- `yarn dev` to build (and watch) the plugin frontend code.',
11
+ `- \`${packageManager} install\` to install frontend dependencies.`,
12
+ `- \`${packageManager} run dev\` to build (and watch) the plugin frontend code.`,
12
13
  ...(answers.hasBackend
13
14
  ? [
14
15
  '- `mage -v build:linux` to build the plugin backend code. Rerun this command every time you edit your backend files.',
@@ -1,13 +1,13 @@
1
- import type { NodePlopAPI, ModifyActionConfig } from 'plop';
1
+ import fs from 'fs';
2
2
  import glob from 'glob';
3
3
  import path from 'path';
4
- import fs from 'fs';
4
+ import type { ModifyActionConfig, NodePlopAPI } from 'plop';
5
+ import { EXTRA_TEMPLATE_VARIABLES, IS_DEV, PARTIALS_DIR, PLUGIN_TYPES, TEMPLATE_PATHS } from '../constants';
5
6
  import { ifEq, normalizeId } from '../utils/utils.handlebars';
6
- import { IS_DEV, TEMPLATE_PATHS, PARTIALS_DIR, PLUGIN_TYPES, EXTRA_TEMPLATE_VARIABLES } from '../constants';
7
+ import { getExportPath } from '../utils/utils.path';
7
8
  import { printGenerateSuccessMessage } from './generate-actions/print-success-message';
8
9
  import { updateGoSdkAndModules } from './generate-actions/update-go-sdk-and-packages';
9
10
  import { CliArgs } from './types';
10
- import { getExportPath } from '../utils/utils.path';
11
11
 
12
12
  // Plopfile API documentation: https://plopjs.com/documentation/#plopfile-api
13
13
  export default function (plop: NodePlopAPI) {
@@ -84,6 +84,7 @@ export default function (plop: NodePlopAPI) {
84
84
  }: CliArgs) {
85
85
  const exportPath = getExportPath(pluginName, orgName, pluginType);
86
86
  const pluginId = normalizeId(pluginName, orgName, pluginType);
87
+
87
88
  // Copy over files that are shared between plugins types
88
89
  const commonActions = getActionsForTemplateFolder({
89
90
  folderPath: TEMPLATE_PATHS.common,
@@ -204,6 +205,11 @@ function getActionsForTemplateFolder({
204
205
  return path.relative(folderPath, path.dirname(f));
205
206
  }
206
207
 
208
+ // Remove the npmrc file if not running `pnpm`.
209
+ if (EXTRA_TEMPLATE_VARIABLES.packageManager !== 'pnpm') {
210
+ files.filter((file) => path.basename(file) === 'npmrc');
211
+ }
212
+
207
213
  return files.filter(isFile).map((f) => ({
208
214
  type: 'add',
209
215
  templateFile: f,
package/src/constants.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import path from 'path';
2
+ import { getInstallCmd, getPackageManager } from './utils/utils.npm';
2
3
 
3
4
  export const IS_DEV = process.env.CREATE_PLUGIN_DEV !== undefined;
4
5
 
@@ -34,11 +35,17 @@ export enum PLUGIN_TYPES {
34
35
  secretsmanager = 'secretsmanager',
35
36
  }
36
37
 
38
+ // Support the users package manager of choice.
39
+ const PACKAGE_MANAGER = getPackageManager();
40
+ const PACKAGE_MANAGER_INSTALL_CMD = getInstallCmd(PACKAGE_MANAGER);
41
+
37
42
  // This gets merged into variables coming from user prompts (when using Plop) or any other dynamic variables,
38
43
  // and will be available to use in the templates.
39
44
  // Example: "@grafana/ui": "{{ grafanaVersion }}"
40
45
  export const EXTRA_TEMPLATE_VARIABLES = {
41
46
  grafanaVersion: '9.3.8',
47
+ packageManager: PACKAGE_MANAGER,
48
+ packageManagerInstallCmd: PACKAGE_MANAGER_INSTALL_CMD,
42
49
  };
43
50
 
44
51
  export const GRAFANA_FE_PACKAGES = [
@@ -249,3 +249,48 @@ function sortKeysAlphabetically(obj: Record<string, string>) {
249
249
  return acc;
250
250
  }, {});
251
251
  }
252
+
253
+ export function getPackageManager() {
254
+ const agent = process.env.npm_config_user_agent;
255
+
256
+ if (!agent) {
257
+ const parent = process.env._;
258
+
259
+ if (!parent) {
260
+ return 'npm';
261
+ }
262
+
263
+ if (parent.endsWith('pnpx') || parent.endsWith('pnpm')) {
264
+ return 'pnpm';
265
+ }
266
+ if (parent.endsWith('yarn')) {
267
+ return 'yarn';
268
+ }
269
+
270
+ return 'npm';
271
+ }
272
+
273
+ const [program] = agent.split('/');
274
+
275
+ if (program === 'yarn') {
276
+ return 'yarn';
277
+ }
278
+ if (program === 'pnpm') {
279
+ return 'pnpm';
280
+ }
281
+
282
+ return 'npm';
283
+ }
284
+
285
+ export function getInstallCmd(packageManager: string) {
286
+ switch (packageManager) {
287
+ case 'yarn':
288
+ return 'yarn install --immutable --prefer-offline';
289
+
290
+ case 'pnpm':
291
+ return 'pnpm install --frozen-lockfile --prefer-offline';
292
+
293
+ default:
294
+ return 'npm ci';
295
+ }
296
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Standalone debug mode",
6
+ "type": "go",
7
+ "request": "launch",
8
+ "mode": "debug",
9
+ "program": "${workspaceFolder}/pkg",
10
+ "env": {},
11
+ "args": [
12
+ "-standalone"
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -2,7 +2,7 @@ module github.com/{{ kebabCase orgName }}/{{ kebabCase pluginName }}
2
2
 
3
3
  go 1.19
4
4
 
5
- require github.com/grafana/grafana-plugin-sdk-go v0.155.0
5
+ require github.com/grafana/grafana-plugin-sdk-go v0.156.0
6
6
 
7
7
  require (
8
8
  github.com/BurntSushi/toml v1.2.1 // indirect
@@ -112,8 +112,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1
112
112
  github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
113
113
  github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
114
114
  github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
115
- github.com/grafana/grafana-plugin-sdk-go v0.155.0 h1:i6yQu3RegxxFph2poE2+DOG8EHT1R9LS5WDbTglIhSQ=
116
- github.com/grafana/grafana-plugin-sdk-go v0.155.0/go.mod h1:Wj4WD+sfoUB/q5UG016IvUQBM7HBJaNEAc88b++4szs=
115
+ github.com/grafana/grafana-plugin-sdk-go v0.156.0 h1:LPR5gpROmdwkkvm5oGihl0mSKyWNHWIjAjzzTxk3k7M=
116
+ github.com/grafana/grafana-plugin-sdk-go v0.156.0/go.mod h1:Wj4WD+sfoUB/q5UG016IvUQBM7HBJaNEAc88b++4szs=
117
117
  github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
118
118
  github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
119
119
  github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Standalone debug mode",
6
+ "type": "go",
7
+ "request": "launch",
8
+ "mode": "debug",
9
+ "program": "${workspaceFolder}/pkg",
10
+ "env": {},
11
+ "args": [
12
+ "-standalone"
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -2,7 +2,7 @@ module github.com/{{ kebabCase orgName }}/{{ kebabCase pluginName }}
2
2
 
3
3
  go 1.19
4
4
 
5
- require github.com/grafana/grafana-plugin-sdk-go v0.155.0
5
+ require github.com/grafana/grafana-plugin-sdk-go v0.156.0
6
6
 
7
7
  require (
8
8
  github.com/BurntSushi/toml v1.2.1 // indirect
@@ -112,8 +112,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1
112
112
  github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
113
113
  github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
114
114
  github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
115
- github.com/grafana/grafana-plugin-sdk-go v0.155.0 h1:i6yQu3RegxxFph2poE2+DOG8EHT1R9LS5WDbTglIhSQ=
116
- github.com/grafana/grafana-plugin-sdk-go v0.155.0/go.mod h1:Wj4WD+sfoUB/q5UG016IvUQBM7HBJaNEAc88b++4szs=
115
+ github.com/grafana/grafana-plugin-sdk-go v0.156.0 h1:LPR5gpROmdwkkvm5oGihl0mSKyWNHWIjAjzzTxk3k7M=
116
+ github.com/grafana/grafana-plugin-sdk-go v0.156.0/go.mod h1:Wj4WD+sfoUB/q5UG016IvUQBM7HBJaNEAc88b++4szs=
117
117
  github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
118
118
  github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y=
119
119
  github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
@@ -4,6 +4,7 @@ logs
4
4
  npm-debug.log*
5
5
  yarn-debug.log*
6
6
  yarn-error.log*
7
+ .pnpm-debug.log*
7
8
 
8
9
  node_modules/
9
10
 
@@ -26,7 +27,7 @@ work/
26
27
  ci/
27
28
  e2e-results/
28
29
  **/cypress/videos
29
- **/cypress/report.json
30
+ **/cypress/report.json
30
31
 
31
32
  # Editor
32
33
  .idea
@@ -9,9 +9,9 @@
9
9
  "test:ci": "jest --passWithNoTests --maxWorkers 4",
10
10
  "typecheck": "tsc --noEmit",
11
11
  "lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .",
12
- "lint:fix": "yarn lint --fix",
13
- "e2e": "yarn cypress install && yarn grafana-e2e run",
14
- "e2e:update": "yarn cypress install && yarn grafana-e2e run --update-screenshots",
12
+ "lint:fix": "{{ packageManager }} run lint --fix",
13
+ "e2e": "{{ packageManager }} exec cypress install && {{ packageManager }} exec grafana-e2e run",
14
+ "e2e:update": "{{ packageManager }} exec cypress install && {{ packageManager }} exec grafana-e2e run --update-screenshots",
15
15
  "server": "docker-compose up --build",
16
16
  "sign": "npx --yes @grafana/sign-plugin@latest"
17
17
  },
@@ -15,30 +15,32 @@ jobs:
15
15
  build:
16
16
  runs-on: ubuntu-latest
17
17
  steps:
18
- - uses: actions/checkout@v3
19
-
18
+ - uses: actions/checkout@v3{{#if_eq packageManager "pnpm"}}
19
+ - uses: pnpm/action-setup@v2
20
+ with:
21
+ version: 7.x.x{{/if_eq}}
20
22
  - name: Setup Node.js environment
21
23
  uses: actions/setup-node@v3
22
24
  with:
23
25
  node-version: '16'
24
- cache: 'yarn'
26
+ cache: '{{ packageManager }}'
25
27
  - name: Install dependencies
26
- run: yarn install --immutable --prefer-offline
28
+ run: {{ packageManagerInstallCmd }}
27
29
 
28
30
  - name: Check types
29
- run: yarn typecheck
31
+ run: {{ packageManager }} run typecheck
30
32
  - name: Lint
31
- run: yarn lint
33
+ run: {{ packageManager }} run lint
32
34
  - name: Unit tests
33
- run: yarn test:ci
35
+ run: {{ packageManager }} run test:ci
34
36
  - name: Build frontend
35
- run: yarn build
37
+ run: {{ packageManager }} run build
36
38
 
37
39
  - name: Start grafana docker
38
- run: yarn server -d
40
+ run: docker-compose up -d
39
41
 
40
42
  - name: Run e2e tests
41
- run: yarn e2e
43
+ run: {{ packageManager }} run e2e
42
44
 
43
45
  - name: Stop grafana docker
44
46
  run: docker-compose down
@@ -12,13 +12,16 @@ jobs:
12
12
  env:
13
13
  GRAFANA_API_KEY: $\{{ secrets.GRAFANA_API_KEY }} # Requires a Grafana API key from Grafana.com.
14
14
  steps:
15
- - uses: actions/checkout@v3
15
+ - uses: actions/checkout@v3{{#if_eq packageManager "pnpm"}}
16
+ - uses: pnpm/action-setup@v2
17
+ with:
18
+ version: 7.x.x{{/if_eq}}
16
19
 
17
20
  - name: Setup Node.js environment
18
21
  uses: actions/setup-node@v3
19
22
  with:
20
23
  node-version: '16'
21
- cache: 'yarn'
24
+ cache: '{{ packageManager }}'
22
25
 
23
26
  - name: Setup Go environment
24
27
  uses: actions/setup-go@v3
@@ -26,10 +29,10 @@ jobs:
26
29
  go-version: '1.19'
27
30
 
28
31
  - name: Install dependencies
29
- run: yarn install --immutable --prefer-offline
32
+ run: {{ packageManagerInstallCmd }}
30
33
 
31
34
  - name: Build and test frontend
32
- run: yarn build
35
+ run: {{ packageManager }} run build
33
36
 
34
37
  - name: Check for backend
35
38
  id: check-for-backend
@@ -60,7 +63,7 @@ jobs:
60
63
  if: $\{{ env.GRAFANA_API_KEY == '' }}
61
64
 
62
65
  - name: Sign plugin
63
- run: yarn sign
66
+ run: {{ packageManager }} run sign
64
67
  if: $\{{ env.GRAFANA_API_KEY != '' }}
65
68
 
66
69
  - name: Get plugin metadata
@@ -9,10 +9,10 @@ jobs:
9
9
  - uses: actions/setup-node@v3
10
10
  with:
11
11
  node-version: '16'
12
- cache: 'yarn'
12
+ cache: '{{ packageManager }}'
13
13
  - name: Install dependencies
14
- run: yarn install --immutable --prefer-offline
14
+ run: {{ packageManagerInstallCmd }}
15
15
  - name: Build plugin
16
- run: yarn build
16
+ run: {{ packageManager }} run build
17
17
  - name: Compatibility check
18
18
  run: npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data,@grafana/ui,@grafana/runtime