-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
62 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
|
||
export default defineConfig(async ({ command, mode }) => { | ||
const plugins = [react()] | ||
|
||
if (process.env.CHEESY_CANVAS) { | ||
const cheesyCanvas = (await import('@pmndrs/examples/vite-plugin-cheesy-canvas')).default | ||
plugins.push(cheesyCanvas()) | ||
} | ||
|
||
return { | ||
plugins | ||
} | ||
export default defineConfig({ | ||
plugins: [react()] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env node | ||
|
||
import { spawn } from "node:child_process"; | ||
import minimist from "minimist"; | ||
import { resolve, dirname } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
|
||
var argv = minimist(process.argv.slice(2)); | ||
// console.log("argv=", argv); | ||
|
||
const name = argv._[0]; | ||
if (!name) { | ||
console.error("Please provide the app name as the first argument."); | ||
process.exit(1); | ||
} | ||
|
||
const __filename = fileURLToPath(import.meta.url); // Converts the URL to a file path | ||
const __dirname = dirname(__filename); // Gets the directory name | ||
const viteConfigPath = resolve(__dirname, "../src/vite.config.ts"); | ||
// console.log("viteConfigPath=", viteConfigPath); | ||
|
||
const cmd = spawn( | ||
"npx", | ||
["vite", "build", "--config", viteConfigPath, "--base", `/examples/${name}`], | ||
{ | ||
stdio: "inherit", | ||
env: process.env, | ||
} | ||
); | ||
|
||
cmd.on("exit", (code) => { | ||
if (code !== 0) { | ||
console.error("Build failed with error"); | ||
process.exit(1); | ||
} | ||
|
||
console.log("Build completed successfully."); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
{ | ||
"name": "@pmndrs/examples", | ||
"private": true, | ||
"type": "module", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"exports": { | ||
"./CheesyCanvas": "./src/CheesyCanvas.jsx", | ||
"./vite-plugin-cheesy-canvas": "./src/vite-plugin-cheesy-canvas.js" | ||
"./CheesyCanvas": "./src/CheesyCanvas.jsx" | ||
}, | ||
"bin": { | ||
"vite-build": "./bin/build.sh" | ||
"vite-build": "./bin/build.mjs" | ||
}, | ||
"dependencies": { | ||
"@babel/parser": "^7.24.8", | ||
"@babel/traverse": "^7.24.8", | ||
"@babel/types": "^7.24.9", | ||
"ast-types": "^0.16.1", | ||
"minimist": "^1.2.8", | ||
"recast": "^0.23.9" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { defineConfig } from "vite"; | ||
import react from "@vitejs/plugin-react"; | ||
|
||
import cheesyCanvas from "./vite-plugin-cheesy-canvas"; | ||
|
||
export default defineConfig({ | ||
plugins: [react(), cheesyCanvas()], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+120 KB
test/e2e/snapshot.test.js-snapshots/aquarium-should-match-previous-one-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.