Skip to content

Commit

Permalink
Fix the web plugin's prepublishOnly script.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenikles committed Aug 8, 2023
1 parent 0b3dac8 commit a37c021
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/three-penguins-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"webstone-plugin-request-logger-web": minor
"create-webstone-app": minor
---

Make sure the plugin's web's prepublishOnly script runs pnpm package.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
"scripts": {
"build": "pnpm --recursive --parallel build",
"changeset": "changeset && pnpm install",
"changeset:version": "changeset version && pnpm install --lockfile-only",
"changeset:publish": "changeset publish",
"clean": "pnpm --recursive --parallel clean",
"clean:nodemodules": "find . -type d -name \"node_modules\" -exec rm -fr {} +",
"dev": "pnpm --recursive --parallel --filter !./packages/plugin-*/web --filter !./packages/plugin-*/packages/web dev",
"lint": "eslint . --fix --ignore-path .gitignore --max-warnings 0",
"preinstall": "npx only-allow pnpm",
"prepare": "husky install",
"release": "changeset publish",
"test": "pnpm test:unit",
"test:e2e": "pnpm playwright test",
"test:e2e:open": "pnpm playwright test --headed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ const installWebDevDependencies = async (ctx: Ctx) => {
};

const configureWebPrepublishOnlyScript = async (ctx: Ctx) => {
const prepublishOnlyCommands = [
`pnpm remove webstone-plugin-${getAppName(ctx.appDir)}-cli @webstone/cli`,
"pnpm package",
];
const packageJson = fs.readJSONSync(
path.join(ctx.appDir, "packages", "web", "package.json"),
);
packageJson.scripts.prepublishOnly = `pnpm remove webstone-plugin-${getAppName(
ctx.appDir,
)}-cli @webstone/cli`;
packageJson.scripts.prepublishOnly = prepublishOnlyCommands.join(" && ");
fs.writeJSONSync(
path.join(ctx.appDir, "packages", "web", "package.json"),
packageJson,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-request-logger/packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build": "vite build && npm run package",
"preview": "vite preview",
"package": "svelte-kit sync && svelte-package && publint",
"prepublishOnly": "pnpm remove webstone-plugin-request-logger-cli @webstone/cli",
"prepublishOnly": "pnpm remove webstone-plugin-request-logger-cli @webstone/cli && pnpm package",
"test": "playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
Expand Down

0 comments on commit a37c021

Please sign in to comment.