@ryanatkn/gro 0.142.0 → 0.143.1
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/build.task.js +1 -1
- package/dist/changeset.task.js +3 -3
- package/dist/check.task.d.ts.map +1 -1
- package/dist/check.task.js +4 -2
- package/dist/clean_fs.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/{path_constants.d.ts → constants.d.ts} +4 -1
- package/dist/constants.d.ts.map +1 -0
- package/dist/{path_constants.js → constants.js} +3 -0
- package/dist/deploy.task.js +1 -1
- package/dist/dev.task.js +1 -1
- package/dist/esbuild_plugin_svelte.js +1 -1
- package/dist/esbuild_plugin_sveltekit_local_imports.js +1 -1
- package/dist/esbuild_plugin_sveltekit_shim_app.js +1 -1
- package/dist/esbuild_plugin_sveltekit_shim_env.js +1 -1
- package/dist/format.task.d.ts.map +1 -1
- package/dist/format.task.js +2 -2
- package/dist/format_directory.d.ts +1 -1
- package/dist/format_directory.d.ts.map +1 -1
- package/dist/format_directory.js +5 -6
- package/dist/gen.task.js +1 -1
- package/dist/gro_config.d.ts +7 -2
- package/dist/gro_config.d.ts.map +1 -1
- package/dist/gro_config.js +9 -7
- package/dist/gro_helpers.d.ts +1 -1
- package/dist/gro_helpers.d.ts.map +1 -1
- package/dist/gro_helpers.js +3 -3
- package/dist/gro_plugin_server.js +4 -4
- package/dist/gro_plugin_sveltekit_app.d.ts.map +1 -1
- package/dist/gro_plugin_sveltekit_app.js +5 -5
- package/dist/gro_plugin_sveltekit_library.js +3 -3
- package/dist/loader.js +1 -1
- package/dist/module.js +1 -1
- package/dist/moss_helpers.d.ts +1 -1
- package/dist/moss_helpers.d.ts.map +1 -1
- package/dist/moss_helpers.js +3 -3
- package/dist/package.d.ts +11 -11
- package/dist/package.d.ts.map +1 -1
- package/dist/package.js +39 -39
- package/dist/package_json.js +2 -2
- package/dist/package_meta.d.ts +1 -1
- package/dist/parse_imports.js +1 -1
- package/dist/paths.js +1 -1
- package/dist/publish.task.d.ts.map +1 -1
- package/dist/publish.task.js +4 -12
- package/dist/reinstall.task.js +10 -10
- package/dist/resolve_node_specifier.js +2 -2
- package/dist/run_task.js +1 -1
- package/dist/sveltekit_config.js +1 -1
- package/dist/sveltekit_helpers.d.ts +3 -3
- package/dist/sveltekit_helpers.d.ts.map +1 -1
- package/dist/sveltekit_helpers.js +7 -7
- package/dist/sync.task.js +5 -5
- package/package.json +6 -6
- package/src/lib/build.task.ts +1 -1
- package/src/lib/changeset.task.ts +3 -3
- package/src/lib/check.task.ts +4 -2
- package/src/lib/clean_fs.ts +1 -1
- package/src/lib/cli.ts +1 -1
- package/src/lib/{path_constants.ts → constants.ts} +4 -0
- package/src/lib/deploy.task.ts +1 -1
- package/src/lib/dev.task.ts +1 -1
- package/src/lib/esbuild_plugin_svelte.ts +1 -1
- package/src/lib/esbuild_plugin_sveltekit_local_imports.ts +1 -1
- package/src/lib/esbuild_plugin_sveltekit_shim_app.ts +1 -1
- package/src/lib/esbuild_plugin_sveltekit_shim_env.ts +1 -1
- package/src/lib/format.task.ts +10 -2
- package/src/lib/format_directory.ts +10 -9
- package/src/lib/gen.task.ts +1 -1
- package/src/lib/gro_config.ts +16 -6
- package/src/lib/gro_helpers.ts +3 -2
- package/src/lib/gro_plugin_server.ts +4 -4
- package/src/lib/gro_plugin_sveltekit_app.ts +7 -5
- package/src/lib/gro_plugin_sveltekit_library.ts +3 -3
- package/src/lib/loader.ts +1 -1
- package/src/lib/module.ts +1 -1
- package/src/lib/moss_helpers.ts +3 -2
- package/src/lib/package.ts +39 -39
- package/src/lib/package_json.ts +2 -2
- package/src/lib/package_meta.ts +1 -1
- package/src/lib/parse_imports.ts +1 -1
- package/src/lib/paths.ts +1 -1
- package/src/lib/publish.task.ts +4 -13
- package/src/lib/reinstall.task.ts +10 -10
- package/src/lib/resolve_node_specifier.ts +2 -2
- package/src/lib/run_task.ts +1 -1
- package/src/lib/sveltekit_config.ts +1 -1
- package/src/lib/sveltekit_helpers.ts +7 -4
- package/src/lib/sync.task.ts +5 -5
- package/dist/path_constants.d.ts.map +0 -1
package/dist/build.task.js
CHANGED
|
@@ -7,7 +7,7 @@ export const Args = z
|
|
|
7
7
|
'no-sync': z.boolean({ description: 'opt out of gro sync' }).default(false),
|
|
8
8
|
install: z.boolean({ description: 'dual of no-install' }).default(true),
|
|
9
9
|
'no-install': z // convenience, same as `gro build -- gro sync --no-install` but the latter takes precedence
|
|
10
|
-
.boolean({ description: 'opt out of
|
|
10
|
+
.boolean({ description: 'opt out of installing packages before building' })
|
|
11
11
|
.default(false),
|
|
12
12
|
})
|
|
13
13
|
.strict();
|
package/dist/changeset.task.js
CHANGED
|
@@ -25,7 +25,7 @@ export const Args = z
|
|
|
25
25
|
.default('@changesets/changelog-git'),
|
|
26
26
|
dep: z.boolean({ description: 'dual of no-dep' }).default(true),
|
|
27
27
|
'no-dep': z
|
|
28
|
-
.boolean({ description: 'opt out of
|
|
28
|
+
.boolean({ description: 'opt out of installing the changelog package' })
|
|
29
29
|
.default(false),
|
|
30
30
|
origin: Git_Origin.describe('git origin to deploy to').default('origin'),
|
|
31
31
|
changeset_cli: z.string({ description: 'the changeset CLI to use' }).default(CHANGESET_CLI),
|
|
@@ -79,11 +79,11 @@ export const task = {
|
|
|
79
79
|
}
|
|
80
80
|
await spawn('git', ['add', dir]);
|
|
81
81
|
if (dep) {
|
|
82
|
-
await spawn(config.pm_cli, ['
|
|
82
|
+
await spawn(config.pm_cli, ['install', '-D', changelog]);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
// TODO small problem here where generated files don't get committed
|
|
86
|
-
await invoke_task('sync', { install: inited || !dep }); // after
|
|
86
|
+
await invoke_task('sync', { install: inited || !dep }); // after installing above, and in all cases
|
|
87
87
|
if (message) {
|
|
88
88
|
// TODO see the helper below, simplify this to CLI flags when support is added to Changesets
|
|
89
89
|
const changeset_adder = create_changeset_adder(package_json.name, dir, message, bump);
|
package/dist/check.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.task.d.ts","sourceRoot":"../src/lib/","sources":["check.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"check.task.d.ts","sourceRoot":"../src/lib/","sources":["check.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAyD3B,CAAC"}
|
package/dist/check.task.js
CHANGED
|
@@ -21,7 +21,9 @@ export const Args = z
|
|
|
21
21
|
sync: z.boolean({ description: 'dual of no-sync' }).default(true),
|
|
22
22
|
'no-sync': z.boolean({ description: 'opt out of syncing' }).default(false),
|
|
23
23
|
install: z.boolean({ description: 'dual of no-install' }).default(true),
|
|
24
|
-
'no-install': z
|
|
24
|
+
'no-install': z
|
|
25
|
+
.boolean({ description: 'opt out of installing packages when syncing' })
|
|
26
|
+
.default(false), // convenience, same as `gro check -- gro sync --no-install` but the latter takes precedence
|
|
25
27
|
workspace: z
|
|
26
28
|
.boolean({ description: 'ensure a clean git workspace, useful for CI, also implies --no-sync' })
|
|
27
29
|
.default(false),
|
|
@@ -33,7 +35,7 @@ export const task = {
|
|
|
33
35
|
run: async ({ args, invoke_task, log, config }) => {
|
|
34
36
|
const { typecheck, test, gen, format, package_json, lint, sync, install, workspace } = args;
|
|
35
37
|
// When checking the workspace, which was added for CI, never sync.
|
|
36
|
-
// Setup like
|
|
38
|
+
// Setup like installing packages and `sveltekit-sync` should be done in the CI setup.
|
|
37
39
|
if (sync && !workspace) {
|
|
38
40
|
await invoke_task('sync', { install, gen: false }); // never generate because `gro gen --check` runs below
|
|
39
41
|
}
|
package/dist/clean_fs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { rm } from 'node:fs/promises';
|
|
2
2
|
import { readdirSync } from 'node:fs';
|
|
3
3
|
import { paths } from './paths.js';
|
|
4
|
-
import { NODE_MODULES_DIRNAME, GRO_DIST_PREFIX, SVELTEKIT_DEV_DIRNAME, SVELTEKIT_BUILD_DIRNAME, SVELTEKIT_VITE_CACHE_PATH, SVELTEKIT_DIST_DIRNAME, } from './
|
|
4
|
+
import { NODE_MODULES_DIRNAME, GRO_DIST_PREFIX, SVELTEKIT_DEV_DIRNAME, SVELTEKIT_BUILD_DIRNAME, SVELTEKIT_VITE_CACHE_PATH, SVELTEKIT_DIST_DIRNAME, } from './constants.js';
|
|
5
5
|
export const clean_fs = async ({ build = false, build_dev = false, build_dist = false, sveltekit = false, nodemodules = false, }, rm_options = { force: true, recursive: true }) => {
|
|
6
6
|
const promises = [];
|
|
7
7
|
if (build) {
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { spawn, spawn_process, } from '@ryanatkn/belt/process.js';
|
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
-
import { NODE_MODULES_DIRNAME } from './
|
|
6
|
+
import { NODE_MODULES_DIRNAME } from './constants.js';
|
|
7
7
|
import { print_command_args } from './args.js';
|
|
8
8
|
/**
|
|
9
9
|
* Searches the filesystem for the CLI `name`, first local to the cwd and then globally.
|
|
@@ -23,4 +23,7 @@ export declare const TS_MATCHER: RegExp;
|
|
|
23
23
|
export declare const JS_MATCHER: RegExp;
|
|
24
24
|
export declare const JSON_MATCHER: RegExp;
|
|
25
25
|
export declare const EVERYTHING_MATCHER: RegExp;
|
|
26
|
-
|
|
26
|
+
export declare const JS_CLI_DEFAULT = "node";
|
|
27
|
+
export declare const PM_CLI_DEFAULT = "npm";
|
|
28
|
+
export declare const PRETTIER_CLI_DEFAULT = "prettier";
|
|
29
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"../src/lib/","sources":["constants.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAC9C,eAAO,MAAM,eAAe,QAAuB,CAAC;AACpD,eAAO,MAAM,UAAU,QAAuB,CAAC;AAC/C,eAAO,MAAM,OAAO,QAAoB,CAAC;AACzC,eAAO,MAAM,WAAW,QAAwB,CAAC;AACjD,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAC/C,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAC5D,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AACrD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AACnD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAC/C,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,yBAAyB,QAAkC,CAAC;AACzE,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,eAAO,MAAM,UAAU,QAAwB,CAAC;AAChD,eAAO,MAAM,UAAU,QAAwB,CAAC;AAChD,eAAO,MAAM,YAAY,QAAY,CAAC;AACtC,eAAO,MAAM,kBAAkB,QAAO,CAAC;AAEvC,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,oBAAoB,aAAa,CAAC"}
|
|
@@ -30,3 +30,6 @@ export const TS_MATCHER = /\.(ts|tsx|mts|cts)$/;
|
|
|
30
30
|
export const JS_MATCHER = /\.(js|jsx|mjs|cjs)$/;
|
|
31
31
|
export const JSON_MATCHER = /\.json$/;
|
|
32
32
|
export const EVERYTHING_MATCHER = /.*/;
|
|
33
|
+
export const JS_CLI_DEFAULT = 'node';
|
|
34
|
+
export const PM_CLI_DEFAULT = 'npm';
|
|
35
|
+
export const PRETTIER_CLI_DEFAULT = 'prettier';
|
package/dist/deploy.task.js
CHANGED
|
@@ -7,7 +7,7 @@ import { join, resolve } from 'node:path';
|
|
|
7
7
|
import { existsSync, readdirSync } from 'node:fs';
|
|
8
8
|
import { Task_Error } from './task.js';
|
|
9
9
|
import { print_path } from './paths.js';
|
|
10
|
-
import { GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME } from './
|
|
10
|
+
import { GRO_DIRNAME, GIT_DIRNAME, SVELTEKIT_BUILD_DIRNAME } from './constants.js';
|
|
11
11
|
import { empty_dir } from './fs.js';
|
|
12
12
|
import { git_check_clean_workspace, git_checkout, git_local_branch_exists, git_remote_branch_exists, Git_Origin, Git_Branch, git_delete_local_branch, git_push_to_create, git_reset_branch_to_first_commit, git_pull, git_fetch, git_check_setting_pull_rebase, git_clone_locally, git_current_branch_name, } from './git.js';
|
|
13
13
|
// docs at ./docs/deploy.md
|
package/dist/dev.task.js
CHANGED
|
@@ -13,7 +13,7 @@ export const Args = z
|
|
|
13
13
|
'no-sync': z.boolean({ description: 'opt out of gro sync' }).default(false),
|
|
14
14
|
install: z.boolean({ description: 'dual of no-install' }).default(true),
|
|
15
15
|
'no-install': z // convenience, same as `gro dev -- gro sync --no-install` but the latter takes precedence
|
|
16
|
-
.boolean({ description: 'opt out of
|
|
16
|
+
.boolean({ description: 'opt out of installing packages before starting the dev server' })
|
|
17
17
|
.default(false),
|
|
18
18
|
})
|
|
19
19
|
.strict();
|
|
@@ -5,7 +5,7 @@ import { relative } from 'node:path';
|
|
|
5
5
|
import { SVELTE_MATCHER, SVELTE_RUNES_MATCHER } from './svelte_helpers.js';
|
|
6
6
|
import { to_define_import_meta_env, default_ts_transform_options } from './esbuild_helpers.js';
|
|
7
7
|
import { default_sveltekit_config, to_default_compile_module_options, } from './sveltekit_config.js';
|
|
8
|
-
import { TS_MATCHER } from './
|
|
8
|
+
import { TS_MATCHER } from './constants.js';
|
|
9
9
|
export const esbuild_plugin_svelte = (options) => {
|
|
10
10
|
const { dev, base_url, dir = process.cwd(), svelte_compile_options = default_sveltekit_config.svelte_compile_options, svelte_compile_module_options = to_default_compile_module_options(svelte_compile_options), svelte_preprocessors, ts_transform_options = default_ts_transform_options, is_ts = (f) => TS_MATCHER.test(f), } = options;
|
|
11
11
|
const final_ts_transform_options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { dirname } from 'node:path';
|
|
3
3
|
import { resolve_specifier } from './resolve_specifier.js';
|
|
4
|
-
import { EVERYTHING_MATCHER } from './
|
|
4
|
+
import { EVERYTHING_MATCHER } from './constants.js';
|
|
5
5
|
/**
|
|
6
6
|
* Adds support for imports to both `.ts` and `.js`,
|
|
7
7
|
* as well as imports without extensions that resolve to `.js` or `.ts`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { render_sveltekit_shim_app_environment, render_sveltekit_shim_app_paths, sveltekit_shim_app_specifiers, } from './sveltekit_shim_app.js';
|
|
2
|
-
import { EVERYTHING_MATCHER } from './
|
|
2
|
+
import { EVERYTHING_MATCHER } from './constants.js';
|
|
3
3
|
export const esbuild_plugin_sveltekit_shim_app = ({ dev, base_url, assets_url, }) => ({
|
|
4
4
|
name: 'sveltekit_shim_app',
|
|
5
5
|
setup: (build) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { render_env_shim_module } from './sveltekit_shim_env.js';
|
|
2
|
-
import { EVERYTHING_MATCHER } from './
|
|
2
|
+
import { EVERYTHING_MATCHER } from './constants.js';
|
|
3
3
|
import { SVELTEKIT_ENV_MATCHER } from './sveltekit_helpers.js';
|
|
4
4
|
const namespace = 'sveltekit_shim_env';
|
|
5
5
|
export const esbuild_plugin_sveltekit_shim_env = ({ dev, public_prefix, private_prefix, env_dir, env_files, ambient_env, }) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.task.d.ts","sourceRoot":"../src/lib/","sources":["format.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,IAAI;;;;;;EAMP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"format.task.d.ts","sourceRoot":"../src/lib/","sources":["format.task.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAa,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,IAAI;;;;;;EAMP,CAAC;AACX,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAqB3B,CAAC"}
|
package/dist/format.task.js
CHANGED
|
@@ -13,10 +13,10 @@ export const Args = z
|
|
|
13
13
|
export const task = {
|
|
14
14
|
summary: 'format source files',
|
|
15
15
|
Args,
|
|
16
|
-
run: async ({ args, log }) => {
|
|
16
|
+
run: async ({ args, log, config }) => {
|
|
17
17
|
const { check } = args;
|
|
18
18
|
// TODO forward prettier args
|
|
19
|
-
const format_result = await format_directory(log, paths.source, check);
|
|
19
|
+
const format_result = await format_directory(log, paths.source, check, undefined, undefined, undefined, config.pm_cli);
|
|
20
20
|
if (!format_result.ok) {
|
|
21
21
|
throw new Task_Error(`Failed ${check ? 'formatting check' : 'to format'}. ${print_spawn_result(format_result)}`);
|
|
22
22
|
}
|
|
@@ -7,5 +7,5 @@ import { type Cli } from './cli.js';
|
|
|
7
7
|
* This is separated from `./format_file` to avoid importing all of the `prettier` code
|
|
8
8
|
* inside modules that import this one. (which has a nontrivial cost)
|
|
9
9
|
*/
|
|
10
|
-
export declare const format_directory: (log: Logger, dir: string, check?: boolean, extensions?: string, root_paths?: string, prettier_cli?: string | Cli) => Promise<Spawn_Result>;
|
|
10
|
+
export declare const format_directory: (log: Logger, dir: string, check?: boolean, extensions?: string, root_paths?: string, prettier_cli?: string | Cli, pm_cli?: string) => Promise<Spawn_Result>;
|
|
11
11
|
//# sourceMappingURL=format_directory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format_directory.d.ts","sourceRoot":"../src/lib/","sources":["format_directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"format_directory.d.ts","sourceRoot":"../src/lib/","sources":["format_directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAclD,OAAO,EAAyB,KAAK,GAAG,EAAC,MAAM,UAAU,CAAC;AAY1D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QACvB,MAAM,OACN,MAAM,4EAIG,MAAM,GAAG,GAAG,WAClB,MAAM,KACZ,OAAO,CAAC,YAAY,CActB,CAAC"}
|
package/dist/format_directory.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { paths } from './paths.js';
|
|
2
|
-
import { GITHUB_DIRNAME, README_FILENAME, SVELTEKIT_CONFIG_FILENAME, VITE_CONFIG_FILENAME, TSCONFIG_FILENAME, GRO_CONFIG_PATH, } from './
|
|
2
|
+
import { GITHUB_DIRNAME, README_FILENAME, SVELTEKIT_CONFIG_FILENAME, VITE_CONFIG_FILENAME, TSCONFIG_FILENAME, GRO_CONFIG_PATH, PM_CLI_DEFAULT, PRETTIER_CLI_DEFAULT, } from './constants.js';
|
|
3
3
|
import { serialize_args, to_forwarded_args } from './args.js';
|
|
4
4
|
import { spawn_cli, to_cli_name } from './cli.js';
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const DEFAULT_ROOT_PATHS = `${[
|
|
5
|
+
const EXTENSIONS_DEFAULT = 'ts,js,json,svelte,html,css,md,yml';
|
|
6
|
+
const ROOT_PATHS_DEFAULT = `${[
|
|
8
7
|
README_FILENAME,
|
|
9
8
|
GRO_CONFIG_PATH,
|
|
10
9
|
SVELTEKIT_CONFIG_FILENAME,
|
|
@@ -18,7 +17,7 @@ const DEFAULT_ROOT_PATHS = `${[
|
|
|
18
17
|
* This is separated from `./format_file` to avoid importing all of the `prettier` code
|
|
19
18
|
* inside modules that import this one. (which has a nontrivial cost)
|
|
20
19
|
*/
|
|
21
|
-
export const format_directory = async (log, dir, check = false, extensions =
|
|
20
|
+
export const format_directory = async (log, dir, check = false, extensions = EXTENSIONS_DEFAULT, root_paths = ROOT_PATHS_DEFAULT, prettier_cli = PRETTIER_CLI_DEFAULT, pm_cli = PM_CLI_DEFAULT) => {
|
|
22
21
|
const forwarded_args = to_forwarded_args(to_cli_name(prettier_cli));
|
|
23
22
|
forwarded_args[check ? 'check' : 'write'] = true;
|
|
24
23
|
const serialized_args = serialize_args(forwarded_args);
|
|
@@ -28,6 +27,6 @@ export const format_directory = async (log, dir, check = false, extensions = DEF
|
|
|
28
27
|
}
|
|
29
28
|
const spawned = await spawn_cli(prettier_cli, serialized_args, log);
|
|
30
29
|
if (!spawned)
|
|
31
|
-
throw new Error(`failed to find \`${to_cli_name(prettier_cli)}\` CLI locally or globally, do you need to run
|
|
30
|
+
throw new Error(`failed to find \`${to_cli_name(prettier_cli)}\` CLI locally or globally, do you need to run \`${pm_cli} install\`?`);
|
|
32
31
|
return spawned;
|
|
33
32
|
};
|
package/dist/gen.task.js
CHANGED
|
@@ -9,7 +9,7 @@ import { format_file } from './format_file.js';
|
|
|
9
9
|
import { print_path } from './paths.js';
|
|
10
10
|
import { log_error_reasons } from './task_logging.js';
|
|
11
11
|
import { write_gen_results, analyze_gen_results, find_genfiles, load_genfiles } from './gen.js';
|
|
12
|
-
import { SOURCE_DIRNAME } from './
|
|
12
|
+
import { SOURCE_DIRNAME } from './constants.js';
|
|
13
13
|
export const Args = z
|
|
14
14
|
.object({
|
|
15
15
|
_: z.array(Raw_Input_Path, { description: 'input paths to generate' }).default([SOURCE_DIRNAME]),
|
package/dist/gro_config.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ export interface Gro_Config {
|
|
|
27
27
|
* directories and files are included if they pass all of these filters.
|
|
28
28
|
*/
|
|
29
29
|
search_filters: Path_Filter[];
|
|
30
|
+
/**
|
|
31
|
+
* The CLI to use that's compatible with `node`.
|
|
32
|
+
*/
|
|
33
|
+
js_cli: string;
|
|
30
34
|
/**
|
|
31
35
|
* The CLI to use that's compatible with `npm install` and `npm link`. Defaults to `'npm'`.
|
|
32
36
|
*/
|
|
@@ -42,6 +46,7 @@ export interface Raw_Gro_Config {
|
|
|
42
46
|
map_package_json?: Map_Package_Json | null;
|
|
43
47
|
task_root_dirs?: string[];
|
|
44
48
|
search_filters?: Path_Filter | Path_Filter[] | null;
|
|
49
|
+
js_cli?: string;
|
|
45
50
|
pm_cli?: string;
|
|
46
51
|
}
|
|
47
52
|
export type Create_Gro_Config = (base_config: Gro_Config) => Raw_Gro_Config | Promise<Raw_Gro_Config>;
|
|
@@ -52,8 +57,8 @@ export declare const create_empty_gro_config: () => Gro_Config;
|
|
|
52
57
|
* Customize via `search_filters` in the `Gro_Config`.
|
|
53
58
|
* See the test cases for the exact behavior.
|
|
54
59
|
*/
|
|
55
|
-
export declare const
|
|
56
|
-
export declare const
|
|
60
|
+
export declare const SEARCH_EXCLUDER_DEFAULT: RegExp;
|
|
61
|
+
export declare const EXPORTS_EXCLUDER_DEFAULT: RegExp;
|
|
57
62
|
/**
|
|
58
63
|
* Transforms a `Raw_Gro_Config` to the more strict `Gro_Config`.
|
|
59
64
|
* This allows users to provide a more relaxed config.
|
package/dist/gro_config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_config.d.ts","sourceRoot":"../src/lib/","sources":["gro_config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gro_config.d.ts","sourceRoot":"../src/lib/","sources":["gro_config.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,OAAO,EAAE,qBAAqB,CAAC;IAC/B;;;;OAIG;IACH,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C;;;OAGG;IACH,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B;;;OAGG;IACH,cAAc,EAAE,WAAW,EAAE,CAAC;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,GAAG,IAAI,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,iBAAiB,GAAG,CAC/B,WAAW,EAAE,UAAU,KACnB,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE9C,eAAO,MAAM,uBAAuB,QAAO,UAYzC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,QAUnC,CAAC;AAWF,eAAO,MAAM,wBAAwB,QAAwD,CAAC;AAE9F;;;GAGG;AACH,eAAO,MAAM,oBAAoB,eAAgB,cAAc,KAAG,UAwBjE,CAAC;AAEF,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,iBAAiB,CAAC;CACrD;AAED,eAAO,MAAM,eAAe,oBAA6B,OAAO,CAAC,UAAU,CAiB1E,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,CACxC,aAAa,EAAE,GAAG,EAClB,WAAW,EAAE,MAAM,KACf,OAAO,CAAC,aAAa,IAAI,iBAS7B,CAAC"}
|
package/dist/gro_config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join, resolve } from 'node:path';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { GRO_DIST_DIR, IS_THIS_GRO, paths } from './paths.js';
|
|
4
|
-
import { GRO_CONFIG_PATH, NODE_MODULES_DIRNAME, SERVER_DIST_PATH, SVELTEKIT_BUILD_DIRNAME, SVELTEKIT_DIST_DIRNAME, } from './
|
|
4
|
+
import { GRO_CONFIG_PATH, JS_CLI_DEFAULT, NODE_MODULES_DIRNAME, PM_CLI_DEFAULT, SERVER_DIST_PATH, SVELTEKIT_BUILD_DIRNAME, SVELTEKIT_DIST_DIRNAME, } from './constants.js';
|
|
5
5
|
import create_default_config from './gro.config.default.js';
|
|
6
6
|
export const create_empty_gro_config = () => ({
|
|
7
7
|
plugins: () => [],
|
|
@@ -12,8 +12,9 @@ export const create_empty_gro_config = () => ({
|
|
|
12
12
|
IS_THIS_GRO ? null : paths.root,
|
|
13
13
|
IS_THIS_GRO ? null : GRO_DIST_DIR,
|
|
14
14
|
].filter((v) => v !== null),
|
|
15
|
-
search_filters: [(id) => !
|
|
16
|
-
|
|
15
|
+
search_filters: [(id) => !SEARCH_EXCLUDER_DEFAULT.test(id)],
|
|
16
|
+
js_cli: JS_CLI_DEFAULT,
|
|
17
|
+
pm_cli: PM_CLI_DEFAULT,
|
|
17
18
|
});
|
|
18
19
|
/**
|
|
19
20
|
* The regexp used by default to exclude directories and files
|
|
@@ -21,7 +22,7 @@ export const create_empty_gro_config = () => ({
|
|
|
21
22
|
* Customize via `search_filters` in the `Gro_Config`.
|
|
22
23
|
* See the test cases for the exact behavior.
|
|
23
24
|
*/
|
|
24
|
-
export const
|
|
25
|
+
export const SEARCH_EXCLUDER_DEFAULT = new RegExp(`(${'(^|/)\\.[^/]+' + // exclude all `.`-prefixed directories
|
|
25
26
|
// TODO probably change to `pkg.name` instead of this catch-all (also `gro` below)
|
|
26
27
|
`|(^|/)${NODE_MODULES_DIRNAME}(?!/(@[^/]+/)?gro/${SVELTEKIT_DIST_DIRNAME})` + // exclude `node_modules` unless it's to the Gro directory
|
|
27
28
|
`|(^|/)${SVELTEKIT_BUILD_DIRNAME}` + // exclude the SvelteKit build directory
|
|
@@ -30,11 +31,11 @@ export const DEFAULT_SEARCH_EXCLUDER = new RegExp(`(${'(^|/)\\.[^/]+' + // exclu
|
|
|
30
31
|
})($|/)`, 'u');
|
|
31
32
|
const default_map_package_json = (package_json) => {
|
|
32
33
|
if (package_json.exports) {
|
|
33
|
-
package_json.exports = Object.fromEntries(Object.entries(package_json.exports).filter(([k]) => !
|
|
34
|
+
package_json.exports = Object.fromEntries(Object.entries(package_json.exports).filter(([k]) => !EXPORTS_EXCLUDER_DEFAULT.test(k)));
|
|
34
35
|
}
|
|
35
36
|
return package_json;
|
|
36
37
|
};
|
|
37
|
-
export const
|
|
38
|
+
export const EXPORTS_EXCLUDER_DEFAULT = /(\.md|\.(test|ignore)\.|\/(test|fixtures|ignore)\/)/;
|
|
38
39
|
/**
|
|
39
40
|
* Transforms a `Raw_Gro_Config` to the more strict `Gro_Config`.
|
|
40
41
|
* This allows users to provide a more relaxed config.
|
|
@@ -43,7 +44,7 @@ export const normalize_gro_config = (raw_config) => {
|
|
|
43
44
|
const empty_config = create_empty_gro_config();
|
|
44
45
|
// All of the raw config properties are optional,
|
|
45
46
|
// so fall back to the empty values when `undefined`.
|
|
46
|
-
const { plugins = empty_config.plugins, map_package_json = empty_config.map_package_json, task_root_dirs = empty_config.task_root_dirs, search_filters = empty_config.search_filters, pm_cli = empty_config.pm_cli, } = raw_config;
|
|
47
|
+
const { plugins = empty_config.plugins, map_package_json = empty_config.map_package_json, task_root_dirs = empty_config.task_root_dirs, search_filters = empty_config.search_filters, js_cli = empty_config.js_cli, pm_cli = empty_config.pm_cli, } = raw_config;
|
|
47
48
|
return {
|
|
48
49
|
plugins,
|
|
49
50
|
map_package_json,
|
|
@@ -53,6 +54,7 @@ export const normalize_gro_config = (raw_config) => {
|
|
|
53
54
|
: search_filters
|
|
54
55
|
? [search_filters]
|
|
55
56
|
: [],
|
|
57
|
+
js_cli,
|
|
56
58
|
pm_cli,
|
|
57
59
|
};
|
|
58
60
|
};
|
package/dist/gro_helpers.d.ts
CHANGED
|
@@ -45,5 +45,5 @@ export declare const resolve_gro_module_path: (path?: string) => string;
|
|
|
45
45
|
* @param loader_path path to loader
|
|
46
46
|
* @param invoke_path path to file to spawn with `node`
|
|
47
47
|
*/
|
|
48
|
-
export declare const spawn_with_loader: (loader_path: string, invoke_path: string, argv: string[]) => Promise<Spawn_Result>;
|
|
48
|
+
export declare const spawn_with_loader: (loader_path: string, invoke_path: string, argv: string[], js_cli?: string) => Promise<Spawn_Result>;
|
|
49
49
|
//# sourceMappingURL=gro_helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_helpers.d.ts","sourceRoot":"../src/lib/","sources":["gro_helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB,qBAAgB,MAsBnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,gBAChB,MAAM,eACN,MAAM,QACb,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"gro_helpers.d.ts","sourceRoot":"../src/lib/","sources":["gro_helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAQ,KAAK,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,uBAAuB,qBAAgB,MAsBnD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,gBAChB,MAAM,eACN,MAAM,QACb,MAAM,EAAE,sBAEZ,OAAO,CAAC,YAAY,CAgBtB,CAAC"}
|
package/dist/gro_helpers.js
CHANGED
|
@@ -2,7 +2,7 @@ import { realpathSync, existsSync } from 'node:fs';
|
|
|
2
2
|
import { join, resolve } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { spawn } from '@ryanatkn/belt/process.js';
|
|
5
|
-
import { NODE_MODULES_DIRNAME, SVELTEKIT_DIST_DIRNAME } from './
|
|
5
|
+
import { JS_CLI_DEFAULT, NODE_MODULES_DIRNAME, SVELTEKIT_DIST_DIRNAME } from './constants.js';
|
|
6
6
|
/*
|
|
7
7
|
|
|
8
8
|
This module is intended to have minimal dependencies to avoid over-imports in the CLI.
|
|
@@ -74,7 +74,7 @@ export const resolve_gro_module_path = (path = '') => {
|
|
|
74
74
|
* @param loader_path path to loader
|
|
75
75
|
* @param invoke_path path to file to spawn with `node`
|
|
76
76
|
*/
|
|
77
|
-
export const spawn_with_loader = (loader_path, invoke_path, argv) => {
|
|
77
|
+
export const spawn_with_loader = (loader_path, invoke_path, argv, js_cli = JS_CLI_DEFAULT) => {
|
|
78
78
|
const args = [
|
|
79
79
|
'--import',
|
|
80
80
|
// This does the same as `$lib/register.ts` but without the cost of importing another file.
|
|
@@ -89,5 +89,5 @@ export const spawn_with_loader = (loader_path, invoke_path, argv) => {
|
|
|
89
89
|
args.push('-C', 'development'); // same as `--conditions`
|
|
90
90
|
}
|
|
91
91
|
args.push(invoke_path, ...argv);
|
|
92
|
-
return spawn(
|
|
92
|
+
return spawn(js_cli, args);
|
|
93
93
|
};
|
|
@@ -6,7 +6,7 @@ import { strip_before, strip_end } from '@ryanatkn/belt/string.js';
|
|
|
6
6
|
import { existsSync } from 'node:fs';
|
|
7
7
|
import { throttle } from '@ryanatkn/belt/throttle.js';
|
|
8
8
|
import { base_path_to_path_id, LIB_DIRNAME, paths } from './paths.js';
|
|
9
|
-
import { GRO_DEV_DIRNAME, SERVER_DIST_PATH } from './
|
|
9
|
+
import { GRO_DEV_DIRNAME, SERVER_DIST_PATH } from './constants.js';
|
|
10
10
|
import { watch_dir } from './watch_dir.js';
|
|
11
11
|
import { init_sveltekit_config, default_sveltekit_config } from './sveltekit_config.js';
|
|
12
12
|
import { esbuild_plugin_sveltekit_shim_app } from './esbuild_plugin_sveltekit_shim_app.js';
|
|
@@ -28,7 +28,7 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = pro
|
|
|
28
28
|
outdir: join(dir, dev ? GRO_DEV_DIRNAME : SERVER_DIST_PATH),
|
|
29
29
|
outbase: paths.lib,
|
|
30
30
|
outname: 'server/server.js',
|
|
31
|
-
}), env_files, ambient_env, sveltekit_config, target = 'esnext', esbuild_build_options = identity, rebuild_throttle_delay = 1000, cli_command
|
|
31
|
+
}), env_files, ambient_env, sveltekit_config, target = 'esnext', esbuild_build_options = identity, rebuild_throttle_delay = 1000, cli_command, run, // `dev` default is not available in this scope
|
|
32
32
|
} = {}) => {
|
|
33
33
|
let build_ctx = null;
|
|
34
34
|
let watcher = null;
|
|
@@ -36,7 +36,7 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = pro
|
|
|
36
36
|
let deps = null;
|
|
37
37
|
return {
|
|
38
38
|
name: 'gro_plugin_server',
|
|
39
|
-
setup: async ({ dev, watch, timings, log }) => {
|
|
39
|
+
setup: async ({ dev, watch, timings, log, config }) => {
|
|
40
40
|
const parsed_sveltekit_config = !sveltekit_config && strip_end(dir, '/') === process.cwd()
|
|
41
41
|
? default_sveltekit_config
|
|
42
42
|
: await init_sveltekit_config(sveltekit_config ?? dir);
|
|
@@ -141,7 +141,7 @@ export const gro_plugin_server = ({ entry_points = [SERVER_SOURCE_ID], dir = pro
|
|
|
141
141
|
cli_args.push('-C', 'development'); // same as `--conditions`
|
|
142
142
|
}
|
|
143
143
|
cli_args.push(server_outpath);
|
|
144
|
-
server_process = spawn_restartable_process(cli_command, cli_args);
|
|
144
|
+
server_process = spawn_restartable_process(cli_command ?? config.js_cli, cli_args);
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
teardown: async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gro_plugin_sveltekit_app.d.ts","sourceRoot":"../src/lib/","sources":["gro_plugin_sveltekit_app.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAExC,OAAO,EAAyB,KAAK,gBAAg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WAAW,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;AAE9D,eAAO,MAAM,wBAAwB,oGAMlC,OAAO,KAAQ,MA6GjB,CAAC"}
|
|
@@ -5,18 +5,18 @@ import { serialize_package_json, load_package_json } from './package_json.js';
|
|
|
5
5
|
import { Task_Error } from './task.js';
|
|
6
6
|
import { find_cli, spawn_cli, spawn_cli_process } from './cli.js';
|
|
7
7
|
import { serialize_src_json, create_src_json } from './src_json.js';
|
|
8
|
-
import {
|
|
8
|
+
import { EXPORTS_EXCLUDER_DEFAULT } from './gro_config.js';
|
|
9
9
|
import { default_sveltekit_config } from './sveltekit_config.js';
|
|
10
|
-
import { SOURCE_DIRNAME } from './
|
|
10
|
+
import { SOURCE_DIRNAME } from './constants.js';
|
|
11
11
|
import { VITE_CLI } from './sveltekit_helpers.js';
|
|
12
12
|
export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_known_package_json, well_known_src_json, well_known_src_files, vite_cli = VITE_CLI, } = {}) => {
|
|
13
13
|
let sveltekit_process = undefined;
|
|
14
14
|
return {
|
|
15
15
|
name: 'gro_plugin_sveltekit_app',
|
|
16
|
-
setup: async ({ dev, watch, log }) => {
|
|
16
|
+
setup: async ({ dev, watch, log, config }) => {
|
|
17
17
|
const found_vite_cli = find_cli(vite_cli);
|
|
18
18
|
if (!found_vite_cli)
|
|
19
|
-
throw new Error(`Failed to find Vite CLI \`${vite_cli}\`, do you need to run
|
|
19
|
+
throw new Error(`Failed to find Vite CLI \`${vite_cli}\`, do you need to run \`${config.pm_cli} i\`?`);
|
|
20
20
|
if (dev) {
|
|
21
21
|
// `vite dev` in development mode
|
|
22
22
|
if (watch) {
|
|
@@ -67,7 +67,7 @@ export const gro_plugin_sveltekit_app = ({ host_target = 'github_pages', well_kn
|
|
|
67
67
|
: null,
|
|
68
68
|
serialized_src_json && well_known_src_files
|
|
69
69
|
? copy_temporarily(SOURCE_DIRNAME, assets_path, '.well-known', well_known_src_files === true
|
|
70
|
-
? (file_path) => !
|
|
70
|
+
? (file_path) => !EXPORTS_EXCLUDER_DEFAULT.test(file_path)
|
|
71
71
|
: well_known_src_files)
|
|
72
72
|
: null,
|
|
73
73
|
/**
|
|
@@ -5,14 +5,14 @@ import { SVELTE_PACKAGE_CLI, run_svelte_package, } from './sveltekit_helpers.js'
|
|
|
5
5
|
export const gro_plugin_sveltekit_library = ({ svelte_package_options, svelte_package_cli = SVELTE_PACKAGE_CLI, } = {}) => {
|
|
6
6
|
return {
|
|
7
7
|
name: 'gro_plugin_sveltekit_library',
|
|
8
|
-
setup: async ({ dev, log }) => {
|
|
8
|
+
setup: async ({ dev, log, config }) => {
|
|
9
9
|
if (!dev) {
|
|
10
|
-
await run_svelte_package(svelte_package_options, svelte_package_cli, log);
|
|
10
|
+
await run_svelte_package(svelte_package_options, svelte_package_cli, log, config.pm_cli);
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
adapt: async ({ log, timings, config }) => {
|
|
14
14
|
const package_json = load_package_json();
|
|
15
|
-
//
|
|
15
|
+
// link the CLI binaries if they exist
|
|
16
16
|
if (package_json.bin) {
|
|
17
17
|
const timing_to_link = timings.start(`${config.pm_cli} link`);
|
|
18
18
|
await Promise.all(Object.values(package_json.bin).map(async (bin_path) => {
|
package/dist/loader.js
CHANGED
|
@@ -9,7 +9,7 @@ import { render_sveltekit_shim_app_environment, render_sveltekit_shim_app_paths,
|
|
|
9
9
|
import { default_sveltekit_config } from './sveltekit_config.js';
|
|
10
10
|
import { SVELTE_MATCHER, SVELTE_RUNES_MATCHER } from './svelte_helpers.js';
|
|
11
11
|
import { IS_THIS_GRO, paths } from './paths.js';
|
|
12
|
-
import { JSON_MATCHER, NODE_MODULES_DIRNAME, TS_MATCHER } from './
|
|
12
|
+
import { JSON_MATCHER, NODE_MODULES_DIRNAME, TS_MATCHER } from './constants.js';
|
|
13
13
|
import { to_define_import_meta_env, default_ts_transform_options } from './esbuild_helpers.js';
|
|
14
14
|
import { resolve_specifier } from './resolve_specifier.js';
|
|
15
15
|
import { resolve_node_specifier } from './resolve_node_specifier.js';
|
package/dist/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LIB_DIRNAME } from './paths.js';
|
|
2
|
-
import { SOURCE_DIR, SOURCE_DIRNAME } from './
|
|
2
|
+
import { SOURCE_DIR, SOURCE_DIRNAME } from './constants.js';
|
|
3
3
|
export const MODULE_PATH_SRC_PREFIX = SOURCE_DIR;
|
|
4
4
|
export const MODULE_PATH_LIB_PREFIX = `$${LIB_DIRNAME}/`;
|
|
5
5
|
const INTERNAL_MODULE_MATCHER = new RegExp(`^(\\.?\\.?|${SOURCE_DIRNAME}|\\$${LIB_DIRNAME})\\/`, 'u');
|
package/dist/moss_helpers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Result } from '@ryanatkn/belt/result.js';
|
|
2
2
|
import { type Package_Json } from './package_json.js';
|
|
3
3
|
export declare const MOSS_PACKAGE_DEP_NAME = "@ryanatkn/moss";
|
|
4
|
-
export declare const load_moss_plugin: (package_json?: Package_Json, dep_name?: string, plugin_path?: string, local_plugin_path?: string) => Promise<Result<{
|
|
4
|
+
export declare const load_moss_plugin: (package_json?: Package_Json, dep_name?: string, plugin_path?: string, local_plugin_path?: string, pm_cli?: string) => Promise<Result<{
|
|
5
5
|
gro_plugin_moss: any;
|
|
6
6
|
}, {
|
|
7
7
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moss_helpers.d.ts","sourceRoot":"../src/lib/","sources":["moss_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAIrD,OAAO,EAAU,KAAK,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAG7D,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,kBACb,YAAY,
|
|
1
|
+
{"version":3,"file":"moss_helpers.d.ts","sourceRoot":"../src/lib/","sources":["moss_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAIrD,OAAO,EAAU,KAAK,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAG7D,eAAO,MAAM,qBAAqB,mBAAmB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,kBACb,YAAY,2FAKzB,OAAO,CAAC,MAAM,CAAC;IAAC,eAAe,EAAE,GAAG,CAAA;CAAC,EAAE;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CA4B3D,CAAC"}
|
package/dist/moss_helpers.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { has_dep } from './package_json.js';
|
|
4
|
-
import { NODE_MODULES_DIRNAME } from './
|
|
4
|
+
import { NODE_MODULES_DIRNAME, PM_CLI_DEFAULT } from './constants.js';
|
|
5
5
|
export const MOSS_PACKAGE_DEP_NAME = '@ryanatkn/moss';
|
|
6
6
|
// TODO plugin type?
|
|
7
7
|
export const load_moss_plugin = async (package_json, dep_name = MOSS_PACKAGE_DEP_NAME, plugin_path = `${NODE_MODULES_DIRNAME}/${dep_name}/dist/gro_plugin_moss.js`, // TODO maybe lookup from its `package_json.exports`? kinda unnecessary
|
|
8
|
-
local_plugin_path = 'src/lib/gro_plugin_moss.ts') => {
|
|
8
|
+
local_plugin_path = 'src/lib/gro_plugin_moss.ts', pm_cli = PM_CLI_DEFAULT) => {
|
|
9
9
|
if (!has_dep(dep_name, package_json)) {
|
|
10
10
|
return {
|
|
11
11
|
ok: false,
|
|
12
|
-
message: `no dependency found in package.json for ${dep_name}, install it with
|
|
12
|
+
message: `no dependency found in package.json for ${dep_name}, install it with \`${pm_cli} install -D ${dep_name}\``,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
let path = undefined;
|
package/dist/package.d.ts
CHANGED
|
@@ -137,6 +137,10 @@ export declare const package_json: {
|
|
|
137
137
|
types: string;
|
|
138
138
|
default: string;
|
|
139
139
|
};
|
|
140
|
+
'./constants.js': {
|
|
141
|
+
types: string;
|
|
142
|
+
default: string;
|
|
143
|
+
};
|
|
140
144
|
'./deploy.task.js': {
|
|
141
145
|
types: string;
|
|
142
146
|
default: string;
|
|
@@ -301,10 +305,6 @@ export declare const package_json: {
|
|
|
301
305
|
types: string;
|
|
302
306
|
default: string;
|
|
303
307
|
};
|
|
304
|
-
'./path_constants.js': {
|
|
305
|
-
types: string;
|
|
306
|
-
default: string;
|
|
307
|
-
};
|
|
308
308
|
'./path.js': {
|
|
309
309
|
types: string;
|
|
310
310
|
default: string;
|
|
@@ -532,6 +532,13 @@ export declare const src_json: {
|
|
|
532
532
|
kind: "variable";
|
|
533
533
|
}[];
|
|
534
534
|
};
|
|
535
|
+
'./constants.js': {
|
|
536
|
+
path: string;
|
|
537
|
+
declarations: {
|
|
538
|
+
name: string;
|
|
539
|
+
kind: "variable";
|
|
540
|
+
}[];
|
|
541
|
+
};
|
|
535
542
|
'./deploy.task.js': {
|
|
536
543
|
path: string;
|
|
537
544
|
declarations: {
|
|
@@ -897,13 +904,6 @@ export declare const src_json: {
|
|
|
897
904
|
kind: "type";
|
|
898
905
|
})[];
|
|
899
906
|
};
|
|
900
|
-
'./path_constants.js': {
|
|
901
|
-
path: string;
|
|
902
|
-
declarations: {
|
|
903
|
-
name: string;
|
|
904
|
-
kind: "variable";
|
|
905
|
-
}[];
|
|
906
|
-
};
|
|
907
907
|
'./path.js': {
|
|
908
908
|
path: string;
|
|
909
909
|
declarations: ({
|
package/dist/package.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"../src/lib/","sources":["package.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY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