powerlines 0.41.6 → 0.41.8
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/README.md +14 -16
- package/dist/{api-CY668wMZ.mjs → api-BYLuEyjx.mjs} +142 -333
- package/dist/api-BYLuEyjx.mjs.map +1 -0
- package/dist/{api-GPlMYw0d.cjs → api-Zx_hzL3g.cjs} +505 -722
- package/dist/astro.cjs +8 -18
- package/dist/astro.d.cts +1 -2
- package/dist/astro.d.cts.map +1 -1
- package/dist/astro.d.mts +1 -6
- package/dist/astro.d.mts.map +1 -1
- package/dist/astro.mjs +6 -16
- package/dist/astro.mjs.map +1 -1
- package/dist/{chunk-CbDLau6x.cjs → chunk-AIJqnxB6.cjs} +27 -1
- package/dist/chunk-CtajNgzt.mjs +36 -0
- package/dist/config.cjs +20 -4
- package/dist/config.d.cts +1 -2
- package/dist/config.d.mts +1 -3
- package/dist/config.mjs +11 -2
- package/dist/config.mjs.map +1 -0
- package/dist/constants.cjs +20 -20
- package/dist/constants.d.cts +1 -24
- package/dist/constants.d.mts +1 -24
- package/dist/constants.mjs +11 -3
- package/dist/constants.mjs.map +1 -0
- package/dist/context/index.cjs +4 -9
- package/dist/context/index.d.cts +56 -132
- package/dist/context/index.d.cts.map +1 -1
- package/dist/context/index.d.mts +55 -135
- package/dist/context/index.d.mts.map +1 -1
- package/dist/context/index.mjs +3 -9
- package/dist/esbuild.cjs +60 -17
- package/dist/esbuild.d.cts +5 -29
- package/dist/esbuild.d.cts.map +1 -1
- package/dist/esbuild.d.mts +5 -33
- package/dist/esbuild.d.mts.map +1 -1
- package/dist/esbuild.mjs +44 -12
- package/dist/esbuild.mjs.map +1 -0
- package/dist/farm.cjs +6 -13
- package/dist/farm.d.cts +2 -3
- package/dist/farm.d.cts.map +1 -1
- package/dist/farm.d.mts +2 -6
- package/dist/farm.d.mts.map +1 -1
- package/dist/farm.mjs +4 -11
- package/dist/farm.mjs.map +1 -1
- package/dist/index.cjs +7 -13
- package/dist/index.d.cts +263 -6
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +263 -7
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -9
- package/dist/index.mjs.map +1 -1
- package/dist/next.cjs +7 -14
- package/dist/next.d.cts +0 -1
- package/dist/next.d.cts.map +1 -1
- package/dist/next.d.mts +0 -1
- package/dist/next.d.mts.map +1 -1
- package/dist/next.mjs +6 -13
- package/dist/next.mjs.map +1 -1
- package/dist/nuxt.cjs +12 -22
- package/dist/nuxt.d.cts +2 -3
- package/dist/nuxt.d.cts.map +1 -1
- package/dist/nuxt.d.mts +2 -7
- package/dist/nuxt.d.mts.map +1 -1
- package/dist/nuxt.mjs +8 -18
- package/dist/nuxt.mjs.map +1 -1
- package/dist/plugin-utils.cjs +20 -28
- package/dist/plugin-utils.d.cts +1 -267
- package/dist/plugin-utils.d.mts +1 -272
- package/dist/plugin-utils.mjs +11 -4
- package/dist/plugin-utils.mjs.map +1 -0
- package/dist/rolldown.cjs +52 -18
- package/dist/rolldown.d.cts +5 -29
- package/dist/rolldown.d.cts.map +1 -1
- package/dist/rolldown.d.mts +5 -32
- package/dist/rolldown.d.mts.map +1 -1
- package/dist/rolldown.mjs +36 -13
- package/dist/rolldown.mjs.map +1 -0
- package/dist/rollup.cjs +20 -48
- package/dist/rollup.d.cts +5 -29
- package/dist/rollup.d.cts.map +1 -1
- package/dist/rollup.d.mts +5 -32
- package/dist/rollup.d.mts.map +1 -1
- package/dist/rollup.mjs +6 -44
- package/dist/rollup.mjs.map +1 -1
- package/dist/rspack.cjs +20 -82
- package/dist/rspack.d.cts +4 -24
- package/dist/rspack.d.cts.map +1 -1
- package/dist/rspack.d.mts +4 -27
- package/dist/rspack.d.mts.map +1 -1
- package/dist/rspack.mjs +5 -77
- package/dist/rspack.mjs.map +1 -1
- package/dist/storage/index.cjs +2 -3
- package/dist/storage/index.d.cts +7 -7
- package/dist/storage/index.d.cts.map +1 -1
- package/dist/storage/index.d.mts +7 -11
- package/dist/storage/index.d.mts.map +1 -1
- package/dist/storage/index.mjs +1 -3
- package/dist/{tsconfig-C8M8X6U0.cjs → tsconfig-BJrUrPC_.cjs} +13 -13
- package/dist/{tsconfig-B92heKit.mjs → tsconfig-D9GCB2I9.mjs} +5 -5
- package/dist/tsconfig-D9GCB2I9.mjs.map +1 -0
- package/dist/tsdown.cjs +38 -187
- package/dist/tsdown.d.cts +2 -24
- package/dist/tsdown.d.cts.map +1 -1
- package/dist/tsdown.d.mts +4 -30
- package/dist/tsdown.d.mts.map +1 -1
- package/dist/tsdown.mjs +8 -167
- package/dist/tsdown.mjs.map +1 -1
- package/dist/tsup.cjs +29 -134
- package/dist/tsup.d.cts +2 -24
- package/dist/tsup.d.cts.map +1 -1
- package/dist/tsup.d.mts +2 -28
- package/dist/tsup.d.mts.map +1 -1
- package/dist/tsup.mjs +7 -122
- package/dist/tsup.mjs.map +1 -1
- package/dist/types-DerAvFjs.d.cts +4 -0
- package/dist/types-DerAvFjs.d.cts.map +1 -0
- package/dist/types-ro7jWCtL.d.mts +4 -0
- package/dist/types-ro7jWCtL.d.mts.map +1 -0
- package/dist/typescript/index.cjs +2 -1
- package/dist/typescript/index.d.cts +2 -2
- package/dist/typescript/index.d.cts.map +1 -1
- package/dist/typescript/index.d.mts +1 -4
- package/dist/typescript/index.d.mts.map +1 -1
- package/dist/typescript/index.mjs +1 -1
- package/dist/unloader.cjs +6 -13
- package/dist/unloader.d.cts +2 -4
- package/dist/unloader.d.cts.map +1 -1
- package/dist/unloader.d.mts +2 -7
- package/dist/unloader.d.mts.map +1 -1
- package/dist/unloader.mjs +4 -11
- package/dist/unloader.mjs.map +1 -1
- package/dist/unplugin.cjs +11 -14
- package/dist/unplugin.d.cts +5 -6
- package/dist/unplugin.d.cts.map +1 -1
- package/dist/unplugin.d.mts +3 -6
- package/dist/unplugin.d.mts.map +1 -1
- package/dist/unplugin.mjs +6 -10
- package/dist/utils.cjs +38 -22
- package/dist/utils.d.cts +3 -2
- package/dist/utils.d.mts +3 -3
- package/dist/utils.mjs +19 -3
- package/dist/utils.mjs.map +1 -0
- package/dist/{virtual-B1MLgqnQ.cjs → virtual-Cbvj12lU.cjs} +33 -33
- package/dist/{virtual-B9imjOqe.mjs → virtual-DvkJm7gK.mjs} +7 -7
- package/dist/virtual-DvkJm7gK.mjs.map +1 -0
- package/dist/vite.cjs +84 -19
- package/dist/vite.d.cts +5 -16
- package/dist/vite.d.cts.map +1 -1
- package/dist/vite.d.mts +5 -19
- package/dist/vite.d.mts.map +1 -1
- package/dist/vite.mjs +67 -14
- package/dist/vite.mjs.map +1 -0
- package/dist/webpack.cjs +42 -16
- package/dist/webpack.d.cts +5 -29
- package/dist/webpack.d.cts.map +1 -1
- package/dist/webpack.d.mts +5 -32
- package/dist/webpack.d.mts.map +1 -1
- package/dist/webpack.mjs +26 -11
- package/dist/webpack.mjs.map +1 -0
- package/package.json +17 -17
- package/dist/api-CY668wMZ.mjs.map +0 -1
- package/dist/commands-7TWNqTU1.d.cts +0 -12
- package/dist/commands-7TWNqTU1.d.cts.map +0 -1
- package/dist/commands-yacLkOi0.d.mts +0 -12
- package/dist/commands-yacLkOi0.d.mts.map +0 -1
- package/dist/config-CK756s0L.d.mts +0 -2232
- package/dist/config-CK756s0L.d.mts.map +0 -1
- package/dist/config-CiPXgwzt.d.mts +0 -39
- package/dist/config-CiPXgwzt.d.mts.map +0 -1
- package/dist/config-D4Fh2gQL.mjs +0 -87
- package/dist/config-D4Fh2gQL.mjs.map +0 -1
- package/dist/config-D86Vw7SC.cjs +0 -105
- package/dist/config-J74ORCFY.d.cts +0 -39
- package/dist/config-J74ORCFY.d.cts.map +0 -1
- package/dist/config-vnrrSxEB.d.cts +0 -2232
- package/dist/config-vnrrSxEB.d.cts.map +0 -1
- package/dist/constants-CZh5rsgh.cjs +0 -103
- package/dist/constants-cXxSHhNp.mjs +0 -32
- package/dist/constants-cXxSHhNp.mjs.map +0 -1
- package/dist/constants.d.cts.map +0 -1
- package/dist/constants.d.mts.map +0 -1
- package/dist/esbuild-B3NuCco0.cjs +0 -100
- package/dist/esbuild-DWiE0pYc.mjs +0 -82
- package/dist/esbuild-DWiE0pYc.mjs.map +0 -1
- package/dist/index-2JXW-b2-.d.mts +0 -82
- package/dist/index-2JXW-b2-.d.mts.map +0 -1
- package/dist/index-6BLROVtJ.d.mts +0 -261
- package/dist/index-6BLROVtJ.d.mts.map +0 -1
- package/dist/index-C7W0kmm7.d.mts +0 -171
- package/dist/index-C7W0kmm7.d.mts.map +0 -1
- package/dist/index-DJ-k0GOX.d.cts +0 -261
- package/dist/index-DJ-k0GOX.d.cts.map +0 -1
- package/dist/paths-CS8ecCnW.mjs +0 -81
- package/dist/paths-CS8ecCnW.mjs.map +0 -1
- package/dist/paths-YmyIGEVo.cjs +0 -98
- package/dist/plugin-B9TQt-p0.d.cts +0 -82
- package/dist/plugin-B9TQt-p0.d.cts.map +0 -1
- package/dist/plugin-BE3wmhoU.d.cts +0 -26
- package/dist/plugin-BE3wmhoU.d.cts.map +0 -1
- package/dist/plugin-CZ_PJPpQ.cjs +0 -96
- package/dist/plugin-C_8RhG5V.d.mts +0 -26
- package/dist/plugin-C_8RhG5V.d.mts.map +0 -1
- package/dist/plugin-E5foRD0k.mjs +0 -61
- package/dist/plugin-E5foRD0k.mjs.map +0 -1
- package/dist/plugin-utils-C3HnZJl1.mjs +0 -387
- package/dist/plugin-utils-C3HnZJl1.mjs.map +0 -1
- package/dist/plugin-utils-Ck3cx3w6.cjs +0 -531
- package/dist/plugin-utils.d.cts.map +0 -1
- package/dist/plugin-utils.d.mts.map +0 -1
- package/dist/resolve-options-6sXFqzEA.mjs +0 -116
- package/dist/resolve-options-6sXFqzEA.mjs.map +0 -1
- package/dist/resolve-options-BQnTgg3V.cjs +0 -105
- package/dist/resolve-options-D-RGs8j8.mjs +0 -117
- package/dist/resolve-options-D-RGs8j8.mjs.map +0 -1
- package/dist/resolve-options-DHL3RM8F.mjs +0 -87
- package/dist/resolve-options-DHL3RM8F.mjs.map +0 -1
- package/dist/resolve-options-lxQ2pm0W.cjs +0 -127
- package/dist/resolve-options-vyFhhkLp.cjs +0 -133
- package/dist/rolldown-CQI8ps6f.cjs +0 -83
- package/dist/rolldown-DsXEFXyP.mjs +0 -65
- package/dist/rolldown-DsXEFXyP.mjs.map +0 -1
- package/dist/tsconfig-B92heKit.mjs.map +0 -1
- package/dist/types-Bh_vLuQ0.d.mts +0 -1
- package/dist/utils-BbDma_5Y.cjs +0 -449
- package/dist/utils-DoQcX7Sk.mjs +0 -339
- package/dist/utils-DoQcX7Sk.mjs.map +0 -1
- package/dist/virtual-B9imjOqe.mjs.map +0 -1
- package/dist/vite-Bx1gbbj3.mjs +0 -171
- package/dist/vite-Bx1gbbj3.mjs.map +0 -1
- package/dist/vite-XV170zx6.cjs +0 -189
- package/dist/webpack-9G4xJBfz.cjs +0 -107
- package/dist/webpack-BkTkELre.mjs +0 -88
- package/dist/webpack-BkTkELre.mjs.map +0 -1
- package/dist/write-file-CpNWY8SV.d.cts +0 -171
- package/dist/write-file-CpNWY8SV.d.cts.map +0 -1
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
2
|
-
const require_tsconfig = require('./tsconfig-
|
|
3
|
-
const require_plugin_utils = require('./plugin-utils
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
let
|
|
12
|
-
let
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
let
|
|
18
|
-
let
|
|
19
|
-
let
|
|
20
|
-
let
|
|
21
|
-
let
|
|
22
|
-
let
|
|
23
|
-
let
|
|
24
|
-
let
|
|
25
|
-
let
|
|
26
|
-
let
|
|
27
|
-
let
|
|
28
|
-
let
|
|
29
|
-
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
30
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
1
|
+
const require_chunk = require('./chunk-AIJqnxB6.cjs');
|
|
2
|
+
const require_tsconfig = require('./tsconfig-BJrUrPC_.cjs');
|
|
3
|
+
const require_plugin_utils = require('./plugin-utils.cjs');
|
|
4
|
+
const require_constants = require('./constants.cjs');
|
|
5
|
+
const require_config = require('./config.cjs');
|
|
6
|
+
const require_utils = require('./utils.cjs');
|
|
7
|
+
const require_virtual = require('./virtual-Cbvj12lU.cjs');
|
|
8
|
+
let _stryke_fs_get_workspace_root = require("@stryke/fs/get-workspace-root");
|
|
9
|
+
let _storm_software_config_tools_logger_console = require("@storm-software/config-tools/logger/console");
|
|
10
|
+
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
11
|
+
let _stryke_fs_helpers = require("@stryke/fs/helpers");
|
|
12
|
+
let _stryke_fs_install = require("@stryke/fs/install");
|
|
13
|
+
let _stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
14
|
+
let _stryke_fs_package_fns = require("@stryke/fs/package-fns");
|
|
15
|
+
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
16
|
+
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
17
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
18
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
19
|
+
let _stryke_path_replace = require("@stryke/path/replace");
|
|
20
|
+
let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
|
|
21
|
+
let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
|
|
22
|
+
let _stryke_type_checks_is_number = require("@stryke/type-checks/is-number");
|
|
23
|
+
let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
|
|
24
|
+
let _stryke_type_checks_is_promise = require("@stryke/type-checks/is-promise");
|
|
25
|
+
let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
26
|
+
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
27
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
28
|
+
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
31
29
|
let chalk = require("chalk");
|
|
32
30
|
chalk = require_chunk.__toESM(chalk);
|
|
33
31
|
let handlebars = require("handlebars");
|
|
34
32
|
handlebars = require_chunk.__toESM(handlebars);
|
|
35
|
-
let
|
|
36
|
-
let
|
|
37
|
-
let
|
|
33
|
+
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
34
|
+
let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
35
|
+
let _stryke_string_format_pretty_bytes = require("@stryke/string-format/pretty-bytes");
|
|
38
36
|
let ts_morph = require("ts-morph");
|
|
39
37
|
let defu = require("defu");
|
|
40
38
|
defu = require_chunk.__toESM(defu);
|
|
41
|
-
let
|
|
42
|
-
let
|
|
43
|
-
let
|
|
44
|
-
let __stryke_string_format_package = require("@stryke/string-format/package");
|
|
45
|
-
let __stryke_fs_exists = require("@stryke/fs/exists");
|
|
46
|
-
let __stryke_fs_json = require("@stryke/fs/json");
|
|
39
|
+
let _stryke_string_format_package = require("@stryke/string-format/package");
|
|
40
|
+
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
41
|
+
let _stryke_fs_json = require("@stryke/fs/json");
|
|
47
42
|
require("@stryke/fs/remove-file");
|
|
48
|
-
let
|
|
49
|
-
let
|
|
50
|
-
let
|
|
51
|
-
let
|
|
52
|
-
let
|
|
53
|
-
let
|
|
54
|
-
let
|
|
55
|
-
let
|
|
56
|
-
let
|
|
57
|
-
let
|
|
58
|
-
let
|
|
43
|
+
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
44
|
+
let _donedeal0_superdiff = require("@donedeal0/superdiff");
|
|
45
|
+
let _stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
46
|
+
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
47
|
+
let _storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
48
|
+
let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
|
|
49
|
+
let _stryke_hash = require("@stryke/hash");
|
|
50
|
+
let _stryke_hash_node = require("@stryke/hash/node");
|
|
51
|
+
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
52
|
+
let _stryke_http_fetch = require("@stryke/http/fetch");
|
|
53
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
54
|
+
let _stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
|
|
55
|
+
let _stryke_type_checks_is_regexp = require("@stryke/type-checks/is-regexp");
|
|
56
|
+
let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
|
|
59
57
|
let bundle_require = require("bundle-require");
|
|
60
58
|
let compatx = require("compatx");
|
|
61
59
|
let flat_cache = require("flat-cache");
|
|
62
60
|
let oxc_parser = require("oxc-parser");
|
|
63
61
|
let undici = require("undici");
|
|
64
62
|
let jiti = require("jiti");
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
let
|
|
68
|
-
let
|
|
69
|
-
let
|
|
70
|
-
let
|
|
71
|
-
let
|
|
63
|
+
let _stryke_capnp = require("@stryke/capnp");
|
|
64
|
+
_stryke_capnp = require_chunk.__toESM(_stryke_capnp);
|
|
65
|
+
let _stryke_fs_buffer = require("@stryke/fs/buffer");
|
|
66
|
+
let _stryke_path_correct_path = require("@stryke/path/correct-path");
|
|
67
|
+
let _stryke_path_glob_to_regex = require("@stryke/path/glob-to-regex");
|
|
68
|
+
let _stryke_path_is_type = require("@stryke/path/is-type");
|
|
69
|
+
let _stryke_path_slash = require("@stryke/path/slash");
|
|
72
70
|
let node_buffer = require("node:buffer");
|
|
73
71
|
let node_url = require("node:url");
|
|
74
72
|
let oxc_resolver = require("oxc-resolver");
|
|
73
|
+
let _powerlines_core_lib_logger = require("@powerlines/core/lib/logger");
|
|
74
|
+
let _powerlines_core_lib_utilities_source_file = require("@powerlines/core/lib/utilities/source-file");
|
|
75
75
|
let unplugin = require("unplugin");
|
|
76
76
|
|
|
77
77
|
//#region package.json
|
|
78
78
|
var name = "powerlines";
|
|
79
|
-
var version = "0.41.
|
|
79
|
+
var version = "0.41.8";
|
|
80
80
|
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/_internal/helpers/generate-types.ts
|
|
83
|
-
const getModuleCommentBlockRegex = (moduleId) =>
|
|
83
|
+
const getModuleCommentBlockRegex = (moduleId) => new RegExp(`\\/\\*\\*(?s:.)*?@module\\s+${moduleId}(?s:.)*?\\*\\/\\s+`);
|
|
84
84
|
/**
|
|
85
85
|
* Formats the generated TypeScript types source code.
|
|
86
86
|
*
|
|
@@ -110,7 +110,7 @@ async function emitBuiltinTypes(context, files) {
|
|
|
110
110
|
declarationMap: false,
|
|
111
111
|
emitDeclarationOnly: true,
|
|
112
112
|
sourceMap: false,
|
|
113
|
-
outDir: (0,
|
|
113
|
+
outDir: (0, _stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot),
|
|
114
114
|
composite: false,
|
|
115
115
|
incremental: false,
|
|
116
116
|
tsBuildInfoFile: void 0
|
|
@@ -127,10 +127,10 @@ async function emitBuiltinTypes(context, files) {
|
|
|
127
127
|
let builtinModules = "";
|
|
128
128
|
for (const emittedFile of emittedFiles) {
|
|
129
129
|
context.trace(`Processing emitted type declaration file: ${emittedFile.filePath}`);
|
|
130
|
-
const filePath = (0,
|
|
131
|
-
if (!filePath.endsWith(".map") && (0,
|
|
132
|
-
const moduleId = `${context.config.framework}:${(0,
|
|
133
|
-
const moduleComment = emittedFile.text.match(getModuleCommentBlockRegex(moduleId))?.find((comment) => (0,
|
|
130
|
+
const filePath = (0, _stryke_path_append.appendPath)(emittedFile.filePath, context.workspaceConfig.workspaceRoot);
|
|
131
|
+
if (!filePath.endsWith(".map") && (0, _stryke_path_file_path_fns.findFileName)(filePath) !== "tsconfig.tsbuildinfo" && (0, _stryke_path_is_parent_path.isParentPath)(filePath, context.builtinsPath)) {
|
|
132
|
+
const moduleId = `${context.config.framework}:${(0, _stryke_path_replace.replaceExtension)((0, _stryke_path_replace.replacePath)(filePath, context.builtinsPath), "", { fullExtension: true })}`;
|
|
133
|
+
const moduleComment = emittedFile.text.match(getModuleCommentBlockRegex(moduleId))?.find((comment) => (0, _stryke_type_checks_is_set_string.isSetString)(comment?.trim()));
|
|
134
134
|
builtinModules += `${moduleComment ? `\n${moduleComment.trim()}` : ""}
|
|
135
135
|
declare module "${moduleId}" {
|
|
136
136
|
${emittedFile.text.replace(moduleComment ?? "", "").trim().replace(/^\s*export\s*declare\s*/gm, "export ").replace(/^\s*declare\s*/gm, "")}
|
|
@@ -139,14 +139,14 @@ declare module "${moduleId}" {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
builtinModules = formatTypes(builtinModules);
|
|
142
|
-
context.debug(`A TypeScript declaration file (size: ${(0,
|
|
142
|
+
context.debug(`A TypeScript declaration file (size: ${(0, _stryke_string_format_pretty_bytes.prettyBytes)(new Blob((0, _stryke_convert_to_array.toArray)(builtinModules)).size)}) emitted for the built-in modules types.`);
|
|
143
143
|
return builtinModules;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region src/_internal/helpers/hooks.ts
|
|
148
148
|
const mergeResultObjects = (0, defu.createDefu)((obj, key, value) => {
|
|
149
|
-
if ((0,
|
|
149
|
+
if ((0, _stryke_type_checks_is_string.isString)(obj[key]) && (0, _stryke_type_checks_is_string.isString)(value)) {
|
|
150
150
|
obj[key] = `${obj[key] || ""}\n${value || ""}`.trim();
|
|
151
151
|
return true;
|
|
152
152
|
}
|
|
@@ -160,8 +160,8 @@ const mergeResultObjects = (0, defu.createDefu)((obj, key, value) => {
|
|
|
160
160
|
* @returns The merged result.
|
|
161
161
|
*/
|
|
162
162
|
function mergeResults(currentResult, previousResults) {
|
|
163
|
-
if ((0,
|
|
164
|
-
else if ((0,
|
|
163
|
+
if ((0, _stryke_type_checks_is_string.isString)(currentResult)) previousResults = [`${(0, _stryke_type_checks_is_string.isString)(previousResults[0]) ? previousResults[0] || "" : ""}\n${currentResult || ""}`.trim()];
|
|
164
|
+
else if ((0, _stryke_type_checks_is_object.isObject)(currentResult)) previousResults = [mergeResultObjects(currentResult, previousResults[0] ?? {})];
|
|
165
165
|
return previousResults;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
@@ -172,8 +172,8 @@ function mergeResults(currentResult, previousResults) {
|
|
|
172
172
|
* @returns The merged result.
|
|
173
173
|
*/
|
|
174
174
|
function mergeConfigs(currentResult, previousResults) {
|
|
175
|
-
if ((0,
|
|
176
|
-
else if ((0,
|
|
175
|
+
if ((0, _stryke_type_checks_is_string.isString)(currentResult)) previousResults = [`${(0, _stryke_type_checks_is_string.isString)(previousResults[0]) ? previousResults[0] || "" : ""}\n${currentResult || ""}`.trim()];
|
|
176
|
+
else if ((0, _stryke_type_checks_is_object.isObject)(currentResult)) previousResults = [(0, require_plugin_utils.plugin_utils_exports.mergeConfig)(currentResult, previousResults[0] ?? {})];
|
|
177
177
|
return previousResults;
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
@@ -194,24 +194,24 @@ async function callHook(context, key, options, ...args) {
|
|
|
194
194
|
};
|
|
195
195
|
let results = [];
|
|
196
196
|
if (options?.sequential === false) results = await Promise.all(hooks.map(async (hook) => {
|
|
197
|
-
if (!(0,
|
|
197
|
+
if (!(0, _stryke_type_checks_is_function.isFunction)(hook.handler)) throw new Error(`Plugin hook handler for hook "${key}" is not a function.`);
|
|
198
198
|
return invokeHook(hook, [...args]);
|
|
199
199
|
}));
|
|
200
200
|
else for (const hook of hooks) {
|
|
201
|
-
if (!(0,
|
|
201
|
+
if (!(0, _stryke_type_checks_is_function.isFunction)(hook.handler)) throw new Error(`Plugin hook handler for hook "${key}" is not a function.`);
|
|
202
202
|
if (options?.result === "first" || options?.asNextParam === false) {
|
|
203
203
|
results.push(await Promise.resolve(invokeHook(hook, [...args])));
|
|
204
|
-
if (options?.result === "first" && (0,
|
|
204
|
+
if (options?.result === "first" && (0, _stryke_type_checks_is_set.isSet)(results[results.length - 1])) break;
|
|
205
205
|
} else {
|
|
206
206
|
const sequenceArgs = [...args];
|
|
207
|
-
if (results.length > 0 && sequenceArgs.length > 0) sequenceArgs[0] = (0,
|
|
207
|
+
if (results.length > 0 && sequenceArgs.length > 0) sequenceArgs[0] = (0, _stryke_type_checks_is_function.isFunction)(options.asNextParam) ? await Promise.resolve(options.asNextParam(results[0])) : results[0];
|
|
208
208
|
const result = await Promise.resolve(invokeHook(hook, [...sequenceArgs]));
|
|
209
209
|
if (result) if (options.result === "last") results = [result];
|
|
210
210
|
else if (options.result === "merge" && options.merge) results = options.merge(result, results);
|
|
211
211
|
else results = mergeResults(result, results);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
const definedResults = results.filter((result) => (0,
|
|
214
|
+
const definedResults = results.filter((result) => (0, _stryke_type_checks_is_set.isSet)(result));
|
|
215
215
|
if (definedResults.length > 0) {
|
|
216
216
|
let mergedResult = void 0;
|
|
217
217
|
for (const result of definedResults) mergedResult = (0, defu.defu)(result, mergedResult ?? {});
|
|
@@ -230,21 +230,21 @@ async function callHook(context, key, options, ...args) {
|
|
|
230
230
|
* @param dev - Whether to install the package as a dev dependency
|
|
231
231
|
*/
|
|
232
232
|
async function installPackage(context, packageName, dev = false) {
|
|
233
|
-
if (!await (0,
|
|
233
|
+
if (!await (0, _stryke_fs_package_fns.isPackageListed)((0, _stryke_string_format_package.getPackageName)(packageName), { cwd: context.config.root })) if (context.config.autoInstall) {
|
|
234
234
|
context.warn(`The package "${packageName}" is not installed. It will be installed automatically.`);
|
|
235
|
-
const result = await (0,
|
|
235
|
+
const result = await (0, _stryke_fs_install.install)(packageName, {
|
|
236
236
|
cwd: context.config.root,
|
|
237
237
|
dev
|
|
238
238
|
});
|
|
239
|
-
if ((0,
|
|
239
|
+
if ((0, _stryke_type_checks_is_number.isNumber)(result.exitCode) && result.exitCode > 0) {
|
|
240
240
|
context.error(result.stderr);
|
|
241
241
|
throw new Error(`An error occurred while installing the package "${packageName}"`);
|
|
242
242
|
}
|
|
243
243
|
} else context.warn(`The package "${packageName}" is not installed. Since the "autoInstall" option is set to false, it will not be installed automatically.`);
|
|
244
|
-
else if ((0,
|
|
245
|
-
if (!await (0,
|
|
246
|
-
const packageListing = await (0,
|
|
247
|
-
if (!packageListing?.version.startsWith("catalog:") && !packageListing?.version.startsWith("workspace:")) context.warn(`The package "${(0,
|
|
244
|
+
else if ((0, _stryke_string_format_package.hasPackageVersion)(packageName) && !process.env.POWERLINES_SKIP_VERSION_CHECK) {
|
|
245
|
+
if (!await (0, _stryke_fs_package_fns.doesPackageMatch)((0, _stryke_string_format_package.getPackageName)(packageName), (0, _stryke_string_format_package.getPackageVersion)(packageName), context.config.root)) {
|
|
246
|
+
const packageListing = await (0, _stryke_fs_package_fns.getPackageListing)((0, _stryke_string_format_package.getPackageName)(packageName), { cwd: context.config.root });
|
|
247
|
+
if (!packageListing?.version.startsWith("catalog:") && !packageListing?.version.startsWith("workspace:")) context.warn(`The package "${(0, _stryke_string_format_package.getPackageName)(packageName)}" is installed but does not match the expected version ${(0, _stryke_string_format_package.getPackageVersion)(packageName)} (installed version: ${packageListing?.version || "<Unknown>"}). Please ensure this is intentional before proceeding. Note: You can skip this validation with the "STORM_STACK_SKIP_VERSION_CHECK" environment variable.`);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
}
|
|
@@ -264,8 +264,8 @@ async function installDependencies(context) {
|
|
|
264
264
|
context.debug(`No dependencies or devDependencies to install. Skipping installation step.`);
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
context.debug(`The following packages are required: \nDependencies: \n${Object.entries(context.dependencies).map(([name
|
|
268
|
-
await Promise.all([Promise.all(Object.entries(context.dependencies).map(async ([name
|
|
267
|
+
context.debug(`The following packages are required: \nDependencies: \n${Object.entries(context.dependencies).map(([name, version]) => `- ${name}@${String(version)}`).join(" \n")}\n\nDevDependencies: \n${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${String(version)}`).join(" \n")}`);
|
|
268
|
+
await Promise.all([Promise.all(Object.entries(context.dependencies).map(async ([name, version]) => installPackage(context, `${(0, _stryke_string_format_package.getPackageName)(name)}@${String(version)}`, false))), Promise.all(Object.entries(context.devDependencies).map(async ([name, version]) => installPackage(context, `${(0, _stryke_string_format_package.getPackageName)(name)}@${String(version)}`, true)))]);
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
//#endregion
|
|
@@ -280,9 +280,9 @@ async function installDependencies(context) {
|
|
|
280
280
|
* @param rootHash - The hash of the project root.
|
|
281
281
|
* @returns An object containing the name and project root hash.
|
|
282
282
|
*/
|
|
283
|
-
function getPrefixedRootHash(name
|
|
284
|
-
const combined = `${(0,
|
|
285
|
-
return combined.length > require_constants.ROOT_HASH_LENGTH ? combined.slice(0, require_constants.ROOT_HASH_LENGTH) : combined;
|
|
283
|
+
function getPrefixedRootHash(name, rootHash) {
|
|
284
|
+
const combined = `${(0, _stryke_string_format_kebab_case.kebabCase)(name)}_${rootHash}`;
|
|
285
|
+
return combined.length > require_constants.constants_exports.ROOT_HASH_LENGTH ? combined.slice(0, require_constants.constants_exports.ROOT_HASH_LENGTH) : combined;
|
|
286
286
|
}
|
|
287
287
|
/**
|
|
288
288
|
* Writes the meta file for the context.
|
|
@@ -291,7 +291,7 @@ function getPrefixedRootHash(name$1, rootHash) {
|
|
|
291
291
|
* @returns A promise that resolves when the meta file has been written.
|
|
292
292
|
*/
|
|
293
293
|
async function writeMetaFile(context) {
|
|
294
|
-
const metaFilePath = (0,
|
|
294
|
+
const metaFilePath = (0, _stryke_path_join_paths.joinPaths)(context.dataPath, "meta.json");
|
|
295
295
|
context.debug(`Writing runtime metadata to ${metaFilePath}`);
|
|
296
296
|
await context.fs.write(metaFilePath, JSON.stringify(context.meta, null, 2));
|
|
297
297
|
}
|
|
@@ -299,11 +299,11 @@ async function writeMetaFile(context) {
|
|
|
299
299
|
//#endregion
|
|
300
300
|
//#region src/_internal/helpers/resolve-tsconfig.ts
|
|
301
301
|
function getTsconfigDtsPath(context) {
|
|
302
|
-
return (0,
|
|
302
|
+
return (0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_file_path_fns.relativePath)((0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root), (0, _stryke_path_file_path_fns.findFilePath)(context.dtsPath)), (0, _stryke_path_file_path_fns.findFileName)(context.dtsPath));
|
|
303
303
|
}
|
|
304
304
|
async function resolveTsconfigChanges(context) {
|
|
305
305
|
const tsconfig = require_tsconfig.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.root, context.config.tsconfig, context.config.tsconfigRaw);
|
|
306
|
-
const tsconfigJson = await (0,
|
|
306
|
+
const tsconfigJson = await (0, _stryke_fs_json.readJsonFile)(require_tsconfig.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.root, context.config.tsconfig));
|
|
307
307
|
tsconfigJson.compilerOptions ??= {};
|
|
308
308
|
if (context.config.output.dts !== false) {
|
|
309
309
|
const dtsRelativePath = getTsconfigDtsPath(context);
|
|
@@ -333,18 +333,18 @@ async function resolveTsconfigChanges(context) {
|
|
|
333
333
|
}
|
|
334
334
|
async function initializeTsconfig(context) {
|
|
335
335
|
context.debug("Initializing TypeScript configuration (tsconfig.json) for the Powerlines project.");
|
|
336
|
-
if (!(0,
|
|
336
|
+
if (!(0, _stryke_fs_package_fns.isPackageExists)("typescript")) throw new Error("The TypeScript package is not installed. Please install the package using the command: \"npm install typescript --save-dev\"");
|
|
337
337
|
const tsconfigFilePath = require_tsconfig.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.root, context.config.tsconfig);
|
|
338
|
-
context.tsconfig.originalTsconfigJson = await (0,
|
|
338
|
+
context.tsconfig.originalTsconfigJson = await (0, _stryke_fs_json.readJsonFile)(tsconfigFilePath);
|
|
339
339
|
context.tsconfig.tsconfigJson = await resolveTsconfigChanges(context);
|
|
340
340
|
context.debug("Writing updated TypeScript configuration (tsconfig.json) file to disk.");
|
|
341
|
-
await context.fs.write(tsconfigFilePath,
|
|
341
|
+
await context.fs.write(tsconfigFilePath, _stryke_json_storm_json.StormJSON.stringify(context.tsconfig.tsconfigJson));
|
|
342
342
|
context.tsconfig = require_tsconfig.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.root, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
|
|
343
343
|
}
|
|
344
344
|
async function resolveTsconfig(context) {
|
|
345
|
-
const updateTsconfigJson = await (0,
|
|
345
|
+
const updateTsconfigJson = await (0, _stryke_fs_json.readJsonFile)(context.tsconfig.tsconfigFilePath);
|
|
346
346
|
if (updateTsconfigJson?.compilerOptions?.types && Array.isArray(updateTsconfigJson.compilerOptions.types) && !updateTsconfigJson.compilerOptions.types.length) delete updateTsconfigJson.compilerOptions.types;
|
|
347
|
-
const result = (0,
|
|
347
|
+
const result = (0, _donedeal0_superdiff.getObjectDiff)(context.tsconfig.originalTsconfigJson, updateTsconfigJson, {
|
|
348
348
|
ignoreArrayOrder: true,
|
|
349
349
|
showOnly: {
|
|
350
350
|
statuses: [
|
|
@@ -361,29 +361,29 @@ async function resolveTsconfig(context) {
|
|
|
361
361
|
else changes.push({
|
|
362
362
|
field: property ? `${property}.${difference.property}` : difference.property,
|
|
363
363
|
status: difference.status,
|
|
364
|
-
previous: difference.status === "added" ? "---" :
|
|
365
|
-
current: difference.status === "deleted" ? "---" :
|
|
364
|
+
previous: difference.status === "added" ? "---" : _stryke_json_storm_json.StormJSON.stringify(difference.previousValue),
|
|
365
|
+
current: difference.status === "deleted" ? "---" : _stryke_json_storm_json.StormJSON.stringify(difference.currentValue)
|
|
366
366
|
});
|
|
367
367
|
};
|
|
368
368
|
for (const diff of result.diff) getChanges(diff);
|
|
369
369
|
if (changes.length > 0) context.warn(`Updating the following configuration values in "${context.tsconfig.tsconfigFilePath}" file:
|
|
370
370
|
|
|
371
|
-
${changes.map((change, i) => `${chalk.default.bold.whiteBright(`${i + 1}. ${(0,
|
|
371
|
+
${changes.map((change, i) => `${chalk.default.bold.whiteBright(`${i + 1}. ${(0, _stryke_string_format_title_case.titleCase)(change.status)} the ${change.field} field: `)}
|
|
372
372
|
${chalk.default.red(` - Previous: ${change.previous} `)}
|
|
373
373
|
${chalk.default.green(` - Updated: ${change.current} `)}
|
|
374
374
|
`).join("\n")}
|
|
375
375
|
`);
|
|
376
|
-
await context.fs.write(context.tsconfig.tsconfigFilePath,
|
|
376
|
+
await context.fs.write(context.tsconfig.tsconfigFilePath, _stryke_json_storm_json.StormJSON.stringify(updateTsconfigJson));
|
|
377
377
|
context.tsconfig = require_tsconfig.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.root, context.config.tsconfig);
|
|
378
378
|
if (!context.tsconfig) throw new Error("Failed to parse the TypeScript configuration file.");
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
//#endregion
|
|
382
382
|
//#region src/_internal/helpers/environment.ts
|
|
383
|
-
function createEnvironment(name
|
|
384
|
-
return (0, defu.default)(userConfig.environments?.[name
|
|
385
|
-
name
|
|
386
|
-
title: userConfig.title || (0,
|
|
383
|
+
function createEnvironment(name, userConfig) {
|
|
384
|
+
return (0, defu.default)(userConfig.environments?.[name] ?? {}, {
|
|
385
|
+
name,
|
|
386
|
+
title: userConfig.title || (0, _stryke_string_format_title_case.titleCase)(userConfig.name),
|
|
387
387
|
ssr: false,
|
|
388
388
|
mainFields: userConfig?.platform === "browser" ? [
|
|
389
389
|
"browser",
|
|
@@ -417,7 +417,7 @@ function createEnvironment(name$1, userConfig) {
|
|
|
417
417
|
}, userConfig);
|
|
418
418
|
}
|
|
419
419
|
function createDefaultEnvironment(userConfig) {
|
|
420
|
-
return createEnvironment(require_constants.DEFAULT_ENVIRONMENT, userConfig);
|
|
420
|
+
return createEnvironment(require_constants.constants_exports.DEFAULT_ENVIRONMENT, userConfig);
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
//#endregion
|
|
@@ -431,7 +431,7 @@ function createDefaultEnvironment(userConfig) {
|
|
|
431
431
|
function resolveOptions(options) {
|
|
432
432
|
return (0, defu.default)(options, {
|
|
433
433
|
interopDefault: true,
|
|
434
|
-
fsCache: options.mode !== "development" ? (0,
|
|
434
|
+
fsCache: options.mode !== "development" ? (0, _stryke_path_join_paths.joinPaths)(options.cacheDir, "jiti") : false,
|
|
435
435
|
moduleCache: options.mode !== "development"
|
|
436
436
|
});
|
|
437
437
|
}
|
|
@@ -442,31 +442,31 @@ function resolveOptions(options) {
|
|
|
442
442
|
* @returns A Jiti instance configured for the specified workspace and project root.
|
|
443
443
|
*/
|
|
444
444
|
function createResolver(options) {
|
|
445
|
-
const baseResolver = (0, jiti.createJiti)((0,
|
|
446
|
-
baseResolver.plugin = (0, jiti.createJiti)((0,
|
|
445
|
+
const baseResolver = (0, jiti.createJiti)((0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, options.root), resolveOptions(options));
|
|
446
|
+
baseResolver.plugin = (0, jiti.createJiti)((0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, options.root), resolveOptions(options));
|
|
447
447
|
return baseResolver;
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
//#endregion
|
|
451
451
|
//#region schemas/fs.ts
|
|
452
452
|
const _capnpFileId = BigInt("0xa56c61324b9d6e49");
|
|
453
|
-
var FileMetadata_KeyValuePair = class extends
|
|
453
|
+
var FileMetadata_KeyValuePair = class extends _stryke_capnp.Struct {
|
|
454
454
|
static _capnp = {
|
|
455
455
|
displayName: "KeyValuePair",
|
|
456
456
|
id: "eabb26cf58b2a14c",
|
|
457
|
-
size: new
|
|
457
|
+
size: new _stryke_capnp.ObjectSize(0, 2)
|
|
458
458
|
};
|
|
459
459
|
get key() {
|
|
460
|
-
return
|
|
460
|
+
return _stryke_capnp.utils.getText(0, this);
|
|
461
461
|
}
|
|
462
462
|
set key(value) {
|
|
463
|
-
|
|
463
|
+
_stryke_capnp.utils.setText(0, value, this);
|
|
464
464
|
}
|
|
465
465
|
get value() {
|
|
466
|
-
return
|
|
466
|
+
return _stryke_capnp.utils.getText(1, this);
|
|
467
467
|
}
|
|
468
468
|
set value(value) {
|
|
469
|
-
|
|
469
|
+
_stryke_capnp.utils.setText(1, value, this);
|
|
470
470
|
}
|
|
471
471
|
toString() {
|
|
472
472
|
return "FileMetadata_KeyValuePair_" + super.toString();
|
|
@@ -476,12 +476,12 @@ var FileMetadata_KeyValuePair = class extends __stryke_capnp.Struct {
|
|
|
476
476
|
* The identifier for the file data.
|
|
477
477
|
*
|
|
478
478
|
*/
|
|
479
|
-
var FileMetadata = class FileMetadata extends
|
|
479
|
+
var FileMetadata = class FileMetadata extends _stryke_capnp.Struct {
|
|
480
480
|
static KeyValuePair = FileMetadata_KeyValuePair;
|
|
481
481
|
static _capnp = {
|
|
482
482
|
displayName: "FileMetadata",
|
|
483
483
|
id: "8e2cab5d7e28c7b3",
|
|
484
|
-
size: new
|
|
484
|
+
size: new _stryke_capnp.ObjectSize(8, 3),
|
|
485
485
|
defaultType: "normal"
|
|
486
486
|
};
|
|
487
487
|
static _Properties;
|
|
@@ -490,48 +490,48 @@ var FileMetadata = class FileMetadata extends __stryke_capnp.Struct {
|
|
|
490
490
|
*
|
|
491
491
|
*/
|
|
492
492
|
get id() {
|
|
493
|
-
return
|
|
493
|
+
return _stryke_capnp.utils.getText(0, this);
|
|
494
494
|
}
|
|
495
495
|
set id(value) {
|
|
496
|
-
|
|
496
|
+
_stryke_capnp.utils.setText(0, value, this);
|
|
497
497
|
}
|
|
498
498
|
/**
|
|
499
499
|
* The timestamp representing the file's creation date.
|
|
500
500
|
*
|
|
501
501
|
*/
|
|
502
502
|
get type() {
|
|
503
|
-
return
|
|
503
|
+
return _stryke_capnp.utils.getText(1, this, FileMetadata._capnp.defaultType);
|
|
504
504
|
}
|
|
505
505
|
set type(value) {
|
|
506
|
-
|
|
506
|
+
_stryke_capnp.utils.setText(1, value, this);
|
|
507
507
|
}
|
|
508
508
|
/**
|
|
509
509
|
* Additional metadata associated with the file.
|
|
510
510
|
*
|
|
511
511
|
*/
|
|
512
512
|
get timestamp() {
|
|
513
|
-
return
|
|
513
|
+
return _stryke_capnp.utils.getUint32(0, this);
|
|
514
514
|
}
|
|
515
515
|
set timestamp(value) {
|
|
516
|
-
|
|
516
|
+
_stryke_capnp.utils.setUint32(0, value, this);
|
|
517
517
|
}
|
|
518
518
|
_adoptProperties(value) {
|
|
519
|
-
|
|
519
|
+
_stryke_capnp.utils.adopt(value, _stryke_capnp.utils.getPointer(2, this));
|
|
520
520
|
}
|
|
521
521
|
_disownProperties() {
|
|
522
|
-
return
|
|
522
|
+
return _stryke_capnp.utils.disown(this.properties);
|
|
523
523
|
}
|
|
524
524
|
get properties() {
|
|
525
|
-
return
|
|
525
|
+
return _stryke_capnp.utils.getList(2, FileMetadata._Properties, this);
|
|
526
526
|
}
|
|
527
527
|
_hasProperties() {
|
|
528
|
-
return !
|
|
528
|
+
return !_stryke_capnp.utils.isNull(_stryke_capnp.utils.getPointer(2, this));
|
|
529
529
|
}
|
|
530
530
|
_initProperties(length) {
|
|
531
|
-
return
|
|
531
|
+
return _stryke_capnp.utils.initList(2, FileMetadata._Properties, length, this);
|
|
532
532
|
}
|
|
533
533
|
set properties(value) {
|
|
534
|
-
|
|
534
|
+
_stryke_capnp.utils.copyFrom(value, _stryke_capnp.utils.getPointer(2, this));
|
|
535
535
|
}
|
|
536
536
|
toString() {
|
|
537
537
|
return "FileMetadata_" + super.toString();
|
|
@@ -541,27 +541,27 @@ var FileMetadata = class FileMetadata extends __stryke_capnp.Struct {
|
|
|
541
541
|
* An identifier for the file.
|
|
542
542
|
*
|
|
543
543
|
*/
|
|
544
|
-
var FileId = class extends
|
|
544
|
+
var FileId = class extends _stryke_capnp.Struct {
|
|
545
545
|
static _capnp = {
|
|
546
546
|
displayName: "FileId",
|
|
547
547
|
id: "990d6a471072f997",
|
|
548
|
-
size: new
|
|
548
|
+
size: new _stryke_capnp.ObjectSize(0, 2)
|
|
549
549
|
};
|
|
550
550
|
/**
|
|
551
551
|
* A virtual (or actual) path to the file in the file system.
|
|
552
552
|
*
|
|
553
553
|
*/
|
|
554
554
|
get id() {
|
|
555
|
-
return
|
|
555
|
+
return _stryke_capnp.utils.getText(0, this);
|
|
556
556
|
}
|
|
557
557
|
set id(value) {
|
|
558
|
-
|
|
558
|
+
_stryke_capnp.utils.setText(0, value, this);
|
|
559
559
|
}
|
|
560
560
|
get path() {
|
|
561
|
-
return
|
|
561
|
+
return _stryke_capnp.utils.getText(1, this);
|
|
562
562
|
}
|
|
563
563
|
set path(value) {
|
|
564
|
-
|
|
564
|
+
_stryke_capnp.utils.setText(1, value, this);
|
|
565
565
|
}
|
|
566
566
|
toString() {
|
|
567
567
|
return "FileId_" + super.toString();
|
|
@@ -571,103 +571,103 @@ var FileId = class extends __stryke_capnp.Struct {
|
|
|
571
571
|
* An identifier for the file.
|
|
572
572
|
*
|
|
573
573
|
*/
|
|
574
|
-
var FileStorage = class extends
|
|
574
|
+
var FileStorage = class extends _stryke_capnp.Struct {
|
|
575
575
|
static _capnp = {
|
|
576
576
|
displayName: "FileStorage",
|
|
577
577
|
id: "9dca66ac858c9ebe",
|
|
578
|
-
size: new
|
|
578
|
+
size: new _stryke_capnp.ObjectSize(0, 2)
|
|
579
579
|
};
|
|
580
580
|
/**
|
|
581
581
|
* A virtual (or actual) path to the file in the file system.
|
|
582
582
|
*
|
|
583
583
|
*/
|
|
584
584
|
get path() {
|
|
585
|
-
return
|
|
585
|
+
return _stryke_capnp.utils.getText(0, this);
|
|
586
586
|
}
|
|
587
587
|
set path(value) {
|
|
588
|
-
|
|
588
|
+
_stryke_capnp.utils.setText(0, value, this);
|
|
589
589
|
}
|
|
590
590
|
get code() {
|
|
591
|
-
return
|
|
591
|
+
return _stryke_capnp.utils.getText(1, this);
|
|
592
592
|
}
|
|
593
593
|
set code(value) {
|
|
594
|
-
|
|
594
|
+
_stryke_capnp.utils.setText(1, value, this);
|
|
595
595
|
}
|
|
596
596
|
toString() {
|
|
597
597
|
return "FileStorage_" + super.toString();
|
|
598
598
|
}
|
|
599
599
|
};
|
|
600
|
-
var FileSystem = class FileSystem extends
|
|
600
|
+
var FileSystem = class FileSystem extends _stryke_capnp.Struct {
|
|
601
601
|
static _capnp = {
|
|
602
602
|
displayName: "FileSystem",
|
|
603
603
|
id: "ae0c23d43e56abcf",
|
|
604
|
-
size: new
|
|
604
|
+
size: new _stryke_capnp.ObjectSize(0, 3)
|
|
605
605
|
};
|
|
606
606
|
static _Ids;
|
|
607
607
|
static _Storage;
|
|
608
608
|
static _Metadata;
|
|
609
609
|
_adoptIds(value) {
|
|
610
|
-
|
|
610
|
+
_stryke_capnp.utils.adopt(value, _stryke_capnp.utils.getPointer(0, this));
|
|
611
611
|
}
|
|
612
612
|
_disownIds() {
|
|
613
|
-
return
|
|
613
|
+
return _stryke_capnp.utils.disown(this.ids);
|
|
614
614
|
}
|
|
615
615
|
get ids() {
|
|
616
|
-
return
|
|
616
|
+
return _stryke_capnp.utils.getList(0, FileSystem._Ids, this);
|
|
617
617
|
}
|
|
618
618
|
_hasIds() {
|
|
619
|
-
return !
|
|
619
|
+
return !_stryke_capnp.utils.isNull(_stryke_capnp.utils.getPointer(0, this));
|
|
620
620
|
}
|
|
621
621
|
_initIds(length) {
|
|
622
|
-
return
|
|
622
|
+
return _stryke_capnp.utils.initList(0, FileSystem._Ids, length, this);
|
|
623
623
|
}
|
|
624
624
|
set ids(value) {
|
|
625
|
-
|
|
625
|
+
_stryke_capnp.utils.copyFrom(value, _stryke_capnp.utils.getPointer(0, this));
|
|
626
626
|
}
|
|
627
627
|
_adoptStorage(value) {
|
|
628
|
-
|
|
628
|
+
_stryke_capnp.utils.adopt(value, _stryke_capnp.utils.getPointer(1, this));
|
|
629
629
|
}
|
|
630
630
|
_disownStorage() {
|
|
631
|
-
return
|
|
631
|
+
return _stryke_capnp.utils.disown(this.storage);
|
|
632
632
|
}
|
|
633
633
|
get storage() {
|
|
634
|
-
return
|
|
634
|
+
return _stryke_capnp.utils.getList(1, FileSystem._Storage, this);
|
|
635
635
|
}
|
|
636
636
|
_hasStorage() {
|
|
637
|
-
return !
|
|
637
|
+
return !_stryke_capnp.utils.isNull(_stryke_capnp.utils.getPointer(1, this));
|
|
638
638
|
}
|
|
639
639
|
_initStorage(length) {
|
|
640
|
-
return
|
|
640
|
+
return _stryke_capnp.utils.initList(1, FileSystem._Storage, length, this);
|
|
641
641
|
}
|
|
642
642
|
set storage(value) {
|
|
643
|
-
|
|
643
|
+
_stryke_capnp.utils.copyFrom(value, _stryke_capnp.utils.getPointer(1, this));
|
|
644
644
|
}
|
|
645
645
|
_adoptMetadata(value) {
|
|
646
|
-
|
|
646
|
+
_stryke_capnp.utils.adopt(value, _stryke_capnp.utils.getPointer(2, this));
|
|
647
647
|
}
|
|
648
648
|
_disownMetadata() {
|
|
649
|
-
return
|
|
649
|
+
return _stryke_capnp.utils.disown(this.metadata);
|
|
650
650
|
}
|
|
651
651
|
get metadata() {
|
|
652
|
-
return
|
|
652
|
+
return _stryke_capnp.utils.getList(2, FileSystem._Metadata, this);
|
|
653
653
|
}
|
|
654
654
|
_hasMetadata() {
|
|
655
|
-
return !
|
|
655
|
+
return !_stryke_capnp.utils.isNull(_stryke_capnp.utils.getPointer(2, this));
|
|
656
656
|
}
|
|
657
657
|
_initMetadata(length) {
|
|
658
|
-
return
|
|
658
|
+
return _stryke_capnp.utils.initList(2, FileSystem._Metadata, length, this);
|
|
659
659
|
}
|
|
660
660
|
set metadata(value) {
|
|
661
|
-
|
|
661
|
+
_stryke_capnp.utils.copyFrom(value, _stryke_capnp.utils.getPointer(2, this));
|
|
662
662
|
}
|
|
663
663
|
toString() {
|
|
664
664
|
return "FileSystem_" + super.toString();
|
|
665
665
|
}
|
|
666
666
|
};
|
|
667
|
-
FileMetadata._Properties =
|
|
668
|
-
FileSystem._Ids =
|
|
669
|
-
FileSystem._Storage =
|
|
670
|
-
FileSystem._Metadata =
|
|
667
|
+
FileMetadata._Properties = _stryke_capnp.CompositeList(FileMetadata_KeyValuePair);
|
|
668
|
+
FileSystem._Ids = _stryke_capnp.CompositeList(FileId);
|
|
669
|
+
FileSystem._Storage = _stryke_capnp.CompositeList(FileStorage);
|
|
670
|
+
FileSystem._Metadata = _stryke_capnp.CompositeList(FileMetadata);
|
|
671
671
|
|
|
672
672
|
//#endregion
|
|
673
673
|
//#region src/_internal/helpers/constants.ts
|
|
@@ -690,7 +690,7 @@ const DEFAULT_EXTENSIONS = [
|
|
|
690
690
|
//#endregion
|
|
691
691
|
//#region src/_internal/vfs.ts
|
|
692
692
|
function toFilePath(path) {
|
|
693
|
-
return (0,
|
|
693
|
+
return (0, _stryke_path_correct_path.correctPath)((0, _stryke_path_slash.slash)(path?.toString() || ".").replace(/^file:\/\//, ""));
|
|
694
694
|
}
|
|
695
695
|
/**
|
|
696
696
|
* Checks if a given file id is valid based on the specified prefix.
|
|
@@ -710,7 +710,7 @@ function isValidId(id, prefix = "powerlines") {
|
|
|
710
710
|
* @returns The formatted file ID.
|
|
711
711
|
*/
|
|
712
712
|
function normalizeId(id, prefix = "powerlines") {
|
|
713
|
-
return (0,
|
|
713
|
+
return (0, _stryke_path_replace.replaceExtension)(toFilePath(id)).replace(/^\\0/, "").replace(/^powerlines:/, "").replace(new RegExp(`^${prefix.replace(/:$/, "")}:`), "");
|
|
714
714
|
}
|
|
715
715
|
/**
|
|
716
716
|
* Normalizes a given path by resolving it against the project root, workspace root, and built-ins path.
|
|
@@ -721,7 +721,7 @@ function normalizeId(id, prefix = "powerlines") {
|
|
|
721
721
|
* @returns The normalized path.
|
|
722
722
|
*/
|
|
723
723
|
function normalizePath(path, builtinsPath, prefix = "powerlines") {
|
|
724
|
-
return (0,
|
|
724
|
+
return (0, _stryke_path_is_type.isAbsolutePath)(path) ? path : isValidId(toFilePath(path), prefix) ? normalizeId(toFilePath(path), prefix).replace(new RegExp(`^${prefix.replace(/:$/, "")}:`), builtinsPath) : toFilePath(path);
|
|
725
725
|
}
|
|
726
726
|
/**
|
|
727
727
|
* Normalizes glob patterns by resolving them against the workspace root.
|
|
@@ -731,11 +731,11 @@ function normalizePath(path, builtinsPath, prefix = "powerlines") {
|
|
|
731
731
|
* @returns An array of normalized glob patterns.
|
|
732
732
|
*/
|
|
733
733
|
function normalizeGlobPatterns(workspaceRoot, patterns) {
|
|
734
|
-
return (0,
|
|
735
|
-
if ((0,
|
|
736
|
-
else if (!(0,
|
|
734
|
+
return (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(patterns).map((pattern) => {
|
|
735
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(pattern) && ((0, _stryke_type_checks_is_set_string.isSetString)(pattern.input) || (0, _stryke_type_checks_is_set_string.isSetString)(pattern.glob))) return (0, _stryke_path_join.joinPaths)(pattern.input || workspaceRoot, pattern.glob || "**/*");
|
|
736
|
+
else if (!(0, _stryke_type_checks_is_set_string.isSetString)(pattern)) return;
|
|
737
737
|
return pattern;
|
|
738
|
-
}).filter(
|
|
738
|
+
}).filter(_stryke_type_checks_is_set_string.isSetString));
|
|
739
739
|
}
|
|
740
740
|
/**
|
|
741
741
|
* Represents a virtual file system (VFS) that stores files and their associated metadata in virtual memory.
|
|
@@ -793,7 +793,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
793
793
|
*/
|
|
794
794
|
#normalizeId(id) {
|
|
795
795
|
let normalized = id;
|
|
796
|
-
if ((0,
|
|
796
|
+
if ((0, _stryke_path_is_parent_path.isParentPath)(normalized, this.#context.builtinsPath)) normalized = (0, _stryke_path_replace.replacePath)(normalized, this.#context.builtinsPath);
|
|
797
797
|
return normalizeId(normalized, this.#context.config.framework);
|
|
798
798
|
}
|
|
799
799
|
/**
|
|
@@ -803,7 +803,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
803
803
|
* @returns The normalized path.
|
|
804
804
|
*/
|
|
805
805
|
#normalizePath(path) {
|
|
806
|
-
return normalizePath(path.includes("{") || path.includes("}") ?
|
|
806
|
+
return normalizePath(path.includes("{") || path.includes("}") ? (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this.#context, path) : path, this.#context.builtinsPath, this.#context.config.framework);
|
|
807
807
|
}
|
|
808
808
|
/**
|
|
809
809
|
* Gets the storage adapter and relative key for a given key.
|
|
@@ -816,9 +816,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
816
816
|
*/
|
|
817
817
|
#getStorage(key, preset) {
|
|
818
818
|
const path = this.resolveSync(this.#normalizePath(key)) || key;
|
|
819
|
-
for (const base of Object.keys(this.#storage).filter(Boolean).sort().reverse()) if ((path === base || (0,
|
|
819
|
+
for (const base of Object.keys(this.#storage).filter(Boolean).sort().reverse()) if ((path === base || (0, _stryke_path_is_parent_path.isParentPath)(path, base)) && (!preset || this.#storage[base]?.preset?.toLowerCase() === preset.toLowerCase())) return {
|
|
820
820
|
base,
|
|
821
|
-
relativeKey: (0,
|
|
821
|
+
relativeKey: (0, _stryke_path_replace.replacePath)(path, base),
|
|
822
822
|
adapter: this.#storage[base]
|
|
823
823
|
};
|
|
824
824
|
if (!preset || this.#storage[""]?.preset?.toLowerCase() === preset.toLowerCase()) return {
|
|
@@ -842,7 +842,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
842
842
|
*/
|
|
843
843
|
#getStorages(base = "", includeParent = false) {
|
|
844
844
|
const baseKey = this.resolveSync(base) || base;
|
|
845
|
-
return Object.keys(this.#storage).sort().reverse().filter((key) => (0,
|
|
845
|
+
return Object.keys(this.#storage).sort().reverse().filter((key) => (0, _stryke_path_is_parent_path.isParentPath)(key, baseKey) || includeParent && (0, _stryke_path_is_parent_path.isParentPath)(baseKey, key) || baseKey.includes("*") && ((0, _stryke_path_is_parent_path.isParentPath)((0, _stryke_path_correct_path.stripStars)(baseKey), key) || (0, _stryke_path_glob_to_regex.globToRegex)((0, _stryke_path_replace.replaceExtension)(baseKey)).test(key))).map((key) => ({
|
|
846
846
|
relativeBase: baseKey.length > key.length ? baseKey.slice(key.length) : void 0,
|
|
847
847
|
base: key,
|
|
848
848
|
adapter: this.#storage[key]
|
|
@@ -866,10 +866,10 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
866
866
|
*/
|
|
867
867
|
#innerResolve = async (id, importer, options = {}) => {
|
|
868
868
|
let path = id;
|
|
869
|
-
if (path.includes("{") || path.includes("}")) path =
|
|
869
|
+
if (path.includes("{") || path.includes("}")) path = (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this.#context, path);
|
|
870
870
|
if (options.skipAlias !== true) path = this.resolveAlias(path);
|
|
871
|
-
if ((0,
|
|
872
|
-
const resolverCacheKey = (0,
|
|
871
|
+
if ((0, _stryke_path_is_type.isAbsolutePath)(path) && (!options.isFile || !await this.isDirectory(path))) return path;
|
|
872
|
+
const resolverCacheKey = (0, _stryke_hash.murmurhash)({
|
|
873
873
|
path: this.#normalizeId(path),
|
|
874
874
|
importer,
|
|
875
875
|
options
|
|
@@ -885,11 +885,11 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
885
885
|
if (importer && !paths.includes(importer)) paths.push(importer);
|
|
886
886
|
if (!importer) {
|
|
887
887
|
paths.push(this.#context.workspaceConfig.workspaceRoot);
|
|
888
|
-
paths.push((0,
|
|
889
|
-
paths.push((0,
|
|
888
|
+
paths.push((0, _stryke_path_append.appendPath)(this.#context.config.root, this.#context.workspaceConfig.workspaceRoot));
|
|
889
|
+
paths.push((0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(this.#context.config.root, "src"), this.#context.workspaceConfig.workspaceRoot));
|
|
890
890
|
}
|
|
891
|
-
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => (0,
|
|
892
|
-
for (const combination of (0,
|
|
891
|
+
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => (0, _stryke_path_append.appendPath)(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
|
|
892
|
+
for (const combination of (0, _stryke_fs_resolve.getResolutionCombinations)(path, { paths })) {
|
|
893
893
|
const { relativeKey, adapter } = this.#getStorage(combination);
|
|
894
894
|
if (await adapter.exists(relativeKey)) {
|
|
895
895
|
result = combination;
|
|
@@ -898,7 +898,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
898
898
|
}
|
|
899
899
|
if (!result) {
|
|
900
900
|
try {
|
|
901
|
-
result = await (0,
|
|
901
|
+
result = await (0, _stryke_fs_resolve.resolve)(path, {
|
|
902
902
|
...options,
|
|
903
903
|
paths
|
|
904
904
|
});
|
|
@@ -934,9 +934,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
934
934
|
*/
|
|
935
935
|
#innerResolveSync = (id, importer, options = {}) => {
|
|
936
936
|
let path = id;
|
|
937
|
-
if (path.includes("{") || path.includes("}")) path =
|
|
937
|
+
if (path.includes("{") || path.includes("}")) path = (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this.#context, path);
|
|
938
938
|
if (options.skipAlias !== true) path = this.resolveAlias(path);
|
|
939
|
-
if ((0,
|
|
939
|
+
if ((0, _stryke_path_is_type.isAbsolutePath)(path) && (!options.isFile || !this.isDirectorySync(path))) return path;
|
|
940
940
|
let result;
|
|
941
941
|
if (!this.#context.config.skipCache) {
|
|
942
942
|
result = this.resolverCache.get(this.#normalizeId(path));
|
|
@@ -948,11 +948,11 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
948
948
|
if (importer && !paths.includes(importer)) paths.push(importer);
|
|
949
949
|
if (!importer) {
|
|
950
950
|
paths.push(this.#context.workspaceConfig.workspaceRoot);
|
|
951
|
-
paths.push((0,
|
|
952
|
-
paths.push((0,
|
|
951
|
+
paths.push((0, _stryke_path_append.appendPath)(this.#context.config.root, this.#context.workspaceConfig.workspaceRoot));
|
|
952
|
+
paths.push((0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(this.#context.config.root, "src"), this.#context.workspaceConfig.workspaceRoot));
|
|
953
953
|
}
|
|
954
|
-
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => (0,
|
|
955
|
-
for (const combination of (0,
|
|
954
|
+
paths.push(...Object.keys(this.#context.tsconfig?.options?.paths ?? {}).filter((tsconfigPath) => path.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig?.options?.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => (0, _stryke_path_append.appendPath)(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
|
|
955
|
+
for (const combination of (0, _stryke_fs_resolve.getResolutionCombinations)(path, { paths })) {
|
|
956
956
|
const { relativeKey, adapter } = this.#getStorage(combination);
|
|
957
957
|
if (adapter.existsSync(relativeKey)) {
|
|
958
958
|
result = combination;
|
|
@@ -961,7 +961,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
961
961
|
}
|
|
962
962
|
if (!result) {
|
|
963
963
|
try {
|
|
964
|
-
result = (0,
|
|
964
|
+
result = (0, _stryke_fs_resolve.resolveSync)(path, {
|
|
965
965
|
...options,
|
|
966
966
|
paths
|
|
967
967
|
});
|
|
@@ -988,9 +988,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
988
988
|
static async create(context) {
|
|
989
989
|
context.debug("Starting virtual file system (VFS) initialization processes...");
|
|
990
990
|
let result;
|
|
991
|
-
if (!context.config.skipCache && (0,
|
|
992
|
-
const buffer = await (0,
|
|
993
|
-
const fs = new
|
|
991
|
+
if (!context.config.skipCache && (0, _stryke_fs_exists.existsSync)((0, _stryke_path_join.joinPaths)(context.dataPath, "fs.bin"))) {
|
|
992
|
+
const buffer = await (0, _stryke_fs_buffer.readFileBuffer)((0, _stryke_path_join.joinPaths)(context.dataPath, "fs.bin"));
|
|
993
|
+
const fs = new _stryke_capnp.Message(buffer, false).getRoot(FileSystem);
|
|
994
994
|
result = new VirtualFileSystem(context, fs);
|
|
995
995
|
if (fs._hasStorage() && fs.storage.length > 0) await Promise.all(fs.storage.values().map(async (file) => {
|
|
996
996
|
if (file.path && file.code) {
|
|
@@ -1009,8 +1009,8 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1009
1009
|
} });
|
|
1010
1010
|
}
|
|
1011
1011
|
}));
|
|
1012
|
-
} else result = new VirtualFileSystem(context, new
|
|
1013
|
-
result.#log(
|
|
1012
|
+
} else result = new VirtualFileSystem(context, new _stryke_capnp.Message().initRoot(FileSystem));
|
|
1013
|
+
result.#log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Successfully completed virtual file system (VFS) initialization.");
|
|
1014
1014
|
return result;
|
|
1015
1015
|
}
|
|
1016
1016
|
/**
|
|
@@ -1022,9 +1022,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1022
1022
|
static createSync(context) {
|
|
1023
1023
|
context.debug("Starting virtual file system (VFS) initialization processes...");
|
|
1024
1024
|
let result;
|
|
1025
|
-
if (!context.config.skipCache && (0,
|
|
1026
|
-
const buffer = (0,
|
|
1027
|
-
const fs = new
|
|
1025
|
+
if (!context.config.skipCache && (0, _stryke_fs_exists.existsSync)((0, _stryke_path_join.joinPaths)(context.dataPath, "fs.bin"))) {
|
|
1026
|
+
const buffer = (0, _stryke_fs_buffer.readFileBufferSync)((0, _stryke_path_join.joinPaths)(context.dataPath, "fs.bin"));
|
|
1027
|
+
const fs = new _stryke_capnp.Message(buffer, false).getRoot(FileSystem);
|
|
1028
1028
|
result = new VirtualFileSystem(context, fs);
|
|
1029
1029
|
if (fs._hasStorage() && fs.storage.length > 0) fs.storage.values().forEach((file) => {
|
|
1030
1030
|
if (file.path && file.code) {
|
|
@@ -1043,8 +1043,8 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1043
1043
|
} });
|
|
1044
1044
|
}
|
|
1045
1045
|
});
|
|
1046
|
-
} else result = new VirtualFileSystem(context, new
|
|
1047
|
-
result.#log(
|
|
1046
|
+
} else result = new VirtualFileSystem(context, new _stryke_capnp.Message().initRoot(FileSystem));
|
|
1047
|
+
result.#log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Successfully completed virtual file system (VFS) initialization.");
|
|
1048
1048
|
return result;
|
|
1049
1049
|
}
|
|
1050
1050
|
/**
|
|
@@ -1067,7 +1067,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1067
1067
|
return this.#normalizeId(prop) in target;
|
|
1068
1068
|
},
|
|
1069
1069
|
ownKeys: (target) => {
|
|
1070
|
-
return (0,
|
|
1070
|
+
return (0, _stryke_helpers_get_unique.getUnique)(Reflect.ownKeys(target).map((key) => this.#normalizeId(key)));
|
|
1071
1071
|
}
|
|
1072
1072
|
});
|
|
1073
1073
|
}
|
|
@@ -1091,7 +1091,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1091
1091
|
return this.#normalizePath(prop) in target;
|
|
1092
1092
|
},
|
|
1093
1093
|
ownKeys: (target) => {
|
|
1094
|
-
return (0,
|
|
1094
|
+
return (0, _stryke_helpers_get_unique.getUnique)(Reflect.ownKeys(target).map((key) => this.#normalizePath(key)));
|
|
1095
1095
|
}
|
|
1096
1096
|
});
|
|
1097
1097
|
}
|
|
@@ -1115,7 +1115,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1115
1115
|
return this.#normalizeId(prop) in target;
|
|
1116
1116
|
},
|
|
1117
1117
|
ownKeys: (target) => {
|
|
1118
|
-
return (0,
|
|
1118
|
+
return (0, _stryke_helpers_get_unique.getUnique)(Reflect.ownKeys(target).map((key) => this.#normalizeId(key)));
|
|
1119
1119
|
}
|
|
1120
1120
|
});
|
|
1121
1121
|
}
|
|
@@ -1142,7 +1142,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1142
1142
|
*/
|
|
1143
1143
|
get resolver() {
|
|
1144
1144
|
if (!this.#resolver) this.#resolver = new oxc_resolver.ResolverFactory({
|
|
1145
|
-
roots: [this.#context.workspaceConfig.workspaceRoot, (0,
|
|
1145
|
+
roots: [this.#context.workspaceConfig.workspaceRoot, (0, _stryke_path_append.appendPath)(this.#context.config.root, this.#context.workspaceConfig.workspaceRoot)],
|
|
1146
1146
|
tsconfig: {
|
|
1147
1147
|
configFile: this.#context.tsconfig.tsconfigFilePath,
|
|
1148
1148
|
references: this.#context.tsconfig.projectReferences && this.#context.tsconfig.projectReferences.length > 0 ? "auto" : void 0
|
|
@@ -1165,7 +1165,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1165
1165
|
constructor(context, fs) {
|
|
1166
1166
|
this.#context = context;
|
|
1167
1167
|
this.#storage = { "": new require_virtual.FileSystemStorageAdapter(context) };
|
|
1168
|
-
if ((0,
|
|
1168
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(this.#context.config.output.storage)) this.#storage = {
|
|
1169
1169
|
...this.#storage,
|
|
1170
1170
|
...this.#context.config.output.storage
|
|
1171
1171
|
};
|
|
@@ -1183,9 +1183,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1183
1183
|
id: metadata.id,
|
|
1184
1184
|
type: metadata.type,
|
|
1185
1185
|
timestamp: metadata.timestamp ?? Date.now(),
|
|
1186
|
-
properties: metadata._hasProperties() ? metadata.properties.values().reduce((ret
|
|
1187
|
-
ret
|
|
1188
|
-
return ret
|
|
1186
|
+
properties: metadata._hasProperties() ? metadata.properties.values().reduce((ret, item) => {
|
|
1187
|
+
ret[item.key] = item.value;
|
|
1188
|
+
return ret;
|
|
1189
1189
|
}, {}) : {}
|
|
1190
1190
|
};
|
|
1191
1191
|
return ret;
|
|
@@ -1202,7 +1202,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1202
1202
|
return ret;
|
|
1203
1203
|
}, {});
|
|
1204
1204
|
}
|
|
1205
|
-
this.#log = require_utils.extendLog(this.#context.log, "file-system");
|
|
1205
|
+
this.#log = (0, require_utils.utils_exports.extendLog)(this.#context.log, "file-system");
|
|
1206
1206
|
}
|
|
1207
1207
|
/**
|
|
1208
1208
|
* Asynchronously checks if a file exists in the virtual file system (VFS).
|
|
@@ -1288,10 +1288,10 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1288
1288
|
listSync(path) {
|
|
1289
1289
|
let resolvedPath = path;
|
|
1290
1290
|
if (resolvedPath.includes("*")) {
|
|
1291
|
-
this.#log(
|
|
1292
|
-
resolvedPath = (0,
|
|
1291
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.WARN, `Invoking "listSync" with a glob pattern is not supported. It is likely you meant to use "globSync". Path: ${path}`);
|
|
1292
|
+
resolvedPath = (0, _stryke_path_correct_path.stripStars)(resolvedPath);
|
|
1293
1293
|
}
|
|
1294
|
-
return (0,
|
|
1294
|
+
return (0, _stryke_helpers_get_unique.getUnique)(this.#getStorages(resolvedPath, true).map((storage) => storage.adapter.listSync(storage.relativeBase ? storage.base ? (0, _stryke_path_append.appendPath)(storage.relativeBase, storage.base) : storage.relativeBase : storage.base)).flat().filter(Boolean));
|
|
1295
1295
|
}
|
|
1296
1296
|
/**
|
|
1297
1297
|
* Lists files in a given path.
|
|
@@ -1302,10 +1302,10 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1302
1302
|
async list(path) {
|
|
1303
1303
|
let resolvedPath = path;
|
|
1304
1304
|
if (resolvedPath.includes("*")) {
|
|
1305
|
-
this.#log(
|
|
1306
|
-
resolvedPath = (0,
|
|
1305
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.WARN, `Invoking "list" with a glob pattern is not supported. It is likely you meant to use "glob". Path: ${path}`);
|
|
1306
|
+
resolvedPath = (0, _stryke_path_correct_path.stripStars)(resolvedPath);
|
|
1307
1307
|
}
|
|
1308
|
-
return (0,
|
|
1308
|
+
return (0, _stryke_helpers_get_unique.getUnique)((await Promise.all(this.#getStorages(resolvedPath, true).map(async (storage) => storage.adapter.list(storage.relativeBase ? storage.base ? (0, _stryke_path_append.appendPath)(storage.relativeBase, storage.base) : storage.relativeBase : storage.base)))).flat().filter(Boolean));
|
|
1309
1309
|
}
|
|
1310
1310
|
/**
|
|
1311
1311
|
* Removes a file in the virtual file system (VFS).
|
|
@@ -1314,9 +1314,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1314
1314
|
*/
|
|
1315
1315
|
async remove(path) {
|
|
1316
1316
|
const normalizedPath = this.#normalizePath(path);
|
|
1317
|
-
this.#log(
|
|
1317
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.TRACE, `Removing file: ${normalizedPath}`);
|
|
1318
1318
|
const { relativeKey, adapter } = this.#getStorage(normalizedPath);
|
|
1319
|
-
if ((0,
|
|
1319
|
+
if ((0, _stryke_path_file_path_fns.hasFileExtension)(normalizedPath)) await adapter.remove(relativeKey);
|
|
1320
1320
|
else await adapter.clear(relativeKey);
|
|
1321
1321
|
const id = this.#ids[normalizedPath];
|
|
1322
1322
|
if (id && this.#metadata[id]) {
|
|
@@ -1332,9 +1332,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1332
1332
|
*/
|
|
1333
1333
|
removeSync(path) {
|
|
1334
1334
|
const normalizedPath = this.#normalizePath(path);
|
|
1335
|
-
this.#log(
|
|
1335
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.TRACE, `Removing file: ${normalizedPath}`);
|
|
1336
1336
|
const { relativeKey, adapter } = this.#getStorage(normalizedPath);
|
|
1337
|
-
if ((0,
|
|
1337
|
+
if ((0, _stryke_path_file_path_fns.hasFileExtension)(normalizedPath)) adapter.removeSync(relativeKey);
|
|
1338
1338
|
else adapter.clearSync(relativeKey);
|
|
1339
1339
|
const id = this.#ids[normalizedPath];
|
|
1340
1340
|
if (id && this.#metadata[id]) {
|
|
@@ -1359,9 +1359,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1359
1359
|
if (resolved && !results.includes(resolved)) results.push(resolved);
|
|
1360
1360
|
}
|
|
1361
1361
|
else {
|
|
1362
|
-
const absPattern = (0,
|
|
1363
|
-
await Promise.all((await this.list((0,
|
|
1364
|
-
if ((0,
|
|
1362
|
+
const absPattern = (0, _stryke_path_is_type.isAbsolutePath)(normalized) ? normalized : this.#normalizePath((0, _stryke_path_append.appendPath)(normalized, this.#context.workspaceConfig.workspaceRoot));
|
|
1363
|
+
await Promise.all((await this.list((0, _stryke_path_correct_path.stripStars)(absPattern))).map(async (file) => {
|
|
1364
|
+
if ((0, _stryke_path_glob_to_regex.globToRegex)(absPattern).test(file)) {
|
|
1365
1365
|
const resolved = await this.resolve(file);
|
|
1366
1366
|
if (resolved && !results.includes(resolved)) results.push(resolved);
|
|
1367
1367
|
}
|
|
@@ -1386,9 +1386,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1386
1386
|
if (resolved && !results.includes(resolved)) results.push(resolved);
|
|
1387
1387
|
}
|
|
1388
1388
|
else {
|
|
1389
|
-
const absPattern = (0,
|
|
1390
|
-
const files = this.listSync((0,
|
|
1391
|
-
for (const file of files) if ((0,
|
|
1389
|
+
const absPattern = (0, _stryke_path_is_type.isAbsolutePath)(normalized) ? normalized : this.#normalizePath((0, _stryke_path_append.appendPath)(normalized, this.#context.workspaceConfig.workspaceRoot));
|
|
1390
|
+
const files = this.listSync((0, _stryke_path_correct_path.stripStars)(absPattern));
|
|
1391
|
+
for (const file of files) if ((0, _stryke_path_glob_to_regex.globToRegex)(absPattern).test(file)) {
|
|
1392
1392
|
const resolved = this.resolveSync(file);
|
|
1393
1393
|
if (resolved && !results.includes(resolved)) results.push(resolved);
|
|
1394
1394
|
}
|
|
@@ -1405,12 +1405,12 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1405
1405
|
async copy(srcPath, destPath) {
|
|
1406
1406
|
const src = srcPath instanceof URL ? (0, node_url.fileURLToPath)(srcPath) : srcPath;
|
|
1407
1407
|
const dest = destPath instanceof URL ? (0, node_url.fileURLToPath)(destPath) : destPath;
|
|
1408
|
-
if (!(0,
|
|
1409
|
-
const sourceStr = (0,
|
|
1408
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(src) && (!(0, _stryke_type_checks_is_set_object.isSetObject)(src) || !(0, _stryke_type_checks_is_set_string.isSetString)(src.input)) || !(0, _stryke_type_checks_is_set_string.isSetString)(dest)) return;
|
|
1409
|
+
const sourceStr = (0, _stryke_type_checks_is_string.isString)(src) ? src : src.input ? src.input : this.#context.workspaceConfig.workspaceRoot;
|
|
1410
1410
|
const source = await this.resolve(sourceStr);
|
|
1411
1411
|
if (!source) return;
|
|
1412
|
-
if (this.isDirectorySync(source) || (0,
|
|
1413
|
-
return this.copy(file, (0,
|
|
1412
|
+
if (this.isDirectorySync(source) || (0, _stryke_type_checks_is_set_string.isSetString)(src) && src.includes("*") || (0, _stryke_type_checks_is_set_object.isSetObject)(src) && (0, _stryke_type_checks_is_set_string.isSetString)(src.glob)) await Promise.all((await this.glob(src)).map(async (file) => {
|
|
1413
|
+
return this.copy(file, (0, _stryke_path_append.appendPath)((0, _stryke_path_replace.replacePath)(file, sourceStr), dest));
|
|
1414
1414
|
}));
|
|
1415
1415
|
else {
|
|
1416
1416
|
const content = await this.read(source);
|
|
@@ -1426,16 +1426,16 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1426
1426
|
copySync(srcPath, destPath) {
|
|
1427
1427
|
const src = srcPath instanceof URL ? (0, node_url.fileURLToPath)(srcPath) : srcPath;
|
|
1428
1428
|
const dest = destPath instanceof URL ? (0, node_url.fileURLToPath)(destPath) : destPath;
|
|
1429
|
-
if (!(0,
|
|
1430
|
-
const sourceStr = (0,
|
|
1429
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(src) && (!(0, _stryke_type_checks_is_set_object.isSetObject)(src) || !(0, _stryke_type_checks_is_set_string.isSetString)(src.input)) || !(0, _stryke_type_checks_is_set_string.isSetString)(dest)) return;
|
|
1430
|
+
const sourceStr = (0, _stryke_type_checks_is_string.isString)(src) ? src : src.input ? src.input : this.#context.workspaceConfig.workspaceRoot;
|
|
1431
1431
|
const source = this.resolveSync(sourceStr);
|
|
1432
1432
|
if (!source) return;
|
|
1433
|
-
if (this.isDirectorySync(source) || (0,
|
|
1434
|
-
return this.copySync(file, (0,
|
|
1433
|
+
if (this.isDirectorySync(source) || (0, _stryke_type_checks_is_set_string.isSetString)(src) && src.includes("*") || (0, _stryke_type_checks_is_set_object.isSetObject)(src) && (0, _stryke_type_checks_is_set_string.isSetString)(src.glob)) this.globSync(src).map((file) => {
|
|
1434
|
+
return this.copySync(file, (0, _stryke_path_append.appendPath)((0, _stryke_path_file_path_fns.findFilePath)((0, _stryke_path_replace.replacePath)(file, sourceStr)), dest));
|
|
1435
1435
|
});
|
|
1436
1436
|
else {
|
|
1437
1437
|
const content = this.readSync(source);
|
|
1438
|
-
if (content !== void 0) this.writeSync(this.#normalizePath((0,
|
|
1438
|
+
if (content !== void 0) this.writeSync(this.#normalizePath((0, _stryke_path_file_path_fns.hasFileExtension)(dest) ? dest : (0, _stryke_path_append.appendPath)((0, _stryke_path_file_path_fns.findFileName)(source), dest)), content, { skipFormat: true });
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
1441
|
/**
|
|
@@ -1445,7 +1445,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1445
1445
|
* @param destPath - The destination path to move to
|
|
1446
1446
|
*/
|
|
1447
1447
|
async move(srcPath, destPath) {
|
|
1448
|
-
if ((0,
|
|
1448
|
+
if ((0, _stryke_path_file_path_fns.hasFileExtension)(srcPath)) {
|
|
1449
1449
|
await this.copy(srcPath, destPath);
|
|
1450
1450
|
await this.remove(srcPath);
|
|
1451
1451
|
} else await Promise.all((await this.list(srcPath)).map(async (file) => {
|
|
@@ -1460,7 +1460,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1460
1460
|
* @param destPath - The destination path to move to
|
|
1461
1461
|
*/
|
|
1462
1462
|
moveSync(srcPath, destPath) {
|
|
1463
|
-
if ((0,
|
|
1463
|
+
if ((0, _stryke_path_file_path_fns.hasFileExtension)(srcPath)) {
|
|
1464
1464
|
this.copySync(srcPath, destPath);
|
|
1465
1465
|
this.removeSync(srcPath);
|
|
1466
1466
|
} else this.listSync(srcPath).forEach((file) => {
|
|
@@ -1478,7 +1478,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1478
1478
|
const filePath = await this.resolve(path, void 0, { isFile: true });
|
|
1479
1479
|
if (!filePath || !this.existsSync(filePath)) return;
|
|
1480
1480
|
const { adapter } = this.#getStorage(filePath);
|
|
1481
|
-
this.#log(
|
|
1481
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.TRACE, `Reading ${adapter.name} file: ${filePath}`);
|
|
1482
1482
|
return await adapter.get(filePath) ?? void 0;
|
|
1483
1483
|
}
|
|
1484
1484
|
/**
|
|
@@ -1491,7 +1491,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1491
1491
|
const filePath = this.resolveSync(path, void 0, { isFile: true });
|
|
1492
1492
|
if (!filePath || !this.existsSync(filePath)) return;
|
|
1493
1493
|
const { adapter } = this.#getStorage(filePath);
|
|
1494
|
-
this.#log(
|
|
1494
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.TRACE, `Reading ${adapter.name} file: ${filePath}`);
|
|
1495
1495
|
return adapter.getSync(filePath) ?? void 0;
|
|
1496
1496
|
}
|
|
1497
1497
|
/**
|
|
@@ -1506,15 +1506,15 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1506
1506
|
const meta = options.meta ?? {};
|
|
1507
1507
|
const resolvedPath = await this.resolve(this.#normalizePath(path)) || path;
|
|
1508
1508
|
const { relativeKey, adapter } = this.#getStorage(resolvedPath, options.storage);
|
|
1509
|
-
this.#log(
|
|
1509
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.TRACE, `Writing ${resolvedPath} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${(0, _stryke_string_format_pretty_bytes.prettyBytes)(new node_buffer.Blob((0, _stryke_convert_to_array.toArray)(data)).size)})`);
|
|
1510
1510
|
let code = data;
|
|
1511
1511
|
try {
|
|
1512
|
-
if (!options.skipFormat) code = await
|
|
1512
|
+
if (!options.skipFormat) code = await (0, require_utils.utils_exports.format)(this.#context, resolvedPath, data);
|
|
1513
1513
|
} catch (err) {
|
|
1514
|
-
if (DEFAULT_EXTENSIONS.includes((0,
|
|
1514
|
+
if (DEFAULT_EXTENSIONS.includes((0, _stryke_path_file_path_fns.findFileExtensionSafe)(resolvedPath, { fullExtension: true }))) this.#log(_storm_software_config_tools_types.LogLevelLabel.WARN, `Failed to format file ${resolvedPath} before writing: ${err.message}`);
|
|
1515
1515
|
code = data;
|
|
1516
1516
|
}
|
|
1517
|
-
this.#log(
|
|
1517
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.TRACE, `Writing ${resolvedPath} to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${(0, _stryke_string_format_pretty_bytes.prettyBytes)(new node_buffer.Blob((0, _stryke_convert_to_array.toArray)(code)).size)})`);
|
|
1518
1518
|
const id = this.#normalizeId(meta.id || resolvedPath);
|
|
1519
1519
|
this.metadata[id] = {
|
|
1520
1520
|
type: "normal",
|
|
@@ -1537,7 +1537,7 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1537
1537
|
const meta = options.meta ?? {};
|
|
1538
1538
|
const resolvedPath = this.resolveSync(this.#normalizePath(path)) || path;
|
|
1539
1539
|
const { relativeKey, adapter } = this.#getStorage(resolvedPath, options.storage);
|
|
1540
|
-
this.#log(
|
|
1540
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.TRACE, `Writing ${resolvedPath} file to ${adapter.name === "virtual" ? "the virtual file system" : adapter.name === "file-system" ? "the local file system" : adapter.name} (size: ${(0, _stryke_string_format_pretty_bytes.prettyBytes)(new node_buffer.Blob((0, _stryke_convert_to_array.toArray)(data)).size)})`);
|
|
1541
1541
|
const id = this.#normalizeId(meta.id || resolvedPath);
|
|
1542
1542
|
this.metadata[id] = {
|
|
1543
1543
|
type: "normal",
|
|
@@ -1588,21 +1588,21 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1588
1588
|
let path = id;
|
|
1589
1589
|
if (this.#context.config.resolve.alias) {
|
|
1590
1590
|
if (Array.isArray(this.#context.config.resolve.alias) && this.#context.config.resolve.alias.length > 0) {
|
|
1591
|
-
const found = this.#context.config.resolve.alias.filter((alias) => (0,
|
|
1591
|
+
const found = this.#context.config.resolve.alias.filter((alias) => (0, _stryke_type_checks_is_set_string.isSetString)(alias.find) && (alias.find === path || path.startsWith(`${alias.find}/`)) || (0, _stryke_type_checks_is_regexp.isRegExp)(alias.find) && alias.find.test(path));
|
|
1592
1592
|
if (found.length > 0) {
|
|
1593
1593
|
const alias = found.reduce((ret, current) => {
|
|
1594
|
-
return ((0,
|
|
1594
|
+
return ((0, _stryke_type_checks_is_set_string.isSetString)(ret.find) ? ret.find.length : (0, _stryke_type_checks_is_regexp.isRegExp)(ret.find) ? ret.find.source.length : 0) > ((0, _stryke_type_checks_is_set_string.isSetString)(current.find) ? current.find.length : (0, _stryke_type_checks_is_regexp.isRegExp)(current.find) ? current.find.source.length : 0) ? ret : current;
|
|
1595
1595
|
});
|
|
1596
|
-
if ((0,
|
|
1597
|
-
else if ((0,
|
|
1596
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(alias.find)) path = path.replace(new RegExp(`^${alias.find}`), alias.replacement);
|
|
1597
|
+
else if ((0, _stryke_type_checks_is_regexp.isRegExp)(alias.find)) path = path.replace(alias.find, alias.replacement);
|
|
1598
1598
|
}
|
|
1599
|
-
} else if ((0,
|
|
1599
|
+
} else if ((0, _stryke_type_checks_is_set_object.isSetObject)(this.#context.config.resolve.alias)) {
|
|
1600
1600
|
const found = Object.keys(this.#context.config.resolve.alias).filter((key) => key === path || path.startsWith(`${key}/`));
|
|
1601
1601
|
if (found.length > 0) {
|
|
1602
1602
|
const alias = found.reduce((ret, current) => {
|
|
1603
1603
|
return ret.length > current.length ? ret : current;
|
|
1604
1604
|
});
|
|
1605
|
-
path = path.replace(
|
|
1605
|
+
path = path.replace(new RegExp(`^${alias}`), this.#context.config.resolve.alias[alias]);
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
@@ -1627,9 +1627,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1627
1627
|
async resolve(id, importer, options = {}) {
|
|
1628
1628
|
const origResult = await this.#innerResolve(id, importer, options);
|
|
1629
1629
|
if (origResult && options.isFile && await this.isDirectory(origResult)) {
|
|
1630
|
-
const indexResult = await this.resolve((0,
|
|
1630
|
+
const indexResult = await this.resolve((0, _stryke_path_join.joinPaths)(origResult, "index"), importer, options);
|
|
1631
1631
|
if (indexResult) return indexResult;
|
|
1632
|
-
if (!(0,
|
|
1632
|
+
if (!(0, _stryke_path_file_path_fns.hasFileExtension)(origResult)) for (const ext of DEFAULT_EXTENSIONS) {
|
|
1633
1633
|
const extResult = await this.resolve(`${origResult}.${ext}`, importer, options);
|
|
1634
1634
|
if (extResult) return extResult;
|
|
1635
1635
|
}
|
|
@@ -1656,9 +1656,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1656
1656
|
resolveSync(id, importer, options = {}) {
|
|
1657
1657
|
const origResult = this.#innerResolveSync(id, importer, options);
|
|
1658
1658
|
if (origResult && options.isFile && this.isDirectorySync(origResult)) {
|
|
1659
|
-
const indexResult = this.resolveSync((0,
|
|
1659
|
+
const indexResult = this.resolveSync((0, _stryke_path_join.joinPaths)(origResult, "index"), importer, options);
|
|
1660
1660
|
if (indexResult) return indexResult;
|
|
1661
|
-
if (!(0,
|
|
1661
|
+
if (!(0, _stryke_path_file_path_fns.hasFileExtension)(origResult)) for (const ext of DEFAULT_EXTENSIONS) {
|
|
1662
1662
|
const extResult = this.resolveSync(`${origResult}.${ext}`, importer, options);
|
|
1663
1663
|
if (extResult) return extResult;
|
|
1664
1664
|
}
|
|
@@ -1672,9 +1672,9 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1672
1672
|
async dispose() {
|
|
1673
1673
|
if (!this.#isDisposed) {
|
|
1674
1674
|
this.#isDisposed = true;
|
|
1675
|
-
this.#log(
|
|
1676
|
-
await this.remove((0,
|
|
1677
|
-
const message = new
|
|
1675
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Disposing virtual file system...");
|
|
1676
|
+
await this.remove((0, _stryke_path_join.joinPaths)(this.#context.dataPath, "fs.bin"));
|
|
1677
|
+
const message = new _stryke_capnp.Message();
|
|
1678
1678
|
const fs = message.initRoot(FileSystem);
|
|
1679
1679
|
const storage = fs._initStorage(Object.keys(this.#paths).length);
|
|
1680
1680
|
await Promise.all(Object.values(this.#paths).map(async (path, index) => {
|
|
@@ -1697,17 +1697,17 @@ var VirtualFileSystem = class VirtualFileSystem {
|
|
|
1697
1697
|
fileMetadata.timestamp = value.timestamp ?? Date.now();
|
|
1698
1698
|
if (value.properties) {
|
|
1699
1699
|
const props = fileMetadata._initProperties(Object.keys(value.properties).length);
|
|
1700
|
-
Object.entries(value.properties).filter(([, val]) => (0,
|
|
1701
|
-
const prop = props.get(index
|
|
1700
|
+
Object.entries(value.properties).filter(([, val]) => (0, _stryke_type_checks_is_set_string.isSetString)(val)).forEach(([key, val], index) => {
|
|
1701
|
+
const prop = props.get(index);
|
|
1702
1702
|
prop.key = key;
|
|
1703
1703
|
prop.value = val;
|
|
1704
1704
|
});
|
|
1705
1705
|
}
|
|
1706
1706
|
});
|
|
1707
|
-
await (0,
|
|
1707
|
+
await (0, _stryke_fs_buffer.writeFileBuffer)((0, _stryke_path_join.joinPaths)(this.#context.dataPath, "fs.bin"), message.toArrayBuffer());
|
|
1708
1708
|
if (!this.#context.config.skipCache) this.#resolverCache.save(true);
|
|
1709
|
-
await Promise.all(this.#getStorages().map(async (storage
|
|
1710
|
-
this.#log(
|
|
1709
|
+
await Promise.all(this.#getStorages().map(async (storage) => storage.adapter.dispose()));
|
|
1710
|
+
this.#log(_storm_software_config_tools_types.LogLevelLabel.TRACE, "Virtual file system has been disposed.");
|
|
1711
1711
|
}
|
|
1712
1712
|
}
|
|
1713
1713
|
async [Symbol.asyncDispose]() {
|
|
@@ -1738,15 +1738,15 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1738
1738
|
#internal = {};
|
|
1739
1739
|
#workspaceConfig;
|
|
1740
1740
|
#checksum = null;
|
|
1741
|
-
#buildId = (0,
|
|
1742
|
-
#releaseId = (0,
|
|
1741
|
+
#buildId = (0, _stryke_unique_id_uuid.uuid)();
|
|
1742
|
+
#releaseId = (0, _stryke_unique_id_uuid.uuid)();
|
|
1743
1743
|
#timestamp = Date.now();
|
|
1744
1744
|
#fs;
|
|
1745
1745
|
#tsconfig;
|
|
1746
1746
|
#parserCache;
|
|
1747
1747
|
#requestCache;
|
|
1748
1748
|
#getConfigProps(config = {}) {
|
|
1749
|
-
return require_plugin_utils.mergeConfig({
|
|
1749
|
+
return (0, require_plugin_utils.plugin_utils_exports.mergeConfig)({
|
|
1750
1750
|
root: config.root,
|
|
1751
1751
|
name: config.name,
|
|
1752
1752
|
title: config.title,
|
|
@@ -1770,7 +1770,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1770
1770
|
...config
|
|
1771
1771
|
}, { output: config.framework ? {
|
|
1772
1772
|
artifactsPath: `.${config.framework ?? "powerlines"}`,
|
|
1773
|
-
dts: (0,
|
|
1773
|
+
dts: (0, _stryke_path_join.joinPaths)(config.root ?? this.config.root, `${config.framework ?? "powerlines"}.d.ts`)
|
|
1774
1774
|
} : {} });
|
|
1775
1775
|
}
|
|
1776
1776
|
/**
|
|
@@ -1781,9 +1781,9 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1781
1781
|
* @returns A promise that resolves to the new context.
|
|
1782
1782
|
*/
|
|
1783
1783
|
static async from(workspaceRoot, config) {
|
|
1784
|
-
const context = new PowerlinesContext(await require_config.loadWorkspaceConfig(workspaceRoot, config.root));
|
|
1784
|
+
const context = new PowerlinesContext(await (0, require_config.config_exports.loadWorkspaceConfig)(workspaceRoot, config.root));
|
|
1785
1785
|
await context.withUserConfig(config);
|
|
1786
|
-
const powerlinesPath = await (0,
|
|
1786
|
+
const powerlinesPath = await (0, _stryke_fs_resolve.resolvePackage)("powerlines");
|
|
1787
1787
|
if (!powerlinesPath) throw new Error("Could not resolve `powerlines` package location.");
|
|
1788
1788
|
context.powerlinesPath = powerlinesPath;
|
|
1789
1789
|
return context;
|
|
@@ -1847,7 +1847,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1847
1847
|
*/
|
|
1848
1848
|
get entry() {
|
|
1849
1849
|
const entry = this.resolvedEntry;
|
|
1850
|
-
return require_utils.resolveInputsSync(this, entry && entry.length > 0 ? entry : Array.isArray(this.config.input) || (0,
|
|
1850
|
+
return (0, require_utils.utils_exports.resolveInputsSync)(this, entry && entry.length > 0 ? entry : Array.isArray(this.config.input) || (0, _stryke_type_checks_is_set_object.isSetObject)(this.config.input) && !(0, require_utils.utils_exports.isTypeDefinition)(this.config.input) ? this.config.input : (0, _stryke_convert_to_array.toArray)(this.config.input).flat());
|
|
1851
1851
|
}
|
|
1852
1852
|
/**
|
|
1853
1853
|
* The TypeScript configuration parsed from the tsconfig file
|
|
@@ -1885,11 +1885,11 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1885
1885
|
releaseId: this.#releaseId,
|
|
1886
1886
|
checksum: this.#checksum,
|
|
1887
1887
|
timestamp: this.#timestamp,
|
|
1888
|
-
rootHash: (0,
|
|
1888
|
+
rootHash: (0, _stryke_hash.murmurhash)({
|
|
1889
1889
|
workspaceRoot: this.workspaceConfig?.workspaceRoot,
|
|
1890
1890
|
root: this.config?.root
|
|
1891
|
-
}, { maxLength: require_constants.ROOT_HASH_LENGTH }),
|
|
1892
|
-
configHash: (0,
|
|
1891
|
+
}, { maxLength: require_constants.constants_exports.ROOT_HASH_LENGTH }),
|
|
1892
|
+
configHash: (0, _stryke_hash.murmurhash)(this.config, { maxLength: require_constants.constants_exports.CACHE_HASH_LENGTH })
|
|
1893
1893
|
};
|
|
1894
1894
|
}
|
|
1895
1895
|
/**
|
|
@@ -1922,7 +1922,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1922
1922
|
workspaceRoot: this.workspaceConfig.workspaceRoot,
|
|
1923
1923
|
framework: this.config?.framework || "powerlines"
|
|
1924
1924
|
});
|
|
1925
|
-
const envPaths = (0,
|
|
1925
|
+
const envPaths = (0, _stryke_env_get_env_paths.getEnvPaths)({
|
|
1926
1926
|
orgId: "storm-software",
|
|
1927
1927
|
appId: this.config?.framework || "powerlines",
|
|
1928
1928
|
workspaceRoot: this.workspaceConfig.workspaceRoot
|
|
@@ -1937,52 +1937,52 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
1937
1937
|
* Get the path to the artifacts directory for the project
|
|
1938
1938
|
*/
|
|
1939
1939
|
get artifactsPath() {
|
|
1940
|
-
return (0,
|
|
1940
|
+
return (0, _stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, this.config.output.artifactsPath);
|
|
1941
1941
|
}
|
|
1942
1942
|
/**
|
|
1943
1943
|
* Get the path to the builtin modules used by the project
|
|
1944
1944
|
*/
|
|
1945
1945
|
get builtinsPath() {
|
|
1946
|
-
return (0,
|
|
1946
|
+
return (0, _stryke_path_join.joinPaths)(this.artifactsPath, "builtins");
|
|
1947
1947
|
}
|
|
1948
1948
|
/**
|
|
1949
1949
|
* Get the path to the entry directory for the project
|
|
1950
1950
|
*/
|
|
1951
1951
|
get entryPath() {
|
|
1952
|
-
return (0,
|
|
1952
|
+
return (0, _stryke_path_join.joinPaths)(this.artifactsPath, "entry");
|
|
1953
1953
|
}
|
|
1954
1954
|
/**
|
|
1955
1955
|
* Get the path to the infrastructure modules used by the project
|
|
1956
1956
|
*/
|
|
1957
1957
|
get infrastructurePath() {
|
|
1958
|
-
return (0,
|
|
1958
|
+
return (0, _stryke_path_join.joinPaths)(this.artifactsPath, "infrastructure");
|
|
1959
1959
|
}
|
|
1960
1960
|
/**
|
|
1961
1961
|
* Get the path to the data directory for the project
|
|
1962
1962
|
*/
|
|
1963
1963
|
get dataPath() {
|
|
1964
|
-
return (0,
|
|
1964
|
+
return (0, _stryke_path_join.joinPaths)(this.envPaths.data, "projects", getPrefixedRootHash(this.config.name, this.meta.rootHash));
|
|
1965
1965
|
}
|
|
1966
1966
|
/**
|
|
1967
1967
|
* Get the path to the cache directory for the project
|
|
1968
1968
|
*/
|
|
1969
1969
|
get cachePath() {
|
|
1970
|
-
return (0,
|
|
1970
|
+
return (0, _stryke_path_join.joinPaths)(this.envPaths.cache, "projects", (0, _stryke_hash.murmurhash)({
|
|
1971
1971
|
checksum: this.#checksum,
|
|
1972
1972
|
config: this.meta.configHash
|
|
1973
|
-
}, { maxLength: require_constants.CACHE_HASH_LENGTH }));
|
|
1973
|
+
}, { maxLength: require_constants.constants_exports.CACHE_HASH_LENGTH }));
|
|
1974
1974
|
}
|
|
1975
1975
|
/**
|
|
1976
1976
|
* Get the path to the generated declaration file for the project
|
|
1977
1977
|
*/
|
|
1978
1978
|
get dtsPath() {
|
|
1979
|
-
return this.config.output.dts ? (0,
|
|
1979
|
+
return this.config.output.dts ? (0, _stryke_path_append.appendPath)(this.config.output.dts, this.workspaceConfig.workspaceRoot) : (0, _stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root, "powerlines.d.ts");
|
|
1980
1980
|
}
|
|
1981
1981
|
/**
|
|
1982
1982
|
* Get the project root relative to the workspace root
|
|
1983
1983
|
*/
|
|
1984
1984
|
get relativeToWorkspaceRoot() {
|
|
1985
|
-
return (0,
|
|
1985
|
+
return (0, _stryke_fs_get_workspace_root.relativeToWorkspaceRoot)(this.config.root);
|
|
1986
1986
|
}
|
|
1987
1987
|
/**
|
|
1988
1988
|
* The builtin module id that exist in the Powerlines virtual file system
|
|
@@ -2042,14 +2042,14 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2042
2042
|
return Object.entries(this.fs.metadata).filter(([, meta]) => meta && meta.type === "entry").map(([path, meta]) => {
|
|
2043
2043
|
const typeDefinition = { file: path };
|
|
2044
2044
|
if (meta.properties) {
|
|
2045
|
-
if ((0,
|
|
2046
|
-
if ((0,
|
|
2047
|
-
if ((0,
|
|
2045
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(meta.properties.file)) typeDefinition.file = meta.properties.file;
|
|
2046
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(meta.properties.name)) typeDefinition.name = meta.properties.name;
|
|
2047
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(meta.properties["input.file"]) || (0, _stryke_type_checks_is_set_string.isSetString)(meta.properties["input.name"])) {
|
|
2048
2048
|
typeDefinition.input ??= {};
|
|
2049
|
-
if ((0,
|
|
2050
|
-
if ((0,
|
|
2049
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(meta.properties["input.file"])) typeDefinition.input.file = meta.properties["input.file"];
|
|
2050
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(meta.properties["input.name"])) typeDefinition.input.name = meta.properties["input.name"];
|
|
2051
2051
|
}
|
|
2052
|
-
if ((0,
|
|
2052
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(meta.properties.output)) typeDefinition.output = meta.properties.output;
|
|
2053
2053
|
}
|
|
2054
2054
|
return typeDefinition;
|
|
2055
2055
|
}).filter(Boolean);
|
|
@@ -2073,7 +2073,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2073
2073
|
* @returns A promise that resolves to a response returned by the fetch.
|
|
2074
2074
|
*/
|
|
2075
2075
|
async fetch(input, options = {}) {
|
|
2076
|
-
const cacheKey = (0,
|
|
2076
|
+
const cacheKey = (0, _stryke_hash.murmurhash)({
|
|
2077
2077
|
input: input.toString(),
|
|
2078
2078
|
options: JSON.stringify(options)
|
|
2079
2079
|
});
|
|
@@ -2085,7 +2085,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2085
2085
|
headers: cached.headers
|
|
2086
2086
|
});
|
|
2087
2087
|
}
|
|
2088
|
-
const response = await (0,
|
|
2088
|
+
const response = await (0, _stryke_http_fetch.fetchRequest)(input, {
|
|
2089
2089
|
timeout: 12e3,
|
|
2090
2090
|
...options
|
|
2091
2091
|
});
|
|
@@ -2123,7 +2123,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2123
2123
|
* @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
|
|
2124
2124
|
*/
|
|
2125
2125
|
async parse(code, options = {}) {
|
|
2126
|
-
const cacheKey = (0,
|
|
2126
|
+
const cacheKey = (0, _stryke_hash.murmurhash)({
|
|
2127
2127
|
code,
|
|
2128
2128
|
options
|
|
2129
2129
|
});
|
|
@@ -2162,7 +2162,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2162
2162
|
if (Array.isArray(this.config.resolve.alias)) {
|
|
2163
2163
|
const alias = this.config.resolve.alias.find((a) => (0, bundle_require.match)(moduleId, [a.find]));
|
|
2164
2164
|
if (alias) moduleId = alias.replacement;
|
|
2165
|
-
} else if ((0,
|
|
2165
|
+
} else if ((0, _stryke_type_checks_is_set_object.isSetObject)(this.config.resolve.alias) && this.config.resolve.alias[id]) moduleId = this.config.resolve.alias[id];
|
|
2166
2166
|
}
|
|
2167
2167
|
if (this.fs.isVirtual(moduleId) || importer && this.fs.isVirtual(importer)) {
|
|
2168
2168
|
let resolvedImporter = importer;
|
|
@@ -2251,8 +2251,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2251
2251
|
* @param options - Additional options for writing the file
|
|
2252
2252
|
*/
|
|
2253
2253
|
async emit(code, path, options = {}) {
|
|
2254
|
-
const filePath = options.extension ? (0,
|
|
2255
|
-
if ((0,
|
|
2254
|
+
const filePath = options.extension ? (0, _stryke_path_file_path_fns.findFileExtensionSafe)(path) ? options.extension.startsWith(".") ? path.replace((0, _stryke_path_file_path_fns.findFileDotExtensionSafe)(path), options.extension) : path.replace((0, _stryke_path_file_path_fns.findFileExtensionSafe)(path), options.extension) : options.extension.startsWith(".") ? `${path}${options.extension}` : `${path}.${options.extension}` : (0, _stryke_path_file_path_fns.findFileExtensionSafe)(path) ? path : `${path}.ts`;
|
|
2255
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(this.emitFile) && options.emitWithBundler) return this.emitFile({
|
|
2256
2256
|
needsCodeReference: options.needsCodeReference,
|
|
2257
2257
|
originalFileName: options.originalFileName,
|
|
2258
2258
|
fileName: filePath,
|
|
@@ -2269,8 +2269,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2269
2269
|
* @param options - Additional options for writing the file
|
|
2270
2270
|
*/
|
|
2271
2271
|
emitSync(code, path, options = {}) {
|
|
2272
|
-
const filePath = options.extension ? (0,
|
|
2273
|
-
if ((0,
|
|
2272
|
+
const filePath = options.extension ? (0, _stryke_path_file_path_fns.findFileExtensionSafe)(path) ? options.extension.startsWith(".") ? path.replace((0, _stryke_path_file_path_fns.findFileDotExtensionSafe)(path), options.extension) : path.replace((0, _stryke_path_file_path_fns.findFileExtensionSafe)(path), options.extension) : options.extension.startsWith(".") ? `${path}${options.extension}` : `${path}.${options.extension}` : (0, _stryke_path_file_path_fns.findFileExtensionSafe)(path) ? path : `${path}.ts`;
|
|
2273
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(this.emitFile) && options.emitWithBundler) return this.emitFile({
|
|
2274
2274
|
needsCodeReference: options.needsCodeReference,
|
|
2275
2275
|
originalFileName: options.originalFileName,
|
|
2276
2276
|
fileName: filePath,
|
|
@@ -2287,16 +2287,16 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2287
2287
|
* @param options - Optional write file options
|
|
2288
2288
|
*/
|
|
2289
2289
|
async emitEntry(code, path, options = {}) {
|
|
2290
|
-
return this.emit(code, (0,
|
|
2290
|
+
return this.emit(code, (0, _stryke_path_append.appendPath)(path, this.entryPath), (0, defu.default)({ meta: {
|
|
2291
2291
|
type: "entry",
|
|
2292
2292
|
properties: {
|
|
2293
|
-
file: (0,
|
|
2293
|
+
file: (0, _stryke_path_append.appendPath)(path, this.entryPath),
|
|
2294
2294
|
name: options?.name,
|
|
2295
2295
|
output: options?.output,
|
|
2296
2296
|
"input.file": options?.input?.file,
|
|
2297
2297
|
"input.name": options?.input?.name
|
|
2298
2298
|
}
|
|
2299
|
-
} }, (0,
|
|
2299
|
+
} }, (0, _stryke_helpers_omit.omit)(options, ["name"])));
|
|
2300
2300
|
}
|
|
2301
2301
|
/**
|
|
2302
2302
|
* Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
|
|
@@ -2306,16 +2306,16 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2306
2306
|
* @param options - Optional write file options
|
|
2307
2307
|
*/
|
|
2308
2308
|
emitEntrySync(code, path, options = {}) {
|
|
2309
|
-
return this.emitSync(code, (0,
|
|
2309
|
+
return this.emitSync(code, (0, _stryke_path_append.appendPath)(path, this.entryPath), (0, defu.default)({ meta: {
|
|
2310
2310
|
type: "entry",
|
|
2311
2311
|
properties: {
|
|
2312
|
-
file: (0,
|
|
2312
|
+
file: (0, _stryke_path_append.appendPath)(path, this.entryPath),
|
|
2313
2313
|
name: options?.name,
|
|
2314
2314
|
output: options?.output,
|
|
2315
2315
|
"input.file": options?.input?.file,
|
|
2316
2316
|
"input.name": options?.input?.name
|
|
2317
2317
|
}
|
|
2318
|
-
} }, (0,
|
|
2318
|
+
} }, (0, _stryke_helpers_omit.omit)(options, ["name"])));
|
|
2319
2319
|
}
|
|
2320
2320
|
/**
|
|
2321
2321
|
* Resolves a builtin virtual file and writes it to the VFS if it does not already exist
|
|
@@ -2326,8 +2326,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2326
2326
|
*/
|
|
2327
2327
|
async emitBuiltin(code, id, options = {}) {
|
|
2328
2328
|
if (!this.builtinsPath) throw new Error(`The builtins path is not set. Cannot emit builtin file with id "${id}".`);
|
|
2329
|
-
if (!(0,
|
|
2330
|
-
return this.emit(code, (0,
|
|
2329
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(id)) throw new Error(`The builtin id must be a non-empty string. Received: ${String(id)}`);
|
|
2330
|
+
return this.emit(code, (0, _stryke_path_append.appendPath)(id, this.builtinsPath), (0, defu.default)(options, { meta: {
|
|
2331
2331
|
type: "builtin",
|
|
2332
2332
|
id
|
|
2333
2333
|
} }));
|
|
@@ -2341,8 +2341,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2341
2341
|
*/
|
|
2342
2342
|
emitBuiltinSync(code, id, options = {}) {
|
|
2343
2343
|
if (!this.builtinsPath) throw new Error(`The builtins path is not set. Cannot emit builtin file with id "${id}".`);
|
|
2344
|
-
if (!(0,
|
|
2345
|
-
return this.emitSync(code, (0,
|
|
2344
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(id)) throw new Error(`The builtin id must be a non-empty string. Received: ${String(id)}`);
|
|
2345
|
+
return this.emitSync(code, (0, _stryke_path_append.appendPath)(id, this.builtinsPath), (0, defu.default)(options, { meta: {
|
|
2346
2346
|
type: "builtin",
|
|
2347
2347
|
id
|
|
2348
2348
|
} }));
|
|
@@ -2356,8 +2356,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2356
2356
|
*/
|
|
2357
2357
|
async emitInfrastructure(code, id, options = {}) {
|
|
2358
2358
|
if (!this.infrastructurePath) throw new Error(`The infrastructure path is not set. Cannot emit infrastructure file with id "${id}".`);
|
|
2359
|
-
if (!(0,
|
|
2360
|
-
return this.emit(code, (0,
|
|
2359
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(id)) throw new Error(`The infrastructure id must be a non-empty string. Received: ${String(id)}`);
|
|
2360
|
+
return this.emit(code, (0, _stryke_path_append.appendPath)(id, this.infrastructurePath), (0, defu.default)(options, { meta: {
|
|
2361
2361
|
type: "infrastructure",
|
|
2362
2362
|
id
|
|
2363
2363
|
} }));
|
|
@@ -2371,8 +2371,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2371
2371
|
*/
|
|
2372
2372
|
emitInfrastructureSync(code, id, options = {}) {
|
|
2373
2373
|
if (!this.infrastructurePath) throw new Error(`The infrastructure path is not set. Cannot emit infrastructure file with id "${id}".`);
|
|
2374
|
-
if (!(0,
|
|
2375
|
-
return this.emitSync(code, (0,
|
|
2374
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(id)) throw new Error(`The infrastructure id must be a non-empty string. Received: ${String(id)}`);
|
|
2375
|
+
return this.emitSync(code, (0, _stryke_path_append.appendPath)(id, this.infrastructurePath), (0, defu.default)(options, { meta: {
|
|
2376
2376
|
type: "infrastructure",
|
|
2377
2377
|
id
|
|
2378
2378
|
} }));
|
|
@@ -2394,10 +2394,10 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2394
2394
|
async withInlineConfig(inlineConfig, options = { isHighPriority: true }) {
|
|
2395
2395
|
this.config.inlineConfig = inlineConfig;
|
|
2396
2396
|
if (inlineConfig.command === "new") {
|
|
2397
|
-
const workspacePackageJsonPath = (0,
|
|
2398
|
-
if (!(0,
|
|
2399
|
-
this.packageJson = await (0,
|
|
2400
|
-
this.workspaceConfig.repository ??= (0,
|
|
2397
|
+
const workspacePackageJsonPath = (0, _stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, "package.json");
|
|
2398
|
+
if (!(0, _stryke_fs_exists.existsSync)(workspacePackageJsonPath)) throw new Error(`The workspace package.json file could not be found at ${workspacePackageJsonPath}`);
|
|
2399
|
+
this.packageJson = await (0, _stryke_fs_json.readJsonFile)(workspacePackageJsonPath);
|
|
2400
|
+
this.workspaceConfig.repository ??= (0, _stryke_type_checks_is_set_string.isSetString)(this.packageJson?.repository) ? this.packageJson.repository : this.packageJson?.repository?.url;
|
|
2401
2401
|
}
|
|
2402
2402
|
await this.init(this.config.inlineConfig, options);
|
|
2403
2403
|
}
|
|
@@ -2407,7 +2407,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2407
2407
|
* @param message - The message to log.
|
|
2408
2408
|
*/
|
|
2409
2409
|
fatal(message) {
|
|
2410
|
-
this.log(
|
|
2410
|
+
this.log(_storm_software_config_tools_types.LogLevelLabel.FATAL, (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
2411
2411
|
}
|
|
2412
2412
|
/**
|
|
2413
2413
|
* A logging function for error messages
|
|
@@ -2415,7 +2415,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2415
2415
|
* @param message - The message to log.
|
|
2416
2416
|
*/
|
|
2417
2417
|
error(message) {
|
|
2418
|
-
this.log(
|
|
2418
|
+
this.log(_storm_software_config_tools_types.LogLevelLabel.ERROR, (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
2419
2419
|
}
|
|
2420
2420
|
/**
|
|
2421
2421
|
* A logging function for warning messages
|
|
@@ -2423,7 +2423,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2423
2423
|
* @param message - The message to log.
|
|
2424
2424
|
*/
|
|
2425
2425
|
warn(message) {
|
|
2426
|
-
this.log(
|
|
2426
|
+
this.log(_storm_software_config_tools_types.LogLevelLabel.WARN, (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
2427
2427
|
}
|
|
2428
2428
|
/**
|
|
2429
2429
|
* A logging function for informational messages
|
|
@@ -2431,7 +2431,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2431
2431
|
* @param message - The message to log.
|
|
2432
2432
|
*/
|
|
2433
2433
|
info(message) {
|
|
2434
|
-
this.log(
|
|
2434
|
+
this.log(_storm_software_config_tools_types.LogLevelLabel.INFO, (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
2435
2435
|
}
|
|
2436
2436
|
/**
|
|
2437
2437
|
* A logging function for debug messages
|
|
@@ -2439,7 +2439,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2439
2439
|
* @param message - The message to log.
|
|
2440
2440
|
*/
|
|
2441
2441
|
debug(message) {
|
|
2442
|
-
this.log(
|
|
2442
|
+
this.log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
2443
2443
|
}
|
|
2444
2444
|
/**
|
|
2445
2445
|
* A logging function for trace messages
|
|
@@ -2447,7 +2447,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2447
2447
|
* @param message - The message to log.
|
|
2448
2448
|
*/
|
|
2449
2449
|
trace(message) {
|
|
2450
|
-
this.log(
|
|
2450
|
+
this.log(_storm_software_config_tools_types.LogLevelLabel.TRACE, (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
2451
2451
|
}
|
|
2452
2452
|
/**
|
|
2453
2453
|
* Create a new logger instance
|
|
@@ -2455,10 +2455,10 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2455
2455
|
* @param name - The name to use for the logger instance
|
|
2456
2456
|
* @returns A logger function
|
|
2457
2457
|
*/
|
|
2458
|
-
createLog(name
|
|
2459
|
-
return require_utils.createLog(name
|
|
2458
|
+
createLog(name = null) {
|
|
2459
|
+
return (0, require_utils.utils_exports.createLog)(name, {
|
|
2460
2460
|
...this.config,
|
|
2461
|
-
logLevel: (0,
|
|
2461
|
+
logLevel: (0, _stryke_type_checks_is_null.isNull)(this.config.logLevel) ? "silent" : this.config.logLevel
|
|
2462
2462
|
});
|
|
2463
2463
|
}
|
|
2464
2464
|
/**
|
|
@@ -2467,8 +2467,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2467
2467
|
* @param name - The name to use for the extended logger instance
|
|
2468
2468
|
* @returns A logger function
|
|
2469
2469
|
*/
|
|
2470
|
-
extendLog(name
|
|
2471
|
-
return require_utils.extendLog(this.log, name
|
|
2470
|
+
extendLog(name) {
|
|
2471
|
+
return (0, require_utils.utils_exports.extendLog)(this.log, name);
|
|
2472
2472
|
}
|
|
2473
2473
|
/**
|
|
2474
2474
|
* Generates a checksum representing the current context state
|
|
@@ -2477,7 +2477,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2477
2477
|
* @returns A promise that resolves to a string representing the checksum
|
|
2478
2478
|
*/
|
|
2479
2479
|
async generateChecksum(root = this.config.root) {
|
|
2480
|
-
this.#checksum = await (0,
|
|
2480
|
+
this.#checksum = await (0, _stryke_hash_node.hashDirectory)(root, { ignore: [
|
|
2481
2481
|
"node_modules",
|
|
2482
2482
|
".git",
|
|
2483
2483
|
".nx",
|
|
@@ -2497,8 +2497,8 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2497
2497
|
envPathCache.set({
|
|
2498
2498
|
workspaceRoot: workspaceConfig.workspaceRoot,
|
|
2499
2499
|
framework: "powerlines"
|
|
2500
|
-
}, (0,
|
|
2501
|
-
orgId: ((0,
|
|
2500
|
+
}, (0, _stryke_env_get_env_paths.getEnvPaths)({
|
|
2501
|
+
orgId: ((0, _stryke_type_checks_is_set_object.isSetObject)(workspaceConfig.organization) ? workspaceConfig.organization.name : workspaceConfig.organization) || "storm-software",
|
|
2502
2502
|
appId: "powerlines",
|
|
2503
2503
|
workspaceRoot: workspaceConfig.workspaceRoot
|
|
2504
2504
|
}));
|
|
@@ -2534,10 +2534,10 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2534
2534
|
this.resolver = result.resolver;
|
|
2535
2535
|
this.mergeUserConfig(result.userConfig.config, this.config.userConfig);
|
|
2536
2536
|
} else {
|
|
2537
|
-
const projectJsonPath = (0,
|
|
2538
|
-
if ((0,
|
|
2539
|
-
const packageJsonPath = (0,
|
|
2540
|
-
if ((0,
|
|
2537
|
+
const projectJsonPath = (0, _stryke_path_join.joinPaths)(cacheKey.root, "project.json");
|
|
2538
|
+
if ((0, _stryke_fs_exists.existsSync)(projectJsonPath)) this.projectJson = await (0, _stryke_fs_json.readJsonFile)(projectJsonPath);
|
|
2539
|
+
const packageJsonPath = (0, _stryke_path_join.joinPaths)(cacheKey.root, "package.json");
|
|
2540
|
+
if ((0, _stryke_fs_exists.existsSync)(packageJsonPath)) this.packageJson = await (0, _stryke_fs_json.readJsonFile)(packageJsonPath);
|
|
2541
2541
|
this.#checksum = await this.generateChecksum(cacheKey.root);
|
|
2542
2542
|
this.resolver = createResolver({
|
|
2543
2543
|
workspaceRoot: this.workspaceConfig.workspaceRoot,
|
|
@@ -2551,7 +2551,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2551
2551
|
return ret;
|
|
2552
2552
|
}, {}) : this.config.resolve.alias : {}
|
|
2553
2553
|
});
|
|
2554
|
-
const userConfig = await require_config.loadUserConfigFile(cacheKey.root, this.workspaceConfig.workspaceRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
|
|
2554
|
+
const userConfig = await (0, require_config.config_exports.loadUserConfigFile)(cacheKey.root, this.workspaceConfig.workspaceRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
|
|
2555
2555
|
this.mergeUserConfig(userConfig.config);
|
|
2556
2556
|
configCache.set(cacheKey, {
|
|
2557
2557
|
projectJson: this.projectJson,
|
|
@@ -2562,7 +2562,7 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2562
2562
|
});
|
|
2563
2563
|
}
|
|
2564
2564
|
config.tsconfig ??= require_tsconfig.getTsconfigFilePath(this.workspaceConfig.workspaceRoot, cacheKey.root, config.tsconfig);
|
|
2565
|
-
if ((0,
|
|
2565
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(config)) this.resolvedConfig = (0, require_plugin_utils.plugin_utils_exports.mergeConfig)({
|
|
2566
2566
|
inlineConfig: this.config.inlineConfig,
|
|
2567
2567
|
userConfig: this.config.userConfig
|
|
2568
2568
|
}, options.isHighPriority ? this.#getConfigProps(config) : {}, {
|
|
@@ -2576,10 +2576,10 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2576
2576
|
name: this.projectJson?.name || this.packageJson?.name,
|
|
2577
2577
|
version: this.packageJson?.version,
|
|
2578
2578
|
description: this.packageJson?.description,
|
|
2579
|
-
output: require_plugin_utils.mergeConfig(config.output ?? {}, {
|
|
2580
|
-
outputPath: cacheKey.root ? (0,
|
|
2579
|
+
output: (0, require_plugin_utils.plugin_utils_exports.mergeConfig)(config.output ?? {}, {
|
|
2580
|
+
outputPath: cacheKey.root ? (0, _stryke_path_join.joinPaths)(this.workspaceConfig?.directories?.build || "dist", cacheKey.root) : this.workspaceConfig?.directories?.build || "dist",
|
|
2581
2581
|
artifactsPath: `.${config.framework ?? "powerlines"}`,
|
|
2582
|
-
dts: (0,
|
|
2582
|
+
dts: (0, _stryke_path_join.joinPaths)(cacheKey.root, `${config.framework ?? "powerlines"}.d.ts`),
|
|
2583
2583
|
assets: [
|
|
2584
2584
|
{ glob: "LICENSE" },
|
|
2585
2585
|
{
|
|
@@ -2604,256 +2604,63 @@ var PowerlinesContext = class PowerlinesContext {
|
|
|
2604
2604
|
environments: {},
|
|
2605
2605
|
resolve: {}
|
|
2606
2606
|
});
|
|
2607
|
-
this.config.input = require_utils.getUniqueInputs(this.config.input);
|
|
2607
|
+
this.config.input = (0, require_utils.utils_exports.getUniqueInputs)(this.config.input);
|
|
2608
2608
|
if (this.config.name?.startsWith("@") && this.config.name.split("/").filter(Boolean).length > 1) this.config.name = this.config.name.split("/").filter(Boolean)[1];
|
|
2609
|
-
this.config.title ??= (0,
|
|
2610
|
-
this.config.organization ??= ((0,
|
|
2611
|
-
if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = (0,
|
|
2612
|
-
if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = (0,
|
|
2613
|
-
if (this.config.resolve.external) this.config.resolve.external = (0,
|
|
2614
|
-
if (this.config.resolve.noExternal) this.config.resolve.noExternal = (0,
|
|
2615
|
-
this.config.output.format = (0,
|
|
2609
|
+
this.config.title ??= (0, _stryke_string_format_title_case.titleCase)(this.config.name);
|
|
2610
|
+
this.config.organization ??= ((0, _stryke_type_checks_is_set_object.isSetObject)(this.workspaceConfig.organization) ? this.workspaceConfig.organization.name : this.workspaceConfig.organization) || ((0, _stryke_type_checks_is_set_object.isSetObject)(this.packageJson?.author) ? this.packageJson?.author?.name : this.packageJson?.author) || this.config.name;
|
|
2611
|
+
if (this.config.userConfig.resolve?.external) this.config.userConfig.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.external);
|
|
2612
|
+
if (this.config.userConfig.resolve?.noExternal) this.config.userConfig.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.userConfig.resolve.noExternal);
|
|
2613
|
+
if (this.config.resolve.external) this.config.resolve.external = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.external);
|
|
2614
|
+
if (this.config.resolve.noExternal) this.config.resolve.noExternal = (0, _stryke_helpers_get_unique.getUnique)(this.config.resolve.noExternal);
|
|
2615
|
+
this.config.output.format = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(this.config.output?.format ?? (this.config.projectType === "library" ? ["cjs", "esm"] : ["esm"])));
|
|
2616
2616
|
if (this.config.root && this.config.root !== "." && this.config.root !== "./" && this.config.root !== this.workspaceConfig.workspaceRoot) {
|
|
2617
|
-
this.config.output.outputPath ??= (0,
|
|
2618
|
-
this.config.output.buildPath ??= (0,
|
|
2617
|
+
this.config.output.outputPath ??= (0, _stryke_path_join.joinPaths)("dist", this.config.root);
|
|
2618
|
+
this.config.output.buildPath ??= (0, _stryke_path_join.joinPaths)(this.config.root, "dist");
|
|
2619
2619
|
} else {
|
|
2620
2620
|
this.config.output.outputPath ??= "dist";
|
|
2621
2621
|
this.config.output.buildPath ??= "dist";
|
|
2622
2622
|
}
|
|
2623
|
-
this.config.output.assets = (0,
|
|
2623
|
+
this.config.output.assets = (0, _stryke_helpers_get_unique.getUniqueBy)(this.config.output.assets.map((asset) => {
|
|
2624
2624
|
return {
|
|
2625
|
-
glob: (0,
|
|
2626
|
-
input: (0,
|
|
2627
|
-
output: (0,
|
|
2628
|
-
ignore: (0,
|
|
2625
|
+
glob: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) ? asset.glob : asset,
|
|
2626
|
+
input: (0, _stryke_type_checks_is_string.isString)(asset) || !asset.input || asset.input === "." || asset.input === "/" || asset.input === "./" ? this.workspaceConfig.workspaceRoot : (0, _stryke_path_is_parent_path.isParentPath)(asset.input, this.workspaceConfig.workspaceRoot) || asset.input === this.workspaceConfig.workspaceRoot ? asset.input : (0, _stryke_path_append.appendPath)(asset.input, this.workspaceConfig.workspaceRoot),
|
|
2627
|
+
output: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) && asset.output ? (0, _stryke_path_is_parent_path.isParentPath)(asset.output, this.workspaceConfig.workspaceRoot) ? asset.output : (0, _stryke_path_append.appendPath)((0, _stryke_path_join.joinPaths)(this.config.output.outputPath, (0, _stryke_path_replace.replacePath)((0, _stryke_path_replace.replacePath)(asset.output, (0, _stryke_path_replace.replacePath)(this.config.output.outputPath, this.workspaceConfig.workspaceRoot)), this.config.output.outputPath)), this.workspaceConfig.workspaceRoot) : (0, _stryke_path_append.appendPath)(this.config.output.outputPath, this.workspaceConfig.workspaceRoot),
|
|
2628
|
+
ignore: (0, _stryke_type_checks_is_set_object.isSetObject)(asset) && asset.ignore ? (0, _stryke_convert_to_array.toArray)(asset.ignore) : void 0
|
|
2629
2629
|
};
|
|
2630
2630
|
}), (a) => `${a.input}-${a.glob}-${a.output}`);
|
|
2631
2631
|
this.config.plugins = (this.config.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
|
|
2632
|
-
if (require_plugin_utils.isPlugin(plugin) && require_plugin_utils.checkDedupe(plugin, ret.filter((p) => require_plugin_utils.isPlugin(p)))) return ret;
|
|
2632
|
+
if ((0, require_plugin_utils.plugin_utils_exports.isPlugin)(plugin) && (0, require_plugin_utils.plugin_utils_exports.checkDedupe)(plugin, ret.filter((p) => (0, require_plugin_utils.plugin_utils_exports.isPlugin)(p)))) return ret;
|
|
2633
2633
|
ret.push(plugin);
|
|
2634
2634
|
return ret;
|
|
2635
2635
|
}, []);
|
|
2636
|
-
if (this.config.tsconfig) this.config.tsconfig =
|
|
2637
|
-
if (this.config.output.dts) if ((0,
|
|
2638
|
-
else this.config.output.dts = (0,
|
|
2636
|
+
if (this.config.tsconfig) this.config.tsconfig = (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, this.config.tsconfig);
|
|
2637
|
+
if (this.config.output.dts) if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.output.dts)) this.config.output.dts = (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, this.config.output.dts);
|
|
2638
|
+
else this.config.output.dts = (0, _stryke_path_join.joinPaths)(this.config.root, `${this.config.framework ?? "powerlines"}.d.ts`);
|
|
2639
2639
|
if (this.config.output.assets) this.config.output.assets = this.config.output.assets.map((asset) => ({
|
|
2640
2640
|
...asset,
|
|
2641
|
-
glob:
|
|
2642
|
-
ignore: asset.ignore ? asset.ignore.map((ignore) =>
|
|
2643
|
-
input:
|
|
2644
|
-
output:
|
|
2641
|
+
glob: (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, asset.glob),
|
|
2642
|
+
ignore: asset.ignore ? asset.ignore.map((ignore) => (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, ignore)) : void 0,
|
|
2643
|
+
input: (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, asset.input),
|
|
2644
|
+
output: (0, require_plugin_utils.plugin_utils_exports.replacePathTokens)(this, asset.output)
|
|
2645
2645
|
}));
|
|
2646
|
-
if ((0,
|
|
2646
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(config.output?.storage) && config.output.storage === "virtual" || (0, _stryke_type_checks_is_set_object.isSetObject)(config.output?.storage) && Object.values(config.output.storage).every((adapter) => adapter.preset === "virtual")) this.config.output.overwrite = true;
|
|
2647
2647
|
this.#fs ??= await VirtualFileSystem.create(this);
|
|
2648
2648
|
}
|
|
2649
2649
|
mergeUserConfig(from = {}, into = this.config.userConfig ?? {}) {
|
|
2650
|
-
this.config.userConfig = require_plugin_utils.mergeConfig({ input: (0,
|
|
2651
|
-
if (this.config.userConfig.output?.format) this.config.userConfig.output.format = (0,
|
|
2650
|
+
this.config.userConfig = (0, require_plugin_utils.plugin_utils_exports.mergeConfig)({ input: (0, _stryke_type_checks_is_set_object.isSetObject)(from.input) && !(0, _stryke_type_checks_is_regexp.isRegExp)(from.input) && !Array.isArray(from.input) && from.input.file ? from.input.file : (0, _stryke_type_checks_is_set_object.isSetObject)(into?.input) && !(0, _stryke_type_checks_is_regexp.isRegExp)(into.input) && !Array.isArray(into.input) && into.input.file ? into.input.file : Array.isArray(from.input) && from.input.length > 0 ? from.input : Array.isArray(into?.input) && into.input.length > 0 ? into.input : [] }, (0, _stryke_helpers_omit.omit)(from ?? {}, ["input"]), (0, _stryke_helpers_omit.omit)(into ?? {}, ["input"]));
|
|
2651
|
+
if (this.config.userConfig.output?.format) this.config.userConfig.output.format = (0, _stryke_helpers_get_unique.getUnique)((0, _stryke_convert_to_array.toArray)(this.config.userConfig.output?.format));
|
|
2652
2652
|
this.config.userConfig.plugins = (this.config.userConfig.plugins ?? []).filter(Boolean).reduce((ret, plugin) => {
|
|
2653
|
-
if (require_plugin_utils.isPlugin(plugin) && require_plugin_utils.checkDedupe(plugin, ret.filter((p) => require_plugin_utils.isPlugin(p)))) return ret;
|
|
2653
|
+
if ((0, require_plugin_utils.plugin_utils_exports.isPlugin)(plugin) && (0, require_plugin_utils.plugin_utils_exports.checkDedupe)(plugin, ret.filter((p) => (0, require_plugin_utils.plugin_utils_exports.isPlugin)(p)))) return ret;
|
|
2654
2654
|
ret.push(plugin);
|
|
2655
2655
|
return ret;
|
|
2656
2656
|
}, []);
|
|
2657
2657
|
}
|
|
2658
2658
|
};
|
|
2659
2659
|
|
|
2660
|
-
//#endregion
|
|
2661
|
-
//#region ../core/src/lib/unplugin/helpers.ts
|
|
2662
|
-
/**
|
|
2663
|
-
* Merges a base plugin context with an unplugin context, combining their properties.
|
|
2664
|
-
*
|
|
2665
|
-
* @param contextA - The base plugin context to merge into.
|
|
2666
|
-
* @param contextB - The unplugin context to merge from.
|
|
2667
|
-
* @returns The merged context.
|
|
2668
|
-
*/
|
|
2669
|
-
function combineContexts(contextA, contextB) {
|
|
2670
|
-
return (0, defu.defu)(contextA, contextB);
|
|
2671
|
-
}
|
|
2672
|
-
/**
|
|
2673
|
-
* Checks if a value is a valid UnpluginBuilderVariant.
|
|
2674
|
-
*
|
|
2675
|
-
* @param str - The value to check.
|
|
2676
|
-
* @returns True if the value is a UnpluginBuilderVariant, false otherwise.
|
|
2677
|
-
*/
|
|
2678
|
-
function isUnpluginBuilderVariant(str) {
|
|
2679
|
-
return (0, __stryke_type_checks_is_set_string.isSetString)(str) && require_plugin.UNPLUGIN_BUILDER_VARIANTS.includes(str);
|
|
2680
|
-
}
|
|
2681
|
-
|
|
2682
|
-
//#endregion
|
|
2683
|
-
//#region ../core/src/lib/unplugin/module-resolution.ts
|
|
2684
|
-
const VIRTUAL_MODULE_PREFIX = "__powerlines-virtual:";
|
|
2685
|
-
const VIRTUAL_MODULE_PREFIX_REGEX = /^__powerlines-virtual:/;
|
|
2686
|
-
/**
|
|
2687
|
-
* Creates the module resolution hook functions for a Powerlines unplugin plugin instance.
|
|
2688
|
-
*
|
|
2689
|
-
* @remarks
|
|
2690
|
-
* This includes the `resolveId` and `load` hooks.
|
|
2691
|
-
*
|
|
2692
|
-
* @see https://rollupjs.org/plugin-development/#resolveid
|
|
2693
|
-
* @see https://rollupjs.org/plugin-development/#load
|
|
2694
|
-
*
|
|
2695
|
-
* @param context - The plugin context.
|
|
2696
|
-
* @param options - Options for creating the module resolution functions.
|
|
2697
|
-
* @returns The module resolution hooks (`resolveId` and `load`).
|
|
2698
|
-
*/
|
|
2699
|
-
function createUnpluginModuleResolutionFunctions(context, options = {}) {
|
|
2700
|
-
const ctx = context;
|
|
2701
|
-
return {
|
|
2702
|
-
async resolveId(id, importer, opts = { isEntry: false }) {
|
|
2703
|
-
const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, "");
|
|
2704
|
-
const normalizedImporter = importer ? importer.replace(VIRTUAL_MODULE_PREFIX_REGEX, "") : void 0;
|
|
2705
|
-
let result = await ctx.$$internal.callHook("resolveId", {
|
|
2706
|
-
sequential: true,
|
|
2707
|
-
result: "first",
|
|
2708
|
-
order: "pre"
|
|
2709
|
-
}, normalizedId, normalizedImporter, opts);
|
|
2710
|
-
if ((0, __stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
2711
|
-
else if ((0, __stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
2712
|
-
...result,
|
|
2713
|
-
id: result.virtual && options.prefix !== false ? `${VIRTUAL_MODULE_PREFIX}${result.id}` : result.id
|
|
2714
|
-
};
|
|
2715
|
-
result = await ctx.$$internal.callHook("resolveId", {
|
|
2716
|
-
sequential: true,
|
|
2717
|
-
result: "first",
|
|
2718
|
-
order: "normal"
|
|
2719
|
-
}, normalizedId, normalizedImporter, opts);
|
|
2720
|
-
if ((0, __stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
2721
|
-
else if ((0, __stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
2722
|
-
...result,
|
|
2723
|
-
id: result.virtual && options.prefix !== false ? `${VIRTUAL_MODULE_PREFIX}${result.id}` : result.id
|
|
2724
|
-
};
|
|
2725
|
-
result = await ctx.resolve(normalizedId, normalizedImporter, {
|
|
2726
|
-
isFile: true,
|
|
2727
|
-
...opts
|
|
2728
|
-
});
|
|
2729
|
-
if ((0, __stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
2730
|
-
...result,
|
|
2731
|
-
id: result.virtual && options.prefix !== false ? `${VIRTUAL_MODULE_PREFIX}${result.id}` : result.id
|
|
2732
|
-
};
|
|
2733
|
-
result = await ctx.$$internal.callHook("resolveId", {
|
|
2734
|
-
sequential: true,
|
|
2735
|
-
result: "first",
|
|
2736
|
-
order: "post"
|
|
2737
|
-
}, normalizedId, normalizedImporter, opts);
|
|
2738
|
-
if ((0, __stryke_type_checks_is_set_string.isSetString)(result)) return result;
|
|
2739
|
-
else if ((0, __stryke_type_checks_is_set_object.isSetObject)(result)) return {
|
|
2740
|
-
...result,
|
|
2741
|
-
id: result.virtual && options.prefix !== false ? `${VIRTUAL_MODULE_PREFIX}${result.id}` : result.id
|
|
2742
|
-
};
|
|
2743
|
-
return null;
|
|
2744
|
-
},
|
|
2745
|
-
load: {
|
|
2746
|
-
filter: options.prefix !== false ? { id: { include: [VIRTUAL_MODULE_PREFIX_REGEX] } } : void 0,
|
|
2747
|
-
async handler(id) {
|
|
2748
|
-
const normalizedId = id.replace(VIRTUAL_MODULE_PREFIX_REGEX, "");
|
|
2749
|
-
let result = await ctx.$$internal.callHook("load", {
|
|
2750
|
-
sequential: true,
|
|
2751
|
-
result: "first",
|
|
2752
|
-
order: "pre"
|
|
2753
|
-
}, normalizedId);
|
|
2754
|
-
if (result) return result;
|
|
2755
|
-
result = await ctx.$$internal.callHook("load", {
|
|
2756
|
-
sequential: true,
|
|
2757
|
-
result: "first",
|
|
2758
|
-
order: "normal"
|
|
2759
|
-
}, normalizedId);
|
|
2760
|
-
if (result) return result;
|
|
2761
|
-
result = await ctx.load(normalizedId);
|
|
2762
|
-
if (result) return result;
|
|
2763
|
-
return ctx.$$internal.callHook("load", {
|
|
2764
|
-
sequential: true,
|
|
2765
|
-
result: "first",
|
|
2766
|
-
order: "post"
|
|
2767
|
-
}, normalizedId);
|
|
2768
|
-
}
|
|
2769
|
-
}
|
|
2770
|
-
};
|
|
2771
|
-
}
|
|
2772
|
-
|
|
2773
|
-
//#endregion
|
|
2774
|
-
//#region ../core/src/lib/unplugin/plugin.ts
|
|
2775
|
-
/**
|
|
2776
|
-
* Creates a Powerlines unplugin instance.
|
|
2777
|
-
*
|
|
2778
|
-
* @param context - The plugin context.
|
|
2779
|
-
* @returns The unplugin instance.
|
|
2780
|
-
*/
|
|
2781
|
-
function createUnpluginResolver(context, options = {}) {
|
|
2782
|
-
const ctx = context;
|
|
2783
|
-
(0, unplugin.setParseImpl)(ctx.parse);
|
|
2784
|
-
const name$1 = options.name || "unplugin";
|
|
2785
|
-
return () => {
|
|
2786
|
-
const log = require_utils.extendLog(ctx.log, name$1);
|
|
2787
|
-
log(__storm_software_config_tools_types.LogLevelLabel.DEBUG, `Initializing ${name$1.toLowerCase() === "unplugin" ? "Unplugin" : `${(0, __stryke_string_format_title_case.titleCase)(name$1)} - Unplugin`} plugin`);
|
|
2788
|
-
try {
|
|
2789
|
-
const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
|
|
2790
|
-
return {
|
|
2791
|
-
name: name$1.toLowerCase() === "unplugin" ? "powerlines" : `powerlines:${(0, __stryke_string_format_kebab_case.kebabCase)(name$1)}`,
|
|
2792
|
-
api: ctx.$$internal.api,
|
|
2793
|
-
resolveId,
|
|
2794
|
-
load
|
|
2795
|
-
};
|
|
2796
|
-
} catch (error) {
|
|
2797
|
-
log(__storm_software_config_tools_types.LogLevelLabel.FATAL, error?.message);
|
|
2798
|
-
throw error;
|
|
2799
|
-
}
|
|
2800
|
-
};
|
|
2801
|
-
}
|
|
2802
|
-
/**
|
|
2803
|
-
* Creates a Powerlines unplugin instance.
|
|
2804
|
-
*
|
|
2805
|
-
* @param context - The plugin context.
|
|
2806
|
-
* @returns The unplugin instance.
|
|
2807
|
-
*/
|
|
2808
|
-
function createUnplugin(context, options = {}) {
|
|
2809
|
-
const ctx = context;
|
|
2810
|
-
(0, unplugin.setParseImpl)(ctx.parse);
|
|
2811
|
-
const name$1 = options.name || "unplugin";
|
|
2812
|
-
return () => {
|
|
2813
|
-
const log = require_utils.extendLog(ctx.log, name$1);
|
|
2814
|
-
log(__storm_software_config_tools_types.LogLevelLabel.DEBUG, `Initializing ${name$1.toLowerCase() === "unplugin" ? "Unplugin" : `${(0, __stryke_string_format_title_case.titleCase)(name$1)} - Unplugin`} plugin`);
|
|
2815
|
-
try {
|
|
2816
|
-
const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
|
|
2817
|
-
async function buildStart() {
|
|
2818
|
-
log(__storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
2819
|
-
await ctx.$$internal.callHook("buildStart", { sequential: true });
|
|
2820
|
-
}
|
|
2821
|
-
async function transform(code, id) {
|
|
2822
|
-
let transformed = code;
|
|
2823
|
-
for (const hook of ctx.$$internal.environment.selectHooks("transform")) {
|
|
2824
|
-
const result = await hook.handler.apply(combineContexts(ctx, this), [require_utils.getString(transformed), id]);
|
|
2825
|
-
if (result) transformed = result;
|
|
2826
|
-
}
|
|
2827
|
-
return transformed;
|
|
2828
|
-
}
|
|
2829
|
-
async function buildEnd() {
|
|
2830
|
-
log(__storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin finishing...");
|
|
2831
|
-
return ctx.$$internal.callHook("buildEnd", { sequential: true });
|
|
2832
|
-
}
|
|
2833
|
-
async function writeBundle() {
|
|
2834
|
-
log(__storm_software_config_tools_types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
|
|
2835
|
-
return ctx.$$internal.callHook("writeBundle", { sequential: true });
|
|
2836
|
-
}
|
|
2837
|
-
return {
|
|
2838
|
-
name: name$1.toLowerCase() === "unplugin" ? "powerlines" : `powerlines:${(0, __stryke_string_format_kebab_case.kebabCase)(name$1)}`,
|
|
2839
|
-
api: ctx.$$internal.api,
|
|
2840
|
-
resolveId,
|
|
2841
|
-
load,
|
|
2842
|
-
transform,
|
|
2843
|
-
buildStart,
|
|
2844
|
-
buildEnd,
|
|
2845
|
-
writeBundle,
|
|
2846
|
-
vite: { sharedDuringBuild: true }
|
|
2847
|
-
};
|
|
2848
|
-
} catch (error) {
|
|
2849
|
-
log(__storm_software_config_tools_types.LogLevelLabel.FATAL, error?.message);
|
|
2850
|
-
throw error;
|
|
2851
|
-
}
|
|
2852
|
-
};
|
|
2853
|
-
}
|
|
2854
|
-
|
|
2855
2660
|
//#endregion
|
|
2856
2661
|
//#region src/unplugin.ts
|
|
2662
|
+
var unplugin_exports = /* @__PURE__ */ require_chunk.__exportAll({ createUnpluginFactory: () => createUnpluginFactory });
|
|
2663
|
+
require_chunk.__reExport(unplugin_exports, require("@powerlines/core/lib/unplugin"));
|
|
2857
2664
|
/**
|
|
2858
2665
|
* Creates a Powerlines unplugin factory that generates a plugin instance.
|
|
2859
2666
|
*
|
|
@@ -2863,8 +2670,8 @@ function createUnplugin(context, options = {}) {
|
|
|
2863
2670
|
*/
|
|
2864
2671
|
function createUnpluginFactory(variant, decorate) {
|
|
2865
2672
|
return (config, meta) => {
|
|
2866
|
-
const log =
|
|
2867
|
-
log(
|
|
2673
|
+
const log = (0, _powerlines_core_lib_logger.createLog)("unplugin", config);
|
|
2674
|
+
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Initializing Unplugin");
|
|
2868
2675
|
try {
|
|
2869
2676
|
const userConfig = {
|
|
2870
2677
|
...config,
|
|
@@ -2873,29 +2680,29 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
2873
2680
|
};
|
|
2874
2681
|
let api;
|
|
2875
2682
|
async function buildStart() {
|
|
2876
|
-
log(
|
|
2877
|
-
api = await PowerlinesAPI.from((0,
|
|
2683
|
+
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
2684
|
+
api = await PowerlinesAPI.from((0, _stryke_fs_get_workspace_root.getWorkspaceRoot)(process.cwd()), userConfig);
|
|
2878
2685
|
(0, unplugin.setParseImpl)(api.context.parse);
|
|
2879
|
-
log(
|
|
2686
|
+
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Preparing build artifacts for the Powerlines project...");
|
|
2880
2687
|
await api.prepare({ command: "build" });
|
|
2881
2688
|
}
|
|
2882
|
-
async function resolveId(id, importer, options
|
|
2883
|
-
return api.context.resolve(id, importer, options
|
|
2689
|
+
async function resolveId(id, importer, options = { isEntry: false }) {
|
|
2690
|
+
return api.context.resolve(id, importer, options);
|
|
2884
2691
|
}
|
|
2885
2692
|
async function load(id) {
|
|
2886
2693
|
const environment = await api.context.getEnvironment();
|
|
2887
|
-
let result
|
|
2694
|
+
let result = await api.callHook("load", {
|
|
2888
2695
|
environment,
|
|
2889
2696
|
order: "pre"
|
|
2890
2697
|
}, id);
|
|
2891
|
-
if (result
|
|
2892
|
-
result
|
|
2698
|
+
if (result) return result;
|
|
2699
|
+
result = await api.callHook("load", {
|
|
2893
2700
|
environment,
|
|
2894
2701
|
order: "normal"
|
|
2895
2702
|
}, id);
|
|
2896
|
-
if (result
|
|
2897
|
-
result
|
|
2898
|
-
if (result
|
|
2703
|
+
if (result) return result;
|
|
2704
|
+
result = await environment.load(id);
|
|
2705
|
+
if (result) return result;
|
|
2899
2706
|
return api.callHook("load", {
|
|
2900
2707
|
environment,
|
|
2901
2708
|
order: "post"
|
|
@@ -2905,11 +2712,11 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
2905
2712
|
return api.callHook("transform", {
|
|
2906
2713
|
environment: await api.context.getEnvironment(),
|
|
2907
2714
|
result: "merge",
|
|
2908
|
-
asNextParam: (previousResult) =>
|
|
2909
|
-
},
|
|
2715
|
+
asNextParam: (previousResult) => (0, _powerlines_core_lib_utilities_source_file.getString)(previousResult)
|
|
2716
|
+
}, (0, _powerlines_core_lib_utilities_source_file.getString)(code), id);
|
|
2910
2717
|
}
|
|
2911
2718
|
async function writeBundle() {
|
|
2912
|
-
log(
|
|
2719
|
+
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
|
|
2913
2720
|
await api.callHook("writeBundle", { environment: await api.context.getEnvironment() });
|
|
2914
2721
|
}
|
|
2915
2722
|
const options = {
|
|
@@ -2928,13 +2735,13 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
2928
2735
|
writeBundle
|
|
2929
2736
|
};
|
|
2930
2737
|
const result = decorate ? decorate(api, options) : options;
|
|
2931
|
-
log(
|
|
2738
|
+
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, "Unplugin initialized successfully.");
|
|
2932
2739
|
return {
|
|
2933
2740
|
api,
|
|
2934
2741
|
...result
|
|
2935
2742
|
};
|
|
2936
2743
|
} catch (error) {
|
|
2937
|
-
log(
|
|
2744
|
+
log(_storm_software_config_tools_types.LogLevelLabel.FATAL, error?.message);
|
|
2938
2745
|
throw error;
|
|
2939
2746
|
}
|
|
2940
2747
|
};
|
|
@@ -2951,7 +2758,7 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
2951
2758
|
*/
|
|
2952
2759
|
function createPluginContext(plugin, environment) {
|
|
2953
2760
|
const normalizeMessage = (message) => {
|
|
2954
|
-
return (0,
|
|
2761
|
+
return (0, _stryke_type_checks_is_string.isString)(message) ? message : message.message;
|
|
2955
2762
|
};
|
|
2956
2763
|
const log = environment.extendLog(plugin.name.replaceAll(":", " - "));
|
|
2957
2764
|
const callHookFn = async (hook, options, ...args) => {
|
|
@@ -2973,22 +2780,22 @@ function createPluginContext(plugin, environment) {
|
|
|
2973
2780
|
};
|
|
2974
2781
|
if (prop === "log" || prop === "logger") return log;
|
|
2975
2782
|
if (prop === "fatal") return (message) => {
|
|
2976
|
-
log(
|
|
2783
|
+
log(_storm_software_config_tools_types.LogLevelLabel.FATAL, normalizeMessage(message));
|
|
2977
2784
|
};
|
|
2978
2785
|
if (prop === "error") return (message) => {
|
|
2979
|
-
log(
|
|
2786
|
+
log(_storm_software_config_tools_types.LogLevelLabel.ERROR, normalizeMessage(message));
|
|
2980
2787
|
};
|
|
2981
2788
|
if (prop === "warn") return (message) => {
|
|
2982
|
-
log(
|
|
2789
|
+
log(_storm_software_config_tools_types.LogLevelLabel.WARN, normalizeMessage(message));
|
|
2983
2790
|
};
|
|
2984
2791
|
if (prop === "info") return (message) => {
|
|
2985
|
-
log(
|
|
2792
|
+
log(_storm_software_config_tools_types.LogLevelLabel.INFO, normalizeMessage(message));
|
|
2986
2793
|
};
|
|
2987
2794
|
if (prop === "debug") return (message) => {
|
|
2988
|
-
log(
|
|
2795
|
+
log(_storm_software_config_tools_types.LogLevelLabel.DEBUG, normalizeMessage(message));
|
|
2989
2796
|
};
|
|
2990
2797
|
if (prop === "trace") return (message) => {
|
|
2991
|
-
log(
|
|
2798
|
+
log(_storm_software_config_tools_types.LogLevelLabel.TRACE, normalizeMessage(message));
|
|
2992
2799
|
};
|
|
2993
2800
|
return environment[prop];
|
|
2994
2801
|
},
|
|
@@ -3006,7 +2813,7 @@ function createPluginContext(plugin, environment) {
|
|
|
3006
2813
|
"addPlugin",
|
|
3007
2814
|
"selectHooks"
|
|
3008
2815
|
].includes(prop)) {
|
|
3009
|
-
log(
|
|
2816
|
+
log(_storm_software_config_tools_types.LogLevelLabel.WARN, `Cannot set read-only property "${String(prop)}"`);
|
|
3010
2817
|
return false;
|
|
3011
2818
|
}
|
|
3012
2819
|
environment[prop] = value;
|
|
@@ -3032,7 +2839,7 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3032
2839
|
static async fromConfig(workspaceConfig, config) {
|
|
3033
2840
|
const context = new PowerlinesEnvironmentContext(config, workspaceConfig);
|
|
3034
2841
|
await context.init();
|
|
3035
|
-
const powerlinesPath = await (0,
|
|
2842
|
+
const powerlinesPath = await (0, _stryke_fs_resolve.resolvePackage)("powerlines");
|
|
3036
2843
|
if (!powerlinesPath) throw new Error("Could not resolve `powerlines` package location.");
|
|
3037
2844
|
context.powerlinesPath = powerlinesPath;
|
|
3038
2845
|
return context;
|
|
@@ -3056,22 +2863,22 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3056
2863
|
}
|
|
3057
2864
|
async addPlugin(plugin) {
|
|
3058
2865
|
let resolvedPlugin = plugin;
|
|
3059
|
-
if ((0,
|
|
2866
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(plugin.applyToEnvironment)) {
|
|
3060
2867
|
const result = await Promise.resolve(plugin.applyToEnvironment(this.environment));
|
|
3061
|
-
if (!result || (0,
|
|
3062
|
-
if (require_plugin_utils.isPluginConfig(result)) return this.$$internal.addPlugin(result);
|
|
3063
|
-
resolvedPlugin = require_plugin_utils.isPlugin(result) ? result : plugin;
|
|
2868
|
+
if (!result || (0, _stryke_type_checks_is_object.isObject)(result) && Object.keys(result).length === 0) return;
|
|
2869
|
+
if ((0, require_plugin_utils.plugin_utils_exports.isPluginConfig)(result)) return this.$$internal.addPlugin(result);
|
|
2870
|
+
resolvedPlugin = (0, require_plugin_utils.plugin_utils_exports.isPlugin)(result) ? result : plugin;
|
|
3064
2871
|
}
|
|
3065
2872
|
const context = createPluginContext(resolvedPlugin, this);
|
|
3066
2873
|
this.plugins.push({
|
|
3067
2874
|
plugin: resolvedPlugin,
|
|
3068
2875
|
context
|
|
3069
2876
|
});
|
|
3070
|
-
this.#hooks = Object.keys(resolvedPlugin).filter((key) => !
|
|
2877
|
+
this.#hooks = Object.keys(resolvedPlugin).filter((key) => !require_constants.constants_exports.PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => {
|
|
3071
2878
|
const hook = key;
|
|
3072
|
-
if (require_plugin_utils.isPluginHookField(hook)) {
|
|
2879
|
+
if ((0, require_plugin_utils.plugin_utils_exports.isPluginHookField)(hook)) {
|
|
3073
2880
|
const pluginHook = resolvedPlugin[hook];
|
|
3074
|
-
if (!require_plugin_utils.isPluginHook(pluginHook)) return ret;
|
|
2881
|
+
if (!(0, require_plugin_utils.plugin_utils_exports.isPluginHook)(pluginHook)) return ret;
|
|
3075
2882
|
ret[hook] ??= {
|
|
3076
2883
|
preEnforced: [],
|
|
3077
2884
|
preOrdered: [],
|
|
@@ -3080,29 +2887,29 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3080
2887
|
postOrdered: []
|
|
3081
2888
|
};
|
|
3082
2889
|
if (resolvedPlugin.enforce) {
|
|
3083
|
-
const hookListOrder
|
|
3084
|
-
ret[hook][hookListOrder
|
|
3085
|
-
const bucket = ret[hook][hookListOrder
|
|
3086
|
-
require_plugin_utils.addPluginHook(context, resolvedPlugin, pluginHook, bucket);
|
|
2890
|
+
const hookListOrder = `${resolvedPlugin.enforce}Enforced`;
|
|
2891
|
+
ret[hook][hookListOrder] ??= [];
|
|
2892
|
+
const bucket = ret[hook][hookListOrder];
|
|
2893
|
+
(0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, resolvedPlugin, pluginHook, bucket);
|
|
3087
2894
|
return ret;
|
|
3088
2895
|
}
|
|
3089
|
-
if ((0,
|
|
2896
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(pluginHook) || !pluginHook.order) {
|
|
3090
2897
|
ret[hook].normal ??= [];
|
|
3091
2898
|
const bucket = ret[hook].normal;
|
|
3092
|
-
require_plugin_utils.addPluginHook(context, resolvedPlugin, pluginHook, bucket);
|
|
2899
|
+
(0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, resolvedPlugin, pluginHook, bucket);
|
|
3093
2900
|
return ret;
|
|
3094
2901
|
}
|
|
3095
2902
|
const hookListOrder = `${pluginHook.order}Ordered`;
|
|
3096
2903
|
ret[hook][hookListOrder] ??= [];
|
|
3097
|
-
require_plugin_utils.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][hookListOrder]);
|
|
2904
|
+
(0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, resolvedPlugin, pluginHook, ret[hook][hookListOrder]);
|
|
3098
2905
|
return ret;
|
|
3099
|
-
} else if (require_plugin_utils.isUnpluginHookField(hook)) {
|
|
2906
|
+
} else if ((0, require_plugin_utils.plugin_utils_exports.isUnpluginHookField)(hook)) {
|
|
3100
2907
|
const unpluginPlugin = resolvedPlugin[hook];
|
|
3101
|
-
if (!(0,
|
|
2908
|
+
if (!(0, _stryke_type_checks_is_set_object.isSetObject)(unpluginPlugin)) return ret;
|
|
3102
2909
|
for (const field of Object.keys(unpluginPlugin)) {
|
|
3103
2910
|
const variantField = field;
|
|
3104
2911
|
const pluginHook = unpluginPlugin[variantField];
|
|
3105
|
-
if (!require_plugin_utils.isPluginHook(pluginHook)) continue;
|
|
2912
|
+
if (!(0, require_plugin_utils.plugin_utils_exports.isPluginHook)(pluginHook)) continue;
|
|
3106
2913
|
ret[hook] ??= {};
|
|
3107
2914
|
ret[hook][variantField] ??= {
|
|
3108
2915
|
preEnforced: [],
|
|
@@ -3112,14 +2919,14 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3112
2919
|
postOrdered: []
|
|
3113
2920
|
};
|
|
3114
2921
|
if (resolvedPlugin.enforce) {
|
|
3115
|
-
require_plugin_utils.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][variantField][`${resolvedPlugin.enforce}Enforced`]);
|
|
2922
|
+
(0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, resolvedPlugin, pluginHook, ret[hook][variantField][`${resolvedPlugin.enforce}Enforced`]);
|
|
3116
2923
|
return ret;
|
|
3117
2924
|
}
|
|
3118
|
-
if ((0,
|
|
3119
|
-
require_plugin_utils.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][variantField].normal);
|
|
2925
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(pluginHook) || !pluginHook.order) {
|
|
2926
|
+
(0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, resolvedPlugin, pluginHook, ret[hook][variantField].normal);
|
|
3120
2927
|
return ret;
|
|
3121
2928
|
}
|
|
3122
|
-
require_plugin_utils.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][variantField][`${pluginHook.order}Ordered`]);
|
|
2929
|
+
(0, require_plugin_utils.plugin_utils_exports.addPluginHook)(context, resolvedPlugin, pluginHook, ret[hook][variantField][`${pluginHook.order}Ordered`]);
|
|
3123
2930
|
}
|
|
3124
2931
|
} else this.warn(`Unknown plugin hook field: ${String(hook)}`);
|
|
3125
2932
|
return ret;
|
|
@@ -3130,9 +2937,9 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3130
2937
|
*/
|
|
3131
2938
|
selectHooks(key, options) {
|
|
3132
2939
|
const result = [];
|
|
3133
|
-
if (require_plugin_utils.isUnpluginHookKey(key)) {
|
|
2940
|
+
if ((0, require_plugin_utils.plugin_utils_exports.isUnpluginHookKey)(key)) {
|
|
3134
2941
|
const variant = String(key).split(":")[0];
|
|
3135
|
-
if (isUnpluginBuilderVariant(variant)) {
|
|
2942
|
+
if ((0, unplugin_exports.isUnpluginBuilderVariant)(variant)) {
|
|
3136
2943
|
const hooks = this.hooks[variant];
|
|
3137
2944
|
if (hooks) {
|
|
3138
2945
|
const field = String(key).split(":")[1];
|
|
@@ -3163,7 +2970,7 @@ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends Po
|
|
|
3163
2970
|
}
|
|
3164
2971
|
}
|
|
3165
2972
|
}
|
|
3166
|
-
} else if (require_plugin_utils.isPluginHookField(key)) {
|
|
2973
|
+
} else if ((0, require_plugin_utils.plugin_utils_exports.isPluginHookField)(key)) {
|
|
3167
2974
|
if (this.hooks[key]) {
|
|
3168
2975
|
const fieldHooks = this.hooks[key];
|
|
3169
2976
|
if (options?.order) {
|
|
@@ -3212,9 +3019,9 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3212
3019
|
* @returns A promise that resolves to the new context.
|
|
3213
3020
|
*/
|
|
3214
3021
|
static async from(workspaceRoot, config) {
|
|
3215
|
-
const context = new PowerlinesAPIContext(await require_config.loadWorkspaceConfig(workspaceRoot, config.root));
|
|
3022
|
+
const context = new PowerlinesAPIContext(await (0, require_config.config_exports.loadWorkspaceConfig)(workspaceRoot, config.root));
|
|
3216
3023
|
await context.withUserConfig(config);
|
|
3217
|
-
const powerlinesPath = await (0,
|
|
3024
|
+
const powerlinesPath = await (0, _stryke_fs_resolve.resolvePackage)("powerlines");
|
|
3218
3025
|
if (!powerlinesPath) throw new Error("Could not resolve `powerlines` package location.");
|
|
3219
3026
|
context.powerlinesPath = powerlinesPath;
|
|
3220
3027
|
return context;
|
|
@@ -3265,7 +3072,7 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3265
3072
|
*/
|
|
3266
3073
|
async init(config = {}) {
|
|
3267
3074
|
await super.init(config);
|
|
3268
|
-
await Promise.all((0,
|
|
3075
|
+
await Promise.all((0, _stryke_convert_to_array.toArray)(this.config.userConfig.environments && Object.keys(this.config.userConfig.environments).length > 0 ? Object.keys(this.config.userConfig.environments).map((name) => createEnvironment(name, this.config.userConfig)) : createDefaultEnvironment(this.config.userConfig)).map(async (env) => {
|
|
3269
3076
|
this.#environments[env.name] = await this.in(env);
|
|
3270
3077
|
}));
|
|
3271
3078
|
}
|
|
@@ -3279,7 +3086,7 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3279
3086
|
let context;
|
|
3280
3087
|
if (this.environments[environment.name]) context = this.environments[environment.name];
|
|
3281
3088
|
else context = await PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
|
|
3282
|
-
if ((0,
|
|
3089
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(this.config.inlineConfig)) await context.withInlineConfig(this.config.inlineConfig);
|
|
3283
3090
|
context.environment = environment;
|
|
3284
3091
|
context.plugins = [];
|
|
3285
3092
|
for (const plugin of this.plugins) await context.addPlugin(plugin);
|
|
@@ -3292,8 +3099,8 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3292
3099
|
*/
|
|
3293
3100
|
async withUserConfig(userConfig, options = { isHighPriority: true }) {
|
|
3294
3101
|
await super.withUserConfig(userConfig, options);
|
|
3295
|
-
await Promise.all(Object.keys(this.#environments).map(async (name
|
|
3296
|
-
await this.#environments[name
|
|
3102
|
+
await Promise.all(Object.keys(this.#environments).map(async (name) => {
|
|
3103
|
+
await this.#environments[name].withUserConfig(userConfig, options);
|
|
3297
3104
|
}));
|
|
3298
3105
|
}
|
|
3299
3106
|
/**
|
|
@@ -3303,8 +3110,8 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3303
3110
|
*/
|
|
3304
3111
|
async withInlineConfig(inlineConfig, options = { isHighPriority: true }) {
|
|
3305
3112
|
await super.withInlineConfig(inlineConfig, options);
|
|
3306
|
-
await Promise.all(Object.keys(this.#environments).map(async (name
|
|
3307
|
-
await this.#environments[name
|
|
3113
|
+
await Promise.all(Object.keys(this.#environments).map(async (name) => {
|
|
3114
|
+
await this.#environments[name].withInlineConfig(inlineConfig, options);
|
|
3308
3115
|
}));
|
|
3309
3116
|
}
|
|
3310
3117
|
/**
|
|
@@ -3314,8 +3121,8 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3314
3121
|
*/
|
|
3315
3122
|
async addPlugin(plugin) {
|
|
3316
3123
|
this.plugins.push(plugin);
|
|
3317
|
-
await Promise.all(Object.keys(this.environments).map(async (name
|
|
3318
|
-
await this.environments[name
|
|
3124
|
+
await Promise.all(Object.keys(this.environments).map(async (name) => {
|
|
3125
|
+
await this.environments[name].addPlugin(plugin);
|
|
3319
3126
|
}));
|
|
3320
3127
|
}
|
|
3321
3128
|
/**
|
|
@@ -3324,15 +3131,15 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3324
3131
|
* @param name - The name of the environment to retrieve.
|
|
3325
3132
|
* @returns The requested environment context.
|
|
3326
3133
|
*/
|
|
3327
|
-
async getEnvironment(name
|
|
3134
|
+
async getEnvironment(name) {
|
|
3328
3135
|
let environment;
|
|
3329
|
-
if (name
|
|
3136
|
+
if (name) environment = this.environments[name];
|
|
3330
3137
|
if (Object.keys(this.environments).length === 1) {
|
|
3331
3138
|
environment = this.environments[Object.keys(this.environments)[0]];
|
|
3332
3139
|
this.debug(`Applying the only configured environment: ${chalk.default.bold.cyanBright(environment?.environment.name)}`);
|
|
3333
3140
|
}
|
|
3334
3141
|
if (!environment) {
|
|
3335
|
-
if (name
|
|
3142
|
+
if (name) throw new Error(`Environment "${name}" not found.`);
|
|
3336
3143
|
environment = await this.in(createDefaultEnvironment(this.config.userConfig));
|
|
3337
3144
|
this.warn(`No environment specified, and no default environment found. Using a temporary default environment: ${chalk.default.bold.cyanBright(environment?.environment.name)}`);
|
|
3338
3145
|
}
|
|
@@ -3344,9 +3151,9 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3344
3151
|
* @param name - The name of the environment to retrieve.
|
|
3345
3152
|
* @returns The requested environment context or `undefined` if not found.
|
|
3346
3153
|
*/
|
|
3347
|
-
async getEnvironmentSafe(name
|
|
3154
|
+
async getEnvironmentSafe(name) {
|
|
3348
3155
|
try {
|
|
3349
|
-
return await this.getEnvironment(name
|
|
3156
|
+
return await this.getEnvironment(name);
|
|
3350
3157
|
} catch {
|
|
3351
3158
|
return;
|
|
3352
3159
|
}
|
|
@@ -3362,7 +3169,7 @@ var PowerlinesAPIContext = class PowerlinesAPIContext extends PowerlinesContext
|
|
|
3362
3169
|
async toEnvironment() {
|
|
3363
3170
|
let environment;
|
|
3364
3171
|
if (Object.keys(this.environments).length > 1) {
|
|
3365
|
-
environment = await this.in(createEnvironment(require_constants.GLOBAL_ENVIRONMENT, this.config.userConfig));
|
|
3172
|
+
environment = await this.in(createEnvironment(require_constants.constants_exports.GLOBAL_ENVIRONMENT, this.config.userConfig));
|
|
3366
3173
|
this.debug(`Combined all ${Object.keys(this.environments).length} environments into a single global context.`);
|
|
3367
3174
|
} else environment = await this.getEnvironment();
|
|
3368
3175
|
return environment;
|
|
@@ -3446,7 +3253,7 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3446
3253
|
environment: context,
|
|
3447
3254
|
order: "normal"
|
|
3448
3255
|
});
|
|
3449
|
-
if (context.entry.length > 0) context.debug(`The configuration provided ${(0,
|
|
3256
|
+
if (context.entry.length > 0) context.debug(`The configuration provided ${(0, _stryke_type_checks_is_object.isObject)(context.config.input) ? Object.keys(context.config.input).length : (0, _stryke_convert_to_array.toArray)(context.config.input).length} entry point(s), Powerlines has found ${context.entry.length} entry files(s) for the ${context.config.title} project${context.entry.length > 0 && context.entry.length < 10 ? `: \n${context.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}`);
|
|
3450
3257
|
else context.warn(`No entry files were found for the ${context.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
|
|
3451
3258
|
await resolveTsconfig(context);
|
|
3452
3259
|
await installDependencies(context);
|
|
@@ -3454,14 +3261,14 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3454
3261
|
environment: context,
|
|
3455
3262
|
order: "post"
|
|
3456
3263
|
});
|
|
3457
|
-
context.trace(`Powerlines configuration has been resolved: \n\n${(0,
|
|
3264
|
+
context.trace(`Powerlines configuration has been resolved: \n\n${(0, _storm_software_config_tools_logger_console.formatLogMessage)({
|
|
3458
3265
|
...context.config,
|
|
3459
|
-
userConfig: (0,
|
|
3460
|
-
inlineConfig: (0,
|
|
3266
|
+
userConfig: (0, _stryke_type_checks_is_set_object.isSetObject)(context.config.userConfig) ? (0, _stryke_helpers_omit.omit)(context.config.userConfig, ["plugins"]) : void 0,
|
|
3267
|
+
inlineConfig: (0, _stryke_type_checks_is_set_object.isSetObject)(context.config.inlineConfig) ? (0, _stryke_helpers_omit.omit)(context.config.inlineConfig, ["plugins"]) : void 0,
|
|
3461
3268
|
plugins: context.plugins.map((plugin) => plugin.plugin.name)
|
|
3462
3269
|
})}`);
|
|
3463
|
-
if (!context.fs.existsSync(context.cachePath)) await (0,
|
|
3464
|
-
if (!context.fs.existsSync(context.dataPath)) await (0,
|
|
3270
|
+
if (!context.fs.existsSync(context.cachePath)) await (0, _stryke_fs_helpers.createDirectory)(context.cachePath);
|
|
3271
|
+
if (!context.fs.existsSync(context.dataPath)) await (0, _stryke_fs_helpers.createDirectory)(context.dataPath);
|
|
3465
3272
|
await this.callHook("prepare", {
|
|
3466
3273
|
environment: context,
|
|
3467
3274
|
order: "pre"
|
|
@@ -3477,16 +3284,16 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3477
3284
|
if (context.config.output.dts !== false) {
|
|
3478
3285
|
context.debug(`Preparing the TypeScript definitions for the Powerlines project.`);
|
|
3479
3286
|
if (context.fs.existsSync(context.dtsPath)) await context.fs.remove(context.dtsPath);
|
|
3480
|
-
if (!await (0,
|
|
3287
|
+
if (!await (0, _stryke_fs_resolve.resolvePackage)("typescript")) throw new Error("Could not resolve TypeScript package location. Please ensure TypeScript is installed.");
|
|
3481
3288
|
context.debug("Running TypeScript compiler for built-in runtime module files.");
|
|
3482
3289
|
let types = await emitBuiltinTypes(context, (await context.getBuiltins()).reduce((ret, builtin) => {
|
|
3483
|
-
const formatted = (0,
|
|
3290
|
+
const formatted = (0, _stryke_path_replace.replacePath)(builtin.path, context.workspaceConfig.workspaceRoot);
|
|
3484
3291
|
if (!ret.includes(formatted)) ret.push(formatted);
|
|
3485
3292
|
return ret;
|
|
3486
3293
|
}, []));
|
|
3487
3294
|
context.debug(`Generating TypeScript declaration file ${context.dtsPath}.`);
|
|
3488
3295
|
const directives = [];
|
|
3489
|
-
const asNextParam = (previousResult) => (0,
|
|
3296
|
+
const asNextParam = (previousResult) => (0, _stryke_type_checks_is_object.isObject)(previousResult) ? previousResult.code : previousResult;
|
|
3490
3297
|
let result = await this.callHook("types", {
|
|
3491
3298
|
environment: context,
|
|
3492
3299
|
sequential: true,
|
|
@@ -3495,10 +3302,10 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3495
3302
|
asNextParam
|
|
3496
3303
|
}, types);
|
|
3497
3304
|
if (result) {
|
|
3498
|
-
if ((0,
|
|
3305
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) {
|
|
3499
3306
|
types = result.code;
|
|
3500
3307
|
if (Array.isArray(result.directives) && result.directives.length > 0) directives.push(...result.directives);
|
|
3501
|
-
} else if ((0,
|
|
3308
|
+
} else if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) types = result;
|
|
3502
3309
|
}
|
|
3503
3310
|
result = await this.callHook("types", {
|
|
3504
3311
|
environment: context,
|
|
@@ -3508,10 +3315,10 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3508
3315
|
asNextParam
|
|
3509
3316
|
}, types);
|
|
3510
3317
|
if (result) {
|
|
3511
|
-
if ((0,
|
|
3318
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) {
|
|
3512
3319
|
types = result.code;
|
|
3513
3320
|
if (Array.isArray(result.directives) && result.directives.length > 0) directives.push(...result.directives);
|
|
3514
|
-
} else if ((0,
|
|
3321
|
+
} else if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) types = result;
|
|
3515
3322
|
}
|
|
3516
3323
|
result = await this.callHook("types", {
|
|
3517
3324
|
environment: context,
|
|
@@ -3521,14 +3328,14 @@ var PowerlinesAPI = class PowerlinesAPI {
|
|
|
3521
3328
|
asNextParam
|
|
3522
3329
|
}, types);
|
|
3523
3330
|
if (result) {
|
|
3524
|
-
if ((0,
|
|
3331
|
+
if ((0, _stryke_type_checks_is_set_object.isSetObject)(result)) {
|
|
3525
3332
|
types = result.code;
|
|
3526
3333
|
if (Array.isArray(result.directives) && result.directives.length > 0) directives.push(...result.directives);
|
|
3527
|
-
} else if ((0,
|
|
3334
|
+
} else if ((0, _stryke_type_checks_is_set_string.isSetString)(result)) types = result;
|
|
3528
3335
|
}
|
|
3529
|
-
if ((0,
|
|
3336
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(types?.trim()) || directives.length > 0) await context.fs.write(context.dtsPath, `${directives.length > 0 ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
|
|
3530
3337
|
|
|
3531
|
-
` : ""}${require_utils.getTypescriptFileHeader(context, {
|
|
3338
|
+
` : ""}${(0, require_utils.utils_exports.getTypescriptFileHeader)(context, {
|
|
3532
3339
|
directive: null,
|
|
3533
3340
|
prettierIgnore: false
|
|
3534
3341
|
})}
|
|
@@ -3547,7 +3354,7 @@ ${formatTypes(types)}
|
|
|
3547
3354
|
context.tsconfig = require_tsconfig.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.root, context.config.tsconfig);
|
|
3548
3355
|
if (!context.tsconfig) throw new Error("Failed to parse the TypeScript configuration file.");
|
|
3549
3356
|
this.context.debug("Formatting files generated during the prepare step.");
|
|
3550
|
-
await Promise.all([
|
|
3357
|
+
await Promise.all([(0, require_utils.utils_exports.formatFolder)(context, context.builtinsPath), (0, require_utils.utils_exports.formatFolder)(context, context.entryPath)]);
|
|
3551
3358
|
await writeMetaFile(context);
|
|
3552
3359
|
context.persistedMeta = context.meta;
|
|
3553
3360
|
});
|
|
@@ -3571,29 +3378,29 @@ ${formatTypes(types)}
|
|
|
3571
3378
|
environment: context,
|
|
3572
3379
|
order: "pre"
|
|
3573
3380
|
});
|
|
3574
|
-
const files = await (0,
|
|
3381
|
+
const files = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)(context.powerlinesPath, "files/common/**/*.hbs"));
|
|
3575
3382
|
for (const file of files) {
|
|
3576
3383
|
context.trace(`Adding template file to project: ${file}`);
|
|
3577
3384
|
const template = handlebars.default.compile(file);
|
|
3578
|
-
await context.fs.write((0,
|
|
3385
|
+
await context.fs.write((0, _stryke_path_join_paths.joinPaths)(context.config.root, file.replace(".hbs", "")), template(context));
|
|
3579
3386
|
}
|
|
3580
3387
|
await this.callHook("new", {
|
|
3581
3388
|
environment: context,
|
|
3582
3389
|
order: "normal"
|
|
3583
3390
|
});
|
|
3584
3391
|
if (context.config.projectType === "application") {
|
|
3585
|
-
const files
|
|
3586
|
-
for (const file of files
|
|
3392
|
+
const files = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)(context.powerlinesPath, "files/application/**/*.hbs"));
|
|
3393
|
+
for (const file of files) {
|
|
3587
3394
|
context.trace(`Adding application template file: ${file}`);
|
|
3588
3395
|
const template = handlebars.default.compile(file);
|
|
3589
|
-
await context.fs.write((0,
|
|
3396
|
+
await context.fs.write((0, _stryke_path_join_paths.joinPaths)(context.config.root, file.replace(".hbs", "")), template(context));
|
|
3590
3397
|
}
|
|
3591
3398
|
} else {
|
|
3592
|
-
const files
|
|
3593
|
-
for (const file of files
|
|
3399
|
+
const files = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join_paths.joinPaths)(context.powerlinesPath, "files/library/**/*.hbs"));
|
|
3400
|
+
for (const file of files) {
|
|
3594
3401
|
context.trace(`Adding library template file: ${file}`);
|
|
3595
3402
|
const template = handlebars.default.compile(file);
|
|
3596
|
-
await context.fs.write((0,
|
|
3403
|
+
await context.fs.write((0, _stryke_path_join_paths.joinPaths)(context.config.root, file.replace(".hbs", "")), template(context));
|
|
3597
3404
|
}
|
|
3598
3405
|
}
|
|
3599
3406
|
await this.callHook("new", {
|
|
@@ -3617,8 +3424,8 @@ ${formatTypes(types)}
|
|
|
3617
3424
|
await this.prepare(inlineConfig);
|
|
3618
3425
|
await this.#executeEnvironments(async (context) => {
|
|
3619
3426
|
context.debug("Cleaning the project's dist and artifacts directories.");
|
|
3620
|
-
await context.fs.remove((0,
|
|
3621
|
-
await context.fs.remove((0,
|
|
3427
|
+
await context.fs.remove((0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.output.buildPath));
|
|
3428
|
+
await context.fs.remove((0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, context.config.output.artifactsPath));
|
|
3622
3429
|
await this.callHook("clean", {
|
|
3623
3430
|
environment: context,
|
|
3624
3431
|
sequential: false
|
|
@@ -3677,8 +3484,8 @@ ${formatTypes(types)}
|
|
|
3677
3484
|
await this.#executeEnvironments(async (context) => {
|
|
3678
3485
|
context.debug("Writing documentation for the Powerlines project artifacts.");
|
|
3679
3486
|
await this.prepare(inlineConfig);
|
|
3680
|
-
await this.#executeEnvironments(async (context
|
|
3681
|
-
await this.callHook("docs", { environment: context
|
|
3487
|
+
await this.#executeEnvironments(async (context) => {
|
|
3488
|
+
await this.callHook("docs", { environment: context });
|
|
3682
3489
|
});
|
|
3683
3490
|
});
|
|
3684
3491
|
this.context.debug("✔ Powerlines documentation generation completed successfully");
|
|
@@ -3727,7 +3534,7 @@ ${formatTypes(types)}
|
|
|
3727
3534
|
* @returns The result of the hook call
|
|
3728
3535
|
*/
|
|
3729
3536
|
async callHook(hook, options, ...args) {
|
|
3730
|
-
return callHook((0,
|
|
3537
|
+
return callHook((0, _stryke_type_checks_is_set_object.isSetObject)(options?.environment) ? options.environment : await this.#context.getEnvironment(options?.environment), hook, {
|
|
3731
3538
|
sequential: true,
|
|
3732
3539
|
...options
|
|
3733
3540
|
}, ...args);
|
|
@@ -3747,21 +3554,21 @@ ${formatTypes(types)}
|
|
|
3747
3554
|
order: "pre"
|
|
3748
3555
|
});
|
|
3749
3556
|
context.debug("Formatting the generated entry files before the build process starts.");
|
|
3750
|
-
await
|
|
3557
|
+
await (0, require_utils.utils_exports.formatFolder)(context, context.entryPath);
|
|
3751
3558
|
await this.callHook("build", {
|
|
3752
3559
|
environment: context,
|
|
3753
3560
|
order: "normal"
|
|
3754
3561
|
});
|
|
3755
3562
|
if (context.config.output.buildPath !== context.config.output.outputPath) {
|
|
3756
|
-
const sourcePath = (0,
|
|
3757
|
-
const destinationPath = (0,
|
|
3563
|
+
const sourcePath = (0, _stryke_path_append.appendPath)(context.config.output.buildPath, context.workspaceConfig.workspaceRoot);
|
|
3564
|
+
const destinationPath = (0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_append.appendPath)(context.config.output.outputPath, context.workspaceConfig.workspaceRoot), "dist");
|
|
3758
3565
|
if (context.fs.existsSync(sourcePath) && sourcePath !== destinationPath) {
|
|
3759
3566
|
context.debug(`Copying build output files from project's build directory (${context.config.output.buildPath}) to the workspace's output directory (${context.config.output.outputPath}).`);
|
|
3760
3567
|
await context.fs.copy(sourcePath, destinationPath);
|
|
3761
3568
|
}
|
|
3762
3569
|
}
|
|
3763
3570
|
await Promise.all(context.config.output.assets.map(async (asset) => {
|
|
3764
|
-
context.trace(`Copying asset(s): ${chalk.default.redBright(context.workspaceConfig.workspaceRoot === asset.input ? asset.glob : (0,
|
|
3571
|
+
context.trace(`Copying asset(s): ${chalk.default.redBright(context.workspaceConfig.workspaceRoot === asset.input ? asset.glob : (0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_replace.replacePath)(asset.input, context.workspaceConfig.workspaceRoot), asset.glob))} -> ${chalk.default.greenBright((0, _stryke_path_join_paths.joinPaths)((0, _stryke_path_replace.replacePath)(asset.output, context.workspaceConfig.workspaceRoot), asset.glob))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk.default.yellowBright(i)).join(", ")})` : ""}`);
|
|
3765
3572
|
await context.fs.copy(asset, asset.output);
|
|
3766
3573
|
}));
|
|
3767
3574
|
await this.callHook("build", {
|
|
@@ -3780,13 +3587,13 @@ ${formatTypes(types)}
|
|
|
3780
3587
|
return [await this.context.getEnvironment()];
|
|
3781
3588
|
}
|
|
3782
3589
|
this.context.debug(`Found ${Object.keys(this.context.config.environments).length} configured environment(s) for this Powerlines project.`);
|
|
3783
|
-
return (await Promise.all(Object.entries(this.context.config.environments).map(async ([name
|
|
3784
|
-
if (!await this.context.getEnvironmentSafe(name
|
|
3785
|
-
const resolvedEnvironment = await this.callHook("configEnvironment", { environment: name
|
|
3786
|
-
if (resolvedEnvironment) this.context.environments[name
|
|
3590
|
+
return (await Promise.all(Object.entries(this.context.config.environments).map(async ([name, config]) => {
|
|
3591
|
+
if (!await this.context.getEnvironmentSafe(name)) {
|
|
3592
|
+
const resolvedEnvironment = await this.callHook("configEnvironment", { environment: name }, name, config);
|
|
3593
|
+
if (resolvedEnvironment) this.context.environments[name] = await this.context.in(resolvedEnvironment);
|
|
3787
3594
|
}
|
|
3788
|
-
return this.context.environments[name
|
|
3789
|
-
}))).filter((context) => (0,
|
|
3595
|
+
return this.context.environments[name];
|
|
3596
|
+
}))).filter((context) => (0, _stryke_type_checks_is_set.isSet)(context));
|
|
3790
3597
|
}
|
|
3791
3598
|
/**
|
|
3792
3599
|
* Execute a handler function for each environment
|
|
@@ -3822,47 +3629,47 @@ ${formatTypes(types)}
|
|
|
3822
3629
|
*/
|
|
3823
3630
|
async #initPlugin(config) {
|
|
3824
3631
|
let awaited = config;
|
|
3825
|
-
if ((0,
|
|
3826
|
-
if (!require_plugin_utils.isPluginConfig(awaited)) {
|
|
3827
|
-
const invalid = require_plugin_utils.findInvalidPluginConfig(awaited);
|
|
3632
|
+
if ((0, _stryke_type_checks_is_promise.isPromiseLike)(config)) awaited = await Promise.resolve(config);
|
|
3633
|
+
if (!(0, require_plugin_utils.plugin_utils_exports.isPluginConfig)(awaited)) {
|
|
3634
|
+
const invalid = (0, require_plugin_utils.plugin_utils_exports.findInvalidPluginConfig)(awaited);
|
|
3828
3635
|
throw new Error(`Invalid ${invalid && invalid.length > 1 ? "plugins" : "plugin"} specified in the configuration - ${invalid && invalid.length > 0 ? JSON.stringify(awaited) : invalid?.join("\n\n")} \n\nPlease ensure the value is one of the following: \n - an instance of \`Plugin\` \n - a plugin name \n - an object with the \`plugin\` and \`options\` properties \n - a tuple array with the plugin and options \n - a factory function that returns a plugin or array of plugins \n - an array of plugins or plugin configurations`);
|
|
3829
3636
|
}
|
|
3830
3637
|
let plugins;
|
|
3831
|
-
if (require_plugin_utils.isPlugin(awaited)) plugins = [awaited];
|
|
3832
|
-
else if ((0,
|
|
3833
|
-
else if ((0,
|
|
3638
|
+
if ((0, require_plugin_utils.plugin_utils_exports.isPlugin)(awaited)) plugins = [awaited];
|
|
3639
|
+
else if ((0, _stryke_type_checks_is_function.isFunction)(awaited)) plugins = (0, _stryke_convert_to_array.toArray)(await Promise.resolve(awaited()));
|
|
3640
|
+
else if ((0, _stryke_type_checks_is_string.isString)(awaited)) {
|
|
3834
3641
|
const resolved = await this.#resolvePlugin(awaited);
|
|
3835
|
-
if ((0,
|
|
3836
|
-
else plugins = (0,
|
|
3837
|
-
} else if (Array.isArray(awaited) && awaited.every(require_plugin_utils.isPlugin)) plugins = awaited;
|
|
3838
|
-
else if (Array.isArray(awaited) && awaited.every(require_plugin_utils.isPluginConfig)) {
|
|
3642
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(resolved)) plugins = (0, _stryke_convert_to_array.toArray)(await Promise.resolve(resolved()));
|
|
3643
|
+
else plugins = (0, _stryke_convert_to_array.toArray)(resolved);
|
|
3644
|
+
} else if (Array.isArray(awaited) && awaited.every(require_plugin_utils.plugin_utils_exports.isPlugin)) plugins = awaited;
|
|
3645
|
+
else if (Array.isArray(awaited) && awaited.every(require_plugin_utils.plugin_utils_exports.isPluginConfig)) {
|
|
3839
3646
|
plugins = [];
|
|
3840
3647
|
for (const pluginConfig of awaited) {
|
|
3841
3648
|
const initialized = await this.#initPlugin(pluginConfig);
|
|
3842
3649
|
if (initialized) plugins.push(...initialized);
|
|
3843
3650
|
}
|
|
3844
|
-
} else if (require_plugin_utils.isPluginConfigTuple(awaited) || require_plugin_utils.isPluginConfigObject(awaited)) {
|
|
3651
|
+
} else if ((0, require_plugin_utils.plugin_utils_exports.isPluginConfigTuple)(awaited) || (0, require_plugin_utils.plugin_utils_exports.isPluginConfigObject)(awaited)) {
|
|
3845
3652
|
let pluginConfig;
|
|
3846
3653
|
let pluginOptions;
|
|
3847
|
-
if (require_plugin_utils.isPluginConfigTuple(awaited)) {
|
|
3654
|
+
if ((0, require_plugin_utils.plugin_utils_exports.isPluginConfigTuple)(awaited)) {
|
|
3848
3655
|
pluginConfig = awaited[0];
|
|
3849
3656
|
pluginOptions = awaited?.length === 2 ? awaited[1] : void 0;
|
|
3850
3657
|
} else {
|
|
3851
3658
|
pluginConfig = awaited.plugin;
|
|
3852
3659
|
pluginOptions = awaited.options;
|
|
3853
3660
|
}
|
|
3854
|
-
if ((0,
|
|
3661
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(pluginConfig)) {
|
|
3855
3662
|
const resolved = await this.#resolvePlugin(pluginConfig);
|
|
3856
|
-
if ((0,
|
|
3857
|
-
else plugins = (0,
|
|
3858
|
-
} else if ((0,
|
|
3859
|
-
else if (Array.isArray(pluginConfig) && pluginConfig.every(require_plugin_utils.isPlugin)) plugins = pluginConfig;
|
|
3860
|
-
else if (require_plugin_utils.isPlugin(pluginConfig)) plugins = (0,
|
|
3663
|
+
if ((0, _stryke_type_checks_is_function.isFunction)(resolved)) plugins = (0, _stryke_convert_to_array.toArray)(await Promise.resolve(pluginOptions ? resolved(pluginOptions) : resolved()));
|
|
3664
|
+
else plugins = (0, _stryke_convert_to_array.toArray)(resolved);
|
|
3665
|
+
} else if ((0, _stryke_type_checks_is_function.isFunction)(pluginConfig)) plugins = (0, _stryke_convert_to_array.toArray)(await Promise.resolve(pluginConfig(pluginOptions)));
|
|
3666
|
+
else if (Array.isArray(pluginConfig) && pluginConfig.every(require_plugin_utils.plugin_utils_exports.isPlugin)) plugins = pluginConfig;
|
|
3667
|
+
else if ((0, require_plugin_utils.plugin_utils_exports.isPlugin)(pluginConfig)) plugins = (0, _stryke_convert_to_array.toArray)(pluginConfig);
|
|
3861
3668
|
}
|
|
3862
3669
|
if (!plugins) throw new Error(`The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`);
|
|
3863
|
-
if (plugins.length > 0 && !plugins.every(require_plugin_utils.isPlugin)) throw new Error(`The plugin option ${JSON.stringify(plugins)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`);
|
|
3670
|
+
if (plugins.length > 0 && !plugins.every(require_plugin_utils.plugin_utils_exports.isPlugin)) throw new Error(`The plugin option ${JSON.stringify(plugins)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`);
|
|
3864
3671
|
const result = [];
|
|
3865
|
-
for (const plugin of plugins) if (require_plugin_utils.checkDedupe(plugin, this.context.plugins)) this.context.trace(`Duplicate ${chalk.default.bold.cyanBright(plugin.name)} plugin dependency detected - Skipping initialization.`);
|
|
3672
|
+
for (const plugin of plugins) if ((0, require_plugin_utils.plugin_utils_exports.checkDedupe)(plugin, this.context.plugins)) this.context.trace(`Duplicate ${chalk.default.bold.cyanBright(plugin.name)} plugin dependency detected - Skipping initialization.`);
|
|
3866
3673
|
else {
|
|
3867
3674
|
result.push(plugin);
|
|
3868
3675
|
this.context.trace(`Initializing the ${chalk.default.bold.cyanBright(plugin.name)} plugin...`);
|
|
@@ -3874,30 +3681,30 @@ ${formatTypes(types)}
|
|
|
3874
3681
|
const splits = pluginPath.split("/").filter(Boolean);
|
|
3875
3682
|
pluginPath = `${splits[0]}/${splits[1]}`;
|
|
3876
3683
|
}
|
|
3877
|
-
const isInstalled = (0,
|
|
3684
|
+
const isInstalled = (0, _stryke_fs_package_fns.isPackageExists)(pluginPath, { paths: [this.context.workspaceConfig.workspaceRoot, this.context.config.root] });
|
|
3878
3685
|
if (!isInstalled && this.context.config.autoInstall) {
|
|
3879
3686
|
this.#context.warn(`The plugin package "${pluginPath}" is not installed. It will be installed automatically.`);
|
|
3880
|
-
const result = await (0,
|
|
3881
|
-
if ((0,
|
|
3687
|
+
const result = await (0, _stryke_fs_install.install)(pluginPath, { cwd: this.context.config.root });
|
|
3688
|
+
if ((0, _stryke_type_checks_is_number.isNumber)(result.exitCode) && result.exitCode > 0) {
|
|
3882
3689
|
this.#context.error(result.stderr);
|
|
3883
3690
|
throw new Error(`An error occurred while installing the build plugin package "${pluginPath}" `);
|
|
3884
3691
|
}
|
|
3885
3692
|
}
|
|
3886
3693
|
try {
|
|
3887
|
-
const module
|
|
3888
|
-
const result = module
|
|
3694
|
+
const module = await this.context.resolver.plugin.import(this.context.resolver.plugin.esmResolve((0, _stryke_path_join_paths.joinPaths)(pluginPath, "plugin")));
|
|
3695
|
+
const result = module.plugin ?? module.default;
|
|
3889
3696
|
if (!result) throw new Error(`The plugin package "${pluginPath}" does not export a valid module.`);
|
|
3890
3697
|
return result;
|
|
3891
3698
|
} catch (error) {
|
|
3892
3699
|
try {
|
|
3893
|
-
const module
|
|
3894
|
-
const result = module
|
|
3700
|
+
const module = await this.context.resolver.plugin.import(this.context.resolver.plugin.esmResolve(pluginPath));
|
|
3701
|
+
const result = module.plugin ?? module.default;
|
|
3895
3702
|
if (!result) throw new Error(`The plugin package "${pluginPath}" does not export a valid module.`);
|
|
3896
3703
|
return result;
|
|
3897
3704
|
} catch {
|
|
3898
3705
|
if (!isInstalled) throw new Error(`The plugin package "${pluginPath}" is not installed. Please install the package using the command: "npm install ${pluginPath} --save-dev"`);
|
|
3899
3706
|
else throw new Error(`An error occurred while importing the build plugin package "${pluginPath}":
|
|
3900
|
-
${(0,
|
|
3707
|
+
${(0, _stryke_type_checks_is_error.isError)(error) ? error.message : String(error)}
|
|
3901
3708
|
|
|
3902
3709
|
Note: Please ensure the plugin package's default export is a class that extends \`Plugin\` with a constructor that excepts a single arguments of type \`PluginOptions\`.`);
|
|
3903
3710
|
}
|
|
@@ -3966,52 +3773,28 @@ Object.defineProperty(exports, '_capnpFileId', {
|
|
|
3966
3773
|
return _capnpFileId;
|
|
3967
3774
|
}
|
|
3968
3775
|
});
|
|
3969
|
-
Object.defineProperty(exports, 'combineContexts', {
|
|
3970
|
-
enumerable: true,
|
|
3971
|
-
get: function () {
|
|
3972
|
-
return combineContexts;
|
|
3973
|
-
}
|
|
3974
|
-
});
|
|
3975
3776
|
Object.defineProperty(exports, 'createPluginContext', {
|
|
3976
3777
|
enumerable: true,
|
|
3977
3778
|
get: function () {
|
|
3978
3779
|
return createPluginContext;
|
|
3979
3780
|
}
|
|
3980
3781
|
});
|
|
3981
|
-
Object.defineProperty(exports, 'createUnplugin', {
|
|
3982
|
-
enumerable: true,
|
|
3983
|
-
get: function () {
|
|
3984
|
-
return createUnplugin;
|
|
3985
|
-
}
|
|
3986
|
-
});
|
|
3987
3782
|
Object.defineProperty(exports, 'createUnpluginFactory', {
|
|
3988
3783
|
enumerable: true,
|
|
3989
3784
|
get: function () {
|
|
3990
3785
|
return createUnpluginFactory;
|
|
3991
3786
|
}
|
|
3992
3787
|
});
|
|
3993
|
-
Object.defineProperty(exports, '
|
|
3994
|
-
enumerable: true,
|
|
3995
|
-
get: function () {
|
|
3996
|
-
return createUnpluginModuleResolutionFunctions;
|
|
3997
|
-
}
|
|
3998
|
-
});
|
|
3999
|
-
Object.defineProperty(exports, 'createUnpluginResolver', {
|
|
4000
|
-
enumerable: true,
|
|
4001
|
-
get: function () {
|
|
4002
|
-
return createUnpluginResolver;
|
|
4003
|
-
}
|
|
4004
|
-
});
|
|
4005
|
-
Object.defineProperty(exports, 'isUnpluginBuilderVariant', {
|
|
3788
|
+
Object.defineProperty(exports, 'name', {
|
|
4006
3789
|
enumerable: true,
|
|
4007
3790
|
get: function () {
|
|
4008
|
-
return
|
|
3791
|
+
return name;
|
|
4009
3792
|
}
|
|
4010
3793
|
});
|
|
4011
|
-
Object.defineProperty(exports, '
|
|
3794
|
+
Object.defineProperty(exports, 'unplugin_exports', {
|
|
4012
3795
|
enumerable: true,
|
|
4013
3796
|
get: function () {
|
|
4014
|
-
return
|
|
3797
|
+
return unplugin_exports;
|
|
4015
3798
|
}
|
|
4016
3799
|
});
|
|
4017
3800
|
Object.defineProperty(exports, 'version', {
|