Fix: NPM Package publishing (#62243)

* move packed packages to npm-artifacts dir

* remove unnecessary any to trigger canary build

* update canary script to create dir only if it does not exist

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
Jack Westbrook 2023-01-26 17:18:05 +01:00 committed by GitHub
parent 641a7182e3
commit 5050822b9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 7 deletions

View File

@ -1098,8 +1098,7 @@ exports[`better eslint`] = {
"packages/grafana-ui/src/components/ColorPicker/ColorPicker.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"]
[0, 0, 0, "Do not use any type assertions.", "2"]
],
"packages/grafana-ui/src/components/ConfirmModal/ConfirmModal.tsx:5381": [
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"]

View File

@ -23,9 +23,9 @@
"test:ci": "yarn i18n:compile && mkdir -p reports/junit && JEST_JUNIT_OUTPUT_DIR=reports/junit jest --ci --reporters=default --reporters=jest-junit -w ${TEST_MAX_WORKERS:-100%}",
"lint:fix": "yarn lint:ts --fix",
"packages:build": "lerna run build --ignore @grafana-plugins/input-datasource",
"packages:clean": "lerna run clean --parallel",
"packages:clean": "rimraf ./npm-artifacts && lerna run clean --parallel",
"packages:prepare": "lerna version --no-push --no-git-tag-version --force-publish --exact",
"packages:pack": "lerna exec --no-private -- yarn pack",
"packages:pack": "mkdir ./npm-artifacts && lerna exec --no-private -- yarn pack --out \"../../npm-artifacts/%s-%v.tgz\"",
"packages:publish": "lerna exec --no-private -- npm publish package.tgz",
"packages:publishCanary": "lerna exec --no-private -- npm publish package.tgz --tag canary",
"packages:publishLatest": "lerna exec --no-private -- npm publish package.tgz",

View File

@ -30,7 +30,7 @@ export const colorPickerFactory = <T extends ColorPickerProps>(
popover: React.ComponentType<React.PropsWithChildren<T>>,
displayName = 'ColorPicker'
) => {
return class ColorPicker extends Component<T & { children?: ColorPickerTriggerRenderer }, any> {
return class ColorPicker extends Component<T & { children?: ColorPickerTriggerRenderer }> {
static displayName = displayName;
pickerTriggerRef = createRef<any>();

View File

@ -15,10 +15,14 @@ else
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
if [ ! -d './npm-artifacts' ]; then
mkdir './npm-artifacts'
fi
echo $'\nPacking packages'
yarn packages:pack
echo $'\nPublishing packages'
yarn packages:publishCanary
fi
for file in ./npm-artifacts/*.tgz; do npm publish "$file" --tag canary; done
fi