@monkeyplus/flow 5.0.0-rc.138 → 5.0.0-rc.139

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.
package/dist/index.mjs CHANGED
@@ -24,7 +24,7 @@ import replace from '@rollup/plugin-replace';
24
24
  import { resolveTSConfig } from 'pkg-types';
25
25
  import fse from 'fs-extra';
26
26
 
27
- const version = "5.0.0-rc.138";
27
+ const version = "5.0.0-rc.139";
28
28
 
29
29
  let _distDir = dirname(fileURLToPath(import.meta.url));
30
30
  if (_distDir.match(/(chunks|shared)$/))
@@ -81,6 +81,7 @@ const TransformPlugin = createUnplugin(({ ctx, options, sourcemap }) => {
81
81
  });
82
82
 
83
83
  const commonPresets = [
84
+ // #head
84
85
  defineUnimportPreset({
85
86
  from: "#head",
86
87
  imports: [
@@ -111,10 +112,12 @@ const appPreset = defineUnimportPreset({
111
112
  const vuePreset = defineUnimportPreset({
112
113
  from: "vue",
113
114
  imports: [
115
+ // Components
114
116
  "defineComponent",
115
117
  "getCurrentInstance",
116
118
  "useSlots",
117
119
  "h",
120
+ // Reactivity
118
121
  "computed"
119
122
  ]
120
123
  });
@@ -410,8 +413,10 @@ async function initNitro(flow) {
410
413
  buildDir: flow.options.buildDir,
411
414
  scanDirs,
412
415
  renderer: resolve(distDir, "core/runtime/nitro/renderer"),
416
+ // errorHandler: resolve(distDir, 'core/runtime/nitro/error'),
413
417
  nodeModulesDirs: flow.options.modulesDir,
414
418
  handlers: [
419
+ //* Important middleware
415
420
  {
416
421
  middleware: true,
417
422
  handler: resolve(distDir, "core/runtime/nitro/flow")
@@ -443,6 +448,7 @@ async function initNitro(flow) {
443
448
  },
444
449
  publicAssets: [
445
450
  {
451
+ // baseURL: flow.options.app.buildAssetsDir,
446
452
  dir: resolve(flow.options.buildDir, "dist/client")
447
453
  },
448
454
  ...flow.options._layers.map((layer) => join(layer.config.srcDir, layer.config.dir?.public || "public")).filter((dir) => existsSync(dir)).map((dir) => ({ dir }))
@@ -456,23 +462,34 @@ async function initNitro(flow) {
456
462
  inline: [
457
463
  ...flow.options.dev ? [] : ["eta", "@monkeyplus/", "@vue/", "@nuxt/", flow.options.buildDir],
458
464
  "@monkeyplus/flow/dist",
465
+ // Dev windows
459
466
  "C:/Users/gnu/Documents/GitHub/flow/packages/flow/dist/app",
460
467
  distDir
461
468
  ]
462
469
  },
470
+ // preset: flow.options.dev ? 'nitro-dev' : undefined,
471
+ // output: {
472
+ // dir: resolve(flow.options.buildDir, 'output'),
473
+ // },
463
474
  replace: {
464
475
  "process.dev": flow.options.dev
465
476
  },
466
477
  alias: {
478
+ // Vue 3 mocks
467
479
  "estree-walker": "unenv/runtime/mock/proxy",
468
480
  "@babel/parser": "unenv/runtime/mock/proxy",
481
+ // Paths
469
482
  "#paths": resolve(distDir, "core/runtime/nitro/paths"),
483
+ // Shortcut to server main file
470
484
  "#server": "#build/dist/server/server.mjs",
485
+ // Nuxt aliases
471
486
  ...flow.options.alias
472
487
  },
473
488
  rollupConfig: {
474
489
  plugins: []
475
490
  },
491
+ // watchOptions:{}
492
+ //* Include to refresh server
476
493
  devServer: {
477
494
  watch: [resolve(flow.options.buildDir, "dist/server/server.mjs")]
478
495
  }
@@ -547,6 +564,7 @@ const addModuleTranspiles = (opts = {}) => {
547
564
  const flow = useNuxt();
548
565
  const modules = [
549
566
  ...opts.additionalModules || [],
567
+ // ...flow.options.buildModules,
550
568
  ...flow.options.modules,
551
569
  ...flow.options._modules
552
570
  ].map((m) => typeof m === "string" ? m : Array.isArray(m) ? m[0] : m.src).filter((m) => typeof m === "string").map((m) => m.split("node_modules/").pop());
@@ -563,7 +581,10 @@ const addModuleTranspiles = (opts = {}) => {
563
581
  function createFlow(options) {
564
582
  const hooks = createHooks();
565
583
  const flow = {
584
+ //* Include nuxt version
566
585
  _version: "3.0.0",
586
+ //* Include version
587
+ // @ts-ignore
567
588
  version,
568
589
  options,
569
590
  hooks,
@@ -582,6 +603,7 @@ async function initFlow(flow) {
582
603
  flow.hook("close", () => nuxtCtx.unset());
583
604
  await flow.callHook("modules:before");
584
605
  const modulesToInstall = [
606
+ // ...flow.options.buildModules,
585
607
  ...flow.options.modules,
586
608
  ...flow.options._modules
587
609
  ];
@@ -725,9 +747,11 @@ const publicPathTemplate = {
725
747
  function _resolveId(id) {
726
748
  return resolvePath(id, {
727
749
  url: [
750
+ // @ts-ignore
728
751
  global.__NUXT_PREPATHS__,
729
752
  import.meta.url,
730
753
  process.cwd(),
754
+ // @ts-ignore
731
755
  global.__NUXT_PATHS__
732
756
  ]
733
757
  });
@@ -735,10 +759,10 @@ function _resolveId(id) {
735
759
 
736
760
  const defaultTemplates = {
737
761
  __proto__: null,
738
- serverPluginTemplate: serverPluginTemplate,
739
762
  pluginsDeclaration: pluginsDeclaration,
763
+ publicPathTemplate: publicPathTemplate,
740
764
  schemaTemplate: schemaTemplate,
741
- publicPathTemplate: publicPathTemplate
765
+ serverPluginTemplate: serverPluginTemplate
742
766
  };
743
767
 
744
768
  function uniqueBy(arr, key) {
@@ -888,6 +912,20 @@ function cacheDirPlugin(rootDir, name) {
888
912
  async function buildServer(ctx) {
889
913
  const serverConfig = vite.mergeConfig(ctx.config, {
890
914
  base: ctx.nuxt.options.dev ? joinURL(ctx.nuxt.options.app.baseURL.replace(/^\.\//, "/") || "/", ctx.nuxt.options.app.buildAssetsDir) : void 0,
915
+ // experimental: {
916
+ // renderBuiltUrl: (filename, { type, hostType }) => {
917
+ // if (hostType !== 'js') {
918
+ // // In CSS we only use relative paths until we craft a clever runtime CSS hack
919
+ // return { relative: true };
920
+ // }
921
+ // if (type === 'public')
922
+ // return { runtime: `globalThis.__publicAssetsURL(${JSON.stringify(filename)})` };
923
+ // if (type === 'asset') {
924
+ // const relativeFilename = filename.replace(withTrailingSlash(withoutLeadingSlash(ctx.nuxt.options.app.buildAssetsDir)), '');
925
+ // return { runtime: `globalThis.__buildAssetsURL(${JSON.stringify(relativeFilename)})` };
926
+ // }
927
+ // },
928
+ // },
891
929
  define: {
892
930
  "process.server": true,
893
931
  "process.client": false,
@@ -906,6 +944,7 @@ async function buildServer(ctx) {
906
944
  external: ["#internal/nitro", "#internal/nitro/utils"],
907
945
  noExternal: [
908
946
  ...ctx.nuxt.options.build.transpile,
947
+ // TODO: Use externality for production (rollup) build
909
948
  /\/esm\/.*\.js$/,
910
949
  /\.(es|esm|esm-browser|esm-bundler).js$/,
911
950
  "/__vue-jsx",
@@ -925,6 +964,7 @@ async function buildServer(ctx) {
925
964
  output: {
926
965
  entryFileNames: "server.mjs",
927
966
  preferConst: true,
967
+ // TODO: https://github.com/vitejs/vite/pull/8641
928
968
  inlineDynamicImports: !ctx.nuxt.options.experimental.viteServerDynamicImports,
929
969
  format: "module"
930
970
  },
@@ -935,6 +975,7 @@ async function buildServer(ctx) {
935
975
  }
936
976
  },
937
977
  server: {
978
+ // https://github.com/vitest-dev/vitest/issues/229#issuecomment-1002685027
938
979
  preTransformRequests: false,
939
980
  hmr: false
940
981
  },
@@ -944,6 +985,8 @@ async function buildServer(ctx) {
944
985
  ...Object.fromEntries([";", "(", "{", "}", " ", " ", "\n"].map((d) => [`${d}global.`, `${d}globalThis.`])),
945
986
  preventAssignment: true
946
987
  })
988
+ // vuePlugin(ctx.config.vue),
989
+ // viteJsxPlugin(),
947
990
  ]
948
991
  });
949
992
  if (ctx.nuxt.options.typescript.typeCheck === true || ctx.nuxt.options.typescript.typeCheck === "build" && !ctx.nuxt.options.dev) {
@@ -984,9 +1027,12 @@ async function bundle$1(nuxt) {
984
1027
  alias: {
985
1028
  ...nuxt.options.alias,
986
1029
  "#app": nuxt.options.appDir,
1030
+ // We need this resolution to be present before the following entry, but it
1031
+ // will be filled in client/server configs
987
1032
  "#build/plugins": "",
988
1033
  "#build": nuxt.options.buildDir,
989
1034
  "web-streams-polyfill/ponyfill/es2018": "unenv/runtime/mock/empty",
1035
+ // Cannot destructure property 'AbortController' of ..
990
1036
  "abort-controller": "unenv/runtime/mock/empty"
991
1037
  }
992
1038
  },
@@ -994,6 +1040,7 @@ async function bundle$1(nuxt) {
994
1040
  entries: [entry],
995
1041
  include: []
996
1042
  },
1043
+ // css: resolveCSSOptions(nuxt),
997
1044
  build: {
998
1045
  rollupOptions: {
999
1046
  output: { sanitizeFileName: sanitizeFilePath },
@@ -1004,6 +1051,7 @@ async function bundle$1(nuxt) {
1004
1051
  }
1005
1052
  },
1006
1053
  plugins: [
1054
+ // composableKeysPlugin.vite({ sourcemap: nuxt.options.sourcemap, rootDir: nuxt.options.rootDir }),
1007
1055
  replace({
1008
1056
  ...Object.fromEntries([";", "(", "{", "}", " ", " ", "\n"].map((d) => [`${d}global.`, `${d}globalThis.`])),
1009
1057
  preventAssignment: true
@@ -27,6 +27,7 @@ const buildPages = (page) => (location, language, _locales) => {
27
27
  name: page.name,
28
28
  noPublish: page.noPublish
29
29
  }
30
+ // locale: _locale,
30
31
  };
31
32
  });
32
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkeyplus/flow",
3
- "version": "5.0.0-rc.138",
3
+ "version": "5.0.0-rc.139",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -25,9 +25,9 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@monkeyplus/flow-cli": "5.0.0-rc.138",
29
- "@monkeyplus/flow-kit": "5.0.0-rc.138",
30
- "@monkeyplus/flow-schema": "5.0.0-rc.138",
28
+ "@monkeyplus/flow-cli": "5.0.0-rc.139",
29
+ "@monkeyplus/flow-kit": "5.0.0-rc.139",
30
+ "@monkeyplus/flow-schema": "5.0.0-rc.139",
31
31
  "@rollup/plugin-replace": "^4.0.0",
32
32
  "@vueuse/head": "^1.0.16",
33
33
  "c12": "^1.0.1",