@powerlines/plugin-env 0.15.122 → 0.15.124
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/babel/plugin.cjs +11 -11
- package/dist/babel/plugin.d.cts +2 -2
- package/dist/babel/plugin.d.mts +2 -3
- package/dist/babel/plugin.mjs +5 -5
- package/dist/components/docs.cjs +6 -6
- package/dist/components/docs.d.cts +1 -1
- package/dist/components/docs.d.mts +1 -1
- package/dist/components/docs.mjs +3 -3
- package/dist/components/env.cjs +40 -40
- package/dist/components/env.d.cts +2 -2
- package/dist/components/env.d.mts +2 -2
- package/dist/components/env.mjs +11 -11
- package/dist/helpers/automd-generator.cjs +2 -2
- package/dist/helpers/automd-generator.d.cts +1 -1
- package/dist/helpers/automd-generator.d.mts +1 -1
- package/dist/helpers/automd-generator.mjs +1 -1
- package/dist/helpers/load.cjs +7 -7
- package/dist/helpers/load.mjs +8 -8
- package/dist/helpers/persistence.cjs +23 -23
- package/dist/helpers/persistence.d.cts +1 -1
- package/dist/helpers/persistence.d.mts +1 -1
- package/dist/helpers/persistence.mjs +5 -5
- package/dist/helpers/reflect.cjs +5 -5
- package/dist/helpers/reflect.mjs +1 -1
- package/dist/helpers/source-file-env.cjs +1 -1
- package/dist/helpers/source-file-env.mjs +1 -1
- package/dist/index.cjs +13 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +12 -12
- package/dist/types/plugin.cjs +19 -18
- package/dist/types/plugin.d.cts +5 -6
- package/dist/types/plugin.d.mts +4 -6
- package/dist/types/plugin.mjs +4 -4
- package/package.json +7 -7
- package/dist/deepkit/schemas/reflection.cjs +0 -5426
- package/dist/deepkit/schemas/reflection.d.cts +0 -1560
- package/dist/deepkit/schemas/reflection.d.mts +0 -1560
- package/dist/deepkit/schemas/reflection.mjs +0 -5423
- package/dist/deepkit/schemas/reflection2.cjs +0 -4112
- package/dist/deepkit/schemas/reflection2.mjs +0 -4110
- package/dist/deepkit/src/capnp.cjs +0 -1692
- package/dist/deepkit/src/capnp.mjs +0 -1690
- package/dist/deepkit/src/esbuild-plugin.cjs +0 -99
- package/dist/deepkit/src/esbuild-plugin.mjs +0 -98
- package/dist/deepkit/src/reflect-type.cjs +0 -40
- package/dist/deepkit/src/reflect-type.mjs +0 -38
- package/dist/deepkit/src/resolve-reflections.cjs +0 -23
- package/dist/deepkit/src/resolve-reflections.mjs +0 -22
- package/dist/deepkit/src/transformer.cjs +0 -92
- package/dist/deepkit/src/transformer.mjs +0 -89
- package/dist/deepkit/src/transpile.cjs +0 -39
- package/dist/deepkit/src/transpile.mjs +0 -37
- package/dist/deepkit/src/types.cjs +0 -22
- package/dist/deepkit/src/types.d.cts +0 -10
- package/dist/deepkit/src/types.d.mts +0 -10
- package/dist/deepkit/src/types.mjs +0 -21
- package/dist/deepkit/src/utilities.cjs +0 -184
- package/dist/deepkit/src/utilities.mjs +0 -183
- package/dist/plugin-alloy/src/core/components/output.cjs +0 -43
- package/dist/plugin-alloy/src/core/components/output.mjs +0 -42
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
- package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
- package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
- package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
- package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
- package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -134
- package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -126
- package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
- package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -110
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -101
- package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -23
- package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -22
- package/dist/plugin-alloy/src/index.cjs +0 -105
- package/dist/plugin-alloy/src/index.mjs +0 -103
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
- package/dist/plugin-alloy/src/markdown/components/markdown-file.d.cts +0 -8
- package/dist/plugin-alloy/src/markdown/components/markdown-file.d.mts +0 -8
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -72
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -71
- package/dist/plugin-alloy/src/types/components.cjs +0 -22
- package/dist/plugin-alloy/src/types/components.d.cts +0 -20
- package/dist/plugin-alloy/src/types/components.d.mts +0 -21
- package/dist/plugin-alloy/src/types/components.mjs +0 -21
- package/dist/plugin-alloy/src/types/index.d.cts +0 -2
- package/dist/plugin-alloy/src/types/index.d.mts +0 -2
- package/dist/plugin-alloy/src/types/plugin.cjs +0 -53
- package/dist/plugin-alloy/src/types/plugin.d.cts +0 -36
- package/dist/plugin-alloy/src/types/plugin.d.mts +0 -36
- package/dist/plugin-alloy/src/types/plugin.mjs +0 -50
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -62
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -26
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -61
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -131
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -129
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -451
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -37
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -37
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -442
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -216
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -16
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -16
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -213
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -72
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +0 -12
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +0 -12
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -71
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
- package/dist/plugin-automd/src/index.cjs +0 -127
- package/dist/plugin-automd/src/index.mjs +0 -124
- package/dist/plugin-automd/src/types/plugin.cjs +0 -47
- package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
- package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
- package/dist/plugin-automd/src/types/plugin.mjs +0 -47
- package/dist/plugin-automd/src/types/toc.cjs +0 -26
- package/dist/plugin-automd/src/types/toc.d.cts +0 -33
- package/dist/plugin-automd/src/types/toc.d.mts +0 -33
- package/dist/plugin-automd/src/types/toc.mjs +0 -25
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -74
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -70
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -71
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -69
- package/dist/plugin-babel/src/helpers/filters.cjs +0 -158
- package/dist/plugin-babel/src/helpers/filters.mjs +0 -154
- package/dist/plugin-babel/src/helpers/index.cjs +0 -5
- package/dist/plugin-babel/src/helpers/index.mjs +0 -7
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -200
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -192
- package/dist/plugin-babel/src/helpers/options.cjs +0 -73
- package/dist/plugin-babel/src/helpers/options.mjs +0 -70
- package/dist/plugin-babel/src/index.cjs +0 -125
- package/dist/plugin-babel/src/index.mjs +0 -123
- package/dist/plugin-babel/src/types/index.d.mts +0 -1
- package/dist/plugin-babel/src/types/plugin.cjs +0 -42
- package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
- package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
- package/dist/plugin-babel/src/types/plugin.mjs +0 -39
- package/dist/powerlines/src/internal/helpers/hooks.cjs +0 -136
- package/dist/powerlines/src/internal/helpers/hooks.d.cts +0 -47
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -49
- package/dist/powerlines/src/internal/helpers/hooks.mjs +0 -134
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -142
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -140
- package/dist/powerlines/src/lib/constants/environments.cjs +0 -6
- package/dist/powerlines/src/lib/constants/environments.mjs +0 -5
- package/dist/powerlines/src/lib/entry.cjs +0 -195
- package/dist/powerlines/src/lib/entry.mjs +0 -194
- package/dist/powerlines/src/lib/logger.cjs +0 -108
- package/dist/powerlines/src/lib/logger.mjs +0 -106
- package/dist/powerlines/src/lib/unplugin/helpers.cjs +0 -41
- package/dist/powerlines/src/lib/unplugin/helpers.mjs +0 -40
- package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +0 -98
- package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +0 -97
- package/dist/powerlines/src/lib/unplugin/plugin.cjs +0 -139
- package/dist/powerlines/src/lib/unplugin/plugin.mjs +0 -138
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -74
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -72
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -69
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -68
- package/dist/powerlines/src/lib/utilities/source-file.cjs +0 -68
- package/dist/powerlines/src/lib/utilities/source-file.mjs +0 -66
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -46
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -45
- package/dist/powerlines/src/types/api.cjs +0 -62
- package/dist/powerlines/src/types/api.d.cts +0 -104
- package/dist/powerlines/src/types/api.d.mts +0 -104
- package/dist/powerlines/src/types/api.mjs +0 -62
- package/dist/powerlines/src/types/babel.cjs +0 -156
- package/dist/powerlines/src/types/babel.d.cts +0 -23
- package/dist/powerlines/src/types/babel.d.mts +0 -23
- package/dist/powerlines/src/types/babel.mjs +0 -147
- package/dist/powerlines/src/types/build.cjs +0 -127
- package/dist/powerlines/src/types/build.d.cts +0 -185
- package/dist/powerlines/src/types/build.d.mts +0 -185
- package/dist/powerlines/src/types/build.mjs +0 -121
- package/dist/powerlines/src/types/commands.cjs +0 -16
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/commands.mjs +0 -15
- package/dist/powerlines/src/types/config.cjs +0 -420
- package/dist/powerlines/src/types/config.d.cts +0 -435
- package/dist/powerlines/src/types/config.d.mts +0 -436
- package/dist/powerlines/src/types/config.mjs +0 -397
- package/dist/powerlines/src/types/context.cjs +0 -388
- package/dist/powerlines/src/types/context.d.cts +0 -514
- package/dist/powerlines/src/types/context.d.mts +0 -514
- package/dist/powerlines/src/types/context.mjs +0 -371
- package/dist/powerlines/src/types/fs.cjs +0 -78
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/fs.mjs +0 -75
- package/dist/powerlines/src/types/hooks.cjs +0 -71
- package/dist/powerlines/src/types/hooks.d.cts +0 -32
- package/dist/powerlines/src/types/hooks.d.mts +0 -32
- package/dist/powerlines/src/types/hooks.mjs +0 -68
- package/dist/powerlines/src/types/index.cjs +0 -11
- package/dist/powerlines/src/types/index.d.mts +0 -12
- package/dist/powerlines/src/types/index.mjs +0 -13
- package/dist/powerlines/src/types/plugin.cjs +0 -184
- package/dist/powerlines/src/types/plugin.d.cts +0 -205
- package/dist/powerlines/src/types/plugin.d.mts +0 -205
- package/dist/powerlines/src/types/plugin.mjs +0 -178
- package/dist/powerlines/src/types/resolved.cjs +0 -149
- package/dist/powerlines/src/types/resolved.d.cts +0 -94
- package/dist/powerlines/src/types/resolved.d.mts +0 -94
- package/dist/powerlines/src/types/resolved.mjs +0 -144
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/powerlines/src/types/unplugin.cjs +0 -64
- package/dist/powerlines/src/types/unplugin.d.cts +0 -22
- package/dist/powerlines/src/types/unplugin.d.mts +0 -23
- package/dist/powerlines/src/types/unplugin.mjs +0 -62
|
@@ -1,142 +0,0 @@
|
|
|
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_join_paths = require("@stryke/path/join-paths");
|
|
6
|
-
let defu = require("defu");
|
|
7
|
-
defu = require_rolldown_runtime.__toESM(defu);
|
|
8
|
-
let __stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
9
|
-
let __stryke_path_replace = require("@stryke/path/replace");
|
|
10
|
-
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
11
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
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)] = entry.file;
|
|
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.alias,
|
|
99
|
-
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
|
|
100
|
-
}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build.override, [
|
|
101
|
-
"alias",
|
|
102
|
-
"inject",
|
|
103
|
-
"external",
|
|
104
|
-
"noExternal",
|
|
105
|
-
"skipNodeModulesBundle",
|
|
106
|
-
"extensions"
|
|
107
|
-
]) : {}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build, [
|
|
108
|
-
"alias",
|
|
109
|
-
"inject",
|
|
110
|
-
"external",
|
|
111
|
-
"noExternal",
|
|
112
|
-
"skipNodeModulesBundle",
|
|
113
|
-
"extensions",
|
|
114
|
-
"variant",
|
|
115
|
-
"override"
|
|
116
|
-
]) : {}, {
|
|
117
|
-
mainFields: context.config.build.mainFields,
|
|
118
|
-
conditions: context.config.build.conditions,
|
|
119
|
-
define: context.config.build.define,
|
|
120
|
-
resolveExtensions: context.config.build.extensions,
|
|
121
|
-
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
122
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
123
|
-
platform: context.config.build.platform,
|
|
124
|
-
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
125
|
-
outdir: context.config.output.buildPath,
|
|
126
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
127
|
-
minify: context.config.mode !== "development",
|
|
128
|
-
metafile: context.config.mode === "development",
|
|
129
|
-
sourcemap: context.config.mode === "development"
|
|
130
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
131
|
-
}
|
|
132
|
-
extractESBuildConfig.__type = [
|
|
133
|
-
() => require_context.__ΩContext,
|
|
134
|
-
"context",
|
|
135
|
-
"BuildOptions",
|
|
136
|
-
"extractESBuildConfig",
|
|
137
|
-
"Resolves the esbuild options.",
|
|
138
|
-
"Pn!2\"\"w#/$?%"
|
|
139
|
-
];
|
|
140
|
-
|
|
141
|
-
//#endregion
|
|
142
|
-
exports.extractESBuildConfig = extractESBuildConfig;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { __ΩContext } from "../../types/context.mjs";
|
|
2
|
-
import { __ΩESBuildResolvedBuildConfig } from "../../types/build.mjs";
|
|
3
|
-
import { resolveEntryOutput } from "../entry.mjs";
|
|
4
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
5
|
-
import defu$1 from "defu";
|
|
6
|
-
import { omit } from "@stryke/helpers/omit";
|
|
7
|
-
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
8
|
-
import { camelCase } from "@stryke/string-format/camel-case";
|
|
9
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
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)] = entry.file;
|
|
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.alias,
|
|
97
|
-
inject: inject && Object.keys(inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
|
|
98
|
-
}, context.config.build.variant === "esbuild" ? omit(context.config.build.override, [
|
|
99
|
-
"alias",
|
|
100
|
-
"inject",
|
|
101
|
-
"external",
|
|
102
|
-
"noExternal",
|
|
103
|
-
"skipNodeModulesBundle",
|
|
104
|
-
"extensions"
|
|
105
|
-
]) : {}, context.config.build.variant === "esbuild" ? omit(context.config.build, [
|
|
106
|
-
"alias",
|
|
107
|
-
"inject",
|
|
108
|
-
"external",
|
|
109
|
-
"noExternal",
|
|
110
|
-
"skipNodeModulesBundle",
|
|
111
|
-
"extensions",
|
|
112
|
-
"variant",
|
|
113
|
-
"override"
|
|
114
|
-
]) : {}, {
|
|
115
|
-
mainFields: context.config.build.mainFields,
|
|
116
|
-
conditions: context.config.build.conditions,
|
|
117
|
-
define: context.config.build.define,
|
|
118
|
-
resolveExtensions: context.config.build.extensions,
|
|
119
|
-
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
120
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
121
|
-
platform: context.config.build.platform,
|
|
122
|
-
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
123
|
-
outdir: context.config.output.buildPath,
|
|
124
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
125
|
-
minify: context.config.mode !== "development",
|
|
126
|
-
metafile: context.config.mode === "development",
|
|
127
|
-
sourcemap: context.config.mode === "development"
|
|
128
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
129
|
-
}
|
|
130
|
-
extractESBuildConfig.__type = [
|
|
131
|
-
() => __ΩContext,
|
|
132
|
-
"context",
|
|
133
|
-
"BuildOptions",
|
|
134
|
-
"extractESBuildConfig",
|
|
135
|
-
"Resolves the esbuild options.",
|
|
136
|
-
"Pn!2\"\"w#/$?%"
|
|
137
|
-
];
|
|
138
|
-
|
|
139
|
-
//#endregion
|
|
140
|
-
export { extractESBuildConfig };
|
|
@@ -1,195 +0,0 @@
|
|
|
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_join_paths = require("@stryke/path/join-paths");
|
|
5
|
-
let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
|
|
6
|
-
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
7
|
-
let __stryke_path_replace = require("@stryke/path/replace");
|
|
8
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
9
|
-
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
10
|
-
let __stryke_hash_murmurhash = require("@stryke/hash/murmurhash");
|
|
11
|
-
let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
12
|
-
let __stryke_path_append = require("@stryke/path/append");
|
|
13
|
-
let __stryke_path_is_type = require("@stryke/path/is-type");
|
|
14
|
-
|
|
15
|
-
//#region ../powerlines/src/lib/entry.ts
|
|
16
|
-
function __assignType(fn, args) {
|
|
17
|
-
fn.__type = args;
|
|
18
|
-
return fn;
|
|
19
|
-
}
|
|
20
|
-
function resolveEntryOutput(context, typeDefinition) {
|
|
21
|
-
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)));
|
|
22
|
-
}
|
|
23
|
-
resolveEntryOutput.__type = [
|
|
24
|
-
"Context",
|
|
25
|
-
"context",
|
|
26
|
-
"typeDefinition",
|
|
27
|
-
"resolveEntryOutput",
|
|
28
|
-
"// }",
|
|
29
|
-
"P\"w!2\"!2#&/$?%"
|
|
30
|
-
];
|
|
31
|
-
function resolveEntry(context, typeDefinition) {
|
|
32
|
-
return {
|
|
33
|
-
...typeDefinition,
|
|
34
|
-
input: typeDefinition,
|
|
35
|
-
output: resolveEntryOutput(context, typeDefinition)
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
resolveEntry.__type = [
|
|
39
|
-
"Context",
|
|
40
|
-
"context",
|
|
41
|
-
"typeDefinition",
|
|
42
|
-
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
43
|
-
"resolveEntry",
|
|
44
|
-
"P\"w!2\"!2#n$/%"
|
|
45
|
-
];
|
|
46
|
-
/**
|
|
47
|
-
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
48
|
-
*
|
|
49
|
-
* @param context - The current context
|
|
50
|
-
* @param typeDefinitions - The type definitions to resolve.
|
|
51
|
-
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
52
|
-
*/
|
|
53
|
-
async function resolveEntries(context, typeDefinitions) {
|
|
54
|
-
return (await Promise.all(typeDefinitions.map(__assignType(async (entry) => {
|
|
55
|
-
if (isResolvedEntryTypeDefinition(entry)) return {
|
|
56
|
-
...entry,
|
|
57
|
-
file: require_paths.replacePathTokens(context, entry.file)
|
|
58
|
-
};
|
|
59
|
-
let typeDefinition;
|
|
60
|
-
if ((0, __stryke_type_checks_is_string.isString)(entry)) typeDefinition = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(require_paths.replacePathTokens(context, entry));
|
|
61
|
-
else {
|
|
62
|
-
typeDefinition = entry;
|
|
63
|
-
typeDefinition.file = require_paths.replacePathTokens(context, typeDefinition.file);
|
|
64
|
-
}
|
|
65
|
-
const filePath = (0, __stryke_path_is_type.isAbsolutePath)(typeDefinition.file) ? typeDefinition.file : (0, __stryke_path_append.appendPath)(typeDefinition.file, context.config.projectRoot);
|
|
66
|
-
if (await context.fs.isFile(filePath)) return resolveEntry(context, {
|
|
67
|
-
file: (0, __stryke_path_replace.replacePath)(filePath, context.config.projectRoot),
|
|
68
|
-
name: typeDefinition.name
|
|
69
|
-
});
|
|
70
|
-
return (await context.fs.glob((0, __stryke_path_append.appendPath)(filePath, context.workspaceConfig.workspaceRoot))).map(__assignType((file) => resolveEntry(context, {
|
|
71
|
-
file: (0, __stryke_path_replace.replacePath)(file, context.config.projectRoot),
|
|
72
|
-
name: typeDefinition.name
|
|
73
|
-
}), [
|
|
74
|
-
"file",
|
|
75
|
-
"",
|
|
76
|
-
"P\"2!\"/\""
|
|
77
|
-
]));
|
|
78
|
-
}, [
|
|
79
|
-
"entry",
|
|
80
|
-
"",
|
|
81
|
-
"P\"2!\"/\""
|
|
82
|
-
])))).flat().filter(Boolean);
|
|
83
|
-
}
|
|
84
|
-
resolveEntries.__type = [
|
|
85
|
-
"Context",
|
|
86
|
-
"context",
|
|
87
|
-
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
88
|
-
"typeDefinitions",
|
|
89
|
-
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
90
|
-
"resolveEntries",
|
|
91
|
-
"Resolves multiple type definitions into their corresponding resolved entry type definitions.",
|
|
92
|
-
"P\"w!2\"P!n#JF2$n%F`/&?'"
|
|
93
|
-
];
|
|
94
|
-
/**
|
|
95
|
-
* Checks if the provided entry is a type definition.
|
|
96
|
-
*
|
|
97
|
-
* @param entry - The entry to check.
|
|
98
|
-
* @returns True if the entry is a type definition, false otherwise.
|
|
99
|
-
*/
|
|
100
|
-
function isTypeDefinition(entry) {
|
|
101
|
-
return !(0, __stryke_type_checks_is_string.isString)(entry) && entry.file !== void 0;
|
|
102
|
-
}
|
|
103
|
-
isTypeDefinition.__type = [
|
|
104
|
-
"entry",
|
|
105
|
-
"isTypeDefinition",
|
|
106
|
-
"Checks if the provided entry is a type definition.",
|
|
107
|
-
"P!2!!/\"?#"
|
|
108
|
-
];
|
|
109
|
-
/**
|
|
110
|
-
* Checks if the provided entry is a resolved entry type definition.
|
|
111
|
-
*
|
|
112
|
-
* @param entry - The entry to check.
|
|
113
|
-
* @returns True if the entry is a resolved entry type definition, false otherwise.
|
|
114
|
-
*/
|
|
115
|
-
function isResolvedEntryTypeDefinition(entry) {
|
|
116
|
-
return isTypeDefinition(entry) && entry.input !== void 0 && entry.output !== void 0;
|
|
117
|
-
}
|
|
118
|
-
isResolvedEntryTypeDefinition.__type = [
|
|
119
|
-
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
120
|
-
"entry",
|
|
121
|
-
"isResolvedEntryTypeDefinition",
|
|
122
|
-
"Checks if the provided entry is a resolved entry type definition.",
|
|
123
|
-
"PP!n!J2\"!/#?$"
|
|
124
|
-
];
|
|
125
|
-
/**
|
|
126
|
-
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
127
|
-
*
|
|
128
|
-
* @param context - The current context
|
|
129
|
-
* @param typeDefinitions - The type definitions to resolve.
|
|
130
|
-
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
131
|
-
*/
|
|
132
|
-
function resolveEntriesSync(context, typeDefinitions) {
|
|
133
|
-
return typeDefinitions.map(__assignType((entry) => {
|
|
134
|
-
if (isResolvedEntryTypeDefinition(entry)) return {
|
|
135
|
-
...entry,
|
|
136
|
-
file: require_paths.replacePathTokens(context, entry.file)
|
|
137
|
-
};
|
|
138
|
-
let typeDefinition;
|
|
139
|
-
if ((0, __stryke_type_checks_is_string.isString)(entry)) typeDefinition = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(require_paths.replacePathTokens(context, entry));
|
|
140
|
-
else {
|
|
141
|
-
typeDefinition = entry;
|
|
142
|
-
typeDefinition.file = require_paths.replacePathTokens(context, typeDefinition.file);
|
|
143
|
-
}
|
|
144
|
-
const filePath = (0, __stryke_path_is_type.isAbsolutePath)(typeDefinition.file) ? typeDefinition.file : (0, __stryke_path_append.appendPath)(typeDefinition.file, context.config.projectRoot);
|
|
145
|
-
if (context.fs.isFileSync(filePath)) return resolveEntry(context, {
|
|
146
|
-
file: (0, __stryke_path_append.appendPath)(filePath, context.workspaceConfig.workspaceRoot),
|
|
147
|
-
name: typeDefinition.name
|
|
148
|
-
});
|
|
149
|
-
return context.fs.globSync((0, __stryke_path_append.appendPath)(filePath, context.workspaceConfig.workspaceRoot)).map(__assignType((file) => resolveEntry(context, {
|
|
150
|
-
file,
|
|
151
|
-
name: typeDefinition.name
|
|
152
|
-
}), [
|
|
153
|
-
"file",
|
|
154
|
-
"",
|
|
155
|
-
"P\"2!\"/\""
|
|
156
|
-
]));
|
|
157
|
-
}, [
|
|
158
|
-
"entry",
|
|
159
|
-
"",
|
|
160
|
-
"P\"2!\"/\""
|
|
161
|
-
])).flat().filter(Boolean);
|
|
162
|
-
}
|
|
163
|
-
resolveEntriesSync.__type = [
|
|
164
|
-
"Context",
|
|
165
|
-
"context",
|
|
166
|
-
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
167
|
-
"typeDefinitions",
|
|
168
|
-
() => require_resolved.__ΩResolvedEntryTypeDefinition,
|
|
169
|
-
"resolveEntriesSync",
|
|
170
|
-
"Resolves multiple type definitions into their corresponding resolved entry type definitions.",
|
|
171
|
-
"P\"w!2\"P!n#JF2$n%F/&?'"
|
|
172
|
-
];
|
|
173
|
-
/**
|
|
174
|
-
* Get unique entries from the provided list.
|
|
175
|
-
*
|
|
176
|
-
* @param entries - The entries to process.
|
|
177
|
-
* @returns An array of unique entries (by file path or content hash).
|
|
178
|
-
*/
|
|
179
|
-
function getUniqueEntries(entries = []) {
|
|
180
|
-
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 }), [
|
|
181
|
-
"item",
|
|
182
|
-
"",
|
|
183
|
-
"P!2!\"/\""
|
|
184
|
-
]));
|
|
185
|
-
}
|
|
186
|
-
getUniqueEntries.__type = [
|
|
187
|
-
"entries",
|
|
188
|
-
() => [],
|
|
189
|
-
"getUniqueEntries",
|
|
190
|
-
"Get unique entries from the provided list.",
|
|
191
|
-
"PP!!FJ2!>\"!F/#?$"
|
|
192
|
-
];
|
|
193
|
-
|
|
194
|
-
//#endregion
|
|
195
|
-
exports.resolveEntryOutput = resolveEntryOutput;
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { __ΩResolvedEntryTypeDefinition } from "../types/resolved.mjs";
|
|
2
|
-
import { replacePathTokens } from "../plugin-utils/paths.mjs";
|
|
3
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
-
import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
|
|
5
|
-
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
6
|
-
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
7
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
8
|
-
import { toArray } from "@stryke/convert/to-array";
|
|
9
|
-
import { murmurhash } from "@stryke/hash/murmurhash";
|
|
10
|
-
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
11
|
-
import { appendPath } from "@stryke/path/append";
|
|
12
|
-
import { isAbsolutePath } from "@stryke/path/is-type";
|
|
13
|
-
|
|
14
|
-
//#region ../powerlines/src/lib/entry.ts
|
|
15
|
-
function __assignType(fn, args) {
|
|
16
|
-
fn.__type = args;
|
|
17
|
-
return fn;
|
|
18
|
-
}
|
|
19
|
-
function resolveEntryOutput(context, typeDefinition) {
|
|
20
|
-
return replaceExtension(replacePath(replacePath(replacePath(replacePath(replacePath(typeDefinition.file, joinPaths(context.workspaceConfig.workspaceRoot, context.config.sourceRoot)), joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot)), context.config.sourceRoot), context.config.projectRoot), replacePath(context.config.sourceRoot, context.config.projectRoot)));
|
|
21
|
-
}
|
|
22
|
-
resolveEntryOutput.__type = [
|
|
23
|
-
"Context",
|
|
24
|
-
"context",
|
|
25
|
-
"typeDefinition",
|
|
26
|
-
"resolveEntryOutput",
|
|
27
|
-
"// }",
|
|
28
|
-
"P\"w!2\"!2#&/$?%"
|
|
29
|
-
];
|
|
30
|
-
function resolveEntry(context, typeDefinition) {
|
|
31
|
-
return {
|
|
32
|
-
...typeDefinition,
|
|
33
|
-
input: typeDefinition,
|
|
34
|
-
output: resolveEntryOutput(context, typeDefinition)
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
resolveEntry.__type = [
|
|
38
|
-
"Context",
|
|
39
|
-
"context",
|
|
40
|
-
"typeDefinition",
|
|
41
|
-
() => __ΩResolvedEntryTypeDefinition,
|
|
42
|
-
"resolveEntry",
|
|
43
|
-
"P\"w!2\"!2#n$/%"
|
|
44
|
-
];
|
|
45
|
-
/**
|
|
46
|
-
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
47
|
-
*
|
|
48
|
-
* @param context - The current context
|
|
49
|
-
* @param typeDefinitions - The type definitions to resolve.
|
|
50
|
-
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
51
|
-
*/
|
|
52
|
-
async function resolveEntries(context, typeDefinitions) {
|
|
53
|
-
return (await Promise.all(typeDefinitions.map(__assignType(async (entry) => {
|
|
54
|
-
if (isResolvedEntryTypeDefinition(entry)) return {
|
|
55
|
-
...entry,
|
|
56
|
-
file: replacePathTokens(context, entry.file)
|
|
57
|
-
};
|
|
58
|
-
let typeDefinition;
|
|
59
|
-
if (isString(entry)) typeDefinition = parseTypeDefinition(replacePathTokens(context, entry));
|
|
60
|
-
else {
|
|
61
|
-
typeDefinition = entry;
|
|
62
|
-
typeDefinition.file = replacePathTokens(context, typeDefinition.file);
|
|
63
|
-
}
|
|
64
|
-
const filePath = isAbsolutePath(typeDefinition.file) ? typeDefinition.file : appendPath(typeDefinition.file, context.config.projectRoot);
|
|
65
|
-
if (await context.fs.isFile(filePath)) return resolveEntry(context, {
|
|
66
|
-
file: replacePath(filePath, context.config.projectRoot),
|
|
67
|
-
name: typeDefinition.name
|
|
68
|
-
});
|
|
69
|
-
return (await context.fs.glob(appendPath(filePath, context.workspaceConfig.workspaceRoot))).map(__assignType((file) => resolveEntry(context, {
|
|
70
|
-
file: replacePath(file, context.config.projectRoot),
|
|
71
|
-
name: typeDefinition.name
|
|
72
|
-
}), [
|
|
73
|
-
"file",
|
|
74
|
-
"",
|
|
75
|
-
"P\"2!\"/\""
|
|
76
|
-
]));
|
|
77
|
-
}, [
|
|
78
|
-
"entry",
|
|
79
|
-
"",
|
|
80
|
-
"P\"2!\"/\""
|
|
81
|
-
])))).flat().filter(Boolean);
|
|
82
|
-
}
|
|
83
|
-
resolveEntries.__type = [
|
|
84
|
-
"Context",
|
|
85
|
-
"context",
|
|
86
|
-
() => __ΩResolvedEntryTypeDefinition,
|
|
87
|
-
"typeDefinitions",
|
|
88
|
-
() => __ΩResolvedEntryTypeDefinition,
|
|
89
|
-
"resolveEntries",
|
|
90
|
-
"Resolves multiple type definitions into their corresponding resolved entry type definitions.",
|
|
91
|
-
"P\"w!2\"P!n#JF2$n%F`/&?'"
|
|
92
|
-
];
|
|
93
|
-
/**
|
|
94
|
-
* Checks if the provided entry is a type definition.
|
|
95
|
-
*
|
|
96
|
-
* @param entry - The entry to check.
|
|
97
|
-
* @returns True if the entry is a type definition, false otherwise.
|
|
98
|
-
*/
|
|
99
|
-
function isTypeDefinition(entry) {
|
|
100
|
-
return !isString(entry) && entry.file !== void 0;
|
|
101
|
-
}
|
|
102
|
-
isTypeDefinition.__type = [
|
|
103
|
-
"entry",
|
|
104
|
-
"isTypeDefinition",
|
|
105
|
-
"Checks if the provided entry is a type definition.",
|
|
106
|
-
"P!2!!/\"?#"
|
|
107
|
-
];
|
|
108
|
-
/**
|
|
109
|
-
* Checks if the provided entry is a resolved entry type definition.
|
|
110
|
-
*
|
|
111
|
-
* @param entry - The entry to check.
|
|
112
|
-
* @returns True if the entry is a resolved entry type definition, false otherwise.
|
|
113
|
-
*/
|
|
114
|
-
function isResolvedEntryTypeDefinition(entry) {
|
|
115
|
-
return isTypeDefinition(entry) && entry.input !== void 0 && entry.output !== void 0;
|
|
116
|
-
}
|
|
117
|
-
isResolvedEntryTypeDefinition.__type = [
|
|
118
|
-
() => __ΩResolvedEntryTypeDefinition,
|
|
119
|
-
"entry",
|
|
120
|
-
"isResolvedEntryTypeDefinition",
|
|
121
|
-
"Checks if the provided entry is a resolved entry type definition.",
|
|
122
|
-
"PP!n!J2\"!/#?$"
|
|
123
|
-
];
|
|
124
|
-
/**
|
|
125
|
-
* Resolves multiple type definitions into their corresponding resolved entry type definitions.
|
|
126
|
-
*
|
|
127
|
-
* @param context - The current context
|
|
128
|
-
* @param typeDefinitions - The type definitions to resolve.
|
|
129
|
-
* @returns A promise that resolves to an array of resolved entry type definitions.
|
|
130
|
-
*/
|
|
131
|
-
function resolveEntriesSync(context, typeDefinitions) {
|
|
132
|
-
return typeDefinitions.map(__assignType((entry) => {
|
|
133
|
-
if (isResolvedEntryTypeDefinition(entry)) return {
|
|
134
|
-
...entry,
|
|
135
|
-
file: replacePathTokens(context, entry.file)
|
|
136
|
-
};
|
|
137
|
-
let typeDefinition;
|
|
138
|
-
if (isString(entry)) typeDefinition = parseTypeDefinition(replacePathTokens(context, entry));
|
|
139
|
-
else {
|
|
140
|
-
typeDefinition = entry;
|
|
141
|
-
typeDefinition.file = replacePathTokens(context, typeDefinition.file);
|
|
142
|
-
}
|
|
143
|
-
const filePath = isAbsolutePath(typeDefinition.file) ? typeDefinition.file : appendPath(typeDefinition.file, context.config.projectRoot);
|
|
144
|
-
if (context.fs.isFileSync(filePath)) return resolveEntry(context, {
|
|
145
|
-
file: appendPath(filePath, context.workspaceConfig.workspaceRoot),
|
|
146
|
-
name: typeDefinition.name
|
|
147
|
-
});
|
|
148
|
-
return context.fs.globSync(appendPath(filePath, context.workspaceConfig.workspaceRoot)).map(__assignType((file) => resolveEntry(context, {
|
|
149
|
-
file,
|
|
150
|
-
name: typeDefinition.name
|
|
151
|
-
}), [
|
|
152
|
-
"file",
|
|
153
|
-
"",
|
|
154
|
-
"P\"2!\"/\""
|
|
155
|
-
]));
|
|
156
|
-
}, [
|
|
157
|
-
"entry",
|
|
158
|
-
"",
|
|
159
|
-
"P\"2!\"/\""
|
|
160
|
-
])).flat().filter(Boolean);
|
|
161
|
-
}
|
|
162
|
-
resolveEntriesSync.__type = [
|
|
163
|
-
"Context",
|
|
164
|
-
"context",
|
|
165
|
-
() => __ΩResolvedEntryTypeDefinition,
|
|
166
|
-
"typeDefinitions",
|
|
167
|
-
() => __ΩResolvedEntryTypeDefinition,
|
|
168
|
-
"resolveEntriesSync",
|
|
169
|
-
"Resolves multiple type definitions into their corresponding resolved entry type definitions.",
|
|
170
|
-
"P\"w!2\"P!n#JF2$n%F/&?'"
|
|
171
|
-
];
|
|
172
|
-
/**
|
|
173
|
-
* Get unique entries from the provided list.
|
|
174
|
-
*
|
|
175
|
-
* @param entries - The entries to process.
|
|
176
|
-
* @returns An array of unique entries (by file path or content hash).
|
|
177
|
-
*/
|
|
178
|
-
function getUniqueEntries(entries = []) {
|
|
179
|
-
return getUniqueBy(toArray(entries), __assignType((item) => isSetString(item) ? item : murmurhash(item ?? {}, { maxLength: 24 }), [
|
|
180
|
-
"item",
|
|
181
|
-
"",
|
|
182
|
-
"P!2!\"/\""
|
|
183
|
-
]));
|
|
184
|
-
}
|
|
185
|
-
getUniqueEntries.__type = [
|
|
186
|
-
"entries",
|
|
187
|
-
() => [],
|
|
188
|
-
"getUniqueEntries",
|
|
189
|
-
"Get unique entries from the provided list.",
|
|
190
|
-
"PP!!FJ2!>\"!F/#?$"
|
|
191
|
-
];
|
|
192
|
-
|
|
193
|
-
//#endregion
|
|
194
|
-
export { resolveEntryOutput };
|