From 8dbf508bf8148cab657de423a00d132023042d48 Mon Sep 17 00:00:00 2001 From: Alex Kanunnikov Date: Sat, 13 Jan 2024 01:51:41 +0300 Subject: [PATCH] trying to run ember-eui trying to run ember-eui trying to run ember-eui + + + + + + word boundary replacement + + + + fix compiler, add helper/modifier/component helpers + better modifiers + + + + + EuiAccordion, EuiPanel + pretty plugin + + + + + + + + --- index.html | 3 + package.json | 13 +- plugins/babel.ts | 21 +- plugins/compiler.ts | 12 +- plugins/converter.ts | 122 +- plugins/decorator-transforms/globals.ts | 2 + plugins/decorator-transforms/index.ts | 286 ++ plugins/decorator-transforms/runtime.ts | 138 + plugins/symbols.ts | 4 + plugins/test.ts | 15 +- plugins/utils.ts | 13 +- pnpm-lock.yaml | 3245 ++++++++++++++++- src/components/pages/PageOne.gts | 130 + src/components/pages/Router.gts | 2 +- ...r-cli-string-helpers__helpers__classify.ts | 6 + ...r-composable-helpers__helpers__optional.ts | 7 + src/ember-compat/ember-modifier.ts | 13 + ...render-modifiers__modifiers__did-insert.ts | 14 + ...render-modifiers__modifiers__did-update.ts | 3 + ...nder-modifiers__modifiers__will-destroy.ts | 5 + .../ember-set-helper__helpers__set.ts | 5 + .../ember-style-modifier__modifiers__style.ts | 14 + .../ember-unique-id-helper-polyfill.ts | 3 + src/ember-compat/ember__application.ts | 3 + src/ember-compat/ember__array.ts | 3 + src/ember-compat/ember__component.ts | 18 + src/ember-compat/ember__component__helper.ts | 14 + .../ember__component__template-only.ts | 4 + src/ember-compat/ember__debug.ts | 5 + src/ember-compat/ember__destroyable.ts | 5 + src/ember-compat/ember__helper.ts | 10 + src/ember-compat/ember__modifier.ts | 12 + src/ember-compat/ember__object.ts | 15 + src/ember-compat/ember__object__internals.ts | 11 + src/ember-compat/ember__runloop.ts | 19 + src/ember-compat/ember__service.ts | 16 + .../ember__template-compilation.ts | 102 + src/ember-compat/ember__template.ts | 3 + src/ember-compat/ember__utils.ts | 9 + src/ember-compat/embroider__macros.ts | 14 + src/ember-compat/embroider__util.ts | 3 + src/ember-compat/glimmer__application.ts | 8 + src/ember-compat/glimmer__component.ts | 11 + src/ember-compat/glimmer__tracking.ts | 23 + src/ember-compat/svg-jar.ts | 3 + src/style.css | 9 + src/utils/component.ts | 15 + src/utils/dom-api.ts | 6 +- src/utils/dom.ts | 260 +- src/utils/if.ts | 2 +- src/utils/reactive.ts | 4 + tests.html | 3 + vite.config.mts | 199 +- 53 files changed, 4716 insertions(+), 169 deletions(-) create mode 100644 plugins/decorator-transforms/globals.ts create mode 100644 plugins/decorator-transforms/index.ts create mode 100644 plugins/decorator-transforms/runtime.ts create mode 100644 src/ember-compat/ember-cli-string-helpers__helpers__classify.ts create mode 100644 src/ember-compat/ember-composable-helpers__helpers__optional.ts create mode 100644 src/ember-compat/ember-modifier.ts create mode 100644 src/ember-compat/ember-render-modifiers__modifiers__did-insert.ts create mode 100644 src/ember-compat/ember-render-modifiers__modifiers__did-update.ts create mode 100644 src/ember-compat/ember-render-modifiers__modifiers__will-destroy.ts create mode 100644 src/ember-compat/ember-set-helper__helpers__set.ts create mode 100644 src/ember-compat/ember-style-modifier__modifiers__style.ts create mode 100644 src/ember-compat/ember-unique-id-helper-polyfill.ts create mode 100644 src/ember-compat/ember__application.ts create mode 100644 src/ember-compat/ember__array.ts create mode 100644 src/ember-compat/ember__component.ts create mode 100644 src/ember-compat/ember__component__helper.ts create mode 100644 src/ember-compat/ember__component__template-only.ts create mode 100644 src/ember-compat/ember__debug.ts create mode 100644 src/ember-compat/ember__destroyable.ts create mode 100644 src/ember-compat/ember__helper.ts create mode 100644 src/ember-compat/ember__modifier.ts create mode 100644 src/ember-compat/ember__object.ts create mode 100644 src/ember-compat/ember__object__internals.ts create mode 100644 src/ember-compat/ember__runloop.ts create mode 100644 src/ember-compat/ember__service.ts create mode 100644 src/ember-compat/ember__template-compilation.ts create mode 100644 src/ember-compat/ember__template.ts create mode 100644 src/ember-compat/ember__utils.ts create mode 100644 src/ember-compat/embroider__macros.ts create mode 100644 src/ember-compat/embroider__util.ts create mode 100644 src/ember-compat/glimmer__application.ts create mode 100644 src/ember-compat/glimmer__component.ts create mode 100644 src/ember-compat/glimmer__tracking.ts create mode 100644 src/ember-compat/svg-jar.ts diff --git a/index.html b/index.html index 48ba38fd..eb3d0984 100644 --- a/index.html +++ b/index.html @@ -14,6 +14,9 @@ +
diff --git a/vite.config.mts b/vite.config.mts index 539dd43b..f4428927 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -5,7 +5,9 @@ import { compiler } from "./plugins/compiler.ts"; // import circleDependency from "vite-plugin-circular-dependency"; import dts from "vite-plugin-dts"; import babel from "vite-plugin-babel"; -import { stripGXTDebug } from "./plugins/babel.ts"; +import { stripGXTDebug, processSource } from "./plugins/babel.ts"; +import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill"; +// import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill'; const isLibBuild = process.env["npm_lifecycle_script"]?.includes("--lib"); const withSourcemaps = @@ -88,6 +90,14 @@ export default defineConfig(({ mode }) => ({ "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*", ], }, + optimizeDeps: { + esbuildOptions: { + plugins: [ + // nodeModulesPolyfillPlugin(), + NodeGlobalsPolyfillPlugin({ buffer: true }), + ], + }, + }, build: { sourcemap: withSourcemaps ? "inline" : undefined, lib: isLibBuild @@ -170,6 +180,193 @@ export default defineConfig(({ mode }) => ({ "utils.ts", ), "@lifeart/gxt": path.join(currentPath, "src", "utils", "index.ts"), + "@glimmer/application": path.join( + currentPath, + "src", + "ember-compat", + "glimmer__application.ts", + ), + "ember-svg-jar/helpers/svg-jar": path.join( + currentPath, + "src", + "ember-compat", + "svg-jar.ts", + ), + "@ember/utils": path.join( + currentPath, + "src", + "ember-compat", + "ember__utils.ts", + ), + "@ember/component/helper": path.join( + currentPath, + "src", + "ember-compat", + "ember__component__helper.ts", + ), + "@ember/template": path.join( + currentPath, + "src", + "ember-compat", + "ember__template.ts", + ), + "@ember/debug": path.join( + currentPath, + "src", + "ember-compat", + "ember__debug.ts", + ), + "@ember/modifier": path.join( + currentPath, + "src", + "ember-compat", + "ember__modifier.ts", + ), + "@ember/service": path.join( + currentPath, + "src", + "ember-compat", + "ember__service.ts", + ), + "@ember/destroyable": path.join( + currentPath, + "src", + "ember-compat", + "ember__destroyable.ts", + ), + "@ember/array": path.join( + currentPath, + "src", + "ember-compat", + "ember__array.ts", + ), + "@ember/component/template-only": path.join( + currentPath, + "src", + "ember-compat", + "ember__component__template-only.ts", + ), + "@ember/template-compilation": path.join( + currentPath, + "src", + "ember-compat", + "ember__template-compilation.ts", + ), + "@ember/object/internals": path.join( + currentPath, + "src", + "ember-compat", + "ember__object__internals.ts", + ), + "@ember/application": path.join( + currentPath, + "src", + "ember-compat", + "ember__application.ts", + ), + "@ember/component": path.join( + currentPath, + "src", + "ember-compat", + "ember__component.ts", + ), + "@ember/helper": path.join( + currentPath, + "src", + "ember-compat", + "ember__helper.ts", + ), + "@embroider/macros": path.join( + currentPath, + "src", + "ember-compat", + "embroider__macros.ts", + ), + "@glimmer/component": path.join( + currentPath, + "src", + "ember-compat", + "glimmer__component.ts", + ), + "ember-modifier": path.join( + currentPath, + "src", + "ember-compat", + "ember-modifier.ts", + ), + "@ember/render-modifiers/modifiers/will-destroy": path.join( + currentPath, + "src", + "ember-compat", + "ember-render-modifiers__modifiers__will-destroy.ts", + ), + "@ember/render-modifiers/modifiers/did-insert": path.join( + currentPath, + "src", + "ember-compat", + "ember-render-modifiers__modifiers__did-insert.ts", + ), + "@ember/object": path.join( + currentPath, + "src", + "ember-compat", + "ember__object.ts", + ), + "@embroider/util": path.join( + currentPath, + "src", + "ember-compat", + "embroider__util.ts", + ), + "ember-style-modifier/modifiers/style": path.join( + currentPath, + "src", + "ember-compat", + "ember-style-modifier__modifiers__style.ts", + ), + "@ember/runloop": path.join( + currentPath, + "src", + "ember-compat", + "ember__runloop.ts", + ), + "ember-cli-string-helpers/helpers/classify": path.join( + currentPath, + "src", + "ember-compat", + "ember-cli-string-helpers__helpers__classify.ts", + ), + "@glimmer/tracking": path.join( + currentPath, + "src", + "ember-compat", + "glimmer__tracking.ts", + ), + "ember-set-helper/helpers/set": path.join( + currentPath, + "src", + "ember-compat", + "ember-set-helper__helpers__set.ts", + ), + "@ember/render-modifiers/modifiers/did-update": path.join( + currentPath, + "src", + "ember-compat", + "ember-render-modifiers__modifiers__did-update.ts", + ), + "ember-composable-helpers/helpers/optional": path.join( + currentPath, + "src", + "ember-compat", + "ember-composable-helpers__helpers__optional.ts", + ), + "ember-unique-id-helper-polyfill/helpers/unique-id": path.join( + currentPath, + "src", + "ember-compat", + "ember-unique-id-helper-polyfill.ts", + ), + "ember-composable-helpers": "ember-composable-helpers/addon", }, }, }));