diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index c8ad92cfd5b..23d1285a83a 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -4,7 +4,8 @@ "new", "/.codesandbox/templates/node", "/.codesandbox/templates/next", - "/.codesandbox/templates/vanilla" + "/.codesandbox/templates/vanilla", + "/.codesandbox/templates/vue" ], "node": "16" } diff --git a/.codesandbox/deploy.mjs b/.codesandbox/deploy.mjs index 4559a21c194..ebd55183d93 100644 --- a/.codesandbox/deploy.mjs +++ b/.codesandbox/deploy.mjs @@ -6,7 +6,7 @@ import match from 'micromatch'; import path from 'path'; import { getGitInfo } from '../scripts/git.mjs'; -const BINARY_EXT = ['png', 'jpg', 'jpeg']; +const BINARY_EXT = ['png', 'jpg', 'jpeg', 'ico']; function bufferToBase64DataUrl(buffer, mimeType) { return 'data:' + mimeType + ';base64,' + buffer.toString('base64'); @@ -94,7 +94,6 @@ export async function createCodeSandbox(appPath) { ); return `https://codesandbox.io/s/${sandbox_id}`; } catch (error) { - // console.log(error.response.data); - throw new Error(error.response.data); + throw error.response?.data || error; } } diff --git a/.codesandbox/templates/vue/.gitignore b/.codesandbox/templates/vue/.gitignore new file mode 100644 index 00000000000..837e96b09b5 --- /dev/null +++ b/.codesandbox/templates/vue/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +package-lock.json +.DS_Store +dist +dist-ssr +coverage +*.local + +# Editor directories and files +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.codesandbox/templates/vue/.vscode/extensions.json b/.codesandbox/templates/vue/.vscode/extensions.json new file mode 100644 index 00000000000..c0a6e5a4811 --- /dev/null +++ b/.codesandbox/templates/vue/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] +} diff --git a/.codesandbox/templates/vue/README.md b/.codesandbox/templates/vue/README.md new file mode 100644 index 00000000000..110f2980b12 --- /dev/null +++ b/.codesandbox/templates/vue/README.md @@ -0,0 +1,15 @@ +# Fabric Vue.js Sandbox + +A [`vue`](https://vuejs.org/) app for reproducing `fabric` issues and creating examples. + +## Reproducing + +Creating a clear, easy to use reproduction is very **IMPORTANT**. +Keep it simple and concise. +Don't add stuff that is out of scope. + +Make sure you are reproducing with the correct version of fabric. + +Provide a **detailed description** including steps to reproduce in the [`REPRODUCE.md`](./REPRODUCE.md) file. + +Navigate to [`src/App.vue`](./src/App.vue) and start editing. diff --git a/.codesandbox/templates/vue/REPRODUCE.md b/.codesandbox/templates/vue/REPRODUCE.md new file mode 100644 index 00000000000..17198ac3882 --- /dev/null +++ b/.codesandbox/templates/vue/REPRODUCE.md @@ -0,0 +1,5 @@ +# Reproducing + +## Steps + +1. diff --git a/.codesandbox/templates/vue/env.d.ts b/.codesandbox/templates/vue/env.d.ts new file mode 100644 index 00000000000..11f02fe2a00 --- /dev/null +++ b/.codesandbox/templates/vue/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/.codesandbox/templates/vue/index.html b/.codesandbox/templates/vue/index.html new file mode 100644 index 00000000000..11603f878f1 --- /dev/null +++ b/.codesandbox/templates/vue/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/.codesandbox/templates/vue/package.json b/.codesandbox/templates/vue/package.json new file mode 100644 index 00000000000..cbbb7653aa2 --- /dev/null +++ b/.codesandbox/templates/vue/package.json @@ -0,0 +1,27 @@ +{ + "name": "vue", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "vite", + "build": "run-p type-check \"build-only {@}\" --", + "preview": "vite preview", + "build-only": "vite build", + "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false" + }, + "dependencies": { + "fabric": "file:../../..", + "vue": "^3.3.4" + }, + "devDependencies": { + "@tsconfig/node18": "^18.2.2", + "@types/node": "^18.18.5", + "@vitejs/plugin-vue": "^4.4.0", + "@vitejs/plugin-vue-jsx": "^3.0.2", + "@vue/tsconfig": "^0.4.0", + "npm-run-all2": "^6.1.1", + "typescript": "~5.2.0", + "vite": "^4.4.11", + "vue-tsc": "^1.8.19" + } +} diff --git a/.codesandbox/templates/vue/public/favicon.ico b/.codesandbox/templates/vue/public/favicon.ico new file mode 100644 index 00000000000..0d10dd16555 Binary files /dev/null and b/.codesandbox/templates/vue/public/favicon.ico differ diff --git a/.codesandbox/templates/vue/sandbox.config.json b/.codesandbox/templates/vue/sandbox.config.json new file mode 100644 index 00000000000..9b732a0abfa --- /dev/null +++ b/.codesandbox/templates/vue/sandbox.config.json @@ -0,0 +1,3 @@ +{ + "template": "vue-cli" +} diff --git a/.codesandbox/templates/vue/src/App.vue b/.codesandbox/templates/vue/src/App.vue new file mode 100644 index 00000000000..ca641c8b2b5 --- /dev/null +++ b/.codesandbox/templates/vue/src/App.vue @@ -0,0 +1,41 @@ + + + diff --git a/.codesandbox/templates/vue/src/main.ts b/.codesandbox/templates/vue/src/main.ts new file mode 100644 index 00000000000..684d04215d7 --- /dev/null +++ b/.codesandbox/templates/vue/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue'; +import App from './App.vue'; + +createApp(App).mount('#app'); diff --git a/.codesandbox/templates/vue/tsconfig.app.json b/.codesandbox/templates/vue/tsconfig.app.json new file mode 100644 index 00000000000..3e5b621ef68 --- /dev/null +++ b/.codesandbox/templates/vue/tsconfig.app.json @@ -0,0 +1,12 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/*"], + "compilerOptions": { + "composite": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } + } +} diff --git a/.codesandbox/templates/vue/tsconfig.json b/.codesandbox/templates/vue/tsconfig.json new file mode 100644 index 00000000000..66b5e5703e8 --- /dev/null +++ b/.codesandbox/templates/vue/tsconfig.json @@ -0,0 +1,11 @@ +{ + "files": [], + "references": [ + { + "path": "./tsconfig.node.json" + }, + { + "path": "./tsconfig.app.json" + } + ] +} diff --git a/.codesandbox/templates/vue/tsconfig.node.json b/.codesandbox/templates/vue/tsconfig.node.json new file mode 100644 index 00000000000..dee96bed470 --- /dev/null +++ b/.codesandbox/templates/vue/tsconfig.node.json @@ -0,0 +1,16 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "include": [ + "vite.config.*", + "vitest.config.*", + "cypress.config.*", + "nightwatch.conf.*", + "playwright.config.*" + ], + "compilerOptions": { + "composite": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "types": ["node"] + } +} diff --git a/.codesandbox/templates/vue/vite.config.ts b/.codesandbox/templates/vue/vite.config.ts new file mode 100644 index 00000000000..dffd198dff6 --- /dev/null +++ b/.codesandbox/templates/vue/vite.config.ts @@ -0,0 +1,15 @@ +import { fileURLToPath, URL } from 'node:url'; + +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import vueJsx from '@vitejs/plugin-vue-jsx'; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue(), vueJsx()], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, + }, +}); diff --git a/.gitpod.yml b/.gitpod.yml index 4094afcbbce..934a3995cfb 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -16,3 +16,7 @@ tasks: - name: Vanilla init: npm install command: npm start vanilla -- --no-watch + + - name: Vue.js + init: gp sync-await deps + command: npm start vue -- --no-watch diff --git a/.prettierignore b/.prettierignore index d1d86f6ba46..833acfada8e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -12,6 +12,7 @@ before_commit **/dist/ /lib/ /test/ +/website/ .next/ .parcel-cache/ /docs/ diff --git a/.vscode/settings.json b/.vscode/settings.json index d7886fd74fa..5a81fab2d3c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,4 +15,19 @@ "source.organizeImports": "never", "source.removeUnusedImports": "explicit" } + "search.exclude": { + "**/node_modules": true, + "**/bower_components": true, + "**/.next": true, + "**/.parcel-cache": true, + "**/*.code-search": true, + "dist": true, + "website": true, + "coverage": true, + ".nyc_output": true, + "e2e/test-results": true, + "e2e/test-report": true, + "test/visual/assets": true + }, + "search.useIgnoreFiles": true } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6962b9c656b..1655899b713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [next] +- ci(): add a vue template [#9502](https://github.com/fabricjs/fabric.js/pull/9502) - refactor(): `getActiveControl` now returns the key, the corner and the coordinates [#9515](https://github.com/fabricjs/fabric.js/pull/9515) - fix(Controls): forbid scaling to avoid NaN issues on scaling zero sized objects. #9475 [#9563](https://github.com/fabricjs/fabric.js/pull/9563) - feat(LayoutManager): BREAKING remove `shouldResetTransform` handling from LayoutManager [#9581](https://github.com/fabricjs/fabric.js/pull/9581)