Skip to content

Commit

Permalink
dev: fix playground dev server (#1666)
Browse files Browse the repository at this point in the history
Co-authored-by: dschlabach <[email protected]>
  • Loading branch information
dschlabach and dschlabach authored Nov 26, 2024
1 parent da2e40e commit 583afa8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
10 changes: 4 additions & 6 deletions playground/nextjs-app-router/onchainkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/onchainkit",
"version": "0.35.5",
"version": "0.35.7",
"type": "module",
"repository": "https://github.com/coinbase/onchainkit.git",
"license": "MIT",
Expand All @@ -12,7 +12,7 @@
"ci:format": "biome ci --linter-enabled=false --organize-imports-enabled=false",
"ci:lint": "biome ci --formatter-enabled=false --organize-imports-enabled=false",
"cp": "cp -R src site/docs/pages",
"dev:watch": "concurrently \"tailwind -i ./src/styles/index-with-tailwind.css -o ./src/styles.css --watch\" \"tsup --watch ./src/**/*.tsx\"",
"dev:watch": "concurrently \"tailwind -i ./src/styles/index-with-tailwind.css -o ./src/styles.css --watch\" \"tsup\"",
"format": "biome format --write .",
"lint": "biome lint --write .",
"lint:unsafe": "biome lint --write --unsafe .",
Expand Down Expand Up @@ -40,10 +40,9 @@
"clsx": "^2.1.1",
"graphql": "^14 || ^15 || ^16",
"graphql-request": "^6.1.0",
"permissionless": "^0.1.29",
"tailwind-merge": "^2.3.0",
"viem": "^2.17.4",
"wagmi": "^2.11.0"
"viem": "^2.21.33",
"wagmi": "^2.12.24"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
Expand Down Expand Up @@ -72,7 +71,6 @@
"graphql-request": "^6.1.0",
"jsdom": "^24.1.0",
"packemon": "3.3.1",
"permissionless": "^0.1.29",
"react": "^18",
"react-dom": "^18",
"rimraf": "^5.0.5",
Expand Down
7 changes: 3 additions & 4 deletions playground/nextjs-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
"build:link": "cd ./onchainkit && bun link && cd .. && bun link @coinbase/onchainkit",
"build:prepare": "bun run build:onchainkit && bun run cp && bun i",
"cp": "cp -R ../../esm ./onchainkit && cp -R ../../src ./onchainkit && cp -R ../../package.json ./onchainkit",
"cp:dev": "cp -R ../../package.json ./node_modules/@coinbase/onchainkit",
"cp:dev": "cp -R ../../package.json ./onchainkit/package.json && mkdir -p ./onchainkit/src && touch ./onchainkit/src/styles.css && (test -f ../../src/styles.css && cp -R ../../src/styles.css ./onchainkit/src/styles.css || true)",
"dev": "next dev",
"dev:watch": "concurrently \"bun dev\" \"bun run cp:dev && cd ../.. && bun run dev:watch\" \"bun run watch:tailwind\" -c red,gray,blue",
"dev:watch": "concurrently \"bun dev\" \"bun run cp:dev && bun build:link && cd ../.. && bun run dev:watch\"",
"lint": "next lint",
"start": "next start",
"watch:tailwind": "mkdir -p ./node_modules/@coinbase/onchainkit/src && nodemon --watch ../../src/styles.css --exec 'cp ../../src/styles.css ./node_modules/@coinbase/onchainkit/src/styles.css'"
"start": "next start"
},
"dependencies": {
"@coinbase/onchainkit": "^0.35.0",
Expand Down
12 changes: 9 additions & 3 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig({
options.jsxImportSource = 'react';
},
sourcemap: true,
outDir: 'playground/nextjs-app-router/node_modules/@coinbase/onchainkit/esm',
outDir: 'playground/nextjs-app-router/onchainkit/esm',
dts: false,
clean: false,
silent: true, // Flip this to false to see tsup output in the terminal, including performance logs
Expand All @@ -30,7 +30,7 @@ export default defineConfig({
'--emitDeclarationOnly',
'--declaration',
'--outDir',
'playground/nextjs-app-router/node_modules/@coinbase/onchainkit/esm',
'playground/nextjs-app-router/onchainkit/esm',
'--rootDir',
'src',
'src/index.ts',
Expand All @@ -39,7 +39,7 @@ export default defineConfig({
'src/**/theme.ts',
'--incremental',
'--tsBuildInfoFile',
'playground/nextjs-app-router/node_modules/@coinbase/onchainkit/esm/tsbuildinfo.json',
'playground/nextjs-app-router/onchainkit/esm/tsbuildinfo.json',
'--jsx',
'react-jsx',
],
Expand All @@ -48,6 +48,12 @@ export default defineConfig({
},
);

// Copy tailwind styles
spawnSync('cp', [
'src/styles.css',
'playground/nextjs-app-router/onchainkit/src/styles.css',
]);

console.log('Declaration files generated.');
},
});

0 comments on commit 583afa8

Please sign in to comment.