Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Use sources as type deifnitions (#539)
Bogdan Chadkin3e96357a2c4a
diff --git a/.husky/pre-commit b/.husky/pre-commitindex 0f79e4af02..d2ae35e84b 100755--- a/.husky/pre-commit+++ b/.husky/pre-commit@@ -1,5 +1,4 @@#!/bin/sh. "$(dirname "$0")/_/husky.sh"-yarn update:ts-referencesyarn lint-stageddiff --git a/packages/react-sdk/@types/detect-font.d.ts b/@types/detect-font.d.tssimilarity index 100%rename from packages/react-sdk/@types/detect-font.d.tsrename to @types/detect-font.d.tsdiff --git a/apps/designer/tsconfig.json b/apps/designer/tsconfig.jsonindex 07716eb5bc..6e2d8210fc 100644--- a/apps/designer/tsconfig.json+++ b/apps/designer/tsconfig.json@@ -1,44 +1,15 @@{// Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091"extends": "../../node_modules/@webstudio-is/tsconfig/remix.json",- "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],+ "include": [+ "remix.env.d.ts",+ "**/*.ts",+ "**/*.tsx",+ "../../@types/**/*.d.ts"+ ],"compilerOptions": {"paths": { "~/*": ["app/*"] },"baseUrl": ".","rootDir": "./app"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../../packages/asset-uploader"- },-- {- "path": "../../packages/css-engine"- },-- {- "path": "../../packages/css-vars"- },-- {- "path": "../../packages/design-system"- },-- {- "path": "../../packages/icons"- },-- {- "path": "../../packages/prisma-client"- },-- {- "path": "../../packages/project"- },-- {- "path": "../../packages/react-sdk"- }- ]+ }}diff --git a/package.json b/package.jsonindex 7a04177a0f..32f5bd1a9f 100644--- a/package.json+++ b/package.json@@ -18,8 +18,7 @@"storybook": "turbo run storybook:run","storybook:build": "npm run build && turbo run storybook:build","storybook:ds:build": "turbo run storybook:build --filter=@webstudio-is/design-system",- "migrations": "cd apps/designer && migrations --dev",- "update:ts-references": "tsx ./bin/update-ts-project-references.ts"+ "migrations": "cd apps/designer && migrations --dev"},"devDependencies": {"@changesets/get-dependents-graph": "^1.3.4",diff --git a/packages/asset-uploader/package.json b/packages/asset-uploader/package.jsonindex e7baba653b..12725c1634 100644--- a/packages/asset-uploader/package.json+++ b/packages/asset-uploader/package.json@@ -10,7 +10,7 @@"test": "NODE_OPTIONS=--experimental-vm-modules jest","checks": "yarn typecheck && yarn lint && yarn test","dev": "tsup --watch",- "build": "rm -fr lib tsconfig.tsbuildinfo && tsc",+ "build": "rm -fr lib && tsc","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","publish-to-npm": "bash ../../bin/publish-to-npm.sh"},@@ -35,10 +35,10 @@".": "./lib/index.js","./server": "./server.js"},- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/asset-uploader/server.d.ts b/packages/asset-uploader/server.d.tsindex a6fbe7c12c..ad6dde9958 100644--- a/packages/asset-uploader/server.d.ts+++ b/packages/asset-uploader/server.d.ts@@ -1 +1 @@-export * from "./lib/index.server";+export * from "./src/index.server";diff --git a/packages/asset-uploader/tsconfig.json b/packages/asset-uploader/tsconfig.jsonindex 13e555ea69..31c85c5126 100644--- a/packages/asset-uploader/tsconfig.json+++ b/packages/asset-uploader/tsconfig.json@@ -9,15 +9,5 @@"baseUrl": ".","outDir": "./lib","rootDir": "./src"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../fonts"- },-- {- "path": "../prisma-client"- }- ]+ }}diff --git a/packages/css-data/package.json b/packages/css-data/package.jsonindex dc27d904c7..76b478146e 100644--- a/packages/css-data/package.json+++ b/packages/css-data/package.json@@ -10,7 +10,7 @@"checks": "yarn typecheck && yarn lint","dev": "tsup --watch","build:cjs": "tsc --module commonjs --outDir lib/cjs && find lib/cjs -name '*.js' | while read NAME; do mv $NAME ${NAME%.js}.cjs; done",- "build": "rm -fr lib tsconfig.tsbuildinfo && tsc && yarn build:cjs",+ "build": "rm -fr lib && tsc && yarn build:cjs","build:mdn-data": "tsx ./bin/mdn-data.ts ./src/__generated__","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","publish-to-npm": "bash ../../bin/publish-to-npm.sh"@@ -32,10 +32,10 @@"import": "./lib/index.js","require": "./lib/cjs/index.cjs"},- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/css-data/tsconfig.json b/packages/css-data/tsconfig.jsonindex ecd0abd8a0..31c85c5126 100644--- a/packages/css-data/tsconfig.json+++ b/packages/css-data/tsconfig.json@@ -9,7 +9,5 @@"baseUrl": ".","outDir": "./lib","rootDir": "./src"- },- // this is auto-generated by update-ts-project-references.ts- "references": []+ }}diff --git a/packages/css-engine/package.json b/packages/css-engine/package.jsonindex 92d21ac25f..ce0c7d57ac 100644--- a/packages/css-engine/package.json+++ b/packages/css-engine/package.json@@ -9,7 +9,7 @@"typecheck": "tsc --noEmit","checks": "yarn typecheck && yarn lint && yarn test","dev": "tsup --watch",- "build": "rm -fr lib tsconfig.tsbuildinfo && tsc",+ "build": "rm -fr lib && tsc","test": "NODE_OPTIONS=--experimental-vm-modules jest","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","storybook:run": "start-storybook -p 6006",@@ -40,10 +40,10 @@"@types/react-dom": "^17.0.9"},"exports": "./lib/index.js",- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/css-engine/tsconfig.json b/packages/css-engine/tsconfig.jsonindex 51bf8d0793..31c85c5126 100644--- a/packages/css-engine/tsconfig.json+++ b/packages/css-engine/tsconfig.json@@ -9,15 +9,5 @@"baseUrl": ".","outDir": "./lib","rootDir": "./src"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../css-data"- },-- {- "path": "../fonts"- }- ]+ }}diff --git a/packages/css-vars/package.json b/packages/css-vars/package.jsonindex 96fbc322ea..f8fa51e71f 100644--- a/packages/css-vars/package.json+++ b/packages/css-vars/package.json@@ -10,7 +10,7 @@"checks": "yarn typecheck && yarn lint","dev": "tsup --watch","build:cjs": "tsc --module commonjs --outDir lib/cjs && find lib/cjs -name '*.js' | while read NAME; do mv $NAME ${NAME%.js}.cjs; done",- "build": "rm -fr lib tsconfig.tsbuildinfo && tsc && yarn build:cjs",+ "build": "rm -fr lib && tsc && yarn build:cjs","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","publish-to-npm": "bash ../../bin/publish-to-npm.sh"},@@ -25,10 +25,10 @@"import": "./lib/index.js","require": "./lib/cjs/index.cjs"},- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/css-vars/tsconfig.json b/packages/css-vars/tsconfig.jsonindex ecd0abd8a0..31c85c5126 100644--- a/packages/css-vars/tsconfig.json+++ b/packages/css-vars/tsconfig.json@@ -9,7 +9,5 @@"baseUrl": ".","outDir": "./lib","rootDir": "./src"- },- // this is auto-generated by update-ts-project-references.ts- "references": []+ }}diff --git a/packages/design-system/package.json b/packages/design-system/package.jsonindex aad801c328..3c683604d7 100644--- a/packages/design-system/package.json+++ b/packages/design-system/package.json@@ -7,7 +7,7 @@"type": "module","scripts": {"dev": "tsup --watch",- "build": "rm -fr lib tsconfig.tsbuildinfo && tsc",+ "build": "rm -fr lib && tsc","typecheck": "tsc --noEmit","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","test": "NODE_OPTIONS=--experimental-vm-modules jest",@@ -71,10 +71,10 @@"react-hot-toast": "^2.3.0"},"exports": "./lib/index.js",- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/design-system/tsconfig.json b/packages/design-system/tsconfig.jsonindex cbd662b720..a97c11ded2 100644--- a/packages/design-system/tsconfig.json+++ b/packages/design-system/tsconfig.json@@ -9,14 +9,7 @@"target": "ES2020","strict": true,"baseUrl": ".",- "paths": { "~/*": ["./src/*"] },"rootDir": "./src","outDir": "./lib"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../icons"- }- ]+ }}diff --git a/packages/fonts/package.json b/packages/fonts/package.jsonindex d6b1c7ccf1..53730b3772 100644--- a/packages/fonts/package.json+++ b/packages/fonts/package.json@@ -11,7 +11,7 @@"checks": "yarn typecheck && yarn lint && yarn test","dev": "tsup --watch","build:cjs": "tsc --module commonjs --outDir lib/cjs && find lib/cjs -name '*.js' | while read NAME; do mv $NAME ${NAME%.js}.cjs; done",- "build": "rm -fr lib tsconfig.tsbuildinfo && tsc && yarn build:cjs",+ "build": "rm -fr lib && tsc && yarn build:cjs","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","publish-to-npm": "bash ../../bin/publish-to-npm.sh"},@@ -37,10 +37,10 @@},"./server": "./server.js"},- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/fonts/server.d.ts b/packages/fonts/server.d.tsindex a6fbe7c12c..ad6dde9958 100644--- a/packages/fonts/server.d.ts+++ b/packages/fonts/server.d.ts@@ -1 +1 @@-export * from "./lib/index.server";+export * from "./src/index.server";diff --git a/packages/fonts/tsconfig.json b/packages/fonts/tsconfig.jsonindex c175851463..20fdf0ed67 100644--- a/packages/fonts/tsconfig.json+++ b/packages/fonts/tsconfig.json@@ -9,11 +9,5 @@"baseUrl": ".","rootDir": "./src","outDir": "./lib"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../design-system"- }- ]+ }}diff --git a/packages/generate-arg-types/tsconfig.json b/packages/generate-arg-types/tsconfig.jsonindex a360eabd33..9db3a9d278 100644--- a/packages/generate-arg-types/tsconfig.json+++ b/packages/generate-arg-types/tsconfig.json@@ -9,7 +9,5 @@"baseUrl": ".","rootDir": "./src","outDir": "./.bin"- },- // this is auto-generated by update-ts-project-references.ts- "references": []+ }}diff --git a/packages/http-client/tsconfig.json b/packages/http-client/tsconfig.jsonindex 64c6a2549e..69307c0597 100644--- a/packages/http-client/tsconfig.json+++ b/packages/http-client/tsconfig.json@@ -1,7 +1,7 @@{// Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091"extends": "../../node_modules/@webstudio-is/tsconfig/base.json",- "include": ["src"],+ "include": ["src", "../../@types/**/*.d.ts"],"compilerOptions": {"lib": ["DOM", "DOM.Iterable", "ES2020"],"module": "commonjs",@@ -12,15 +12,5 @@"paths": { "~/*": ["./src/*"] },"outDir": "./lib","rootDir": "./src"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../prisma-client"- },-- {- "path": "../project"- }- ]+ }}diff --git a/packages/icons/package.json b/packages/icons/package.jsonindex 2e9fa6cc5d..9a63f79ee6 100644--- a/packages/icons/package.json+++ b/packages/icons/package.json@@ -8,7 +8,7 @@"scripts": {"dev": "tsup --watch","build:cjs": "tsc --module commonjs --outDir lib/cjs && find lib/cjs -name '*.js' | while read NAME; do mv $NAME ${NAME%.js}.cjs; done",- "build": "rm -fr lib tsconfig.tsbuildinfo && tsc && yarn build:cjs",+ "build": "rm -fr lib && tsc && yarn build:cjs","generate": "rm -fr src/__generated__ && NODE_OPTIONS='--loader=tsx' svgo-jsx svgo-jsx.config.ts","typecheck": "tsc --noEmit","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0",@@ -45,10 +45,10 @@"import": "./lib/index.js","require": "./lib/cjs/index.cjs"},- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/icons/tsconfig.json b/packages/icons/tsconfig.jsonindex 05b1877afe..627342b2e8 100644--- a/packages/icons/tsconfig.json+++ b/packages/icons/tsconfig.json@@ -9,14 +9,7 @@"target": "ES2020","strict": true,"baseUrl": ".",- "paths": { "~/*": ["./src/*"] },"outDir": "./lib","rootDir": "./src"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../css-vars"- }- ]+ }}diff --git a/packages/image/package.json b/packages/image/package.jsonindex 9bcb0f9f5d..57443c3417 100644--- a/packages/image/package.json+++ b/packages/image/package.json@@ -11,7 +11,7 @@"checks": "yarn typecheck && yarn lint && yarn test","dev": "tsup --watch","build:args": "generate-arg-types './src/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.tsx' && prettier --write \"**/*.props.json\"",- "build": "rm -fr lib tsconfig.tsbuildinfo && yarn build:cjs && tsc",+ "build": "rm -fr lib && yarn build:cjs && tsc","build:cjs": "tsc --module commonjs --outDir lib/cjs && find lib/cjs -name '*.js' | while read NAME; do mv $NAME ${NAME%.js}.cjs; done","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","storybook:run": "start-storybook -p 6006",@@ -43,10 +43,10 @@"import": "./lib/index.js","require": "./lib/cjs/index.cjs"},- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/image/tsconfig.json b/packages/image/tsconfig.jsonindex 31fcdc1455..d42c045702 100644--- a/packages/image/tsconfig.json+++ b/packages/image/tsconfig.json@@ -9,11 +9,5 @@"baseUrl": ".","rootDir": "./src","outDir": "./lib"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../generate-arg-types"- }- ]+ }}diff --git a/packages/prisma-client/package.json b/packages/prisma-client/package.jsonindex eaea200a55..724a095b7e 100644--- a/packages/prisma-client/package.json+++ b/packages/prisma-client/package.json@@ -10,7 +10,7 @@"lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","checks": "yarn typecheck && yarn lint","dev": "yarn concurrently 'prisma generate --watch' 'tsup --watch'",- "build": "prisma format && prisma generate && rm -fr lib tsconfig.tsbuildinfo && tsc",+ "build": "prisma format && prisma generate && rm -fr lib && tsc","publish-to-npm": "bash ../../bin/publish-to-npm.sh"},"bin": {@@ -25,7 +25,7 @@"zod": "^3.19.1"},"exports": "./lib/index.js",- "types": "lib/index.d.ts",+ "types": "src/index.ts","license": "MIT","private": false,"dependencies": {diff --git a/packages/project/package.json b/packages/project/package.jsonindex de93580069..6b1a04191b 100644--- a/packages/project/package.json+++ b/packages/project/package.json@@ -11,7 +11,7 @@"checks": "yarn typecheck && yarn lint && yarn test","dev": "tsup --watch","build:cjs": "tsc --module commonjs --outDir lib/cjs && find lib/cjs -name '*.js' | while read NAME; do mv $NAME ${NAME%.js}.cjs; done",- "build": "rm -fr lib tsconfig.tsbuildinfo && tsc && yarn build:cjs",+ "build": "rm -fr lib && tsc && yarn build:cjs","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","publish-to-npm": "bash ../../bin/publish-to-npm.sh"},@@ -41,10 +41,10 @@},"./server": "./server.js"},- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/project/server.d.ts b/packages/project/server.d.tsindex a6fbe7c12c..ad6dde9958 100644--- a/packages/project/server.d.ts+++ b/packages/project/server.d.ts@@ -1 +1 @@-export * from "./lib/index.server";+export * from "./src/index.server";diff --git a/packages/project/tsconfig.json b/packages/project/tsconfig.jsonindex d930d000e6..d2bd726a48 100644--- a/packages/project/tsconfig.json+++ b/packages/project/tsconfig.json@@ -1,7 +1,7 @@{// Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091"extends": "../../node_modules/@webstudio-is/tsconfig/base.json",- "include": ["src"],+ "include": ["src", "../../@types/**/*.d.ts"],"compilerOptions": {"module": "ES2020","target": "ES2020",@@ -9,31 +9,5 @@"baseUrl": ".","outDir": "./lib","rootDir": "./src"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../asset-uploader"- },-- {- "path": "../css-data"- },-- {- "path": "../css-engine"- },-- {- "path": "../fonts"- },-- {- "path": "../prisma-client"- },-- {- "path": "../react-sdk"- }- ]+ }}diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.jsonindex 581d73f7b6..26fd98a67d 100644--- a/packages/react-sdk/package.json+++ b/packages/react-sdk/package.json@@ -11,7 +11,7 @@"build:args": "generate-arg-types './src/components/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.tsx' && prettier --write \"**/*.props.json\"","typecheck": "tsc --noEmit","build:cjs": "tsc --module commonjs --outDir lib/cjs && find lib/cjs -name '*.js' | while read NAME; do mv $NAME ${NAME%.js}.cjs; done",- "build:lib": "rm -fr lib tsconfig.tsbuildinfo && tsc && yarn build:cjs",+ "build:lib": "rm -fr lib && tsc && yarn build:cjs","test": "NODE_OPTIONS=--experimental-vm-modules jest","lint": "eslint ./src --ext .ts,.tsx --max-warnings 0","checks": "yarn typecheck && yarn lint && yarn test",@@ -72,10 +72,10 @@"import": "./lib/index.js","require": "./lib/cjs/index.cjs"},- "types": "lib/index.d.ts",+ "types": "src/index.ts","files": ["lib/*",- "README.md",+ "src/*","!*.test.*"],"license": "MIT",diff --git a/packages/react-sdk/src/app/custom-components/index.ts b/packages/react-sdk/src/app/custom-components/index.tsindex fb0f7e190c..1bba09b7f2 100644--- a/packages/react-sdk/src/app/custom-components/index.ts+++ b/packages/react-sdk/src/app/custom-components/index.ts@@ -1,6 +1,6 @@import { Image } from "./image";import { imageProps } from "@webstudio-is/image";-import type { MetaProps } from "~/components/component-type";+import type { MetaProps } from "../../components/component-type";export const customComponents = {Image,diff --git a/packages/react-sdk/tsconfig.json b/packages/react-sdk/tsconfig.jsonindex 47c6c0fb2a..9bd7a95bfc 100644--- a/packages/react-sdk/tsconfig.json+++ b/packages/react-sdk/tsconfig.json@@ -1,7 +1,11 @@{// Extends can't use node's resolution rn https://github.com/dividab/tsconfig-paths/issues/209#issuecomment-1177261091"extends": "../../node_modules/@webstudio-is/tsconfig/base.json",- "include": ["./src", "./src/**/__generated__/*.json", "./@types/**/*.d.ts"],+ "include": [+ "./src",+ "./src/**/__generated__/*.json",+ "../../@types/**/*.d.ts"+ ],"compilerOptions": {"lib": ["DOM", "DOM.Iterable", "ES2020"],"module": "ES2020",@@ -9,34 +13,7 @@"target": "ES2020","strict": true,"baseUrl": ".",- "paths": { "~/*": ["./src/*"] },"outDir": "./lib","rootDir": "./src"- },- // this is auto-generated by update-ts-project-references.ts- "references": [- {- "path": "../asset-uploader"- },-- {- "path": "../css-data"- },-- {- "path": "../generate-arg-types"- },-- {- "path": "../icons"- },-- {- "path": "../image"- },-- {- "path": "../prisma-client"- }- ]+ }}diff --git a/packages/tsconfig/base.json b/packages/tsconfig/base.jsonindex 9d7171ceab..b0adf0bc43 100644--- a/packages/tsconfig/base.json+++ b/packages/tsconfig/base.json@@ -2,9 +2,6 @@"$schema": "https://json.schemastore.org/tsconfig","display": "Default","compilerOptions": {- "composite": true,- "declaration": true,- "declarationMap": true,"esModuleInterop": true,"forceConsistentCasingInFileNames": true,"inlineSources": false,@@ -18,6 +15,5 @@"allowJs": false,"jsx": "react-jsx","resolveJsonModule": true- },- "exclude": ["node_modules"]+ }}diff --git a/tsconfig.json b/tsconfig.jsondeleted file mode 100644index 927e224b54..0000000000--- a/tsconfig.json+++ /dev/null@@ -1,32 +0,0 @@-{- "files": [],- // this is auto-generated by update-ts-project-references.ts- "references": [- { "path": "apps/designer" },- { "path": "packages/asset-uploader" },- { "path": "packages/css-data" },- { "path": "packages/css-engine" },- { "path": "packages/css-vars" },- { "path": "packages/design-system" },- { "path": "packages/fonts" },- { "path": "packages/generate-arg-types" },- { "path": "packages/http-client" },- { "path": "packages/icons" },-- {- "path": "packages/image"- },-- {- "path": "packages/prisma-client"- },-- {- "path": "packages/project"- },-- {- "path": "packages/react-sdk"- }- ]-}