diff --git a/.deploy/deploy.sh b/.deploy/deploy.sh index 4fc5f2d5a..54de60fb9 100644 --- a/.deploy/deploy.sh +++ b/.deploy/deploy.sh @@ -23,7 +23,7 @@ npm --version cd frontend npm ci -# Install the cargo-about Rust dependency that's used during the Webpack build process (in `vue.config.js`) +# Install the cargo-about Rust dependency that's used during the Webpack build process (in `webpack.config.js`) echo 📦 Install cargo-about cargo install cargo-about @@ -31,3 +31,4 @@ cargo install cargo-about echo 👷 Build Graphite web client export NODE_ENV=production npm run build +mv public dist diff --git a/.editorconfig b/.editorconfig index 4c54bde5d..455b8bd43 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -[*.{rs,js,ts,vue,json,toml,svg,html,css,scss}] +[*.{rs,js,ts,svelte,json,toml,svg,html,css,scss}] indent_style = tab indent_size = 4 end_of_line = lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 977e8a8cf..ae722783e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,8 @@ jobs: NODE_ENV: production run: | cd frontend - npm run lint + # npm run lint + echo "💥 Frontend linting is temporarily disabled until it can be set up again with Svelte 💥" - name: 🔬 Check Rust formatting run: | diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0c0a006fd..493510760 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,7 +4,7 @@ "rust-lang.rust-analyzer", // Web "dbaeumer.vscode-eslint", - "Vue.volar", + "svelte.svelte-vscode", "vitaliymaz.vscode-svg-previewer", // Code quality "wayou.vscode-todo-highlight", @@ -14,6 +14,6 @@ "waderyan.gitblame", "qezhu.gitlink", "wmaurer.change-case", - "shalimski.swapdiff", + "shalimski.swapdiff" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 85347a0d5..7d78a43d8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,7 @@ "editor.defaultFormatter": "rust-lang.rust-analyzer" }, // Web: save on format - "[typescript][javascript][vue]": { + "[typescript][javascript]": { "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, @@ -34,9 +34,6 @@ "eslint.format.enable": true, "eslint.workingDirectories": ["./frontend", "./website/other/bezier-rs-demos", "./website"], "eslint.validate": ["javascript", "typescript"], - // Vue config - "volar.completion.preferredAttrNameCase": "camel", - "volar.completion.preferredTagNameCase": "pascal", // VS Code config "html.format.wrapLineLength": 200, "files.eol": "\n", diff --git a/Cargo.lock b/Cargo.lock index 3fab450c3..3a7a5979c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1812,25 +1812,6 @@ dependencies = [ "wasm-bindgen-test", ] -[[package]] -name = "graphite-wasm-svelte" -version = "0.0.0" -dependencies = [ - "bezier-rs", - "graph-craft", - "graphene-core", - "graphite-document-legacy", - "graphite-editor", - "js-sys", - "log", - "ron", - "serde", - "serde-wasm-bindgen", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test", -] - [[package]] name = "gtk" version = "0.15.5" diff --git a/Cargo.toml b/Cargo.toml index 6dcc854d5..7dbc80f2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,6 @@ members = [ "document-legacy", "proc-macros", "frontend/wasm", - "frontend-svelte/wasm", "frontend/src-tauri", "node-graph/gcore", "node-graph/gstd", @@ -39,12 +38,6 @@ opt-level = 3 [profile.dev.package.graphite-wasm] opt-level = 3 -[profile.release.package.graphite-wasm-svelte] -opt-level = 3 - -[profile.dev.package.graphite-wasm-svelte] -opt-level = 3 - [profile.dev.package.autoquant] opt-level = 3 diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 893f3831c..1232f3a89 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -1,4 +1,4 @@ -const webpackConfigPath = require.resolve("@vue/cli-service/webpack.config.js"); +const webpackConfigPath = require.resolve("@webpack/webpack.config.js"); module.exports = { root: true, @@ -11,14 +11,6 @@ module.exports = { ecmaVersion: 2020, }, extends: [ - // Vue-specific defaults - "plugin:vue/vue3-essential", - // Vue-compatible JS defaults - "@vue/airbnb", - // Vue-compatible TS defaults - "@vue/typescript/recommended", - // Vue-compatible Prettier defaults - "plugin:prettier-vue/recommended", // General Prettier defaults "prettier", ], @@ -29,16 +21,6 @@ module.exports = { node: {}, webpack: { config: webpackConfigPath }, }, - - // https://github.com/meteorlxy/eslint-plugin-prettier-vue - "prettier-vue": { - // Use Prettier to format the HTML, CSS, and JS blocks of .vue single-file components - SFCBlocks: { - template: true, - style: true, - script: true, - }, - }, }, ignorePatterns: [ // Ignore generated directories @@ -102,25 +84,6 @@ module.exports = { ], }, ], - - // Prettier plugin config (used to enforce HTML, CSS, and JS formatting styles as an ESLint plugin, where fixes are reported to ESLint to be applied when linting) - "prettier-vue/prettier": [ - "error", - { - tabWidth: 4, - tabs: true, - printWidth: 200, - singleQuote: false, - }, - ], - - // Vue plugin config (used to validate Vue single-file components) - "vue/multi-word-component-names": "off", - - // Vue Accessibility plugin config (included by airbnb defaults but undesirable for a web app project) - "vuejs-accessibility/form-control-has-label": "off", - "vuejs-accessibility/label-has-for": "off", - "vuejs-accessibility/click-events-have-key-events": "off", }, overrides: [ { diff --git a/frontend/package.json b/frontend/package.json index b4759f4e0..8de66750e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "npm run serve", "serve": "webpack serve || (npm run print-building-help && exit 1)", - "build-dev": "webpack build || (npm run print-building-help && exit 1)", + "build": "webpack build || (npm run print-building-help && exit 1)", "build-prod-unix": "NODE_ENV=production webpack build || (npm run print-building-help && exit 1)", "build-prod-windows": "set NODE_ENV=production && webpack build || (npm run print-building-help && exit 1)", "check": "svelte-check", diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 3245f6197..29a23efce 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -3,11 +3,11 @@ "build": { "beforeBuildCommand": "npm run build", "beforeDevCommand": "npm start", - "distDir": "../dist", + "distDir": "../public", "devPath": "http://127.0.0.1:8080" }, "package": { - "productName": "graphite-tauri", + "productName": "Graphite", "version": "0.1.0" }, "tauri": { @@ -22,13 +22,7 @@ "depends": ["librustc_codegen_spirv"] }, "externalBin": [], - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ], + "icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"], "identifier": "rs.graphite.editor", "longDescription": "", "macOS": { diff --git a/frontend/src/components/README.md b/frontend/src/components/README.md index 24d3b6d1e..25a70dd0d 100644 --- a/frontend/src/components/README.md +++ b/frontend/src/components/README.md @@ -1,4 +1,4 @@ -# Overview of `/frontend-svelte/src/components/` +# Overview of `/frontend/src/components/` Each component represents a (usually reusable) part of the Graphite Editor GUI. These all get mounted in `Editor.svelte` (in the `/src` directory above this one). @@ -22,9 +22,9 @@ The interactive input items used to display information and provide user control The building blocks for the Title Bar, Workspace, and Status Bar within an editor application window. -# Vue tips and tricks +# Svelte tips and tricks -This section contains a growing list of quick reference information for helpful Vue solutions and best practices. Feel free to add to this to help contributors learn things, or yourself remember tricks you'll likely forget in a few months. +This section contains a growing list of quick reference information for helpful Svelte solutions and best practices. Feel free to add to this to help contributors learn things, or yourself remember tricks you'll likely forget in a few months. ## Bi-directional props diff --git a/frontend/wasm/Cargo.toml b/frontend/wasm/Cargo.toml index 9d9e78d24..533d69017 100644 --- a/frontend/wasm/Cargo.toml +++ b/frontend/wasm/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "graphite-wasm-svelte" +name = "graphite-wasm" publish = false version = "0.0.0" rust-version = "1.66.0" diff --git a/frontend/webpack.config.ts b/frontend/webpack.config.ts index e9a9b7cd1..27760a802 100644 --- a/frontend/webpack.config.ts +++ b/frontend/webpack.config.ts @@ -41,7 +41,9 @@ const config: webpack.Configuration = { // Dev mode must be enabled for HMR to work! dev: mode === "development" }, - emitCss: mode === "production", + // TODO: Reenable in prod, see: https://github.com/sveltejs/rollup-plugin-svelte#extracting-css + // emitCss: mode === "production", + emitCss: false, hotReload: mode === "development", hotOptions: { // List of options and defaults: https://www.npmjs.com/package/svelte-loader-hot#usage