Toolkit: Fix script failures due to missing import paths (#55857)

* fix(toolkit): package without dist folder so config file paths are correct

* chore(packages): make sure to bundle readme, changelog and apache2 license

* refactor(packages): recursively copy src when prepacking toolkit

* chore(toolkit): lock down babel dependencies. use grafana-eslint-config@5 for TS4.8 support
pull/55955/head
Jack Westbrook 3 years ago committed by GitHub
parent 71578d0932
commit b81f90cd0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 3
      packages/grafana-data/package.json
  3. 3
      packages/grafana-e2e-selectors/package.json
  4. 3
      packages/grafana-e2e/package.json
  5. 3
      packages/grafana-runtime/package.json
  6. 3
      packages/grafana-schema/package.json
  7. 30
      packages/grafana-toolkit/package.json
  8. 10
      packages/grafana-toolkit/src/cli/tasks/toolkit.build.ts
  9. 3
      packages/grafana-ui/package.json
  10. 246
      yarn.lock

1
.gitignore vendored

@ -130,6 +130,7 @@ pkg/cmd/grafana-server/__debug_bin
/packages/**/.rpt2_cache
/packages/**/tsdoc-metadata.json
/packages/**/package.tgz
/packages/grafana-toolkit/sass
## CI places the packages in a different location
/npm-artifacts/*.tgz

@ -23,7 +23,8 @@
},
"files": [
"dist",
"CHANGELOG.md",
"./README.md",
"./CHANGELOG.md",
"LICENSE_APACHE2"
],
"scripts": {

@ -26,7 +26,8 @@
},
"files": [
"dist",
"CHANGELOG.md",
"./README.md",
"./CHANGELOG.md",
"LICENSE_APACHE2"
],
"scripts": {

@ -30,7 +30,8 @@
"dist",
"cli.js",
"cypress.json",
"CHANGELOG.md",
"./README.md",
"./CHANGELOG.md",
"LICENSE_APACHE2"
],
"scripts": {

@ -24,7 +24,8 @@
},
"files": [
"dist",
"CHANGELOG.md",
"./README.md",
"./CHANGELOG.md",
"LICENSE_APACHE2"
],
"scripts": {

@ -23,7 +23,8 @@
},
"files": [
"dist",
"CHANGELOG.md",
"./README.md",
"./CHANGELOG.md",
"LICENSE_APACHE2"
],
"scripts": {

@ -18,26 +18,24 @@
"bin": {
"grafana-toolkit": "./bin/grafana-toolkit.js"
},
"publishConfig": {
"bin": {
"grafana-toolkit": "./dist/bin/grafana-toolkit.js"
},
"access": "public"
},
"files": [
"dist",
"README.md",
"CHANGELOG.md"
"config",
"src",
"sass",
"./README.md",
"./CHANGELOG.md",
"LICENSE_APACHE2"
],
"scripts": {
"build": "grafana-toolkit toolkit:build",
"clean": "rimraf ./dist ./compiled ./package.tgz",
"precommit": "npm run lint & npm run typecheck",
"clean": "rimraf ./dist ./compiled ./sass ./package.tgz",
"prepack": "mv ./src ./src_bak && cp -r ./dist/src ./src",
"postpack": "rimraf ./src && mv ./src_bak ./src",
"typecheck": "tsc --noEmit"
},
"main": "src/index.ts",
"dependencies": {
"@babel/core": "^7.18.9",
"@babel/core": "7.18.9",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
"@babel/plugin-proposal-object-rest-spread": "7.18.9",
@ -46,11 +44,11 @@
"@babel/plugin-transform-react-constant-elements": "7.18.9",
"@babel/plugin-transform-runtime": "7.18.10",
"@babel/plugin-transform-typescript": "7.19.0",
"@babel/preset-env": "^7.18.9",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@babel/preset-env": "7.18.9",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.18.6",
"@grafana/data": "9.3.0-pre",
"@grafana/eslint-config": "^4.0.0",
"@grafana/eslint-config": "5.0.0",
"@grafana/tsconfig": "^1.2.0-rc1",
"@grafana/ui": "9.3.0-pre",
"@jest/core": "27.5.1",

@ -24,8 +24,6 @@ const compile = () =>
const copyFiles = () => {
const files = [
'config/circleci/config.yml',
'bin/grafana-toolkit.js',
'src/config/prettier.plugin.config.json',
'src/config/prettier.plugin.rc.js',
'src/config/tsconfig.plugin.json',
@ -60,12 +58,16 @@ const copyFiles = () => {
const copySassFiles = () => {
const files = ['_variables.generated.scss', '_variables.dark.generated.scss', '_variables.light.generated.scss'];
const exportDir = `${cwd}/sass`;
return useSpinner(`Copy scss files ${files.join(', ')} files`, async () => {
const sassDir = path.resolve(cwd, '../../public/sass/');
if (!fs.existsSync(exportDir)) {
fs.mkdirSync(exportDir);
}
const promises = files.map((file) => {
return new Promise<void>((resolve, reject) => {
const name = file.replace('.generated', '');
fs.copyFile(`${sassDir}/${file}`, `${distDir}/sass/${name}`, (err) => {
fs.copyFile(`${sassDir}/${file}`, `${exportDir}/${name}`, (err) => {
if (err) {
reject(err);
return;
@ -89,8 +91,6 @@ const toolkitBuildTaskRunner: TaskRunner<ToolkitBuildOptions> = async () => {
await clean();
await compile();
fs.mkdirSync('./dist/bin');
fs.mkdirSync('./dist/sass');
await copyFiles();
await copySassFiles();
};

@ -26,7 +26,8 @@
},
"files": [
"dist",
"CHANGELOG.md",
"./README.md",
"./CHANGELOG.md",
"LICENSE_APACHE2"
],
"scripts": {

@ -116,6 +116,29 @@ __metadata:
languageName: node
linkType: hard
"@babel/core@npm:7.18.9":
version: 7.18.9
resolution: "@babel/core@npm:7.18.9"
dependencies:
"@ampproject/remapping": ^2.1.0
"@babel/code-frame": ^7.18.6
"@babel/generator": ^7.18.9
"@babel/helper-compilation-targets": ^7.18.9
"@babel/helper-module-transforms": ^7.18.9
"@babel/helpers": ^7.18.9
"@babel/parser": ^7.18.9
"@babel/template": ^7.18.6
"@babel/traverse": ^7.18.9
"@babel/types": ^7.18.9
convert-source-map: ^1.7.0
debug: ^4.1.0
gensync: ^1.0.0-beta.2
json5: ^2.2.1
semver: ^6.3.0
checksum: 64b9088b03fdf659b334864ef93bed85d60c17b27fcbd72970f8eb9e0d3266ffa5a1926960f648f2db36b0bafec615f947ea5117d200599a0661b9f0a9cdf323
languageName: node
linkType: hard
"@babel/core@npm:7.19.0":
version: 7.19.0
resolution: "@babel/core@npm:7.19.0"
@ -208,29 +231,6 @@ __metadata:
languageName: node
linkType: hard
"@babel/core@npm:^7.18.9":
version: 7.18.9
resolution: "@babel/core@npm:7.18.9"
dependencies:
"@ampproject/remapping": ^2.1.0
"@babel/code-frame": ^7.18.6
"@babel/generator": ^7.18.9
"@babel/helper-compilation-targets": ^7.18.9
"@babel/helper-module-transforms": ^7.18.9
"@babel/helpers": ^7.18.9
"@babel/parser": ^7.18.9
"@babel/template": ^7.18.6
"@babel/traverse": ^7.18.9
"@babel/types": ^7.18.9
convert-source-map: ^1.7.0
debug: ^4.1.0
gensync: ^1.0.0-beta.2
json5: ^2.2.1
semver: ^6.3.0
checksum: 64b9088b03fdf659b334864ef93bed85d60c17b27fcbd72970f8eb9e0d3266ffa5a1926960f648f2db36b0bafec615f947ea5117d200599a0661b9f0a9cdf323
languageName: node
linkType: hard
"@babel/core@npm:^7.7.2":
version: 7.16.0
resolution: "@babel/core@npm:7.16.0"
@ -3563,6 +3563,91 @@ __metadata:
languageName: node
linkType: hard
"@babel/preset-env@npm:7.18.9":
version: 7.18.9
resolution: "@babel/preset-env@npm:7.18.9"
dependencies:
"@babel/compat-data": ^7.18.8
"@babel/helper-compilation-targets": ^7.18.9
"@babel/helper-plugin-utils": ^7.18.9
"@babel/helper-validator-option": ^7.18.6
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.18.6
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.18.9
"@babel/plugin-proposal-async-generator-functions": ^7.18.6
"@babel/plugin-proposal-class-properties": ^7.18.6
"@babel/plugin-proposal-class-static-block": ^7.18.6
"@babel/plugin-proposal-dynamic-import": ^7.18.6
"@babel/plugin-proposal-export-namespace-from": ^7.18.9
"@babel/plugin-proposal-json-strings": ^7.18.6
"@babel/plugin-proposal-logical-assignment-operators": ^7.18.9
"@babel/plugin-proposal-nullish-coalescing-operator": ^7.18.6
"@babel/plugin-proposal-numeric-separator": ^7.18.6
"@babel/plugin-proposal-object-rest-spread": ^7.18.9
"@babel/plugin-proposal-optional-catch-binding": ^7.18.6
"@babel/plugin-proposal-optional-chaining": ^7.18.9
"@babel/plugin-proposal-private-methods": ^7.18.6
"@babel/plugin-proposal-private-property-in-object": ^7.18.6
"@babel/plugin-proposal-unicode-property-regex": ^7.18.6
"@babel/plugin-syntax-async-generators": ^7.8.4
"@babel/plugin-syntax-class-properties": ^7.12.13
"@babel/plugin-syntax-class-static-block": ^7.14.5
"@babel/plugin-syntax-dynamic-import": ^7.8.3
"@babel/plugin-syntax-export-namespace-from": ^7.8.3
"@babel/plugin-syntax-import-assertions": ^7.18.6
"@babel/plugin-syntax-json-strings": ^7.8.3
"@babel/plugin-syntax-logical-assignment-operators": ^7.10.4
"@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3
"@babel/plugin-syntax-numeric-separator": ^7.10.4
"@babel/plugin-syntax-object-rest-spread": ^7.8.3
"@babel/plugin-syntax-optional-catch-binding": ^7.8.3
"@babel/plugin-syntax-optional-chaining": ^7.8.3
"@babel/plugin-syntax-private-property-in-object": ^7.14.5
"@babel/plugin-syntax-top-level-await": ^7.14.5
"@babel/plugin-transform-arrow-functions": ^7.18.6
"@babel/plugin-transform-async-to-generator": ^7.18.6
"@babel/plugin-transform-block-scoped-functions": ^7.18.6
"@babel/plugin-transform-block-scoping": ^7.18.9
"@babel/plugin-transform-classes": ^7.18.9
"@babel/plugin-transform-computed-properties": ^7.18.9
"@babel/plugin-transform-destructuring": ^7.18.9
"@babel/plugin-transform-dotall-regex": ^7.18.6
"@babel/plugin-transform-duplicate-keys": ^7.18.9
"@babel/plugin-transform-exponentiation-operator": ^7.18.6
"@babel/plugin-transform-for-of": ^7.18.8
"@babel/plugin-transform-function-name": ^7.18.9
"@babel/plugin-transform-literals": ^7.18.9
"@babel/plugin-transform-member-expression-literals": ^7.18.6
"@babel/plugin-transform-modules-amd": ^7.18.6
"@babel/plugin-transform-modules-commonjs": ^7.18.6
"@babel/plugin-transform-modules-systemjs": ^7.18.9
"@babel/plugin-transform-modules-umd": ^7.18.6
"@babel/plugin-transform-named-capturing-groups-regex": ^7.18.6
"@babel/plugin-transform-new-target": ^7.18.6
"@babel/plugin-transform-object-super": ^7.18.6
"@babel/plugin-transform-parameters": ^7.18.8
"@babel/plugin-transform-property-literals": ^7.18.6
"@babel/plugin-transform-regenerator": ^7.18.6
"@babel/plugin-transform-reserved-words": ^7.18.6
"@babel/plugin-transform-shorthand-properties": ^7.18.6
"@babel/plugin-transform-spread": ^7.18.9
"@babel/plugin-transform-sticky-regex": ^7.18.6
"@babel/plugin-transform-template-literals": ^7.18.9
"@babel/plugin-transform-typeof-symbol": ^7.18.9
"@babel/plugin-transform-unicode-escapes": ^7.18.6
"@babel/plugin-transform-unicode-regex": ^7.18.6
"@babel/preset-modules": ^0.1.5
"@babel/types": ^7.18.9
babel-plugin-polyfill-corejs2: ^0.3.1
babel-plugin-polyfill-corejs3: ^0.5.2
babel-plugin-polyfill-regenerator: ^0.3.1
core-js-compat: ^3.22.1
semver: ^6.3.0
peerDependencies:
"@babel/core": ^7.0.0-0
checksum: 311002b9255d1aa261afe712ab73a93687652437804e2f44e6cc55438f8b199463f53bb2b8e0912b0034f208a42eee664a9e126a6061ca504a792ede97dd027e
languageName: node
linkType: hard
"@babel/preset-env@npm:7.19.0":
version: 7.19.0
resolution: "@babel/preset-env@npm:7.19.0"
@ -3732,91 +3817,6 @@ __metadata:
languageName: node
linkType: hard
"@babel/preset-env@npm:^7.18.9":
version: 7.18.9
resolution: "@babel/preset-env@npm:7.18.9"
dependencies:
"@babel/compat-data": ^7.18.8
"@babel/helper-compilation-targets": ^7.18.9
"@babel/helper-plugin-utils": ^7.18.9
"@babel/helper-validator-option": ^7.18.6
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.18.6
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.18.9
"@babel/plugin-proposal-async-generator-functions": ^7.18.6
"@babel/plugin-proposal-class-properties": ^7.18.6
"@babel/plugin-proposal-class-static-block": ^7.18.6
"@babel/plugin-proposal-dynamic-import": ^7.18.6
"@babel/plugin-proposal-export-namespace-from": ^7.18.9
"@babel/plugin-proposal-json-strings": ^7.18.6
"@babel/plugin-proposal-logical-assignment-operators": ^7.18.9
"@babel/plugin-proposal-nullish-coalescing-operator": ^7.18.6
"@babel/plugin-proposal-numeric-separator": ^7.18.6
"@babel/plugin-proposal-object-rest-spread": ^7.18.9
"@babel/plugin-proposal-optional-catch-binding": ^7.18.6
"@babel/plugin-proposal-optional-chaining": ^7.18.9
"@babel/plugin-proposal-private-methods": ^7.18.6
"@babel/plugin-proposal-private-property-in-object": ^7.18.6
"@babel/plugin-proposal-unicode-property-regex": ^7.18.6
"@babel/plugin-syntax-async-generators": ^7.8.4
"@babel/plugin-syntax-class-properties": ^7.12.13
"@babel/plugin-syntax-class-static-block": ^7.14.5
"@babel/plugin-syntax-dynamic-import": ^7.8.3
"@babel/plugin-syntax-export-namespace-from": ^7.8.3
"@babel/plugin-syntax-import-assertions": ^7.18.6
"@babel/plugin-syntax-json-strings": ^7.8.3
"@babel/plugin-syntax-logical-assignment-operators": ^7.10.4
"@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3
"@babel/plugin-syntax-numeric-separator": ^7.10.4
"@babel/plugin-syntax-object-rest-spread": ^7.8.3
"@babel/plugin-syntax-optional-catch-binding": ^7.8.3
"@babel/plugin-syntax-optional-chaining": ^7.8.3
"@babel/plugin-syntax-private-property-in-object": ^7.14.5
"@babel/plugin-syntax-top-level-await": ^7.14.5
"@babel/plugin-transform-arrow-functions": ^7.18.6
"@babel/plugin-transform-async-to-generator": ^7.18.6
"@babel/plugin-transform-block-scoped-functions": ^7.18.6
"@babel/plugin-transform-block-scoping": ^7.18.9
"@babel/plugin-transform-classes": ^7.18.9
"@babel/plugin-transform-computed-properties": ^7.18.9
"@babel/plugin-transform-destructuring": ^7.18.9
"@babel/plugin-transform-dotall-regex": ^7.18.6
"@babel/plugin-transform-duplicate-keys": ^7.18.9
"@babel/plugin-transform-exponentiation-operator": ^7.18.6
"@babel/plugin-transform-for-of": ^7.18.8
"@babel/plugin-transform-function-name": ^7.18.9
"@babel/plugin-transform-literals": ^7.18.9
"@babel/plugin-transform-member-expression-literals": ^7.18.6
"@babel/plugin-transform-modules-amd": ^7.18.6
"@babel/plugin-transform-modules-commonjs": ^7.18.6
"@babel/plugin-transform-modules-systemjs": ^7.18.9
"@babel/plugin-transform-modules-umd": ^7.18.6
"@babel/plugin-transform-named-capturing-groups-regex": ^7.18.6
"@babel/plugin-transform-new-target": ^7.18.6
"@babel/plugin-transform-object-super": ^7.18.6
"@babel/plugin-transform-parameters": ^7.18.8
"@babel/plugin-transform-property-literals": ^7.18.6
"@babel/plugin-transform-regenerator": ^7.18.6
"@babel/plugin-transform-reserved-words": ^7.18.6
"@babel/plugin-transform-shorthand-properties": ^7.18.6
"@babel/plugin-transform-spread": ^7.18.9
"@babel/plugin-transform-sticky-regex": ^7.18.6
"@babel/plugin-transform-template-literals": ^7.18.9
"@babel/plugin-transform-typeof-symbol": ^7.18.9
"@babel/plugin-transform-unicode-escapes": ^7.18.6
"@babel/plugin-transform-unicode-regex": ^7.18.6
"@babel/preset-modules": ^0.1.5
"@babel/types": ^7.18.9
babel-plugin-polyfill-corejs2: ^0.3.1
babel-plugin-polyfill-corejs3: ^0.5.2
babel-plugin-polyfill-regenerator: ^0.3.1
core-js-compat: ^3.22.1
semver: ^6.3.0
peerDependencies:
"@babel/core": ^7.0.0-0
checksum: 311002b9255d1aa261afe712ab73a93687652437804e2f44e6cc55438f8b199463f53bb2b8e0912b0034f208a42eee664a9e126a6061ca504a792ede97dd027e
languageName: node
linkType: hard
"@babel/preset-flow@npm:^7.12.1":
version: 7.16.7
resolution: "@babel/preset-flow@npm:7.16.7"
@ -3845,7 +3845,7 @@ __metadata:
languageName: node
linkType: hard
"@babel/preset-react@npm:7.18.6, @babel/preset-react@npm:^7.18.6":
"@babel/preset-react@npm:7.18.6":
version: 7.18.6
resolution: "@babel/preset-react@npm:7.18.6"
dependencies:
@ -3877,7 +3877,7 @@ __metadata:
languageName: node
linkType: hard
"@babel/preset-typescript@npm:7.18.6, @babel/preset-typescript@npm:^7.18.6":
"@babel/preset-typescript@npm:7.18.6":
version: 7.18.6
resolution: "@babel/preset-typescript@npm:7.18.6"
dependencies:
@ -5371,22 +5371,6 @@ __metadata:
languageName: node
linkType: hard
"@grafana/eslint-config@npm:^4.0.0":
version: 4.0.0
resolution: "@grafana/eslint-config@npm:4.0.0"
dependencies:
"@typescript-eslint/eslint-plugin": 5.16.0
"@typescript-eslint/parser": 5.16.0
eslint: 8.11.0
eslint-config-prettier: 8.5.0
eslint-plugin-jsdoc: 38.0.6
eslint-plugin-react: 7.29.4
eslint-plugin-react-hooks: 4.3.0
typescript: 4.6.4
checksum: ed7dbf3bff5ac38daf57dfd590696d3f48f31f216f2bbcac126c3a37619aea66e856c07677c6387531bb2ae007bdd09caf36b8f289bb88b1ac1c719b6a537ae9
languageName: node
linkType: hard
"@grafana/experimental@npm:^0.0.2-canary.36":
version: 0.0.2-canary.36
resolution: "@grafana/experimental@npm:0.0.2-canary.36"
@ -5485,7 +5469,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@grafana/toolkit@workspace:packages/grafana-toolkit"
dependencies:
"@babel/core": ^7.18.9
"@babel/core": 7.18.9
"@babel/plugin-proposal-class-properties": 7.18.6
"@babel/plugin-proposal-nullish-coalescing-operator": 7.18.6
"@babel/plugin-proposal-object-rest-spread": 7.18.9
@ -5494,11 +5478,11 @@ __metadata:
"@babel/plugin-transform-react-constant-elements": 7.18.9
"@babel/plugin-transform-runtime": 7.18.10
"@babel/plugin-transform-typescript": 7.19.0
"@babel/preset-env": ^7.18.9
"@babel/preset-react": ^7.18.6
"@babel/preset-typescript": ^7.18.6
"@babel/preset-env": 7.18.9
"@babel/preset-react": 7.18.6
"@babel/preset-typescript": 7.18.6
"@grafana/data": 9.3.0-pre
"@grafana/eslint-config": ^4.0.0
"@grafana/eslint-config": 5.0.0
"@grafana/tsconfig": ^1.2.0-rc1
"@grafana/ui": 9.3.0-pre
"@jest/core": 27.5.1

Loading…
Cancel
Save