eddev 2.0.0-beta.6 → 2.0.0-beta.60

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 (257) hide show
  1. package/dist/app/entry/MetaTags.d.ts +7 -0
  2. package/dist/app/entry/MetaTags.js +17 -0
  3. package/dist/app/entry/boot-admin.d.ts +1 -0
  4. package/dist/app/entry/boot-admin.js +14 -0
  5. package/dist/app/entry/spa-root.d.ts +1 -0
  6. package/dist/app/entry/spa-root.js +8 -0
  7. package/dist/app/entry/ssr-root-client.d.ts +6 -0
  8. package/dist/app/entry/ssr-root-client.js +26 -0
  9. package/dist/app/entry/ssr-root.d.ts +10 -0
  10. package/dist/app/entry/ssr-root.js +23 -0
  11. package/dist/app/lib/admin/index.d.ts +2 -2
  12. package/dist/app/lib/admin/index.js +2 -2
  13. package/dist/app/lib/admin/installFieldTypes.js +1 -1
  14. package/dist/app/lib/admin/runWidgets.js +1 -1
  15. package/dist/app/lib/blocks/ContentBlocks.d.ts +1 -1
  16. package/dist/app/lib/blocks/ContentBlocks.js +5 -5
  17. package/dist/app/lib/blocks/EditableText.d.ts +1 -1
  18. package/dist/app/lib/blocks/EditableText.js +3 -3
  19. package/dist/app/lib/blocks/InnerBlocks.d.ts +13 -3
  20. package/dist/app/lib/blocks/InnerBlocks.js +13 -5
  21. package/dist/app/lib/blocks/block-utils.d.ts +2 -2
  22. package/dist/app/lib/blocks/block-utils.js +2 -2
  23. package/dist/app/lib/blocks/editor/EditorSupport.js +4 -5
  24. package/dist/app/lib/blocks/editor/editor-config.d.ts +16 -3
  25. package/dist/app/lib/blocks/editor/editor-config.js +2 -4
  26. package/dist/app/lib/blocks/editor/installGutenbergHooks.js +17 -13
  27. package/dist/app/lib/blocks/editor/root-blocks.d.ts +6 -0
  28. package/dist/app/lib/blocks/editor/root-blocks.js +30 -0
  29. package/dist/app/lib/blocks/editor/usePostEditor.d.ts +1 -1
  30. package/dist/app/lib/blocks/index.d.ts +9 -9
  31. package/dist/app/lib/blocks/index.js +9 -9
  32. package/dist/app/lib/blocks/inline-editing.d.ts +1 -1
  33. package/dist/app/lib/blocks/inline-editing.js +7 -5
  34. package/dist/app/lib/devtools/components/BreakpointIndicator.js +6 -4
  35. package/dist/app/lib/devtools/components/DevUI.js +4 -3
  36. package/dist/app/lib/devtools/components/GridIndicator.d.ts +1 -0
  37. package/dist/app/lib/devtools/components/GridIndicator.js +24 -0
  38. package/dist/app/lib/devtools/dev-tools-store.d.ts +9 -0
  39. package/dist/app/lib/devtools/dev-tools-store.js +8 -0
  40. package/dist/app/lib/devtools/hooks/usePersistState.d.ts +1 -1
  41. package/dist/app/lib/devtools/hooks/usePersistState.js +11 -2
  42. package/dist/app/lib/devtools/hooks/useTailwind.d.ts +1094 -1095
  43. package/dist/app/lib/devtools/hooks/useTailwind.js +6 -3
  44. package/dist/app/lib/devtools/index.d.ts +1 -0
  45. package/dist/app/lib/devtools/index.js +1 -1
  46. package/dist/app/lib/devtools/loader.js +8 -7
  47. package/dist/app/lib/devtools/useQueryDebug.d.ts +7 -1
  48. package/dist/app/lib/devtools/useQueryDebug.js +5 -8
  49. package/dist/app/lib/dynamic/index.d.ts +1 -1
  50. package/dist/app/lib/dynamic/index.js +1 -1
  51. package/dist/app/lib/hooks/index.d.ts +4 -5
  52. package/dist/app/lib/hooks/index.js +4 -5
  53. package/dist/app/lib/hooks/queryUtils.d.ts +37 -3
  54. package/dist/app/lib/hooks/queryUtils.js +63 -26
  55. package/dist/app/lib/hooks/useAppData.js +1 -1
  56. package/dist/app/lib/hooks/useRPC.d.ts +0 -4
  57. package/dist/app/lib/hooks/useRPC.js +1 -8
  58. package/dist/app/lib/internal/finalize-rpc.d.ts +17 -0
  59. package/dist/app/lib/internal/finalize-rpc.js +3 -0
  60. package/dist/app/lib/internal/index.d.ts +5 -4
  61. package/dist/app/lib/internal/index.js +5 -4
  62. package/dist/app/lib/internal/internal-store.d.ts +0 -2
  63. package/dist/app/lib/internal/internal-store.js +1 -3
  64. package/dist/app/lib/internal/read-admin-manifest.d.ts +1 -1
  65. package/dist/app/lib/legacy-stitches/createStitches.d.ts +21 -21
  66. package/dist/app/lib/legacy-stitches/createStitches.js +1 -1
  67. package/dist/app/lib/legacy-stitches/index.d.ts +1 -1
  68. package/dist/app/lib/legacy-stitches/index.js +1 -1
  69. package/dist/app/lib/routing/components/BackButton.d.ts +49 -0
  70. package/dist/app/lib/routing/components/BackButton.js +47 -0
  71. package/dist/app/lib/routing/components/BrowserRouter.d.ts +4 -1
  72. package/dist/app/lib/routing/components/BrowserRouter.js +79 -11
  73. package/dist/app/lib/routing/components/ClientOnly.js +1 -1
  74. package/dist/app/lib/routing/components/Link.d.ts +1 -0
  75. package/dist/app/lib/routing/components/Link.js +9 -10
  76. package/dist/app/lib/routing/components/RouteRenderer.d.ts +1 -1
  77. package/dist/app/lib/routing/components/RouteRenderer.js +7 -6
  78. package/dist/app/lib/routing/components/SSRRouter.d.ts +2 -2
  79. package/dist/app/lib/routing/components/SSRRouter.js +5 -6
  80. package/dist/app/lib/routing/components/ScrollRestoration.js +1 -1
  81. package/dist/app/lib/routing/context.d.ts +8 -5
  82. package/dist/app/lib/routing/context.js +13 -96
  83. package/dist/app/lib/routing/hooks/useRestorableState.d.ts +2 -1
  84. package/dist/app/lib/routing/hooks/useRestorableState.js +2 -1
  85. package/dist/app/lib/routing/hooks/useRoute.d.ts +16 -1
  86. package/dist/app/lib/routing/hooks/useRoute.js +22 -1
  87. package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +5 -0
  88. package/dist/app/lib/routing/hooks/useRouteMeta.js +9 -0
  89. package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +1 -1
  90. package/dist/app/lib/routing/hooks/useRouteTransition.js +1 -1
  91. package/dist/app/lib/routing/hooks/useRouter.d.ts +1 -1
  92. package/dist/app/lib/routing/hooks/useRouter.js +1 -1
  93. package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +1 -1
  94. package/dist/app/lib/routing/hooks/useRouterEvents.js +1 -1
  95. package/dist/app/lib/routing/hooks/useRouterState.d.ts +1 -1
  96. package/dist/app/lib/routing/hooks/useRouterState.js +1 -1
  97. package/dist/app/lib/routing/hooks/useSearchParams.js +2 -2
  98. package/dist/app/lib/routing/index.d.ts +14 -13
  99. package/dist/app/lib/routing/index.js +14 -13
  100. package/dist/app/lib/routing/loader.d.ts +2 -2
  101. package/dist/app/lib/routing/loader.js +7 -5
  102. package/dist/app/lib/routing/types.d.ts +35 -9
  103. package/dist/app/lib/routing/utils.d.ts +3 -1
  104. package/dist/app/lib/routing/utils.js +12 -1
  105. package/dist/app/lib/{hooks → runtime}/apiConfig.d.ts +6 -2
  106. package/dist/app/lib/runtime/apiConfig.js +6 -0
  107. package/dist/app/lib/runtime/errorHandling.d.ts +39 -0
  108. package/dist/app/lib/runtime/errorHandling.js +6 -0
  109. package/dist/app/lib/runtime/index.d.ts +2 -0
  110. package/dist/app/lib/runtime/index.js +2 -0
  111. package/dist/app/lib/views/index.d.ts +1 -1
  112. package/dist/app/lib/views/index.js +1 -1
  113. package/dist/app/server/defineRouter.d.ts +2 -0
  114. package/dist/app/server/defineRouter.js +4 -0
  115. package/dist/app/server/index.d.ts +5 -0
  116. package/dist/app/server/index.js +5 -0
  117. package/dist/app/server/proxy-wp-admin.d.ts +2 -0
  118. package/dist/app/server/proxy-wp-admin.js +112 -0
  119. package/dist/app/server/render-ssr-page.d.ts +11 -0
  120. package/dist/app/server/render-ssr-page.js +100 -0
  121. package/dist/app/server/rpc.d.ts +56 -0
  122. package/dist/app/server/rpc.js +18 -0
  123. package/dist/app/server/server-context.d.ts +51 -0
  124. package/dist/app/server/server-context.js +147 -0
  125. package/dist/app/server/utils/headers.d.ts +1 -0
  126. package/dist/app/server/utils/headers.js +17 -0
  127. package/dist/app/server/utils/replace-host.d.ts +6 -4
  128. package/dist/app/server/utils/replace-host.js +58 -11
  129. package/dist/app/utils/APIProvider.d.ts +2 -0
  130. package/dist/app/utils/APIProvider.js +5 -0
  131. package/dist/app/utils/BlockErrorBoundary.d.ts +19 -0
  132. package/dist/app/utils/BlockErrorBoundary.js +38 -0
  133. package/dist/app/utils/ErrorMessage.d.ts +5 -0
  134. package/dist/app/utils/ErrorMessage.js +14 -0
  135. package/dist/app/utils/RouteErrorBoundary.d.ts +18 -0
  136. package/dist/app/utils/RouteErrorBoundary.js +38 -0
  137. package/dist/app/utils/query-client.d.ts +2 -0
  138. package/dist/app/utils/query-client.js +5 -1
  139. package/dist/app/utils/trpc-client.d.ts +2 -0
  140. package/dist/app/utils/trpc-client.js +34 -0
  141. package/dist/node/cli/cli-worker.d.ts +1 -1
  142. package/dist/node/cli/cli-worker.js +12 -3
  143. package/dist/node/cli/cli.js +91 -13
  144. package/dist/node/cli/display/CLIApp.d.ts +1 -1
  145. package/dist/node/cli/display/CLIApp.js +4 -7
  146. package/dist/node/cli/display/components/LogEntries.d.ts +1 -1
  147. package/dist/node/cli/display/hooks/useStatefulLog.d.ts +1 -1
  148. package/dist/node/cli/display/tools/CreateBlock.d.ts +1 -1
  149. package/dist/node/cli/display/tools/cli-tools.d.ts +1 -11
  150. package/dist/node/cli/display/tools/cli-tools.js +9 -9
  151. package/dist/node/cli/display/util/colors.d.ts +2 -2
  152. package/dist/node/cli/version.d.ts +1 -1
  153. package/dist/node/cli/version.js +1 -1
  154. package/dist/node/compiler/build-vinxi.d.ts +8 -0
  155. package/dist/node/compiler/build-vinxi.js +38 -0
  156. package/dist/node/compiler/bundler.admin.d.ts +2 -2
  157. package/dist/node/compiler/bundler.admin.js +3 -4
  158. package/dist/node/compiler/bundler.frontend.d.ts +1 -1
  159. package/dist/node/compiler/bundler.frontend.js +3 -4
  160. package/dist/node/compiler/{serverless.dev.d.ts → dev-server.d.ts} +7 -5
  161. package/dist/node/compiler/dev-server.js +106 -0
  162. package/dist/node/compiler/get-vite-config.d.ts +19 -0
  163. package/dist/node/compiler/get-vite-config.js +200 -0
  164. package/dist/node/compiler/vinxi-app.d.ts +20 -0
  165. package/dist/node/compiler/vinxi-app.js +204 -0
  166. package/dist/node/compiler/vinxi-codegen.d.ts +12 -0
  167. package/dist/node/compiler/vinxi-codegen.js +547 -0
  168. package/dist/node/graphql/graphql-codegen.d.ts +12 -2
  169. package/dist/node/graphql/graphql-codegen.js +213 -36
  170. package/dist/node/graphql/graphql-schema-loader.js +15 -18
  171. package/dist/node/graphql/plugins/gql-plugin-queries.js +1 -1
  172. package/dist/node/graphql/query-files-loader.d.ts +3 -0
  173. package/dist/node/graphql/query-files-loader.js +5 -0
  174. package/dist/node/project/config.d.ts +31 -37
  175. package/dist/node/project/config.js +13 -11
  176. package/dist/node/project/env.d.ts +1 -1
  177. package/dist/node/project/env.js +1 -1
  178. package/dist/node/project/manifest/block-manifest.js +3 -2
  179. package/dist/node/project/manifest/manifest.d.ts +2 -1
  180. package/dist/node/project/manifest/manifest.js +15 -11
  181. package/dist/node/project/manifest/routes-manifest.d.ts +20 -0
  182. package/dist/node/project/manifest/routes-manifest.js +74 -0
  183. package/dist/node/project/manifest/view-manifest.js +2 -2
  184. package/dist/node/project/project.d.ts +5 -2
  185. package/dist/node/project/project.js +21 -20
  186. package/dist/node/project/wp-info.js +3 -2
  187. package/dist/node/types/block-type.d.ts +5 -0
  188. package/dist/node/types/block-type.js +1 -0
  189. package/dist/node/types/view-type.js +3 -4
  190. package/dist/node/utils/fs-codegen.d.ts +42 -0
  191. package/dist/node/utils/fs-codegen.js +98 -0
  192. package/dist/node/utils/fs.js +2 -0
  193. package/dist/node/utils/{selfSignedCert.js → self-signed-cert.js} +1 -1
  194. package/dist/node/utils/{statefulLog.js → stateful-log.js} +1 -1
  195. package/dist/node/utils/watch-file-tree.d.ts +25 -0
  196. package/dist/node/utils/{watchFileTree.js → watch-file-tree.js} +12 -5
  197. package/package.json +39 -32
  198. package/types.app.d.ts +4 -2
  199. package/types.app.internal.d.ts +2 -2
  200. package/types.node.d.ts +3 -3
  201. package/dist/app/entry/Root.d.ts +0 -1
  202. package/dist/app/entry/Root.js +0 -9
  203. package/dist/app/entry/main.admin.d.ts +0 -3
  204. package/dist/app/entry/main.admin.js +0 -10
  205. package/dist/app/entry/main.frontend.spa.d.ts +0 -3
  206. package/dist/app/entry/main.frontend.spa.js +0 -13
  207. package/dist/app/entry/main.frontend.ssr.d.ts +0 -21
  208. package/dist/app/entry/main.frontend.ssr.js +0 -79
  209. package/dist/app/entry/main.serverless.dev.d.ts +0 -4
  210. package/dist/app/entry/main.serverless.dev.js +0 -21
  211. package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +0 -15
  212. package/dist/app/lib/blocks/ErrorBoundaryFrontend.js +0 -35
  213. package/dist/app/lib/hooks/apiConfig.js +0 -4
  214. package/dist/app/lib/hooks/usePageLoad.d.ts +0 -6
  215. package/dist/app/lib/hooks/usePageLoad.js +0 -5
  216. package/dist/app/server/create-api-builtin-hono.d.ts +0 -8
  217. package/dist/app/server/create-api-builtin-hono.js +0 -80
  218. package/dist/app/server/create-ssr-hono.d.ts +0 -18
  219. package/dist/app/server/create-ssr-hono.js +0 -104
  220. package/dist/app/server/utils/index.html.d.ts +0 -2
  221. package/dist/app/server/utils/index.html.js +0 -14
  222. package/dist/node/compiler/index.html.d.ts +0 -2
  223. package/dist/node/compiler/index.html.js +0 -15
  224. package/dist/node/compiler/serverless.dev.js +0 -222
  225. package/dist/node/compiler/vite/get-vite-config.d.ts +0 -13
  226. package/dist/node/compiler/vite/get-vite-config.js +0 -315
  227. package/dist/node/compiler/vite/plugin-admin.d.ts +0 -4
  228. package/dist/node/compiler/vite/plugin-admin.js +0 -67
  229. package/dist/node/compiler/vite/plugin-blocks.d.ts +0 -4
  230. package/dist/node/compiler/vite/plugin-blocks.js +0 -73
  231. package/dist/node/compiler/vite/plugin-entry.d.ts +0 -6
  232. package/dist/node/compiler/vite/plugin-entry.js +0 -16
  233. package/dist/node/compiler/vite/plugin-resolved-tailwind.d.ts +0 -4
  234. package/dist/node/compiler/vite/plugin-resolved-tailwind.js +0 -29
  235. package/dist/node/compiler/vite/plugin-theme.d.ts +0 -4
  236. package/dist/node/compiler/vite/plugin-theme.js +0 -40
  237. package/dist/node/compiler/vite/plugin-views.d.ts +0 -4
  238. package/dist/node/compiler/vite/plugin-views.js +0 -51
  239. package/dist/node/utils/console.d.ts +0 -21
  240. package/dist/node/utils/console.js +0 -28
  241. package/dist/node/utils/unsafe-fetch.d.ts +0 -2
  242. package/dist/node/utils/unsafe-fetch.js +0 -19
  243. package/dist/node/utils/watchFileTree.d.ts +0 -11
  244. package/tsup.config.ts +0 -40
  245. package/types.manifests.d.ts +0 -22
  246. /package/dist/node/utils/{formatZodError.d.ts → format-zod-error.d.ts} +0 -0
  247. /package/dist/node/utils/{formatZodError.js → format-zod-error.js} +0 -0
  248. /package/dist/node/utils/{getRepoInfo.d.ts → get-repo-info.d.ts} +0 -0
  249. /package/dist/node/utils/{getRepoInfo.js → get-repo-info.js} +0 -0
  250. /package/dist/node/utils/{highlightCode.d.ts → highlight-code.d.ts} +0 -0
  251. /package/dist/node/utils/{highlightCode.js → highlight-code.js} +0 -0
  252. /package/dist/node/utils/{isDeploying.d.ts → is-deploying.d.ts} +0 -0
  253. /package/dist/node/utils/{isDeploying.js → is-deploying.js} +0 -0
  254. /package/dist/node/utils/{selfSignedCert.d.ts → self-signed-cert.d.ts} +0 -0
  255. /package/dist/node/utils/{statefulLog.d.ts → stateful-log.d.ts} +0 -0
  256. /package/dist/node/utils/{export-extractor.d.ts → ts-export-extractor.d.ts} +0 -0
  257. /package/dist/node/utils/{export-extractor.js → ts-export-extractor.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
- }
@@ -1,11 +0,0 @@
1
- type FileList = string[];
2
- type Disposer = () => void;
3
- export type FileWatchEvent = "added" | "deleted" | "changed";
4
- export type FileEvent = {
5
- type: FileWatchEvent;
6
- file: string;
7
- };
8
- export declare function watchFileTree(pattern: string | string[], callback: (files: FileList, event?: FileEvent) => void): Promise<Disposer>;
9
- export declare function watchFileTreeForChanges(pattern: string | string[], callback: (event: FileEvent) => void): Promise<Disposer>;
10
- export declare function getFileTree(pattern: string | string[]): Promise<FileList>;
11
- export {};
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
- }