eddev 2.0.0-beta.1 → 2.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/app/entry/boot-admin.d.ts +1 -0
  2. package/dist/app/entry/{main.admin.js → boot-admin.js} +3 -5
  3. package/dist/app/entry/spa-root.d.ts +1 -0
  4. package/dist/app/entry/{Root.js → spa-root.js} +4 -4
  5. package/dist/app/entry/ssr-root-client.d.ts +4 -0
  6. package/dist/app/entry/ssr-root-client.js +9 -0
  7. package/dist/app/entry/ssr-root.d.ts +9 -0
  8. package/dist/app/entry/ssr-root.js +21 -0
  9. package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +1 -1
  10. package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +1 -1
  11. package/dist/app/lib/devtools/components/BreakpointIndicator.js +5 -3
  12. package/dist/app/lib/devtools/dev-tools-store.d.ts +9 -0
  13. package/dist/app/lib/devtools/dev-tools-store.js +8 -0
  14. package/dist/app/lib/devtools/hooks/useTailwind.d.ts +120 -121
  15. package/dist/app/lib/devtools/hooks/useTailwind.js +6 -3
  16. package/dist/app/lib/devtools/index.d.ts +1 -0
  17. package/dist/app/lib/devtools/index.js +1 -1
  18. package/dist/app/lib/hooks/queryUtils.d.ts +4 -1
  19. package/dist/app/lib/hooks/queryUtils.js +8 -11
  20. package/dist/app/lib/internal/internal-store.d.ts +0 -2
  21. package/dist/app/lib/internal/internal-store.js +1 -3
  22. package/dist/app/lib/routing/components/ClientOnly.d.ts +1 -1
  23. package/dist/app/lib/routing/loader.js +6 -4
  24. package/dist/app/server/index.d.ts +3 -0
  25. package/dist/app/server/index.js +3 -0
  26. package/dist/app/server/proxy-wp-admin.d.ts +3 -0
  27. package/dist/app/server/proxy-wp-admin.js +106 -0
  28. package/dist/app/server/render-ssr-page.d.ts +2 -0
  29. package/dist/app/server/render-ssr-page.js +22 -0
  30. package/dist/app/server/server-context.d.ts +34 -0
  31. package/dist/app/server/server-context.js +116 -0
  32. package/dist/app/server/utils/headers.d.ts +1 -0
  33. package/dist/app/server/utils/headers.js +17 -0
  34. package/dist/app/server/utils/replace-host.d.ts +6 -4
  35. package/dist/app/server/utils/replace-host.js +58 -11
  36. package/dist/node/cli/cli-worker.d.ts +1 -1
  37. package/dist/node/cli/cli-worker.js +3 -0
  38. package/dist/node/cli/cli.js +45 -14
  39. package/dist/node/cli/display/CLIApp.d.ts +1 -1
  40. package/dist/node/cli/display/CLIApp.js +1 -1
  41. package/dist/node/cli/display/components/LogEntries.d.ts +1 -1
  42. package/dist/node/cli/display/hooks/useStatefulLog.d.ts +1 -1
  43. package/dist/node/cli/display/util/colors.d.ts +2 -2
  44. package/dist/node/cli/version.d.ts +1 -1
  45. package/dist/node/cli/version.js +1 -1
  46. package/dist/node/compiler/build-vinxi.d.ts +8 -0
  47. package/dist/node/compiler/build-vinxi.js +37 -0
  48. package/dist/node/compiler/bundler.admin.d.ts +1 -1
  49. package/dist/node/compiler/bundler.admin.js +3 -3
  50. package/dist/node/compiler/bundler.frontend.d.ts +1 -1
  51. package/dist/node/compiler/bundler.frontend.js +3 -3
  52. package/dist/node/compiler/{serverless.dev.d.ts → dev-server.d.ts} +7 -5
  53. package/dist/node/compiler/dev-server.js +97 -0
  54. package/dist/node/compiler/get-vite-config.d.ts +19 -0
  55. package/dist/node/compiler/get-vite-config.js +184 -0
  56. package/dist/node/compiler/vinxi-app.d.ts +10 -0
  57. package/dist/node/compiler/vinxi-app.js +121 -0
  58. package/dist/node/compiler/vinxi-codegen.d.ts +12 -0
  59. package/dist/node/compiler/vinxi-codegen.js +408 -0
  60. package/dist/node/graphql/graphql-codegen.d.ts +1 -1
  61. package/dist/node/graphql/graphql-codegen.js +3 -3
  62. package/dist/node/graphql/graphql-schema-loader.js +15 -18
  63. package/dist/node/project/config.js +1 -1
  64. package/dist/node/project/env.d.ts +1 -1
  65. package/dist/node/project/env.js +1 -1
  66. package/dist/node/project/manifest/block-manifest.js +2 -2
  67. package/dist/node/project/manifest/manifest.d.ts +1 -1
  68. package/dist/node/project/manifest/manifest.js +1 -1
  69. package/dist/node/project/manifest/view-manifest.js +2 -2
  70. package/dist/node/project/project.d.ts +2 -1
  71. package/dist/node/project/project.js +13 -15
  72. package/dist/node/project/wp-info.js +0 -2
  73. package/dist/node/types/view-type.js +3 -4
  74. package/dist/node/utils/fs-codegen.d.ts +40 -0
  75. package/dist/node/utils/fs-codegen.js +97 -0
  76. package/dist/node/utils/fs.js +2 -0
  77. package/dist/node/utils/{selfSignedCert.js → self-signed-cert.js} +1 -1
  78. package/dist/node/utils/{statefulLog.js → stateful-log.js} +1 -1
  79. package/package.json +29 -31
  80. package/dist/app/entry/Root.d.ts +0 -1
  81. package/dist/app/entry/main.admin.d.ts +0 -3
  82. package/dist/app/entry/main.frontend.spa.d.ts +0 -3
  83. package/dist/app/entry/main.frontend.spa.js +0 -13
  84. package/dist/app/entry/main.frontend.ssr.d.ts +0 -21
  85. package/dist/app/entry/main.frontend.ssr.js +0 -79
  86. package/dist/app/entry/main.serverless.dev.d.ts +0 -4
  87. package/dist/app/entry/main.serverless.dev.js +0 -21
  88. package/dist/app/server/create-api-builtin-hono.d.ts +0 -8
  89. package/dist/app/server/create-api-builtin-hono.js +0 -80
  90. package/dist/app/server/create-ssr-hono.d.ts +0 -18
  91. package/dist/app/server/create-ssr-hono.js +0 -104
  92. package/dist/app/server/utils/index.html.d.ts +0 -2
  93. package/dist/app/server/utils/index.html.js +0 -14
  94. package/dist/node/compiler/index.html.d.ts +0 -2
  95. package/dist/node/compiler/index.html.js +0 -15
  96. package/dist/node/compiler/serverless.dev.js +0 -215
  97. package/dist/node/compiler/vite/get-vite-config.d.ts +0 -13
  98. package/dist/node/compiler/vite/get-vite-config.js +0 -315
  99. package/dist/node/compiler/vite/plugin-admin.d.ts +0 -4
  100. package/dist/node/compiler/vite/plugin-admin.js +0 -67
  101. package/dist/node/compiler/vite/plugin-blocks.d.ts +0 -4
  102. package/dist/node/compiler/vite/plugin-blocks.js +0 -73
  103. package/dist/node/compiler/vite/plugin-entry.d.ts +0 -6
  104. package/dist/node/compiler/vite/plugin-entry.js +0 -16
  105. package/dist/node/compiler/vite/plugin-resolved-tailwind.d.ts +0 -4
  106. package/dist/node/compiler/vite/plugin-resolved-tailwind.js +0 -29
  107. package/dist/node/compiler/vite/plugin-theme.d.ts +0 -4
  108. package/dist/node/compiler/vite/plugin-theme.js +0 -40
  109. package/dist/node/compiler/vite/plugin-views.d.ts +0 -4
  110. package/dist/node/compiler/vite/plugin-views.js +0 -51
  111. package/dist/node/utils/console.d.ts +0 -21
  112. package/dist/node/utils/console.js +0 -28
  113. package/dist/node/utils/unsafe-fetch.d.ts +0 -2
  114. package/dist/node/utils/unsafe-fetch.js +0 -19
  115. package/tsup.config.ts +0 -40
  116. package/types.manifests.d.ts +0 -22
  117. /package/dist/node/utils/{formatZodError.d.ts → format-zod-error.d.ts} +0 -0
  118. /package/dist/node/utils/{formatZodError.js → format-zod-error.js} +0 -0
  119. /package/dist/node/utils/{getRepoInfo.d.ts → get-repo-info.d.ts} +0 -0
  120. /package/dist/node/utils/{getRepoInfo.js → get-repo-info.js} +0 -0
  121. /package/dist/node/utils/{highlightCode.d.ts → highlight-code.d.ts} +0 -0
  122. /package/dist/node/utils/{highlightCode.js → highlight-code.js} +0 -0
  123. /package/dist/node/utils/{isDeploying.d.ts → is-deploying.d.ts} +0 -0
  124. /package/dist/node/utils/{isDeploying.js → is-deploying.js} +0 -0
  125. /package/dist/node/utils/{selfSignedCert.d.ts → self-signed-cert.d.ts} +0 -0
  126. /package/dist/node/utils/{statefulLog.d.ts → stateful-log.d.ts} +0 -0
  127. /package/dist/node/utils/{export-extractor.d.ts → ts-export-extractor.d.ts} +0 -0
  128. /package/dist/node/utils/{export-extractor.js → ts-export-extractor.js} +0 -0
  129. /package/dist/node/utils/{watchFileTree.d.ts → watch-file-tree.d.ts} +0 -0
  130. /package/dist/node/utils/{watchFileTree.js → watch-file-tree.js} +0 -0
@@ -1,73 +0,0 @@
1
- import { join } from "path";
2
- export function pluginBlocks(project, console, ssr) {
3
- const manifestId = "\0virtual:block-manifest.js";
4
- let server = null;
5
- const fakePath = join(project.rootDir, "__block-manifest.js");
6
- let lastHash = "";
7
- project.blocks.subscribeFuture(async (manifest) => {
8
- if (server) {
9
- const hash = Object.keys(manifest.blocks).join("");
10
- const virtualModule = server.moduleGraph.getModuleById(manifestId);
11
- if (virtualModule && hash !== lastHash && lastHash !== "") {
12
- server.moduleGraph.invalidateModule(virtualModule);
13
- }
14
- lastHash = hash;
15
- }
16
- });
17
- return {
18
- name: "eddev:blockManifest",
19
- enforce: "pre",
20
- resolveId(id) {
21
- if (id === fakePath) {
22
- return manifestId;
23
- }
24
- },
25
- async load(id) {
26
- if (id === manifestId) {
27
- const blockManifest = await project.blocks.get();
28
- return `
29
- import { blockManifestReader } from 'eddev/_internal'
30
- import { dynamic } from 'eddev/dynamic'
31
- import core from './blocks/_core'
32
-
33
- const manifest = {
34
- ${Object.entries(blockManifest.blocks)
35
- .filter(([name]) => !name.match(/^_[a-z]+$/i))
36
- .map(([name, block]) => {
37
- const importStatement = `dynamic(() => import(${JSON.stringify("./" + block.fileName)}))`;
38
- return JSON.stringify(block.acfName) + ": " + importStatement;
39
- })
40
- .join(",\n")},
41
- ...core
42
- }
43
-
44
- const info = {
45
- ${Object.entries(blockManifest.blocks)
46
- .filter(([name]) => !name.match(/^_[a-z]+$/i))
47
- .map(([name, block]) => {
48
- return (JSON.stringify(block.acfName) +
49
- ": " +
50
- JSON.stringify({
51
- slug: block.slug,
52
- tags: block.tags,
53
- flags: block.flags ?? {},
54
- }));
55
- })
56
- .join(",\n")}
57
- }
58
-
59
- blockManifestReader.set(manifest, info)
60
-
61
- export default manifest
62
-
63
- if (import.meta.hot) {
64
- import.meta.hot.accept()
65
- }
66
- `;
67
- }
68
- },
69
- configureServer(_server) {
70
- server = _server;
71
- },
72
- };
73
- }
@@ -1,6 +0,0 @@
1
- import { Plugin } from "vite";
2
- export declare function pluginEntryFile(args: {
3
- code: string;
4
- id: string;
5
- path: string;
6
- }): Plugin;
@@ -1,16 +0,0 @@
1
- export function pluginEntryFile(args) {
2
- const virtualId = "\0virtual:" + args.id;
3
- return {
4
- name: "eddev:entry:" + args.id,
5
- resolveId(id) {
6
- if (id === args.path) {
7
- return virtualId;
8
- }
9
- },
10
- load(id) {
11
- if (id === virtualId) {
12
- return args.code;
13
- }
14
- },
15
- };
16
- }
@@ -1,4 +0,0 @@
1
- import { Plugin } from "vite";
2
- import { Project } from "../../project/project.js";
3
- import { StatefulLog } from "../../utils/statefulLog.js";
4
- export declare function pluginResolvedTailwind(project: Project, console: StatefulLog<any>, ssr: boolean): Plugin;
@@ -1,29 +0,0 @@
1
- import { join } from "path";
2
- export function pluginResolvedTailwind(project, console, ssr) {
3
- const virtualId = "\0virtual:resolved-tailwind.js";
4
- const fakePath = join(project.rootDir, "__resolved-tailwind.js");
5
- return {
6
- name: "eddev:resolvedTailwind",
7
- resolveId(id) {
8
- if (id === fakePath) {
9
- return virtualId;
10
- }
11
- },
12
- async load(id) {
13
- if (id === virtualId) {
14
- return `
15
- import tw from "./tailwind.config"
16
- import resolveConfig from 'tailwindcss/resolveConfig'
17
- import { internalStore } from 'eddev/_internal'
18
-
19
- const value = resolveConfig(tw)
20
- internalStore.set('tailwindConfig', value)
21
-
22
- if (import.meta.hot) {
23
- import.meta.hot.accept()
24
- }
25
- `;
26
- }
27
- },
28
- };
29
- }
@@ -1,4 +0,0 @@
1
- import { Plugin } from "vite";
2
- import { Project } from "../../project/project.js";
3
- import { StatefulLog } from "../../utils/statefulLog.js";
4
- export declare function pluginThemeManifest(project: Project, console: StatefulLog<any>): Plugin;
@@ -1,40 +0,0 @@
1
- import { join } from "path";
2
- export function pluginThemeManifest(project, console) {
3
- const virtualId = "\0virtual:theme-manifest.js";
4
- const fakePath = join(project.rootDir, "__theme-manifest.js");
5
- const usingStitches = project.config?.legacyStitches;
6
- return {
7
- name: "eddev:themeManifest",
8
- resolveId(id) {
9
- if (id === fakePath) {
10
- return virtualId;
11
- }
12
- },
13
- async load(id) {
14
- if (id === virtualId) {
15
- if (usingStitches) {
16
- return `
17
- import * as theme from './theme.css'
18
- export const getCssText = () => {
19
- if (theme.getCssText) {
20
- return theme.getCssText()
21
- }
22
- return ''
23
- }
24
-
25
- export const editorGlobalStyles = () => {
26
- if (theme.editorGlobalStyles)
27
- return theme.editorGlobalStyles()
28
- }
29
- `;
30
- }
31
- else {
32
- return `
33
- export const getCssText = undefined
34
- export const editorGlobalStyles = () => {}
35
- `;
36
- }
37
- }
38
- },
39
- };
40
- }
@@ -1,4 +0,0 @@
1
- import { Plugin } from "vite";
2
- import { Project } from "../../project/project.js";
3
- import { StatefulLog } from "../../utils/statefulLog.js";
4
- export declare function pluginViews(project: Project, console: StatefulLog<any>, ssr: boolean): Plugin;
@@ -1,51 +0,0 @@
1
- import { join } from "path";
2
- export function pluginViews(project, console, ssr) {
3
- const virtualId = "\0virtual:view-manifest.js";
4
- let server = null;
5
- const fakePath = join(project.rootDir, "__view-manifest.js");
6
- let lastHash = "";
7
- project.views.subscribeFuture(async (manifest) => {
8
- if (server) {
9
- const hash = Object.keys(manifest.views).join("");
10
- const virtualModule = server.moduleGraph.getModuleById(virtualId);
11
- if (virtualModule && hash !== lastHash && lastHash !== "") {
12
- server.moduleGraph.invalidateModule(virtualModule);
13
- }
14
- lastHash = hash;
15
- }
16
- });
17
- return {
18
- name: "eddev:viewManifest",
19
- resolveId(id) {
20
- if (id === fakePath) {
21
- return virtualId;
22
- }
23
- },
24
- async load(id) {
25
- if (id === virtualId) {
26
- const viewManifest = await project.views.get();
27
- return `
28
- import { viewManifestReader } from 'eddev/_internal'
29
- import { dynamic } from 'eddev/dynamic'
30
- const manifest = {${Object.entries(viewManifest.views)
31
- .map(([name, view]) => {
32
- const importStatement = `dynamic(() => import(${JSON.stringify("./" + view.fileName)}))`;
33
- return JSON.stringify(view.slug) + ": " + importStatement;
34
- })
35
- .join(",\n")}}
36
-
37
- viewManifestReader.value = manifest
38
-
39
- export default manifest
40
-
41
- if (import.meta.hot) {
42
- import.meta.hot.accept()
43
- }
44
- `;
45
- }
46
- },
47
- configureServer(_server) {
48
- server = _server;
49
- },
50
- };
51
- }
@@ -1,21 +0,0 @@
1
- import { ConsolaInstance, LogLevel } from "consola";
2
- export declare const logger: ConsolaInstance;
3
- export declare const console: {
4
- setLevel: (level: LogLevel) => void;
5
- failish: (message: string) => void;
6
- heading: (message: string) => void;
7
- log: (message: any, ...args: any[]) => void;
8
- verbose: (message: any, ...args: any[]) => void;
9
- info: (message: any, ...args: any[]) => void;
10
- warn: (message: any, ...args: any[]) => void;
11
- error: (message: any, ...args: any[]) => void;
12
- fail: (message: any, ...args: any[]) => void;
13
- success: (message: any, ...args: any[]) => void;
14
- ready: (message: any, ...args: any[]) => void;
15
- silent: (message: any, ...args: any[]) => void;
16
- fatal: (message: any, ...args: any[]) => void;
17
- start: (message: any, ...args: any[]) => void;
18
- box: (message: any, ...args: any[]) => void;
19
- debug: (message: any, ...args: any[]) => void;
20
- trace: (message: any, ...args: any[]) => void;
21
- };
@@ -1,28 +0,0 @@
1
- import chalk from "chalk";
2
- import { createConsola } from "consola";
3
- import { box } from "consola/utils";
4
- export const logger = createConsola({
5
- formatOptions: {
6
- date: false,
7
- },
8
- });
9
- const funcs = logger;
10
- export const console = {
11
- ...funcs,
12
- setLevel: (level) => {
13
- logger.level = level;
14
- },
15
- failish: (message) => {
16
- console.log(chalk.hex("#FFA500")("⚠") + " " + message);
17
- },
18
- heading: (message) => {
19
- logger.log(box(" " + message + " ", {
20
- style: {
21
- borderColor: "magenta",
22
- padding: 0,
23
- marginLeft: 0,
24
- marginBottom: 0,
25
- },
26
- }));
27
- },
28
- };
@@ -1,2 +0,0 @@
1
- import fetch from "node-fetch";
2
- export declare function getUnsafeFetch(url: string): typeof fetch;
@@ -1,19 +0,0 @@
1
- import { Agent as HttpsAgent } from "https";
2
- import fetch from "node-fetch";
3
- export function getUnsafeFetch(url) {
4
- if (url.includes("https")) {
5
- const httpsAgent = new HttpsAgent({
6
- rejectUnauthorized: false,
7
- });
8
- const fetchImpl = (...args) => {
9
- return fetch(args[0], {
10
- ...(args[1] ?? {}),
11
- agent: httpsAgent,
12
- });
13
- };
14
- return fetchImpl;
15
- }
16
- else {
17
- return fetch;
18
- }
19
- }
package/tsup.config.ts DELETED
@@ -1,40 +0,0 @@
1
- import { defineConfig } from "tsup"
2
-
3
- const isProduction = process.env.NODE_ENV === "production"
4
-
5
- export default defineConfig({
6
- // clean: true,
7
- dts: true,
8
- entry: ["src/node/cli/cli.ts"],
9
- format: ["esm"],
10
- clean: true,
11
- bundle: true,
12
- tsconfig: "tsconfig.node.json",
13
- minify: isProduction,
14
- sourcemap: true,
15
- platform: "node",
16
- target: "node16",
17
- outDir: "dist",
18
- external: [
19
- "react",
20
- "react-dom",
21
- "react-devtools-core",
22
- "uglify-js",
23
- "@swc/core",
24
- "emitter",
25
- "pnpapi",
26
- "tty",
27
- "@pmmmwh/react-refresh-webpack-plugin",
28
- "ink",
29
- ],
30
- banner: {
31
- js: `
32
- import { fileURLToPath as _fileURLToPath } from 'url';
33
- import { dirname as _dirname } from 'path';
34
- import { createRequire as topLevelCreateRequire } from 'module';
35
- const require = topLevelCreateRequire(import.meta.url);
36
- const __filename = _fileURLToPath(import.meta.url);
37
- const __dirname = _dirname(__filename);
38
- `,
39
- },
40
- })
@@ -1,22 +0,0 @@
1
- declare module "@manifest/admin" {
2
- const editorConfig: any
3
- }
4
-
5
- declare module "@manifest/blocks" {}
6
-
7
- declare module "@manifest/views" {}
8
-
9
- declare module "@manifest/theme" {
10
- const editorGlobalStyles: (() => void) | undefined
11
- const getCssText: (() => string) | undefined
12
- export { editorGlobalStyles, getCssText }
13
- }
14
-
15
- declare module "@manifest/tailwind" {
16
- import { Config } from "tailwindcss"
17
- const config: {
18
- value: Config
19
- subscribe: (func: (conf: Config) => void) => () => void
20
- }
21
- export = config
22
- }