@powerlines/plugin-env 0.15.4 → 0.15.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/babel/index.cjs +1 -0
- package/dist/babel/index.d.cts +1 -0
- package/dist/babel/index.d.mts +1 -0
- package/dist/babel/index.mjs +3 -0
- package/dist/babel/plugin.cjs +200 -0
- package/dist/babel/plugin.d.cts +8 -0
- package/dist/babel/plugin.d.mts +9 -0
- package/dist/babel/plugin.mjs +198 -0
- package/dist/components/docs.cjs +70 -3
- package/dist/components/docs.d.cts +8 -1
- package/dist/components/docs.d.mts +8 -1
- package/dist/components/docs.mjs +68 -2
- package/dist/components/env.cjs +574 -4
- package/dist/components/env.d.cts +19 -2
- package/dist/components/env.d.mts +19 -3
- package/dist/components/env.mjs +570 -2
- package/dist/components/index.cjs +5 -7
- package/dist/components/index.d.cts +2 -4
- package/dist/components/index.d.mts +2 -5
- package/dist/components/index.mjs +2 -4
- package/dist/deepkit/schemas/reflection.cjs +5368 -0
- package/dist/{plugin-BwuEBScL.d.cts → deepkit/schemas/reflection.d.cts} +1 -268
- package/dist/{plugin-BaInAuAh.d.mts → deepkit/schemas/reflection.d.mts} +59 -326
- package/dist/deepkit/schemas/reflection.mjs +5365 -0
- package/dist/deepkit/schemas/reflection2.cjs +4112 -0
- package/dist/deepkit/schemas/reflection2.mjs +4110 -0
- package/dist/deepkit/src/capnp.cjs +1692 -0
- package/dist/deepkit/src/capnp.mjs +1690 -0
- package/dist/deepkit/src/esbuild-plugin.cjs +99 -0
- package/dist/deepkit/src/esbuild-plugin.mjs +98 -0
- package/dist/deepkit/src/reflect-type.cjs +40 -0
- package/dist/deepkit/src/reflect-type.mjs +38 -0
- package/dist/deepkit/src/resolve-reflections.cjs +23 -0
- package/dist/deepkit/src/resolve-reflections.mjs +22 -0
- package/dist/deepkit/src/transformer.cjs +92 -0
- package/dist/deepkit/src/transformer.mjs +89 -0
- package/dist/deepkit/src/transpile.cjs +39 -0
- package/dist/deepkit/src/transpile.mjs +37 -0
- package/dist/deepkit/src/types.cjs +22 -0
- package/dist/deepkit/src/types.d.cts +10 -0
- package/dist/deepkit/src/types.d.mts +10 -0
- package/dist/deepkit/src/types.mjs +21 -0
- package/dist/deepkit/src/utilities.cjs +182 -0
- package/dist/deepkit/src/utilities.mjs +181 -0
- package/dist/helpers/automd-generator.cjs +32 -0
- package/dist/helpers/automd-generator.mjs +31 -0
- package/dist/helpers/create-reflection-resource.cjs +98 -0
- package/dist/helpers/create-reflection-resource.d.cts +15 -0
- package/dist/helpers/create-reflection-resource.d.mts +15 -0
- package/dist/helpers/create-reflection-resource.mjs +97 -0
- package/dist/helpers/index.cjs +6 -0
- package/dist/helpers/index.d.cts +6 -0
- package/dist/helpers/index.d.mts +6 -0
- package/dist/helpers/index.mjs +8 -0
- package/dist/helpers/load.cjs +134 -0
- package/dist/helpers/load.d.cts +35 -0
- package/dist/helpers/load.d.mts +36 -0
- package/dist/helpers/load.mjs +131 -0
- package/dist/helpers/persistence.cjs +320 -0
- package/dist/helpers/persistence.d.cts +84 -0
- package/dist/helpers/persistence.d.mts +84 -0
- package/dist/helpers/persistence.mjs +308 -0
- package/dist/helpers/reflect.cjs +263 -0
- package/dist/helpers/reflect.d.cts +46 -0
- package/dist/helpers/reflect.d.mts +46 -0
- package/dist/helpers/reflect.mjs +254 -0
- package/dist/helpers/source-file-env.cjs +58 -0
- package/dist/helpers/source-file-env.d.cts +8 -0
- package/dist/helpers/source-file-env.d.mts +8 -0
- package/dist/helpers/source-file-env.mjs +56 -0
- package/dist/helpers/template-helpers.cjs +70 -0
- package/dist/helpers/template-helpers.d.cts +15 -0
- package/dist/helpers/template-helpers.d.mts +15 -0
- package/dist/helpers/template-helpers.mjs +69 -0
- package/dist/index.cjs +82 -696
- package/dist/index.d.cts +16 -185
- package/dist/index.d.mts +17 -190
- package/dist/index.mjs +31 -648
- package/dist/plugin-alloy/src/core/components/output.cjs +45 -0
- package/dist/plugin-alloy/src/core/components/output.mjs +44 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +22 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +21 -0
- package/dist/plugin-alloy/src/core/components/source-file.cjs +64 -0
- package/dist/plugin-alloy/src/core/components/source-file.d.cts +23 -0
- package/dist/plugin-alloy/src/core/components/source-file.d.mts +23 -0
- package/dist/plugin-alloy/src/core/components/source-file.mjs +62 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +136 -0
- package/dist/plugin-alloy/src/core/contexts/context.mjs +128 -0
- package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
- package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +110 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +101 -0
- package/dist/plugin-alloy/src/helpers/refkey.cjs +23 -0
- package/dist/plugin-alloy/src/helpers/refkey.mjs +22 -0
- package/dist/plugin-alloy/src/index.cjs +93 -0
- package/dist/plugin-alloy/src/index.mjs +91 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +115 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +114 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +39 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +38 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +72 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +71 -0
- package/dist/plugin-alloy/src/types/components.cjs +22 -0
- package/dist/plugin-alloy/src/types/components.d.cts +22 -0
- package/dist/{components-8W0Zgj0y.d.mts → plugin-alloy/src/types/components.d.mts} +2 -1
- package/dist/plugin-alloy/src/types/components.mjs +21 -0
- package/dist/plugin-alloy/src/types/index.d.mts +2 -0
- package/dist/plugin-alloy/src/types/plugin.cjs +55 -0
- package/dist/plugin-alloy/src/types/plugin.d.cts +37 -0
- package/dist/plugin-alloy/src/types/plugin.d.mts +37 -0
- package/dist/plugin-alloy/src/types/plugin.mjs +52 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +57 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +25 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +26 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +56 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +126 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +124 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +442 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +27 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +28 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +433 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +194 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +14 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +15 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +191 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +68 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +11 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +12 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +67 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +124 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +123 -0
- package/dist/plugin-automd/src/index.cjs +127 -0
- package/dist/plugin-automd/src/index.mjs +124 -0
- package/dist/plugin-automd/src/types/plugin.cjs +47 -0
- package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
- package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
- package/dist/plugin-automd/src/types/plugin.mjs +47 -0
- package/dist/plugin-automd/src/types/toc.cjs +26 -0
- package/dist/plugin-automd/src/types/toc.d.cts +33 -0
- package/dist/plugin-automd/src/types/toc.d.mts +33 -0
- package/dist/plugin-automd/src/types/toc.mjs +25 -0
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +74 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +70 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +71 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +69 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +158 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +154 -0
- package/dist/plugin-babel/src/helpers/index.cjs +5 -0
- package/dist/plugin-babel/src/helpers/index.mjs +7 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +200 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +192 -0
- package/dist/plugin-babel/src/helpers/options.cjs +74 -0
- package/dist/plugin-babel/src/helpers/options.mjs +71 -0
- package/dist/plugin-babel/src/index.cjs +134 -0
- package/dist/plugin-babel/src/index.mjs +132 -0
- package/dist/plugin-babel/src/types/index.d.mts +1 -0
- package/dist/plugin-babel/src/types/plugin.cjs +42 -0
- package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
- package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
- package/dist/plugin-babel/src/types/plugin.mjs +39 -0
- package/dist/powerlines/schemas/fs.d.mts +1 -0
- package/dist/powerlines/src/api.d.mts +7 -0
- package/dist/powerlines/src/index.d.mts +12 -0
- package/dist/powerlines/src/internal/helpers/hooks.cjs +119 -0
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +5 -0
- package/dist/powerlines/src/internal/helpers/hooks.mjs +118 -0
- package/dist/powerlines/src/lib/build/esbuild.cjs +161 -0
- package/dist/powerlines/src/lib/build/esbuild.mjs +159 -0
- package/dist/powerlines/src/lib/entry.cjs +203 -0
- package/dist/powerlines/src/lib/entry.mjs +201 -0
- package/dist/powerlines/src/lib/logger.cjs +108 -0
- package/dist/powerlines/src/lib/logger.mjs +106 -0
- package/dist/powerlines/src/lib/utilities/bundle.cjs +67 -0
- package/dist/powerlines/src/lib/utilities/bundle.mjs +66 -0
- package/dist/powerlines/src/lib/utilities/resolve.cjs +49 -0
- package/dist/powerlines/src/lib/utilities/resolve.mjs +48 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +46 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +45 -0
- package/dist/powerlines/src/types/api.cjs +1 -0
- package/dist/powerlines/src/types/api.d.mts +5 -0
- package/dist/powerlines/src/types/api.mjs +3 -0
- package/dist/powerlines/src/types/babel.cjs +156 -0
- package/dist/powerlines/src/types/babel.d.cts +23 -0
- package/dist/powerlines/src/types/babel.d.mts +23 -0
- package/dist/powerlines/src/types/babel.mjs +147 -0
- package/dist/powerlines/src/types/build.cjs +105 -0
- package/dist/powerlines/src/types/build.d.cts +145 -0
- package/dist/powerlines/src/types/build.d.mts +147 -0
- package/dist/powerlines/src/types/build.mjs +101 -0
- package/dist/powerlines/src/types/commands.cjs +16 -0
- package/dist/powerlines/src/types/commands.d.cts +8 -0
- package/dist/powerlines/src/types/commands.d.mts +9 -0
- package/dist/powerlines/src/types/commands.mjs +15 -0
- package/dist/powerlines/src/types/config.cjs +306 -0
- package/dist/powerlines/src/types/config.d.cts +387 -0
- package/dist/powerlines/src/types/config.d.mts +388 -0
- package/dist/powerlines/src/types/config.mjs +293 -0
- package/dist/powerlines/src/types/context.cjs +324 -0
- package/dist/powerlines/src/types/context.d.cts +414 -0
- package/dist/powerlines/src/types/context.d.mts +416 -0
- package/dist/powerlines/src/types/context.mjs +311 -0
- package/dist/powerlines/src/types/fs.cjs +78 -0
- package/dist/powerlines/src/types/fs.d.cts +486 -0
- package/dist/powerlines/src/types/fs.d.mts +486 -0
- package/dist/powerlines/src/types/fs.mjs +75 -0
- package/dist/powerlines/src/types/hooks.cjs +52 -0
- package/dist/powerlines/src/types/hooks.d.mts +2 -0
- package/dist/powerlines/src/types/hooks.mjs +48 -0
- package/dist/powerlines/src/types/index.cjs +11 -0
- package/dist/powerlines/src/types/index.d.mts +12 -0
- package/dist/powerlines/src/types/index.mjs +13 -0
- package/dist/powerlines/src/types/plugin.cjs +249 -0
- package/dist/powerlines/src/types/plugin.d.cts +231 -0
- package/dist/powerlines/src/types/plugin.d.mts +231 -0
- package/dist/powerlines/src/types/plugin.mjs +240 -0
- package/dist/powerlines/src/types/resolved.cjs +153 -0
- package/dist/powerlines/src/types/resolved.d.cts +82 -0
- package/dist/powerlines/src/types/resolved.d.mts +83 -0
- package/dist/powerlines/src/types/resolved.mjs +148 -0
- package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
- package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
- package/dist/powerlines/src/types/unplugin.cjs +1 -0
- package/dist/powerlines/src/types/unplugin.d.mts +7 -0
- package/dist/powerlines/src/types/unplugin.mjs +3 -0
- package/dist/types/index.cjs +10 -3
- package/dist/types/index.d.cts +2 -4
- package/dist/types/index.d.mts +2 -5
- package/dist/types/index.mjs +3 -4
- package/dist/types/plugin.cjs +133 -1
- package/dist/types/plugin.d.cts +156 -3
- package/dist/types/plugin.d.mts +158 -4
- package/dist/types/plugin.mjs +128 -2
- package/dist/types/runtime.cjs +242 -1
- package/dist/types/runtime.d.cts +793 -2
- package/dist/types/runtime.d.mts +793 -2
- package/dist/types/runtime.mjs +240 -2
- package/package.json +13 -9
- package/dist/components-C9bYrQVK.cjs +0 -0
- package/dist/components-CNIQFfeK.mjs +0 -1
- package/dist/create-reflection-resource-BNYxBgW2.mjs +0 -9846
- package/dist/create-reflection-resource-BWYhmX7O.cjs +0 -10085
- package/dist/docs-5r844zC1.d.mts +0 -9
- package/dist/docs-B66b9li3.mjs +0 -219
- package/dist/docs-_MmTNBQX.d.cts +0 -9
- package/dist/docs-hBlKCRWK.cjs +0 -224
- package/dist/env-BPodCdD1.d.cts +0 -116
- package/dist/env-IQvgnabX.mjs +0 -1578
- package/dist/env-cO4BUDn1.cjs +0 -1596
- package/dist/env-zhzvpUI5.d.mts +0 -98
- package/dist/index-BXxhKmeA.d.mts +0 -1
- package/dist/index-Cc7fCJU9.d.mts +0 -1
- package/dist/index-CqdNToYT.d.cts +0 -1
- package/dist/index-DWPDThxu.d.cts +0 -1
- package/dist/plugin-D3B5E_Hg.mjs +0 -1
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/resolved-BZG2cwRG.d.cts +0 -1789
- package/dist/resolved-V5COsfDu.d.mts +0 -1791
- package/dist/runtime-Bisl_1Ja.cjs +0 -0
- package/dist/runtime-Q8Ni8SeN.d.cts +0 -794
- package/dist/runtime-azNoeKr-.mjs +0 -1
- package/dist/runtime-qZ0Z2kEd.d.mts +0 -794
- package/dist/types-DwElXV6q.mjs +0 -1
- package/dist/types-MYBaygjr.cjs +0 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_context = require('../../types/context.cjs');
|
|
3
|
+
const require_build = require('../../types/build.cjs');
|
|
4
|
+
const require_entry = require('../entry.cjs');
|
|
5
|
+
let __stryke_path_replace = require("@stryke/path/replace");
|
|
6
|
+
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
7
|
+
let defu = require("defu");
|
|
8
|
+
defu = require_rolldown_runtime.__toESM(defu);
|
|
9
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
10
|
+
let __stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
11
|
+
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
12
|
+
|
|
13
|
+
//#region ../powerlines/src/lib/build/esbuild.ts
|
|
14
|
+
function __assignType(fn, args) {
|
|
15
|
+
fn.__type = args;
|
|
16
|
+
return fn;
|
|
17
|
+
}
|
|
18
|
+
const DEFAULT_ESBUILD_CONFIG = {
|
|
19
|
+
target: "esnext",
|
|
20
|
+
platform: "neutral",
|
|
21
|
+
format: "esm",
|
|
22
|
+
write: true,
|
|
23
|
+
minify: true,
|
|
24
|
+
sourcemap: false,
|
|
25
|
+
bundle: true,
|
|
26
|
+
treeShaking: true,
|
|
27
|
+
keepNames: true,
|
|
28
|
+
splitting: true,
|
|
29
|
+
logLevel: "silent"
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Resolves the entry options for esbuild.
|
|
33
|
+
*
|
|
34
|
+
* @param context - The build context.
|
|
35
|
+
* @param entryPoints - The entry points to resolve.
|
|
36
|
+
* @returns The resolved entry options.
|
|
37
|
+
*/
|
|
38
|
+
function resolveESBuildEntry(context, entryPoints = []) {
|
|
39
|
+
return entryPoints.reduce(__assignType((ret, entry) => {
|
|
40
|
+
if ((0, __stryke_type_checks_is_string.isString)(entry)) ret[(0, __stryke_path_replace.replaceExtension)((0, __stryke_path_replace.replacePath)(entry, context.config.sourceRoot || context.config.projectRoot))] = (0, __stryke_path_replace.replacePath)(entry, context.config.sourceRoot || context.config.projectRoot);
|
|
41
|
+
else ret[entry.output || require_entry.resolveEntryOutput(context, entry.input || entry)] = require_entry.resolveEntryInputFile(context, entry.input || entry);
|
|
42
|
+
return ret;
|
|
43
|
+
}, [
|
|
44
|
+
"ret",
|
|
45
|
+
"entry",
|
|
46
|
+
"",
|
|
47
|
+
"P\"2!\"2\"\"/#"
|
|
48
|
+
]), {});
|
|
49
|
+
}
|
|
50
|
+
resolveESBuildEntry.__type = [
|
|
51
|
+
() => require_context.__ΩContext,
|
|
52
|
+
"context",
|
|
53
|
+
"ResolvedEntryTypeDefinition",
|
|
54
|
+
"entryPoints",
|
|
55
|
+
() => [],
|
|
56
|
+
() => require_build.__ΩESBuildResolvedBuildConfig,
|
|
57
|
+
"entryPoints",
|
|
58
|
+
"resolveESBuildEntry",
|
|
59
|
+
"Resolves the entry options for esbuild.",
|
|
60
|
+
"Pn!2\"P\"w#F&FJ2$>%n&.'f/(?)"
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* Resolves the esbuild options.
|
|
64
|
+
*
|
|
65
|
+
* @param context - The build context.
|
|
66
|
+
* @returns The resolved esbuild options.
|
|
67
|
+
*/
|
|
68
|
+
function extractESBuildConfig(context) {
|
|
69
|
+
const inject = context.config.build.override.inject ?? context.config.build.inject;
|
|
70
|
+
if (inject && Object.keys(inject).length > 0) context.fs.writeSync((0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(__assignType(([key, value]) => {
|
|
71
|
+
if (value) if (Array.isArray(value)) {
|
|
72
|
+
if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) {
|
|
73
|
+
if (value.length === 1) return `
|
|
74
|
+
import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
|
|
75
|
+
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
76
|
+
else if (value.length > 1) return `
|
|
77
|
+
import ${value[1] === "*" ? `* as ${(0, __stryke_string_format_camel_case.camelCase)(key)}` : `{ ${value[1]} as ${(0, __stryke_string_format_camel_case.camelCase)(key)} }`} from "${value[0]}";
|
|
78
|
+
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
79
|
+
} else if (value.length === 1) return `
|
|
80
|
+
import ${key} from "${value[0]}";
|
|
81
|
+
export { ${key} };`;
|
|
82
|
+
else if (value.length > 1) return `
|
|
83
|
+
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
84
|
+
export { ${key} };`;
|
|
85
|
+
} else if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) return `
|
|
86
|
+
import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
|
|
87
|
+
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
88
|
+
else return `
|
|
89
|
+
import ${key} from "${value}";
|
|
90
|
+
export { ${key} };`;
|
|
91
|
+
return "";
|
|
92
|
+
}, [
|
|
93
|
+
"param0",
|
|
94
|
+
"",
|
|
95
|
+
"P\"2!\"/\""
|
|
96
|
+
])).join("\n"));
|
|
97
|
+
return (0, defu.default)({
|
|
98
|
+
alias: context.builtins.reduce(__assignType((ret, id) => {
|
|
99
|
+
if (!ret[id]) {
|
|
100
|
+
const path = context.fs.ids[id];
|
|
101
|
+
if (path) ret[id] = path;
|
|
102
|
+
}
|
|
103
|
+
return ret;
|
|
104
|
+
}, [
|
|
105
|
+
"ret",
|
|
106
|
+
"id",
|
|
107
|
+
"",
|
|
108
|
+
"P\"2!\"2\"\"/#"
|
|
109
|
+
]), context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce(__assignType((ret, alias) => {
|
|
110
|
+
if (!ret[alias.find.toString()]) ret[alias.find.toString()] = alias.replacement;
|
|
111
|
+
return ret;
|
|
112
|
+
}, [
|
|
113
|
+
"ret",
|
|
114
|
+
"alias",
|
|
115
|
+
"",
|
|
116
|
+
"P\"2!\"2\"\"/#"
|
|
117
|
+
]), {}) : context.config.build.alias : {}),
|
|
118
|
+
inject: inject && Object.keys(inject).length > 0 ? [(0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
|
|
119
|
+
}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build.override, [
|
|
120
|
+
"alias",
|
|
121
|
+
"inject",
|
|
122
|
+
"external",
|
|
123
|
+
"noExternal",
|
|
124
|
+
"skipNodeModulesBundle",
|
|
125
|
+
"extensions"
|
|
126
|
+
]) : {}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build, [
|
|
127
|
+
"alias",
|
|
128
|
+
"inject",
|
|
129
|
+
"external",
|
|
130
|
+
"noExternal",
|
|
131
|
+
"skipNodeModulesBundle",
|
|
132
|
+
"extensions",
|
|
133
|
+
"variant",
|
|
134
|
+
"override"
|
|
135
|
+
]) : {}, {
|
|
136
|
+
mainFields: context.config.build.mainFields,
|
|
137
|
+
conditions: context.config.build.conditions,
|
|
138
|
+
define: context.config.build.define,
|
|
139
|
+
resolveExtensions: context.config.build.extensions,
|
|
140
|
+
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
141
|
+
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
142
|
+
platform: context.config.build.platform,
|
|
143
|
+
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
144
|
+
outdir: context.config.output.buildPath,
|
|
145
|
+
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
146
|
+
minify: context.config.mode !== "development",
|
|
147
|
+
metafile: context.config.mode === "development",
|
|
148
|
+
sourcemap: context.config.mode === "development"
|
|
149
|
+
}, DEFAULT_ESBUILD_CONFIG);
|
|
150
|
+
}
|
|
151
|
+
extractESBuildConfig.__type = [
|
|
152
|
+
() => require_context.__ΩContext,
|
|
153
|
+
"context",
|
|
154
|
+
"BuildOptions",
|
|
155
|
+
"extractESBuildConfig",
|
|
156
|
+
"Resolves the esbuild options.",
|
|
157
|
+
"Pn!2\"\"w#/$?%"
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
//#endregion
|
|
161
|
+
exports.extractESBuildConfig = extractESBuildConfig;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { __ΩContext } from "../../types/context.mjs";
|
|
2
|
+
import { __ΩESBuildResolvedBuildConfig } from "../../types/build.mjs";
|
|
3
|
+
import { resolveEntryInputFile, resolveEntryOutput } from "../entry.mjs";
|
|
4
|
+
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
5
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
6
|
+
import defu$1 from "defu";
|
|
7
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
8
|
+
import { omit } from "@stryke/helpers/omit";
|
|
9
|
+
import { camelCase } from "@stryke/string-format/camel-case";
|
|
10
|
+
|
|
11
|
+
//#region ../powerlines/src/lib/build/esbuild.ts
|
|
12
|
+
function __assignType(fn, args) {
|
|
13
|
+
fn.__type = args;
|
|
14
|
+
return fn;
|
|
15
|
+
}
|
|
16
|
+
const DEFAULT_ESBUILD_CONFIG = {
|
|
17
|
+
target: "esnext",
|
|
18
|
+
platform: "neutral",
|
|
19
|
+
format: "esm",
|
|
20
|
+
write: true,
|
|
21
|
+
minify: true,
|
|
22
|
+
sourcemap: false,
|
|
23
|
+
bundle: true,
|
|
24
|
+
treeShaking: true,
|
|
25
|
+
keepNames: true,
|
|
26
|
+
splitting: true,
|
|
27
|
+
logLevel: "silent"
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Resolves the entry options for esbuild.
|
|
31
|
+
*
|
|
32
|
+
* @param context - The build context.
|
|
33
|
+
* @param entryPoints - The entry points to resolve.
|
|
34
|
+
* @returns The resolved entry options.
|
|
35
|
+
*/
|
|
36
|
+
function resolveESBuildEntry(context, entryPoints = []) {
|
|
37
|
+
return entryPoints.reduce(__assignType((ret, entry) => {
|
|
38
|
+
if (isString(entry)) ret[replaceExtension(replacePath(entry, context.config.sourceRoot || context.config.projectRoot))] = replacePath(entry, context.config.sourceRoot || context.config.projectRoot);
|
|
39
|
+
else ret[entry.output || resolveEntryOutput(context, entry.input || entry)] = resolveEntryInputFile(context, entry.input || entry);
|
|
40
|
+
return ret;
|
|
41
|
+
}, [
|
|
42
|
+
"ret",
|
|
43
|
+
"entry",
|
|
44
|
+
"",
|
|
45
|
+
"P\"2!\"2\"\"/#"
|
|
46
|
+
]), {});
|
|
47
|
+
}
|
|
48
|
+
resolveESBuildEntry.__type = [
|
|
49
|
+
() => __ΩContext,
|
|
50
|
+
"context",
|
|
51
|
+
"ResolvedEntryTypeDefinition",
|
|
52
|
+
"entryPoints",
|
|
53
|
+
() => [],
|
|
54
|
+
() => __ΩESBuildResolvedBuildConfig,
|
|
55
|
+
"entryPoints",
|
|
56
|
+
"resolveESBuildEntry",
|
|
57
|
+
"Resolves the entry options for esbuild.",
|
|
58
|
+
"Pn!2\"P\"w#F&FJ2$>%n&.'f/(?)"
|
|
59
|
+
];
|
|
60
|
+
/**
|
|
61
|
+
* Resolves the esbuild options.
|
|
62
|
+
*
|
|
63
|
+
* @param context - The build context.
|
|
64
|
+
* @returns The resolved esbuild options.
|
|
65
|
+
*/
|
|
66
|
+
function extractESBuildConfig(context) {
|
|
67
|
+
const inject = context.config.build.override.inject ?? context.config.build.inject;
|
|
68
|
+
if (inject && Object.keys(inject).length > 0) context.fs.writeSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(__assignType(([key, value]) => {
|
|
69
|
+
if (value) if (Array.isArray(value)) {
|
|
70
|
+
if (camelCase(key) !== key) {
|
|
71
|
+
if (value.length === 1) return `
|
|
72
|
+
import ${camelCase(key)} from "${value[0]}";
|
|
73
|
+
export { ${camelCase(key)} as "${key}" }`;
|
|
74
|
+
else if (value.length > 1) return `
|
|
75
|
+
import ${value[1] === "*" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from "${value[0]}";
|
|
76
|
+
export { ${camelCase(key)} as "${key}" }`;
|
|
77
|
+
} else if (value.length === 1) return `
|
|
78
|
+
import ${key} from "${value[0]}";
|
|
79
|
+
export { ${key} };`;
|
|
80
|
+
else if (value.length > 1) return `
|
|
81
|
+
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
82
|
+
export { ${key} };`;
|
|
83
|
+
} else if (camelCase(key) !== key) return `
|
|
84
|
+
import ${camelCase(key)} from "${value[0]}";
|
|
85
|
+
export { ${camelCase(key)} as "${key}" }`;
|
|
86
|
+
else return `
|
|
87
|
+
import ${key} from "${value}";
|
|
88
|
+
export { ${key} };`;
|
|
89
|
+
return "";
|
|
90
|
+
}, [
|
|
91
|
+
"param0",
|
|
92
|
+
"",
|
|
93
|
+
"P\"2!\"/\""
|
|
94
|
+
])).join("\n"));
|
|
95
|
+
return defu$1({
|
|
96
|
+
alias: context.builtins.reduce(__assignType((ret, id) => {
|
|
97
|
+
if (!ret[id]) {
|
|
98
|
+
const path = context.fs.ids[id];
|
|
99
|
+
if (path) ret[id] = path;
|
|
100
|
+
}
|
|
101
|
+
return ret;
|
|
102
|
+
}, [
|
|
103
|
+
"ret",
|
|
104
|
+
"id",
|
|
105
|
+
"",
|
|
106
|
+
"P\"2!\"2\"\"/#"
|
|
107
|
+
]), context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce(__assignType((ret, alias) => {
|
|
108
|
+
if (!ret[alias.find.toString()]) ret[alias.find.toString()] = alias.replacement;
|
|
109
|
+
return ret;
|
|
110
|
+
}, [
|
|
111
|
+
"ret",
|
|
112
|
+
"alias",
|
|
113
|
+
"",
|
|
114
|
+
"P\"2!\"2\"\"/#"
|
|
115
|
+
]), {}) : context.config.build.alias : {}),
|
|
116
|
+
inject: inject && Object.keys(inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
|
|
117
|
+
}, context.config.build.variant === "esbuild" ? omit(context.config.build.override, [
|
|
118
|
+
"alias",
|
|
119
|
+
"inject",
|
|
120
|
+
"external",
|
|
121
|
+
"noExternal",
|
|
122
|
+
"skipNodeModulesBundle",
|
|
123
|
+
"extensions"
|
|
124
|
+
]) : {}, context.config.build.variant === "esbuild" ? omit(context.config.build, [
|
|
125
|
+
"alias",
|
|
126
|
+
"inject",
|
|
127
|
+
"external",
|
|
128
|
+
"noExternal",
|
|
129
|
+
"skipNodeModulesBundle",
|
|
130
|
+
"extensions",
|
|
131
|
+
"variant",
|
|
132
|
+
"override"
|
|
133
|
+
]) : {}, {
|
|
134
|
+
mainFields: context.config.build.mainFields,
|
|
135
|
+
conditions: context.config.build.conditions,
|
|
136
|
+
define: context.config.build.define,
|
|
137
|
+
resolveExtensions: context.config.build.extensions,
|
|
138
|
+
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
139
|
+
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
140
|
+
platform: context.config.build.platform,
|
|
141
|
+
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
142
|
+
outdir: context.config.output.buildPath,
|
|
143
|
+
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
144
|
+
minify: context.config.mode !== "development",
|
|
145
|
+
metafile: context.config.mode === "development",
|
|
146
|
+
sourcemap: context.config.mode === "development"
|
|
147
|
+
}, DEFAULT_ESBUILD_CONFIG);
|
|
148
|
+
}
|
|
149
|
+
extractESBuildConfig.__type = [
|
|
150
|
+
() => __ΩContext,
|
|
151
|
+
"context",
|
|
152
|
+
"BuildOptions",
|
|
153
|
+
"extractESBuildConfig",
|
|
154
|
+
"Resolves the esbuild options.",
|
|
155
|
+
"Pn!2\"\"w#/$?%"
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
export { extractESBuildConfig };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_resolved = require('../types/resolved.cjs');
|
|
3
|
+
const require_paths = require('../plugin-utils/paths.cjs');
|
|
4
|
+
let __stryke_path_replace = require("@stryke/path/replace");
|
|
5
|
+
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
6
|
+
let __stryke_fs_is_file = require("@stryke/fs/is-file");
|
|
7
|
+
let __stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
8
|
+
let __stryke_path_append = require("@stryke/path/append");
|
|
9
|
+
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
10
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
11
|
+
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
12
|
+
let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
|
|
13
|
+
let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
14
|
+
let __stryke_hash_murmurhash = require("@stryke/hash/murmurhash");
|
|
15
|
+
|
|
16
|
+
//#region ../powerlines/src/lib/entry.ts
|
|
17
|
+
function __assignType(fn, args) {
|
|
18
|
+
fn.__type = args;
|
|
19
|
+
return fn;
|
|
20
|
+
}
|
|
21
|
+
function resolveEntryInputFile(context, typeDefinition) {
|
|
22
|
+
return (0, __stryke_path_replace.replacePath)(typeDefinition.file, (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot));
|
|
23
|
+
}
|
|
24
|
+
resolveEntryInputFile.__type = [
|
|
25
|
+
"Context",
|
|
26
|
+
"context",
|
|
27
|
+
"typeDefinition",
|
|
28
|
+
"resolveEntryInputFile",
|
|
29
|
+
"P\"w!2\"!2#&/$"
|
|
30
|
+
];
|
|
31
|
+
function resolveEntryInput(context, typeDefinition) {
|
|
32
|
+
return {
|
|
33
|
+
file: resolveEntryInputFile(context, typeDefinition),
|
|
34
|
+
name: typeDefinition.name
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
resolveEntryInput.__type = [
|
|
38
|
+
"Context",
|
|
39
|
+
"context",
|
|
40
|
+
"typeDefinition",
|
|
41
|
+
"resolveEntryInput",
|
|
42
|
+
"P\"w!2\"!2#!/$"
|
|
43
|
+
];
|
|
44
|
+
function resolveEntryOutput(context, typeDefinition) {
|
|
45
|
+
return (0, __stryke_path_replace.replaceExtension)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)((0, __stryke_path_replace.replacePath)(typeDefinition.file, (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.sourceRoot)), (0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot)), context.config.sourceRoot), context.config.projectRoot), (0, __stryke_path_replace.replacePath)(context.config.sourceRoot, context.config.projectRoot)));
|
|
46
|
+
}
|
|
47
|
+
resolveEntryOutput.__type = [
|
|
48
|
+
"Context",
|
|
49
|
+
"context",
|
|
50
|
+
"typeDefinition",
|
|
51
|
+
"resolveEntryOutput",
|
|
52
|
+
"P\"w!2\"!2#&/$"
|
|
53
|
+
];
|
|
54
|
+
function resolveEntry(context, typeDefinition) {
|
|
55
|
+
const input = resolveEntryInput(context, typeDefinition);
|
|
56
|
+
return {
|
|
57
|
+
...input,
|
|
58
|
+
input,
|
|
59
|
+
output: resolveEntryOutput(context, typeDefinition)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
resolveEntry.__type = [
|
|
63
|
+
"Context",
|
|
64
|
+
"context",
|
|
65
|
+
"typeDefinition",
|
|
66
|
+
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
67
|
+
"resolveEntry",
|
|
68
|
+
"P\"w!2\"!2#n$/%"
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
71
|
+
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
72
|
+
*
|
|
73
|
+
* @param context - The current context
|
|
74
|
+
* @param typeDefinitions - The type definitions to resolve.
|
|
75
|
+
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
76
|
+
*/
|
|
77
|
+
async function resolveEntries(context, typeDefinitions) {
|
|
78
|
+
return (await Promise.all(typeDefinitions.map(__assignType(async (typeDefinition) => {
|
|
79
|
+
const parsed = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(typeDefinition);
|
|
80
|
+
const filePath = (0, __stryke_path_append.appendPath)(parsed.file, context.config.projectRoot);
|
|
81
|
+
if ((0, __stryke_fs_is_file.isFile)(filePath)) return resolveEntry(context, {
|
|
82
|
+
file: (0, __stryke_path_replace.replacePath)(filePath, context.config.projectRoot),
|
|
83
|
+
name: parsed.name
|
|
84
|
+
});
|
|
85
|
+
return (await (0, __stryke_fs_list_files.listFiles)((0, __stryke_path_append.appendPath)(parsed.file, context.config.projectRoot))).map(__assignType((file) => resolveEntry(context, {
|
|
86
|
+
file,
|
|
87
|
+
name: parsed.name
|
|
88
|
+
}), [
|
|
89
|
+
"file",
|
|
90
|
+
"",
|
|
91
|
+
"P\"2!\"/\""
|
|
92
|
+
]));
|
|
93
|
+
}, [
|
|
94
|
+
"typeDefinition",
|
|
95
|
+
"",
|
|
96
|
+
"P\"2!\"/\""
|
|
97
|
+
])))).flat().filter(Boolean);
|
|
98
|
+
}
|
|
99
|
+
resolveEntries.__type = [
|
|
100
|
+
"Context",
|
|
101
|
+
"context",
|
|
102
|
+
"typeDefinitions",
|
|
103
|
+
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
104
|
+
"resolveEntries",
|
|
105
|
+
"Resolves multiple type definitions into their corresponding resolved entry type definitions.",
|
|
106
|
+
"P\"w!2\"!F2#n$F`/%?&"
|
|
107
|
+
];
|
|
108
|
+
/**
|
|
109
|
+
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
110
|
+
*
|
|
111
|
+
* @param context - The current context
|
|
112
|
+
* @param typeDefinitions - The type definitions to resolve.
|
|
113
|
+
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
114
|
+
*/
|
|
115
|
+
function resolveEntriesSync(context, typeDefinitions) {
|
|
116
|
+
return typeDefinitions.map(__assignType((entry) => (0, __stryke_type_checks_is_string.isString)(entry) ? require_paths.replacePathTokens(context, entry) : require_paths.replacePathTokens(context, entry.file), [
|
|
117
|
+
"entry",
|
|
118
|
+
"",
|
|
119
|
+
"P\"2!\"/\""
|
|
120
|
+
])).map(__assignType((typeDefinition) => {
|
|
121
|
+
const parsed = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(typeDefinition);
|
|
122
|
+
const filePath = (0, __stryke_path_append.appendPath)(parsed.file, context.config.projectRoot);
|
|
123
|
+
if ((0, __stryke_fs_is_file.isFile)(filePath)) return resolveEntry(context, {
|
|
124
|
+
file: (0, __stryke_path_replace.replacePath)(filePath, context.config.projectRoot),
|
|
125
|
+
name: parsed.name
|
|
126
|
+
});
|
|
127
|
+
return (0, __stryke_fs_list_files.listFilesSync)(filePath).map(__assignType((file) => resolveEntry(context, {
|
|
128
|
+
file,
|
|
129
|
+
name: parsed.name
|
|
130
|
+
}), [
|
|
131
|
+
"file",
|
|
132
|
+
"",
|
|
133
|
+
"P\"2!\"/\""
|
|
134
|
+
]));
|
|
135
|
+
}, [
|
|
136
|
+
"typeDefinition",
|
|
137
|
+
"",
|
|
138
|
+
"P\"2!\"/\""
|
|
139
|
+
])).flat().filter(Boolean);
|
|
140
|
+
}
|
|
141
|
+
resolveEntriesSync.__type = [
|
|
142
|
+
"Context",
|
|
143
|
+
"context",
|
|
144
|
+
"typeDefinitions",
|
|
145
|
+
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
146
|
+
"resolveEntriesSync",
|
|
147
|
+
"Resolves multiple type definitions into their corresponding resolved entry type definitions.",
|
|
148
|
+
"P\"w!2\"!F2#n$F/%?&"
|
|
149
|
+
];
|
|
150
|
+
/** Resolve a virtual entry point by generating a unique file path in the artifacts directory.
|
|
151
|
+
*
|
|
152
|
+
* @param context - The current context
|
|
153
|
+
* @param typeDefinition - The type definition to resolve.
|
|
154
|
+
* @returns The resolved entry type definition with a unique virtual file path.
|
|
155
|
+
*/
|
|
156
|
+
function resolveVirtualEntry(context, typeDefinition) {
|
|
157
|
+
const resolved = resolveEntry(context, (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(typeDefinition));
|
|
158
|
+
const file = (0, __stryke_path_join_paths.joinPaths)(context.artifactsPath, `entry-${(0, __stryke_hash_murmurhash.murmurhash)({
|
|
159
|
+
file: resolved.file,
|
|
160
|
+
name: resolved.name
|
|
161
|
+
}, { maxLength: 24 }).replaceAll("-", "0").replaceAll("_", "1")}.ts`);
|
|
162
|
+
return {
|
|
163
|
+
file,
|
|
164
|
+
name: resolved.name,
|
|
165
|
+
input: {
|
|
166
|
+
file,
|
|
167
|
+
name: resolved.name
|
|
168
|
+
},
|
|
169
|
+
output: file
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
resolveVirtualEntry.__type = [
|
|
173
|
+
"Context",
|
|
174
|
+
"context",
|
|
175
|
+
"typeDefinition",
|
|
176
|
+
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
177
|
+
"resolveVirtualEntry",
|
|
178
|
+
"P\"w!2\"!2#n$/%"
|
|
179
|
+
];
|
|
180
|
+
/**
|
|
181
|
+
* Get unique entries from the provided list.
|
|
182
|
+
*
|
|
183
|
+
* @param entries - The entries to process.
|
|
184
|
+
* @returns An array of unique entries (by file path or content hash).
|
|
185
|
+
*/
|
|
186
|
+
function getUniqueEntries(entries = []) {
|
|
187
|
+
return (0, __stryke_helpers_get_unique.getUniqueBy)((0, __stryke_convert_to_array.toArray)(entries), __assignType((item) => (0, __stryke_type_checks_is_set_string.isSetString)(item) ? item : (0, __stryke_hash_murmurhash.murmurhash)(item ?? {}, { maxLength: 24 }), [
|
|
188
|
+
"item",
|
|
189
|
+
"",
|
|
190
|
+
"P!2!\"/\""
|
|
191
|
+
]));
|
|
192
|
+
}
|
|
193
|
+
getUniqueEntries.__type = [
|
|
194
|
+
"entries",
|
|
195
|
+
() => [],
|
|
196
|
+
"getUniqueEntries",
|
|
197
|
+
"Get unique entries from the provided list.",
|
|
198
|
+
"PP!!FJ2!>\"!F/#?$"
|
|
199
|
+
];
|
|
200
|
+
|
|
201
|
+
//#endregion
|
|
202
|
+
exports.resolveEntryInputFile = resolveEntryInputFile;
|
|
203
|
+
exports.resolveEntryOutput = resolveEntryOutput;
|