From 04f06a089ff2f75806ce6aa638ed422ae7a04d34 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Fri, 26 Jul 2024 13:57:32 -0400 Subject: [PATCH] adopt vite --- DEVELOPMENT.md | 4 +- package.json | 30 +- snowpack.config.js | 13 - test/scratch.html | 8 +- vite.config.js | 3 + yarn.lock | 3098 +++++++------------------------------------- 6 files changed, 520 insertions(+), 2636 deletions(-) delete mode 100644 snowpack.config.js create mode 100644 vite.config.js diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index cece985..51ead04 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -8,14 +8,14 @@ cd inputs yarn ``` -Inputs is written in ES modules and uses [Snowpack](https://snowpack.dev/) for development; this means that you can edit the Inputs source code and examples, and they’ll update live as you save changes. To start, copy over the example scratch.html file: +Inputs is written in ES modules and uses [Vite](https://vitejs.dev/) for development; this means that you can edit the Inputs source code and examples, and they’ll update live as you save changes. To start, copy over the example scratch.html file: ``` mkdir scratch cp test/scratch.html scratch/index.html ``` -Then start Snowpack: +Then start Vite: ``` yarn dev diff --git a/package.json b/package.json index 097a304..c4916d1 100644 --- a/package.json +++ b/package.json @@ -37,28 +37,28 @@ "test:lint": "eslint src test", "prepublishOnly": "rm -rf dist && rollup -c && node bin/clean-css < src/style.css > dist/index.css", "postpublish": "git push && git push --tags", - "dev": "snowpack dev" + "dev": "vite dev" }, "_moduleAliases": { "@observablehq/inputs": "./src/index.js" }, "devDependencies": { - "@rollup/plugin-json": "4", - "@rollup/plugin-node-resolve": "13", - "@rollup/plugin-replace": "3", - "clean-css": "5", - "d3": "7", - "eslint": "8", - "js-beautify": "1", - "jsdom": "19", - "jsesc": "3", - "mocha": "9", - "rollup": "2", - "rollup-plugin-terser": "7", - "snowpack": "3" + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.3.0", + "@rollup/plugin-replace": "^3.1.0", + "clean-css": "^5.3.3", + "d3": "^7.9.0", + "eslint": "^8.57.0", + "js-beautify": "^1.15.1", + "jsdom": "^24.1.1", + "jsesc": "^3.0.2", + "mocha": "^10.7.0", + "rollup": "^2.79.1", + "rollup-plugin-terser": "^7.0.2", + "vite": "^5.3.5" }, "dependencies": { - "htl": "0.3", + "htl": "^0.3.1", "isoformat": "^0.2.0" }, "publishConfig": { diff --git a/snowpack.config.js b/snowpack.config.js deleted file mode 100644 index bb05e82..0000000 --- a/snowpack.config.js +++ /dev/null @@ -1,13 +0,0 @@ -export default { - alias: { - "@observablehq/inputs": "./src/index.js" - }, - devOptions: { - port: 8008 - }, - mount: { - "src": "/src", - "test/data": "/data", - "scratch": "/" - } -}; diff --git a/test/scratch.html b/test/scratch.html index 5e46a48..1bcc4df 100644 --- a/test/scratch.html +++ b/test/scratch.html @@ -1,6 +1,7 @@ - + +