From 0c9f9762d6086045eed1e721dedab9dadffbe6bc Mon Sep 17 00:00:00 2001 From: Doug Richar Date: Thu, 5 Sep 2024 20:23:55 -0400 Subject: [PATCH] feat: improve dev/build process with new development scripts (#253) * feat: add "watch:all" script to root package.json * feat: add "dev:{example}" scripts for examples * feat: separate build scripts for packages and examples * chore: rename "watch:all" to "watch" * chore: rename "dev:" scripts to "example:" * feat: add "dev" script as an alias for "watch" --- package.json | 13 +++++++++++-- packages/use-wallet-react/package.json | 2 +- packages/use-wallet-solid/package.json | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9cff8dc4..d122d05f 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,21 @@ "packageManager": "pnpm@9.9.0", "type": "module", "scripts": { - "build": "pnpm -r build", + "build": "pnpm build:packages && pnpm build:examples", "build:packages": "pnpm -r --filter '@txnlab/*' build", + "build:examples": "pnpm -r --filter 'use-wallet-example-*' build", + "watch": "pnpm -r --filter '@txnlab/*' --parallel start", + "dev": "pnpm run watch", "test": "pnpm -r --if-present test", "lint": "pnpm -r lint", "prettier": "prettier --check .", - "typecheck": "pnpm -r typecheck" + "typecheck": "pnpm -r typecheck", + "example:ts": "pnpm --filter 'use-wallet-example-vanilla-ts' dev", + "example:react": "pnpm --filter 'use-wallet-example-react' dev", + "example:solid": "pnpm --filter 'use-wallet-example-solid' dev", + "example:vue": "pnpm --filter 'use-wallet-example-vue' dev", + "example:nextjs": "pnpm --filter 'use-wallet-example-nextjs' dev", + "example:nuxt": "pnpm --filter 'use-wallet-example-nuxt' dev" }, "devDependencies": { "@testing-library/jest-dom": "6.5.0", diff --git a/packages/use-wallet-react/package.json b/packages/use-wallet-react/package.json index fc3c1b88..c0022da9 100644 --- a/packages/use-wallet-react/package.json +++ b/packages/use-wallet-react/package.json @@ -16,7 +16,7 @@ "types": "./dist/index.d.ts", "scripts": { "build": "tsup", - "start": "tsup src/index.ts --watch", + "start": "tsup src/index.tsx --watch", "test": "vitest", "test:watch": "vitest --watch", "lint": "eslint -c '../../.eslintrc.json' '**/*.{js,ts}'", diff --git a/packages/use-wallet-solid/package.json b/packages/use-wallet-solid/package.json index eef17058..11f32903 100644 --- a/packages/use-wallet-solid/package.json +++ b/packages/use-wallet-solid/package.json @@ -39,7 +39,7 @@ "types": "./dist/index.d.ts", "scripts": { "build": "tsup", - "start": "tsup src/index.ts --watch", + "start": "tsup src/index.tsx --watch", "test": "vitest", "test:watch": "vitest --watch", "lint": "eslint -c '../../.eslintrc.json' '**/*.{js,ts}'",