From 3a54e6ced5a020cd74233b07398f5be1fcd9f7f9 Mon Sep 17 00:00:00 2001 From: Alexandra Goff Date: Tue, 3 Sep 2024 10:58:16 -0700 Subject: [PATCH] ci: clean up build --- packages/epo-react-lib/.clean-publish | 23 +------------ packages/epo-react-lib/package.json | 3 +- packages/epo-react-lib/release.config.mjs | 12 ++++++- packages/epo-widget-lib/.clean-publish | 23 +------------ packages/epo-widget-lib/.npmignore | 38 ++++++++++++++++++++++ packages/epo-widget-lib/release.config.mjs | 14 ++++---- 6 files changed, 59 insertions(+), 54 deletions(-) create mode 100644 packages/epo-widget-lib/.npmignore diff --git a/packages/epo-react-lib/.clean-publish b/packages/epo-react-lib/.clean-publish index 39bd7d16..4978ed22 100644 --- a/packages/epo-react-lib/.clean-publish +++ b/packages/epo-react-lib/.clean-publish @@ -1,24 +1,3 @@ { - "packageManager": "yarn", - "tempDir": "tempPublish", - "files": [ - "vite.config.ts", - "tsconfig.json", - "tsconfig.node.json", - "jest.config.ts", - "jest-setup.ts", - "babel.config.cjs", - ".jest-test-results.json", - ".gitignore", - ".env.*", - "__mocks__", - ".out", - ".storybook", - "src", - "storybook-static", - "publish", - "postcss.config.ts", - "release.config.mjs", - ".prettierignore" - ] + "packageManager": "yarn" } diff --git a/packages/epo-react-lib/package.json b/packages/epo-react-lib/package.json index 121c4e02..f8852bae 100644 --- a/packages/epo-react-lib/package.json +++ b/packages/epo-react-lib/package.json @@ -23,7 +23,6 @@ "fix-js": "prettier --write \"**/*.{js,jsx}\" && eslint -c .eslintrc.js \"**/*.{js,jsx,ts,tsx}\" --fix", "lint-js": "prettier --check \"**/*.{js,jsx}\" & eslint -c .eslintrc.js \"**/*.{js,jsx,ts,tsx}\"", "prebuild": "rm -fr tempPublish", - "publish-clean": "yarn test && yarn build && clean-publish", "publish-beta": "yarn build && clean-publish --tag beta", "publish-local": "yarn build && clean-publish --without-publish", "storybook": "storybook dev -p 6006", @@ -31,7 +30,7 @@ "build-storybook:production": "yarn build-storybook -o ../../storybook-static", "test": "NODE_OPTIONS=--experimental-vm-modules jest --max-workers=2", "test:generate-output": "yarn test --json --outputFile=.jest-test-results.json || true", - "release": "yarn build && semantic-release -e semantic-release-monorepo --debug" + "release": "yarn build && clean-publish --without-publish && semantic-release -e semantic-release-monorepo --debug" }, "files": [ "CHANGELOG.md", diff --git a/packages/epo-react-lib/release.config.mjs b/packages/epo-react-lib/release.config.mjs index 18164c28..c519f471 100644 --- a/packages/epo-react-lib/release.config.mjs +++ b/packages/epo-react-lib/release.config.mjs @@ -24,7 +24,17 @@ const release = { ], }, ], - ["@semantic-release/github"], + [ + "@semantic-release/github", + { + assets: [ + { + path: ["dist/**", "package.json", "README.md"], + name: "epo-react-lib", + }, + ], + }, + ], ["@semantic-release/npm"], ], }; diff --git a/packages/epo-widget-lib/.clean-publish b/packages/epo-widget-lib/.clean-publish index 39bd7d16..4978ed22 100644 --- a/packages/epo-widget-lib/.clean-publish +++ b/packages/epo-widget-lib/.clean-publish @@ -1,24 +1,3 @@ { - "packageManager": "yarn", - "tempDir": "tempPublish", - "files": [ - "vite.config.ts", - "tsconfig.json", - "tsconfig.node.json", - "jest.config.ts", - "jest-setup.ts", - "babel.config.cjs", - ".jest-test-results.json", - ".gitignore", - ".env.*", - "__mocks__", - ".out", - ".storybook", - "src", - "storybook-static", - "publish", - "postcss.config.ts", - "release.config.mjs", - ".prettierignore" - ] + "packageManager": "yarn" } diff --git a/packages/epo-widget-lib/.npmignore b/packages/epo-widget-lib/.npmignore new file mode 100644 index 00000000..6a1e0acd --- /dev/null +++ b/packages/epo-widget-lib/.npmignore @@ -0,0 +1,38 @@ +# env +.env.* + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + + +# testing + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +# Source +__mocks__ +node_modules/ +dist/ +dist-ssr +*.local +storybook-static/ +tempPublish/ +public/ +src/ + +.out/* \ No newline at end of file diff --git a/packages/epo-widget-lib/release.config.mjs b/packages/epo-widget-lib/release.config.mjs index 5032d00b..dce370ef 100644 --- a/packages/epo-widget-lib/release.config.mjs +++ b/packages/epo-widget-lib/release.config.mjs @@ -27,15 +27,15 @@ const release = { [ "@semantic-release/github", { - assets: [{ path: "tempPublish/**", label: "Package" }], - }, - ], - [ - "@semantic-release/npm", - { - pkgRoot: "tempPublish", + assets: [ + { + path: ["dist/**", "package.json", "README.md"], + name: "epo-widget-lib", + }, + ], }, ], + ["@semantic-release/npm"], ], };