diff --git a/.prettierignore b/.prettierignore index 0de1479724..b502bb8065 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,17 +5,16 @@ __snapshots__ .* packages/fiddle/build/** .yarn -e2e/**/output/** +e2e/**/output/src/** e2e/e2e-app-vue3-output/vue3/src/** e2e/e2e-angular/angular_src/app/lib/** e2e/e2e-qwik/server/** e2e/e2e-app-qwik-output/src/e2e-app/** e2e/e2e-app-qwik-output/lib/** -packages/e2e-*/** **/test-results/ **/playwright-report/ **/playwright/.cache/ -**/tsconfig.json +# **/tsconfig.json examples/**/output/**/* diff --git a/.vscode/settings.json b/.vscode/settings.json index 497a8b5ff8..aa645897e8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,5 @@ }, "typescript.format.enable": true, "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/.yarn/versions/2e8dddaa.yml b/.yarn/versions/2e8dddaa.yml new file mode 100644 index 0000000000..8a48931abe --- /dev/null +++ b/.yarn/versions/2e8dddaa.yml @@ -0,0 +1,3 @@ +undecided: + - "@builder.io/mitosis-repo" + - "@builder.io/mitosis" diff --git a/.yarn/versions/3cb89724.yml b/.yarn/versions/3cb89724.yml new file mode 100644 index 0000000000..8a48931abe --- /dev/null +++ b/.yarn/versions/3cb89724.yml @@ -0,0 +1,3 @@ +undecided: + - "@builder.io/mitosis-repo" + - "@builder.io/mitosis" diff --git a/e2e/e2e-alpine/src/main.ts b/e2e/e2e-alpine/src/main.ts index 44012bfbcf..5d148b5074 100644 --- a/e2e/e2e-alpine/src/main.ts +++ b/e2e/e2e-alpine/src/main.ts @@ -1,11 +1,11 @@ -import Alpine from 'alpinejs' +import Alpine from 'alpinejs'; // import myComponent from '@builder.io/e2e-app/alpine/components/my-component.html?raw' - -window.Alpine = Alpine - + +window.Alpine = Alpine; + // Alpine.data('myComponent', myComponent) // console.log(myComponent) // document.getElementById('app').innerHTML = myComponent; -Alpine.start() \ No newline at end of file +Alpine.start(); diff --git a/e2e/e2e-alpine/vite.config.ts b/e2e/e2e-alpine/vite.config.ts index 48d13eec9e..2aa1a17889 100644 --- a/e2e/e2e-alpine/vite.config.ts +++ b/e2e/e2e-alpine/vite.config.ts @@ -2,13 +2,23 @@ import { resolve } from 'path'; import { defineConfig } from 'vite'; import handlebars from 'vite-plugin-handlebars'; -const dir = resolve(__dirname, 'node_modules', '@builder.io', 'e2e-app', 'output', 'alpine', 'alpine', 'src', 'components'); +const dir = resolve( + __dirname, + 'node_modules', + '@builder.io', + 'e2e-app', + 'output', + 'alpine', + 'alpine', + 'src', + 'components', +); // https://vitejs.dev/config/ export default defineConfig({ plugins: [ handlebars({ partialDirectory: dir, - }) - ] + }), + ], }); diff --git a/e2e/e2e-angular/angular_src/app/mitosis.module.ts b/e2e/e2e-angular/angular_src/app/mitosis.module.ts index 32414b9951..c05960806f 100644 --- a/e2e/e2e-angular/angular_src/app/mitosis.module.ts +++ b/e2e/e2e-angular/angular_src/app/mitosis.module.ts @@ -2,8 +2,8 @@ // components we are using from Mitosis output. Ideally this would be generated // by Mitosis, and/or Angular 14 "standalone components" would be generated. -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { components } from './mitosis-component-list'; diff --git a/e2e/e2e-angular/package.json b/e2e/e2e-angular/package.json index 7c52b257ba..78f94b4560 100644 --- a/e2e/e2e-angular/package.json +++ b/e2e/e2e-angular/package.json @@ -32,6 +32,6 @@ "fast-glob": "^3.2.11", "rimraf": "^3.0.2", "sync-directory": "^5.1.5", - "typescript": "^4.8.4" + "typescript": "^5.3.2" } } diff --git a/e2e/e2e-app/e2e.ts b/e2e/e2e-app/e2e.ts index 5837f2af58..429d9763e8 100644 --- a/e2e/e2e-app/e2e.ts +++ b/e2e/e2e-app/e2e.ts @@ -1,8 +1,8 @@ // Mitosis E2E orchestration script +import { spawn } from 'child_process'; import { readFile, writeFile } from 'fs/promises'; import { resolve } from 'path'; -import { spawn } from 'child_process'; import syncDirectory from 'sync-directory'; import { emitTable, Entry } from './e2e-output'; diff --git a/e2e/e2e-app/output/qwik/package.json b/e2e/e2e-app/output/qwik/package.json index c3a5a9e92b..98d9a3dfca 100644 --- a/e2e/e2e-app/output/qwik/package.json +++ b/e2e/e2e-app/output/qwik/package.json @@ -29,7 +29,7 @@ "@builder.io/e2e-app": "workspace:*", "@builder.io/qwik": "^1.1.4", "@types/node": "latest", - "typescript": "^4", + "typescript": "^5.3.2", "vite": "^3.2.2" } } diff --git a/e2e/e2e-app/output/qwik/project.json b/e2e/e2e-app/output/qwik/project.json index 5152b8618b..b335e2c752 100644 --- a/e2e/e2e-app/output/qwik/project.json +++ b/e2e/e2e-app/output/qwik/project.json @@ -1,6 +1,4 @@ { "name": "@builder.io/e2e-app-qwik", - "implicitDependencies": [ - "@builder.io/e2e-app" - ] + "implicitDependencies": ["@builder.io/e2e-app"] } diff --git a/e2e/e2e-app/output/qwik/tsconfig.json b/e2e/e2e-app/output/qwik/tsconfig.json index d0a7666422..453db9fe5b 100644 --- a/e2e/e2e-app/output/qwik/tsconfig.json +++ b/e2e/e2e-app/output/qwik/tsconfig.json @@ -20,9 +20,5 @@ "skipLibCheck": true /* Skip type checking all .d.ts files. */, "emitDeclarationOnly": true }, - "include": [ - "types.d.ts", - "types-hack.d.ts", - "src" - ], -} \ No newline at end of file + "include": ["types.d.ts", "types-hack.d.ts", "src"] +} diff --git a/e2e/e2e-app/output/qwik/vite.config.ts b/e2e/e2e-app/output/qwik/vite.config.ts index e0e8376cd1..4f22b3eb1e 100644 --- a/e2e/e2e-app/output/qwik/vite.config.ts +++ b/e2e/e2e-app/output/qwik/vite.config.ts @@ -1,6 +1,6 @@ -import { defineConfig } from 'vite'; import { qwikVite } from '@builder.io/qwik/optimizer'; import { resolve } from 'path'; +import { defineConfig } from 'vite'; export default defineConfig(() => { return { diff --git a/e2e/e2e-app/output/vue/packages/_vue2/package.json b/e2e/e2e-app/output/vue/packages/_vue2/package.json index 144b138ec7..f5b7257dac 100644 --- a/e2e/e2e-app/output/vue/packages/_vue2/package.json +++ b/e2e/e2e-app/output/vue/packages/_vue2/package.json @@ -14,7 +14,7 @@ "@vitejs/plugin-vue2": "^1.1.2", "@vue/tsconfig": "^0.1.3", "terser": "^5.14.2", - "typescript": "^4", + "typescript": "^5.3.2", "vite": "^3.2.2", "vite-plugin-dts": "^1.5.0", "vue-tsc": "^0.38.8" diff --git a/e2e/e2e-app/output/vue/packages/_vue2/tsconfig.config.json b/e2e/e2e-app/output/vue/packages/_vue2/tsconfig.config.json index c2d3a309ef..02be539489 100644 --- a/e2e/e2e-app/output/vue/packages/_vue2/tsconfig.config.json +++ b/e2e/e2e-app/output/vue/packages/_vue2/tsconfig.config.json @@ -3,6 +3,7 @@ "include": ["vite.config.*", "vitest.config.*", "cypress.config.*"], "compilerOptions": { "composite": true, - "types": ["node"] + "types": ["node"], + "noImplicitAny": false } } diff --git a/e2e/e2e-app/output/vue/packages/_vue2/tsconfig.json b/e2e/e2e-app/output/vue/packages/_vue2/tsconfig.json index 8d2359999e..aa4715d30d 100644 --- a/e2e/e2e-app/output/vue/packages/_vue2/tsconfig.json +++ b/e2e/e2e-app/output/vue/packages/_vue2/tsconfig.json @@ -3,6 +3,7 @@ "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], "compilerOptions": { "baseUrl": ".", + "noImplicitAny": false, "paths": { "@/*": ["./src/*"] } diff --git a/e2e/e2e-app/output/vue/packages/_vue2/vite.config.ts b/e2e/e2e-app/output/vue/packages/_vue2/vite.config.ts index f417f3aed6..2f7a09122f 100644 --- a/e2e/e2e-app/output/vue/packages/_vue2/vite.config.ts +++ b/e2e/e2e-app/output/vue/packages/_vue2/vite.config.ts @@ -1,14 +1,11 @@ +import vue from '@vitejs/plugin-vue2'; import { resolve } from 'path'; import { defineConfig } from 'vite'; -import vue from '@vitejs/plugin-vue2'; import dts from 'vite-plugin-dts'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [ - vue(), - dts({ insertTypesEntry: true }), - ], + plugins: [vue(), dts({ insertTypesEntry: true })], build: { lib: { entry: resolve(__dirname, 'src/index.ts'), diff --git a/e2e/e2e-app/output/vue/packages/_vue3/package.json b/e2e/e2e-app/output/vue/packages/_vue3/package.json index 0aee1b2029..91d1199104 100644 --- a/e2e/e2e-app/output/vue/packages/_vue3/package.json +++ b/e2e/e2e-app/output/vue/packages/_vue3/package.json @@ -13,7 +13,7 @@ "@types/node": "^16.11.47", "@vitejs/plugin-vue": "^3.0.1", "@vue/tsconfig": "^0.1.3", - "typescript": "^4", + "typescript": "^5.3.2", "vite": "^3.2.2", "vite-plugin-dts": "^1.5.0", "vue-tsc": "^0.39.5" diff --git a/e2e/e2e-app/output/vue/packages/_vue3/project.json b/e2e/e2e-app/output/vue/packages/_vue3/project.json index 8c30f49971..78e34a0414 100644 --- a/e2e/e2e-app/output/vue/packages/_vue3/project.json +++ b/e2e/e2e-app/output/vue/packages/_vue3/project.json @@ -1,6 +1,4 @@ { "name": "@e2e-app/vue-3", - "implicitDependencies": [ - "@builder.io/e2e-app" - ] + "implicitDependencies": ["@builder.io/e2e-app"] } diff --git a/e2e/e2e-app/output/vue/packages/_vue3/tsconfig.config.json b/e2e/e2e-app/output/vue/packages/_vue3/tsconfig.config.json index c2d3a309ef..62614f8efc 100644 --- a/e2e/e2e-app/output/vue/packages/_vue3/tsconfig.config.json +++ b/e2e/e2e-app/output/vue/packages/_vue3/tsconfig.config.json @@ -3,6 +3,7 @@ "include": ["vite.config.*", "vitest.config.*", "cypress.config.*"], "compilerOptions": { "composite": true, + "noImplicitAny": false, "types": ["node"] } } diff --git a/e2e/e2e-app/output/vue/packages/_vue3/tsconfig.json b/e2e/e2e-app/output/vue/packages/_vue3/tsconfig.json index 8d2359999e..e12a5acde8 100644 --- a/e2e/e2e-app/output/vue/packages/_vue3/tsconfig.json +++ b/e2e/e2e-app/output/vue/packages/_vue3/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@vue/tsconfig/tsconfig.web.json", "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], "compilerOptions": { + "noImplicitAny": false, "baseUrl": ".", "paths": { "@/*": ["./src/*"] diff --git a/e2e/e2e-app/output/vue/packages/_vue3/vite.config.ts b/e2e/e2e-app/output/vue/packages/_vue3/vite.config.ts index e8c361862a..e237936f91 100644 --- a/e2e/e2e-app/output/vue/packages/_vue3/vite.config.ts +++ b/e2e/e2e-app/output/vue/packages/_vue3/vite.config.ts @@ -1,6 +1,6 @@ +import vue from '@vitejs/plugin-vue'; import { resolve } from 'path'; import { defineConfig } from 'vite'; -import vue from '@vitejs/plugin-vue'; import dts from 'vite-plugin-dts'; // https://vitejs.dev/config/ diff --git a/e2e/e2e-app/output/vue/project.json b/e2e/e2e-app/output/vue/project.json index 4c84f2089e..8e02435b7a 100644 --- a/e2e/e2e-app/output/vue/project.json +++ b/e2e/e2e-app/output/vue/project.json @@ -1,7 +1,4 @@ { "name": "@e2e-app/vue", - "implicitDependencies": [ - "@e2e-app/vue-2", - "@e2e-app/vue-3" - ] + "implicitDependencies": ["@e2e-app/vue-2", "@e2e-app/vue-3"] } diff --git a/e2e/e2e-app/package.json b/e2e/e2e-app/package.json index 5ee0616924..7175aaeb74 100644 --- a/e2e/e2e-app/package.json +++ b/e2e/e2e-app/package.json @@ -26,7 +26,7 @@ "solid-styled-components": "^0.28.4", "sync-directory": "^5.1.7", "ts-node": "^10.9.1", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vue": "~2.6" }, "peerDependencies": { diff --git a/e2e/e2e-app/results.json b/e2e/e2e-app/results.json index ca0267e011..5c40b826f8 100644 --- a/e2e/e2e-app/results.json +++ b/e2e/e2e-app/results.json @@ -18,17 +18,12 @@ "name": "chromium", "testDir": "/Users/kcordes/projects/Qwik/mitosis/e2e/e2e-app/tests", "testIgnore": [], - "testMatch": [ - "**/?(*.)@(spec|test).*" - ], + "testMatch": ["**/?(*.)@(spec|test).*"], "timeout": 20000 } ], "reporter": [ - [ - "list", - null - ], + ["list", null], [ "html", { @@ -367,4 +362,4 @@ } ], "errors": [] -} \ No newline at end of file +} diff --git a/e2e/e2e-app/src/show-for-component/components/MyComponent.lite.tsx b/e2e/e2e-app/src/show-for-component/components/MyComponent.lite.tsx index d7c12a2b71..0a4b4d81d0 100644 --- a/e2e/e2e-app/src/show-for-component/components/MyComponent.lite.tsx +++ b/e2e/e2e-app/src/show-for-component/components/MyComponent.lite.tsx @@ -1,24 +1,19 @@ -import { useStore, Show, For } from "@builder.io/mitosis"; +import { For, Show, useStore } from '@builder.io/mitosis'; export default function MyComponent() { const state = useStore({ - numbers : [1,2,3], - vowels : ['a', 'e', 'i', 'o', 'u'] - }) + numbers: [1, 2, 3], + vowels: ['a', 'e', 'i', 'o', 'u'], + }); return (
- - {(vowel) =>

vowel :{vowel}

} - - } + {(vowel) =>

vowel :{vowel}

}} > - - {(number) =>

number :{number}

} -
+ {(number) =>

number :{number}

}
); -} \ No newline at end of file +} diff --git a/e2e/e2e-app/src/show-for-component/index.ts b/e2e/e2e-app/src/show-for-component/index.ts index 47b9301e1e..f445e0fded 100644 --- a/e2e/e2e-app/src/show-for-component/index.ts +++ b/e2e/e2e-app/src/show-for-component/index.ts @@ -1 +1 @@ -export {default} from './components/MyComponent.lite'; \ No newline at end of file +export { default } from './components/MyComponent.lite'; diff --git a/e2e/e2e-app/src/two-components/components/my-component.lite.tsx b/e2e/e2e-app/src/two-components/components/my-component.lite.tsx index 5e60e4066e..08d1236458 100644 --- a/e2e/e2e-app/src/two-components/components/my-component.lite.tsx +++ b/e2e/e2e-app/src/two-components/components/my-component.lite.tsx @@ -1,4 +1,4 @@ -import { useStore, useMetadata } from '@builder.io/mitosis'; +import { useMetadata, useStore } from '@builder.io/mitosis'; import ItemList from './item-list.lite'; diff --git a/e2e/e2e-app/tsconfig.json b/e2e/e2e-app/tsconfig.json index 9ec5bc5aec..4fa9815e35 100644 --- a/e2e/e2e-app/tsconfig.json +++ b/e2e/e2e-app/tsconfig.json @@ -12,9 +12,5 @@ "declaration": true, "allowJs": true }, - "include": [ - "src", - "tests", - "./playwright.config.ts" - ] -} \ No newline at end of file + "include": ["src", "tests", "./playwright.config.ts"] +} diff --git a/e2e/e2e-qwikcity/package.json b/e2e/e2e-qwikcity/package.json index 77e9972e19..8f45a4de50 100644 --- a/e2e/e2e-qwikcity/package.json +++ b/e2e/e2e-qwikcity/package.json @@ -25,13 +25,13 @@ "@types/eslint": "8.21.1", "@types/node": "^18.14.0", "@types/node-fetch": "latest", - "@typescript-eslint/eslint-plugin": "5.54.0", - "@typescript-eslint/parser": "5.54.0", + "@typescript-eslint/eslint-plugin": "^6.13.1", + "@typescript-eslint/parser": "^6.13.1", "eslint": "8.35.0", "eslint-plugin-qwik": "0.21.0", "node-fetch": "3.3.0", "prettier": "2.8.4", - "typescript": "4.9.5", + "typescript": "^5.3.2", "undici": "5.20.0", "vite": "4.1.4", "vite-tsconfig-paths": "3.5.0" diff --git a/e2e/e2e-qwikcity/src/entry.preview.tsx b/e2e/e2e-qwikcity/src/entry.preview.tsx index 4c0628defd..a4f8f99e3e 100644 --- a/e2e/e2e-qwikcity/src/entry.preview.tsx +++ b/e2e/e2e-qwikcity/src/entry.preview.tsx @@ -11,8 +11,8 @@ * */ import { createQwikCity } from '@builder.io/qwik-city/middleware/node'; -import render from './entry.ssr'; import qwikCityPlan from '@qwik-city-plan'; +import render from './entry.ssr'; /** * The default export is the QwikCity adapter used by Vite preview. diff --git a/e2e/e2e-qwikcity/src/routes/[...index]/index.tsx b/e2e/e2e-qwikcity/src/routes/[...index]/index.tsx index 6c0b71d5fb..3d8753cdce 100644 --- a/e2e/e2e-qwikcity/src/routes/[...index]/index.tsx +++ b/e2e/e2e-qwikcity/src/routes/[...index]/index.tsx @@ -1,6 +1,6 @@ +import { E2eApp } from '@builder.io/e2e-app-qwik'; import { component$ } from '@builder.io/qwik'; import { useLocation } from '@builder.io/qwik-city'; -import { E2eApp } from '@builder.io/e2e-app-qwik'; export interface MainProps { url: string; diff --git a/e2e/e2e-qwikcity/vite.config.ts b/e2e/e2e-qwikcity/vite.config.ts index f072aa7a35..2cce3c07c0 100644 --- a/e2e/e2e-qwikcity/vite.config.ts +++ b/e2e/e2e-qwikcity/vite.config.ts @@ -1,6 +1,6 @@ -import { defineConfig } from 'vite'; -import { qwikVite } from '@builder.io/qwik/optimizer'; import { qwikCity } from '@builder.io/qwik-city/vite'; +import { qwikVite } from '@builder.io/qwik/optimizer'; +import { defineConfig } from 'vite'; import tsconfigPaths from 'vite-tsconfig-paths'; export default defineConfig(() => { diff --git a/e2e/e2e-react/package.json b/e2e/e2e-react/package.json index aed7037ef9..f504eb8343 100644 --- a/e2e/e2e-react/package.json +++ b/e2e/e2e-react/package.json @@ -17,7 +17,7 @@ "@types/react-dom": "^18.0.5", "@vitejs/plugin-react": "^1.3.0", "rimraf": "^3.0.2", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vite": "^3.2.2" } } diff --git a/e2e/e2e-react/vite.config.ts b/e2e/e2e-react/vite.config.ts index 627a319624..4e7004ebc6 100644 --- a/e2e/e2e-react/vite.config.ts +++ b/e2e/e2e-react/vite.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; +import { defineConfig } from 'vite'; // https://vitejs.dev/config/ export default defineConfig({ diff --git a/e2e/e2e-solid/package.json b/e2e/e2e-solid/package.json index b8f88d8ecd..1b64908ec2 100644 --- a/e2e/e2e-solid/package.json +++ b/e2e/e2e-solid/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "rimraf": "^3.0.2", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vite": "^3.2.2", "vite-plugin-solid": "^2.2.6" } diff --git a/e2e/e2e-svelte/package.json b/e2e/e2e-svelte/package.json index 9bd0aa169c..f8b985d8c9 100644 --- a/e2e/e2e-svelte/package.json +++ b/e2e/e2e-svelte/package.json @@ -19,7 +19,7 @@ "svelte-check": "^2.8.0", "svelte-preprocess": "^5.0.3", "tslib": "^2.4.0", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vite": "^3.2.2" } } diff --git a/e2e/e2e-svelte/tsconfig.json b/e2e/e2e-svelte/tsconfig.json index 2d9cb09e91..96bfd81aaf 100644 --- a/e2e/e2e-svelte/tsconfig.json +++ b/e2e/e2e-svelte/tsconfig.json @@ -16,11 +16,6 @@ "checkJs": true, "isolatedModules": true }, - "include": [ - "src/**/*.d.ts", - "src/**/*.ts", - "src/**/*.js", - "src/**/*.svelte" - ], + "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/e2e/e2e-svelte/vite.config.ts b/e2e/e2e-svelte/vite.config.ts index e3a889ffcf..60f9a138dc 100644 --- a/e2e/e2e-svelte/vite.config.ts +++ b/e2e/e2e-svelte/vite.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from 'vite'; import { svelte } from '@sveltejs/vite-plugin-svelte'; +import { defineConfig } from 'vite'; // https://vitejs.dev/config/ export default defineConfig({ diff --git a/e2e/e2e-vue2/package.json b/e2e/e2e-vue2/package.json index 05b8813686..0e4011794b 100644 --- a/e2e/e2e-vue2/package.json +++ b/e2e/e2e-vue2/package.json @@ -15,7 +15,7 @@ }, "devDependencies": { "@vitejs/plugin-vue2": "^1.1.2", - "typescript": "^4", + "typescript": "^5.3.2", "unplugin-vue-components": "^0.22.7", "vite": "^3.2.2", "vue-template-compiler": "^2.7.8" diff --git a/e2e/e2e-vue2/tsconfig.json b/e2e/e2e-vue2/tsconfig.json index 4200f791ce..2f115ae215 100644 --- a/e2e/e2e-vue2/tsconfig.json +++ b/e2e/e2e-vue2/tsconfig.json @@ -18,11 +18,6 @@ }, "lib": ["esnext", "dom", "dom.iterable", "scripthost"] }, - "include": [ - "src/**/*.ts", - "src/**/*.d.ts", - "src/**/*.tsx", - "src/**/*.vue" - ], + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], "exclude": ["node_modules", "**/*.lite.tsx"] } diff --git a/e2e/e2e-vue2/vite.config.ts b/e2e/e2e-vue2/vite.config.ts index 9a7360864b..6a000e9960 100644 --- a/e2e/e2e-vue2/vite.config.ts +++ b/e2e/e2e-vue2/vite.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue2'; +import { defineConfig } from 'vite'; const config = defineConfig({ plugins: [vue()], diff --git a/e2e/e2e-vue3/package.json b/e2e/e2e-vue3/package.json index 2cf106817d..050d762122 100644 --- a/e2e/e2e-vue3/package.json +++ b/e2e/e2e-vue3/package.json @@ -13,8 +13,8 @@ "devDependencies": { "@vitejs/plugin-vue": "^2.3.3", "@vue/devtools": "^6.5.0", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vite": "^3.2.2", - "vue-tsc": "^0.38.2" + "vue-tsc": "^1.8.22" } } diff --git a/e2e/e2e-vue3/vite.config.ts b/e2e/e2e-vue3/vite.config.ts index 0adf2b498a..ef50c8d167 100644 --- a/e2e/e2e-vue3/vite.config.ts +++ b/e2e/e2e-vue3/vite.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; +import { defineConfig } from 'vite'; export default defineConfig({ plugins: [vue()], diff --git a/examples/basic/package.json b/examples/basic/package.json index 1b237d07e1..465559e1c8 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -14,11 +14,11 @@ "devDependencies": { "@builder.io/eslint-plugin-mitosis": "workspace:*", "@types/node-fetch": "^2.5.12", - "@typescript-eslint/eslint-plugin": "^5.27.1", - "@typescript-eslint/parser": "^5.27.1", + "@typescript-eslint/eslint-plugin": "^6.13.1", + "@typescript-eslint/parser": "^6.13.1", "eslint": "^8.17.0", "prettier": "^2.5.0", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "watch": "^1.0.2" } } diff --git a/examples/talk/apps/output/svelte/package.json b/examples/talk/apps/output/svelte/package.json index 27f003f3c4..5290889039 100644 --- a/examples/talk/apps/output/svelte/package.json +++ b/examples/talk/apps/output/svelte/package.json @@ -34,7 +34,7 @@ "svelte-check": "^2.7.1", "svelte-preprocess": "^5.0.3", "tslib": "^2.3.1", - "typescript": "^4", + "typescript": "^5.3.2", "vite": "^3.2.2" } } diff --git a/examples/talk/react-server/package.json b/examples/talk/react-server/package.json index c259b6b604..705c91d38a 100644 --- a/examples/talk/react-server/package.json +++ b/examples/talk/react-server/package.json @@ -17,7 +17,7 @@ "@types/react-dom": "^18.0.5", "@vitejs/plugin-react": "^1.3.0", "rimraf": "^3.0.2", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vite": "^3.2.2" } } diff --git a/examples/talk/svelte-server/package.json b/examples/talk/svelte-server/package.json index 2d036c8f55..fb8ef08515 100644 --- a/examples/talk/svelte-server/package.json +++ b/examples/talk/svelte-server/package.json @@ -19,7 +19,7 @@ "svelte-check": "^2.8.0", "svelte-preprocess": "^5.0.3", "tslib": "^2.4.0", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vite": "^3.2.2" } } diff --git a/package.json b/package.json index 29f6fde0b2..ba33ecf5e4 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "lint:eslint": "eslint --cache 'packages/**/*.ts{,x}'", "lint:prettier": "yarn run prettier --check", "prerelease": "yarn build", - "prettier": "prettier --cache --loglevel warn '{packages,docs}/**/*.{js,jsx,ts,tsx,json,md,html}'", + "prettier": "prettier --cache --loglevel warn '{packages,docs,e2e}/**/*.{js,jsx,ts,tsx,json,md,html}'", "release:dev": "cd packages/core && yarn run release:dev && cd ../cli && yarn run release:dev && cd ../eslint-plugin && yarn run release:dev", "release:patch": "cd packages/core && yarn run release:patch && cd ../cli && yarn run release:patch && cd ../eslint-plugin && yarn run release:patch" }, @@ -44,8 +44,8 @@ "devDependencies": { "@babel/preset-env": "^7.6.0", "@nrwl/nx-cloud": "15.0.2", - "@typescript-eslint/eslint-plugin": "^5.27.1", - "@typescript-eslint/parser": "^5.27.1", + "@typescript-eslint/eslint-plugin": "^6.13.1", + "@typescript-eslint/parser": "^6.13.1", "commitizen": "^3.0.2", "esbuild": "0.14.25", "esbuild-register": "3.3.2", @@ -57,7 +57,7 @@ "nx": "15.4.5", "prettier": "^2.3.2", "prettier-plugin-organize-imports": "^3.2.2", - "typescript": "^4.8.4" + "typescript": "^5.3.2" }, "packageManager": "yarn@3.2.0", "dependencies": { diff --git a/packages/cli/package.json b/packages/cli/package.json index 4b01db7748..4d26401ef1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@builder.io/mitosis-cli", - "version": "0.0.93", + "version": "0.0.95", "description": "mitosis CLI", "types": "build/types/types.d.ts", "bin": { @@ -60,7 +60,7 @@ "concurrently": "^8.2.2", "ts-node": "^8.4.1", "tsc-alias": "^1.8.8", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vite": "^3.2.2", "vitest": "^0.34.6" } diff --git a/packages/cli/src/build/build.ts b/packages/cli/src/build/build.ts index 620c897ec7..e8e379413c 100644 --- a/packages/cli/src/build/build.ts +++ b/packages/cli/src/build/build.ts @@ -28,6 +28,7 @@ import { MitosisComponent, MitosisConfig, parseJsx, + ParseMitosisOptions, parseSvelte, removeMitosisImport, renameComponentFile, @@ -36,12 +37,11 @@ import { } from '@builder.io/mitosis'; import debug from 'debug'; import { flow, pipe } from 'fp-ts/lib/function'; -import { outputFile, pathExists, readFile, remove } from 'fs-extra'; +import { outputFile, pathExists, pathExistsSync, readFile, remove } from 'fs-extra'; import { kebabCase } from 'lodash'; import { fastClone } from '../helpers/fast-clone'; import { generateContextFile } from './helpers/context'; import { getFiles } from './helpers/files'; -import { checkIsDefined } from './helpers/nullable'; import { getOverrideFile } from './helpers/overrides'; import { transformImports, transpile, transpileIfNecessary } from './helpers/transpile'; @@ -62,16 +62,17 @@ const getTargetPath = ({ target }: { target: Target }): string => { } }; -const DEFAULT_CONFIG: Partial = { +const DEFAULT_CONFIG = { targets: [], dest: 'output', files: 'src/*', overridesDir: 'overrides', getTargetPath, -}; + options: {}, +} satisfies Partial; const getOptions = (config?: MitosisConfig): MitosisConfig => { - const newConfig = { + const newConfig: MitosisConfig = { ...DEFAULT_CONFIG, ...config, options: { @@ -80,11 +81,19 @@ const getOptions = (config?: MitosisConfig): MitosisConfig => { }, }; - if (checkIsDefined(newConfig.commonOptions?.typescript)) { - for (const target of newConfig.targets) { - if (!checkIsDefined(newConfig.options[target]?.typescript)) { - newConfig.options[target].typescript = newConfig.commonOptions.typescript; - } + /** + * Apply common options to all targets + */ + if (newConfig.commonOptions) { + for (const target of newConfig.targets || []) { + newConfig.options[target] = { + ...newConfig.commonOptions, + ...newConfig.options[target], + plugins: [ + ...(newConfig.commonOptions?.plugins || []), + ...(newConfig.options[target]?.plugins || []), + ], + } as any; } } @@ -103,7 +112,7 @@ async function clean(options: MitosisConfig, target: Target) { ? getNonComponentOutputFileName({ target, path, options }) : undefined, ) - .filter(Boolean); + .filter((x): x is string => Boolean(x)); await Promise.all( oldFiles.map(async (oldFile) => { @@ -161,16 +170,17 @@ const parseJsxComponent = async ({ options: MitosisConfig; path: string; file: string; - tsProject: Parameters[1]['tsProject']; + tsProject: ParseMitosisOptions['tsProject']; }) => { const requiredParses = getRequiredParsers(options); let typescriptMitosisJson: ParsedMitosisJson['typescriptMitosisJson']; let javascriptMitosisJson: ParsedMitosisJson['javascriptMitosisJson']; - const jsxArgs: Parameters[1] = { + const jsxArgs: ParseMitosisOptions = { ...options.parserOptions?.jsx, tsProject, filePath: path, + typescript: false, }; if (requiredParses.typescript && requiredParses.javascript) { typescriptMitosisJson = options.parser @@ -212,13 +222,13 @@ const parseSvelteComponent = async ({ path, file }: { path: string; file: string const findTsConfigFile = (options: MitosisConfig) => { const optionPath = options.parserOptions?.jsx?.tsConfigFilePath; - if (optionPath && pathExists(optionPath)) { + if (optionPath && pathExistsSync(optionPath)) { return optionPath; } const defaultPath = [cwd, 'tsconfig.json'].join('/'); - if (pathExists(defaultPath)) { + if (pathExistsSync(defaultPath)) { return defaultPath; } @@ -253,7 +263,7 @@ const getMitosisComponentJSONs = async (options: MitosisConfig): Promise; + generator: TranspilerGenerator[Target]>; outputPath: string; } @@ -265,7 +275,7 @@ const getTargetContexts = (options: MitosisConfig) => options.targets.map( (target): TargetContext => ({ target, - generator: getGeneratorForTarget({ target }), + generator: getGeneratorForTarget({ target }) as any, outputPath: options.getTargetPath({ target }), }), ); @@ -306,7 +316,7 @@ export async function build(config?: MitosisConfig) { console.info('Mitosis: generation completed.'); } -const getGeneratorForTarget = ({ target }: { target: Target }): TargetContext['generator'] => { +const getGeneratorForTarget = ({ target }: { target: Target }) => { switch (target) { case 'alpine': return componentToAlpine; @@ -457,7 +467,7 @@ async function buildContextFile({ options, path, }: TargetContextWithConfig & { path: string }) { - let output = await generateContextFile({ path, options, target }); + let output = (await generateContextFile({ path, options, target })) || ''; // transpile to JS if necessary if (!checkShouldOutputTypeScript({ target, options })) { diff --git a/packages/cli/src/build/helpers/context.ts b/packages/cli/src/build/helpers/context.ts index dc15c8f672..4645203175 100644 --- a/packages/cli/src/build/helpers/context.ts +++ b/packages/cli/src/build/helpers/context.ts @@ -29,11 +29,11 @@ export const generateContextFile = async ({ } else { switch (target) { case 'svelte': - return contextToSvelte(options.options.svelte)({ context }); + return contextToSvelte(options.options.svelte || {})({ context }); case 'vue': case 'vue2': case 'vue3': - return contextToVue(options.options[target])({ context }); + return contextToVue(options.options[target] || {})({ context }); case 'solid': return contextToSolid()({ context }); case 'preact': diff --git a/packages/cli/src/build/helpers/files.ts b/packages/cli/src/build/helpers/files.ts index 744b9586f2..26c80486e8 100644 --- a/packages/cli/src/build/helpers/files.ts +++ b/packages/cli/src/build/helpers/files.ts @@ -8,8 +8,8 @@ export const getFiles = ({ files, exclude, }: { - files: string | string[]; + files: string | string[] | undefined; exclude: string[] | undefined; }): string[] => { - return glob.sync(files, { ignore: exclude, onlyFiles: true, cwd: process.cwd() }); + return files ? glob.sync(files, { ignore: exclude, onlyFiles: true, cwd: process.cwd() }) : []; }; diff --git a/packages/cli/src/build/helpers/transpile.ts b/packages/cli/src/build/helpers/transpile.ts index ca23e23fe1..f3a37eea1d 100644 --- a/packages/cli/src/build/helpers/transpile.ts +++ b/packages/cli/src/build/helpers/transpile.ts @@ -24,7 +24,11 @@ export const transformImports = code = code.replace(/\.context\.lite(.js|.ts)?(['"])/g, `.context.js$2`); // afterwards, we replace all component imports with the correct file extension - return renameImport({ importPath: code, target: target }); + return renameImport({ + importPath: code, + target: target, + explicitImportFileExtension: options.options?.[target]?.explicitImportFileExtension || false, + }); }; /** diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index dc2b4e573b..9cef6c8c38 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -6,7 +6,8 @@ "sourceMap": false, "inlineSourceMap": true, "outDir": "dist", - "strict": false, + "strict": true, + "noImplicitAny": false, "target": "es5", "declaration": true, "declarationDir": "dist/types", diff --git a/packages/core/package.json b/packages/core/package.json index 3a4ce24269..2d6d196d17 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -22,7 +22,7 @@ "name": "Builder.io", "url": "https://www.builder.io" }, - "version": "0.0.134", + "version": "0.0.136", "homepage": "https://github.com/BuilderIO/mitosis", "main": "./dist/src/index.js", "exports": { @@ -82,7 +82,7 @@ "svelte-preprocess": "^5.0.3", "traverse": "^0.6.6", "ts-morph": "^19.0.0", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "vue": "~2.6" }, "devDependencies": { @@ -114,7 +114,7 @@ "sugarss": "^4.0.1", "ts-node": "^9.1.1", "tsc-alias": "^1.8.8", - "typescript": "^4.8.4", + "typescript": "^5.3.2", "universalify": "^2.0.0", "vite": "^4.5.0", "vite-tsconfig-paths": "^3.5.0", diff --git a/packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap b/packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap index 9b638b37c0..e0a9d3bb58 100644 --- a/packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap @@ -167,7 +167,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; @Component({ selector: \\"my-basic-component, MyBasicComponent\\", @@ -4440,7 +4440,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; @Component({ selector: \\"my-basic-component, MyBasicComponent\\", @@ -5347,7 +5347,7 @@ export interface FormProps { } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/angular.mapper.test.ts.snap b/packages/core/src/__tests__/__snapshots__/angular.mapper.test.ts.snap index 82a198f194..9b45fd388a 100644 --- a/packages/core/src/__tests__/__snapshots__/angular.mapper.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/angular.mapper.test.ts.snap @@ -170,7 +170,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; @Component({ selector: \\"my-basic-component, MyBasicComponent\\", @@ -4541,7 +4541,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; @Component({ selector: \\"my-basic-component, MyBasicComponent\\", @@ -5465,7 +5465,7 @@ export interface FormProps { } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponentModule, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/angular.test.ts.snap b/packages/core/src/__tests__/__snapshots__/angular.test.ts.snap index 7b3eae63d5..94d0878829 100644 --- a/packages/core/src/__tests__/__snapshots__/angular.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/angular.test.ts.snap @@ -307,7 +307,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; @Component({ selector: \\"my-basic-component, MyBasicComponent\\", @@ -351,7 +351,7 @@ exports[`Angular > jsx > Javascript Test > Basic Context 2`] = ` "import { Component } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; @Component({ selector: \\"my-basic-component, MyBasicComponent\\", @@ -8148,7 +8148,7 @@ import { CommonModule } from \\"@angular/common\\"; import { Component } from \\"@angular/core\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; @Component({ selector: \\"my-basic-component, MyBasicComponent\\", @@ -8192,7 +8192,7 @@ exports[`Angular > jsx > Typescript Test > Basic Context 2`] = ` "import { Component } from \\"@angular/core\\"; import { CommonModule } from \\"@angular/common\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; @Component({ selector: \\"my-basic-component, MyBasicComponent\\", @@ -9815,7 +9815,7 @@ export interface FormProps { } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, @@ -10176,7 +10176,7 @@ export interface FormProps { } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/lit.test.ts.snap b/packages/core/src/__tests__/__snapshots__/lit.test.ts.snap index 92aeabd5d8..3140f0226a 100644 --- a/packages/core/src/__tests__/__snapshots__/lit.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/lit.test.ts.snap @@ -145,7 +145,7 @@ export default class MyBasicForShowComponent extends LitElement { `; exports[`Lit > jsx > Javascript Test > Basic Context 1`] = ` -"import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +"import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; import { LitElement, html, css } from \\"lit\\"; import { customElement, property, state, query } from \\"lit/decorators.js\\"; @@ -4289,7 +4289,7 @@ export default class MyBasicForShowComponent extends LitElement { `; exports[`Lit > jsx > Typescript Test > Basic Context 1`] = ` -"import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +"import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; import { LitElement, html, css } from \\"lit\\"; import { customElement, property, state, query } from \\"lit/decorators.js\\"; @@ -5145,7 +5145,7 @@ export default class CustomCode extends LitElement { `; exports[`Lit > jsx > Typescript Test > Form 1`] = ` -"import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +"import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/marko.test.ts.snap b/packages/core/src/__tests__/__snapshots__/marko.test.ts.snap index 54eb26c427..bdf74033d7 100644 --- a/packages/core/src/__tests__/__snapshots__/marko.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/marko.test.ts.snap @@ -168,7 +168,7 @@ exports[`Marko > jsx > Javascript Test > Basic 2`] = ` `; exports[`Marko > jsx > Javascript Test > Basic Context 1`] = ` -"import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +"import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; class { onChange = function onChange() { @@ -2536,7 +2536,7 @@ exports[`Marko > jsx > Typescript Test > Basic 2`] = ` `; exports[`Marko > jsx > Typescript Test > Basic Context 1`] = ` -"import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +"import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; class { onChange = function onChange() { @@ -3023,7 +3023,7 @@ exports[`Marko > jsx > Typescript Test > Embed 1`] = ` `; exports[`Marko > jsx > Typescript Test > Form 1`] = ` -"import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +"import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/preact.test.ts.snap b/packages/core/src/__tests__/__snapshots__/preact.test.ts.snap index 8bd72aaa23..5dcf30ff6e 100644 --- a/packages/core/src/__tests__/__snapshots__/preact.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/preact.test.ts.snap @@ -110,7 +110,7 @@ exports[`Preact > jsx > Javascript Test > Basic Context 1`] = ` "/** @jsx h */ import { h, Fragment } from \\"preact\\"; import { useState, useContext, useEffect } from \\"preact/hooks\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props) { const [name, setName] = useState(() => \\"PatrickJS\\"); @@ -3426,7 +3426,7 @@ exports[`Preact > jsx > Typescript Test > Basic Context 1`] = ` "/** @jsx h */ import { h, Fragment } from \\"preact\\"; import { useState, useContext, useEffect } from \\"preact/hooks\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props: any) { const [name, setName] = useState(() => \\"PatrickJS\\"); @@ -4178,7 +4178,7 @@ export interface FormProps { errorMessagePath?: string; } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/react-native.test.ts.snap b/packages/core/src/__tests__/__snapshots__/react-native.test.ts.snap index 04da7fb547..921230750b 100644 --- a/packages/core/src/__tests__/__snapshots__/react-native.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/react-native.test.ts.snap @@ -125,7 +125,7 @@ import { Text, } from \\"react-native\\"; import { useState, useContext, useEffect } from \\"react\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props) { const [name, setName] = useState(() => \\"PatrickJS\\"); @@ -4003,7 +4003,7 @@ import { Text, } from \\"react-native\\"; import { useState, useContext, useEffect } from \\"react\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props: any) { const [name, setName] = useState(() => \\"PatrickJS\\"); @@ -4845,7 +4845,7 @@ export interface FormProps { errorMessagePath?: string; } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/react.test.ts.snap b/packages/core/src/__tests__/__snapshots__/react.test.ts.snap index 6d86b4b2a9..b5cb3227e2 100644 --- a/packages/core/src/__tests__/__snapshots__/react.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/react.test.ts.snap @@ -110,7 +110,7 @@ exports[`React > jsx > Javascript Test > Basic Context 1`] = ` "\\"use client\\"; import * as React from \\"react\\"; import { useState, useContext, useEffect } from \\"react\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props) { const [name, setName] = useState(() => \\"PatrickJS\\"); @@ -3380,7 +3380,7 @@ exports[`React > jsx > Typescript Test > Basic Context 1`] = ` "\\"use client\\"; import * as React from \\"react\\"; import { useState, useContext, useEffect } from \\"react\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props: any) { const [name, setName] = useState(() => \\"PatrickJS\\"); @@ -4127,7 +4127,7 @@ export interface FormProps { errorMessagePath?: string; } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/rsc.test.ts.snap b/packages/core/src/__tests__/__snapshots__/rsc.test.ts.snap index 5c4b7d299e..2c95aa1fae 100644 --- a/packages/core/src/__tests__/__snapshots__/rsc.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/rsc.test.ts.snap @@ -110,7 +110,7 @@ exports[`RSC > jsx > Javascript Test > Basic Context 1`] = ` "\\"use client\\"; import * as React from \\"react\\"; import { useState, useContext, useEffect } from \\"react\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props) { const [name, setName] = useState(() => \\"PatrickJS\\"); @@ -3118,7 +3118,7 @@ exports[`RSC > jsx > Typescript Test > Basic Context 1`] = ` "\\"use client\\"; import * as React from \\"react\\"; import { useState, useContext, useEffect } from \\"react\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props: any) { const [name, setName] = useState(() => \\"PatrickJS\\"); @@ -3862,7 +3862,7 @@ export interface FormProps { errorMessagePath?: string; } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/solid.test.ts.snap b/packages/core/src/__tests__/__snapshots__/solid.test.ts.snap index f189fe0a1d..cc09103256 100644 --- a/packages/core/src/__tests__/__snapshots__/solid.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/solid.test.ts.snap @@ -283,7 +283,7 @@ export default MyBasicForShowComponent; exports[`Solid > jsx > Javascript Test > Basic Context 1`] = ` "import { useContext, onMount, createSignal } from \\"solid-js\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props) { const [name, setName] = createSignal(\\"PatrickJS\\"); @@ -320,7 +320,7 @@ exports[`Solid > jsx > Javascript Test > Basic Context 2`] = ` import { css } from \\"solid-styled-components\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props) { const [name, setName] = createSignal(\\"PatrickJS\\"); @@ -6804,7 +6804,7 @@ export default MyBasicForShowComponent; exports[`Solid > jsx > Typescript Test > Basic Context 1`] = ` "import { useContext, onMount, createSignal } from \\"solid-js\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props: any) { const [name, setName] = createSignal(\\"PatrickJS\\"); @@ -6841,7 +6841,7 @@ exports[`Solid > jsx > Typescript Test > Basic Context 2`] = ` import { css } from \\"solid-styled-components\\"; -import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; function MyBasicComponent(props: any) { const [name, setName] = createSignal(\\"PatrickJS\\"); @@ -8242,7 +8242,7 @@ export interface FormProps { } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, @@ -8576,7 +8576,7 @@ export interface FormProps { } export type FormState = \\"unsubmitted\\" | \\"sending\\" | \\"success\\" | \\"error\\"; -import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/stencil.test.ts.snap b/packages/core/src/__tests__/__snapshots__/stencil.test.ts.snap index fc8e6ae8bb..2222ba7768 100644 --- a/packages/core/src/__tests__/__snapshots__/stencil.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/stencil.test.ts.snap @@ -102,7 +102,7 @@ export default class MyBasicComponent { `; exports[`Stencil > jsx > Javascript Test > Basic Context 1`] = ` -"import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +"import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; import { Component, Prop, h, State, Fragment } from \\"@stencil/core\\"; @@ -3145,7 +3145,7 @@ export default class MyBasicComponent { `; exports[`Stencil > jsx > Typescript Test > Basic Context 1`] = ` -"import { createInjector, Injector, MyService } from \\"@dummy/injection-js\\"; +"import { Injector, MyService, createInjector } from \\"@dummy/injection-js\\"; import { Component, Prop, h, State, Fragment } from \\"@stencil/core\\"; @@ -3798,7 +3798,7 @@ export default class CustomCode { `; exports[`Stencil > jsx > Typescript Test > Form 1`] = ` -"import { Builder, builder, BuilderElement } from \\"@builder.io/sdk\\"; +"import { Builder, BuilderElement, builder } from \\"@builder.io/sdk\\"; import { BuilderBlock as BuilderBlockComponent, BuilderBlocks, diff --git a/packages/core/src/__tests__/__snapshots__/svelte.test.ts.snap b/packages/core/src/__tests__/__snapshots__/svelte.test.ts.snap index 274619a8bb..36a6dcc965 100644 --- a/packages/core/src/__tests__/__snapshots__/svelte.test.ts.snap +++ b/packages/core/src/__tests__/__snapshots__/svelte.test.ts.snap @@ -113,7 +113,7 @@ exports[`Svelte > jsx > Javascript Test > Basic Context 1`] = ` "