@ryanatkn/gro 0.116.0 → 0.116.2

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.
@@ -1,13 +1,14 @@
1
1
  /// <reference types="svelte" />
2
2
  import * as esbuild from 'esbuild';
3
3
  import type { Logger } from '@ryanatkn/belt/log.js';
4
- import type { CompileOptions, PreprocessorGroup } from 'svelte/compiler';
4
+ import type { CompileOptions, PreprocessorGroup, ModuleCompileOptions } from 'svelte/compiler';
5
5
  import type { Parsed_Sveltekit_Config } from './sveltekit_config.js';
6
6
  export interface Options {
7
7
  dev: boolean;
8
8
  build_options: esbuild.BuildOptions;
9
9
  dir?: string;
10
10
  svelte_compile_options?: CompileOptions;
11
+ svelte_compile_module_options?: ModuleCompileOptions;
11
12
  svelte_preprocessors?: PreprocessorGroup | PreprocessorGroup[];
12
13
  alias?: Record<string, string>;
13
14
  base_url?: Parsed_Sveltekit_Config['base_url'];
@@ -19,4 +20,4 @@ export interface Options {
19
20
  ambient_env?: Record<string, string>;
20
21
  log?: Logger;
21
22
  }
22
- export declare const esbuild_plugin_external_worker: ({ dev, build_options, dir, svelte_compile_options, svelte_preprocessors, alias, base_url, assets_url, public_prefix, private_prefix, env_dir, env_files, ambient_env, log, }: Options) => esbuild.Plugin;
23
+ export declare const esbuild_plugin_external_worker: ({ dev, build_options, dir, svelte_compile_options, svelte_preprocessors, svelte_compile_module_options, alias, base_url, assets_url, public_prefix, private_prefix, env_dir, env_files, ambient_env, log, }: Options) => esbuild.Plugin;
@@ -8,7 +8,7 @@ import { esbuild_plugin_sveltekit_shim_env } from './esbuild_plugin_sveltekit_sh
8
8
  import { esbuild_plugin_sveltekit_shim_app } from './esbuild_plugin_sveltekit_shim_app.js';
9
9
  import { esbuild_plugin_sveltekit_local_imports } from './esbuild_plugin_sveltekit_local_imports.js';
10
10
  import { esbuild_plugin_svelte } from './esbuild_plugin_svelte.js';
11
- export const esbuild_plugin_external_worker = ({ dev, build_options, dir = cwd(), svelte_compile_options, svelte_preprocessors, alias, base_url, assets_url, public_prefix, private_prefix, env_dir, env_files, ambient_env, log, }) => ({
11
+ export const esbuild_plugin_external_worker = ({ dev, build_options, dir = cwd(), svelte_compile_options, svelte_preprocessors, svelte_compile_module_options, alias, base_url, assets_url, public_prefix, private_prefix, env_dir, env_files, ambient_env, log, }) => ({
12
12
  name: 'external_worker',
13
13
  setup: (build) => {
14
14
  const builds = new Map();
@@ -28,7 +28,12 @@ export const esbuild_plugin_external_worker = ({ dev, build_options, dir = cwd()
28
28
  ambient_env,
29
29
  }),
30
30
  esbuild_plugin_sveltekit_shim_alias({ dir, alias }),
31
- esbuild_plugin_svelte({ dir, svelte_compile_options, svelte_preprocessors }),
31
+ esbuild_plugin_svelte({
32
+ dir,
33
+ svelte_compile_options,
34
+ svelte_compile_module_options,
35
+ svelte_preprocessors,
36
+ }),
32
37
  esbuild_plugin_sveltekit_local_imports(),
33
38
  ],
34
39
  define: to_define_import_meta_env(dev, base_url),
@@ -32,11 +32,14 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = cwd
32
32
  return {
33
33
  name: 'gro_plugin_server',
34
34
  setup: async ({ dev, watch, timings, log }) => {
35
- const { alias, base_url, assets_url, env_dir, private_prefix, public_prefix, svelte_compile_options, svelte_preprocessors, } = await init_sveltekit_config(sveltekit_config ?? dir);
36
- // TODO feels hacky
35
+ const { alias, base_url, assets_url, env_dir, private_prefix, public_prefix, svelte_compile_options, svelte_compile_module_options, svelte_preprocessors, } = await init_sveltekit_config(sveltekit_config ?? dir);
36
+ // TODO hacky
37
37
  if (svelte_compile_options.generate === undefined) {
38
38
  svelte_compile_options.generate = 'server';
39
39
  }
40
+ if (svelte_compile_module_options.generate === undefined) {
41
+ svelte_compile_module_options.generate = 'server';
42
+ }
40
43
  const { outbase, outdir, outname } = outpaths(dev);
41
44
  const server_outpath = join(outdir, outname);
42
45
  const timing_to_esbuild_create_context = timings.start('create build context');
@@ -68,6 +71,7 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = cwd
68
71
  build_options,
69
72
  dir,
70
73
  svelte_compile_options,
74
+ svelte_compile_module_options,
71
75
  svelte_preprocessors,
72
76
  alias,
73
77
  base_url,
@@ -78,7 +82,12 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = cwd
78
82
  ambient_env,
79
83
  log,
80
84
  }),
81
- esbuild_plugin_svelte({ dir, svelte_compile_options, svelte_preprocessors }),
85
+ esbuild_plugin_svelte({
86
+ dir,
87
+ svelte_compile_options,
88
+ svelte_compile_module_options,
89
+ svelte_preprocessors,
90
+ }),
82
91
  esbuild_plugin_sveltekit_local_imports(),
83
92
  ],
84
93
  define: to_define_import_meta_env(dev, base_url),
package/dist/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // generated by src/lib/package.gen.ts
2
2
  export const package_json = {
3
3
  name: '@ryanatkn/gro',
4
- version: '0.116.0',
4
+ version: '0.116.2',
5
5
  description: 'task runner and toolkit extending SvelteKit',
6
6
  motto: 'generate, run, optimize',
7
7
  icon: '🌰',
@@ -51,7 +51,7 @@ export const package_json = {
51
51
  '@changesets/changelog-git': '^0.2.0',
52
52
  '@changesets/types': '^6.0.0',
53
53
  '@ryanatkn/eslint-config': '^0.1.2',
54
- '@ryanatkn/fuz': '^0.101.2',
54
+ '@ryanatkn/fuz': '^0.101.4',
55
55
  '@ryanatkn/moss': '^0.3.0',
56
56
  '@sveltejs/adapter-static': '^3.0.1',
57
57
  '@sveltejs/kit': '^2.5.10',
@@ -64,7 +64,7 @@ export const package_json = {
64
64
  esbuild: '^0.20.2',
65
65
  eslint: '^8.57.0',
66
66
  'eslint-plugin-svelte': '^2.39.0',
67
- svelte: '^5.0.0-next.141',
67
+ svelte: '^5.0.0-next.153',
68
68
  'svelte-check': '^3.7.1',
69
69
  typescript: '^5.4.5',
70
70
  uvu: '^0.5.6',
@@ -241,7 +241,7 @@ export const package_json = {
241
241
  };
242
242
  export const src_json = {
243
243
  name: '@ryanatkn/gro',
244
- version: '0.116.0',
244
+ version: '0.116.2',
245
245
  modules: {
246
246
  '.': {
247
247
  path: 'index.ts',
@@ -97,7 +97,10 @@ const to_args_schema_type = ({ _def }) => {
97
97
  case ZodFirstPartyTypeKind.ZodUnion:
98
98
  return 'string | string[]'; // TODO support unions of arbitrary types, or more hardcoded ones as needed
99
99
  default: {
100
- if ('innerType' in _def) {
100
+ if ('type' in _def) {
101
+ return to_args_schema_type(_def.type);
102
+ }
103
+ else if ('innerType' in _def) {
101
104
  return to_args_schema_type(_def.innerType);
102
105
  }
103
106
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryanatkn/gro",
3
- "version": "0.116.0",
3
+ "version": "0.116.2",
4
4
  "description": "task runner and toolkit extending SvelteKit",
5
5
  "motto": "generate, run, optimize",
6
6
  "icon": "🌰",
@@ -66,7 +66,7 @@
66
66
  "@changesets/changelog-git": "^0.2.0",
67
67
  "@changesets/types": "^6.0.0",
68
68
  "@ryanatkn/eslint-config": "^0.1.2",
69
- "@ryanatkn/fuz": "^0.101.2",
69
+ "@ryanatkn/fuz": "^0.101.4",
70
70
  "@ryanatkn/moss": "^0.3.0",
71
71
  "@sveltejs/adapter-static": "^3.0.1",
72
72
  "@sveltejs/kit": "^2.5.10",
@@ -79,7 +79,7 @@
79
79
  "esbuild": "^0.20.2",
80
80
  "eslint": "^8.57.0",
81
81
  "eslint-plugin-svelte": "^2.39.0",
82
- "svelte": "^5.0.0-next.141",
82
+ "svelte": "^5.0.0-next.153",
83
83
  "svelte-check": "^3.7.1",
84
84
  "typescript": "^5.4.5",
85
85
  "uvu": "^0.5.6"