auklet 0.1.3 → 0.1.5
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 +113 -412
- package/dist/build/tsdown/dependencies.js +2 -2
- package/dist/cli/build.d.ts +3 -5
- package/dist/cli/build.js +88 -17
- package/dist/cli/buildCss.d.ts +10 -3
- package/dist/cli/buildCss.js +40 -29
- package/dist/cli/buildWorkspace.d.ts +23 -0
- package/dist/cli/buildWorkspace.js +43 -0
- package/dist/cli/dev.d.ts +2 -1
- package/dist/cli/dev.js +131 -16
- package/dist/cli/main.js +36 -12
- package/dist/cli/parse/build.d.ts +62 -0
- package/dist/cli/parse/build.js +161 -0
- package/dist/cli/parse/core.d.ts +14 -0
- package/dist/cli/parse/core.js +68 -0
- package/dist/cli/parse/dev.d.ts +17 -0
- package/dist/cli/parse/dev.js +4 -0
- package/dist/cli/parse/owner.d.ts +11 -0
- package/dist/cli/parse/owner.js +25 -0
- package/dist/cli/parse/publish.d.ts +19 -0
- package/dist/cli/parse/publish.js +60 -0
- package/dist/cli/parse/values.d.ts +17 -0
- package/dist/cli/parse/values.js +14 -0
- package/dist/cli/parse/workspace.d.ts +12 -0
- package/dist/cli/parse/workspace.js +45 -0
- package/dist/css/core/style/dependencies.d.ts +0 -1
- package/dist/css/core/style/dependencies.js +0 -3
- package/dist/css/core/style/entries.js +2 -2
- package/dist/css/core/style/files.d.ts +0 -1
- package/dist/css/core/style/files.js +0 -3
- package/dist/css/core/stylePackageContext.js +3 -3
- package/dist/css/inspect.js +4 -3
- package/dist/css/vite/hmr.js +2 -2
- package/dist/css/vite/moduleGraph/packageSource/monorepo.d.ts +1 -1
- package/dist/css/vite/moduleGraph/packageSource/monorepo.js +2 -2
- package/dist/env.d.ts +22 -0
- package/dist/env.js +105 -0
- package/dist/logger.d.ts +0 -1
- package/dist/logger.js +0 -3
- package/dist/publish/api/npmrc.d.ts +1 -1
- package/dist/publish/api/npmrc.js +1 -4
- package/dist/publish/api/pnpmApi.d.ts +5 -13
- package/dist/publish/api/pnpmApi.js +5 -47
- package/dist/publish/api/pnpmPublishApi.d.ts +2 -2
- package/dist/publish/api/pnpmPublishApi.js +5 -3
- package/dist/publish/cli.d.ts +0 -12
- package/dist/publish/cli.js +27 -106
- package/dist/publish/inspect.js +19 -9
- package/dist/publish/inspectPack.js +6 -2
- package/dist/publish/inspectRegistry.d.ts +3 -2
- package/dist/publish/inspectRegistry.js +11 -4
- package/dist/publish/publishEnv.d.ts +13 -0
- package/dist/publish/publishEnv.js +21 -0
- package/dist/publish/publishRunner.d.ts +3 -2
- package/dist/publish/publishRunner.js +9 -7
- package/dist/publish/runner/packageBuilder.d.ts +2 -3
- package/dist/publish/runner/packageBuilder.js +5 -3
- package/dist/publish/runner/packagePublisher.d.ts +3 -2
- package/dist/publish/runner/packagePublisher.js +4 -2
- package/dist/publish/runner/publishPreflight.d.ts +3 -2
- package/dist/publish/runner/publishPreflight.js +13 -6
- package/dist/publish/runner/versionWriter.d.ts +1 -1
- package/dist/publish/targetResolver.d.ts +2 -2
- package/dist/publish/targetResolver.js +34 -75
- package/dist/publish/types.d.ts +6 -7
- package/dist/workspace/targets.d.ts +31 -0
- package/dist/workspace/targets.js +144 -0
- package/package.json +1 -1
- package/dist/cli/buildArgs.d.ts +0 -8
- package/dist/cli/buildArgs.js +0 -114
- package/dist/cli/publish.d.ts +0 -2
- package/dist/cli/publish.js +0 -9
package/dist/cli/buildArgs.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { hasTsdownConfigArg } from '#auklet/build/runTsdown';
|
|
2
|
-
import { aukletCliConfigOverridesEnv, encodeAukletCliConfigOverrides, } from '#auklet/build/cliOverrides';
|
|
3
|
-
const buildFormats = new Set(['cjs', 'esm', 'iife']);
|
|
4
|
-
const buildPlatforms = new Set(['node', 'neutral', 'browser']);
|
|
5
|
-
const hasAukletConfig = (config) => {
|
|
6
|
-
return Object.keys(config).length > 0;
|
|
7
|
-
};
|
|
8
|
-
export function resolveBuildCliArgs(args) {
|
|
9
|
-
const remainingArgs = [];
|
|
10
|
-
const config = {};
|
|
11
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
12
|
-
const arg = args[index];
|
|
13
|
-
const [name, inlineValue] = arg.split('=', 2);
|
|
14
|
-
if (name === '--source') {
|
|
15
|
-
config.source = getFlagValue(args, index, inlineValue, name);
|
|
16
|
-
if (inlineValue === undefined)
|
|
17
|
-
index += 1;
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
if (name === '--output') {
|
|
21
|
-
config.output = getFlagValue(args, index, inlineValue, name);
|
|
22
|
-
if (inlineValue === undefined)
|
|
23
|
-
index += 1;
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (name === '--modules') {
|
|
27
|
-
config.modules = true;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (name === '--no-modules') {
|
|
31
|
-
config.modules = false;
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (name === '--build.formats') {
|
|
35
|
-
config.build = {
|
|
36
|
-
...config.build,
|
|
37
|
-
formats: parseBuildFormats(getFlagValue(args, index, inlineValue, name)),
|
|
38
|
-
};
|
|
39
|
-
if (inlineValue === undefined)
|
|
40
|
-
index += 1;
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
if (name === '--build.target') {
|
|
44
|
-
config.build = {
|
|
45
|
-
...config.build,
|
|
46
|
-
target: getFlagValue(args, index, inlineValue, name),
|
|
47
|
-
};
|
|
48
|
-
if (inlineValue === undefined)
|
|
49
|
-
index += 1;
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
if (name === '--build.platform') {
|
|
53
|
-
config.build = {
|
|
54
|
-
...config.build,
|
|
55
|
-
platform: parseBuildPlatform(getFlagValue(args, index, inlineValue, name)),
|
|
56
|
-
};
|
|
57
|
-
if (inlineValue === undefined)
|
|
58
|
-
index += 1;
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
if (name === '--build.tsconfig') {
|
|
62
|
-
config.build = {
|
|
63
|
-
...config.build,
|
|
64
|
-
tsconfig: getFlagValue(args, index, inlineValue, name),
|
|
65
|
-
};
|
|
66
|
-
if (inlineValue === undefined)
|
|
67
|
-
index += 1;
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
remainingArgs.push(arg);
|
|
71
|
-
}
|
|
72
|
-
if (hasAukletConfig(config) && hasTsdownConfigArg(remainingArgs)) {
|
|
73
|
-
throw new Error('Auklet build config flags cannot be used with tsdown --config, -c, or --no-config.');
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
args: remainingArgs,
|
|
77
|
-
config,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
export function createBuildEnv(config) {
|
|
81
|
-
if (!hasAukletConfig(config))
|
|
82
|
-
return undefined;
|
|
83
|
-
return {
|
|
84
|
-
[aukletCliConfigOverridesEnv]: encodeAukletCliConfigOverrides(config),
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
const getFlagValue = (args, index, inlineValue, flag) => {
|
|
88
|
-
const value = inlineValue ?? args[index + 1];
|
|
89
|
-
if (!value || value.startsWith('--')) {
|
|
90
|
-
throw new Error(`${flag} requires a value.`);
|
|
91
|
-
}
|
|
92
|
-
return value;
|
|
93
|
-
};
|
|
94
|
-
const parseBuildFormats = (value) => {
|
|
95
|
-
const formats = value
|
|
96
|
-
.split(',')
|
|
97
|
-
.map((format) => format.trim())
|
|
98
|
-
.filter(Boolean);
|
|
99
|
-
if (!formats.length) {
|
|
100
|
-
throw new Error('--build.formats requires at least one format.');
|
|
101
|
-
}
|
|
102
|
-
for (const format of formats) {
|
|
103
|
-
if (!buildFormats.has(format)) {
|
|
104
|
-
throw new Error(`Unknown build format: ${format}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return formats;
|
|
108
|
-
};
|
|
109
|
-
const parseBuildPlatform = (value) => {
|
|
110
|
-
if (!buildPlatforms.has(value)) {
|
|
111
|
-
throw new Error(`Unknown build platform: ${value}`);
|
|
112
|
-
}
|
|
113
|
-
return value;
|
|
114
|
-
};
|
package/dist/cli/publish.d.ts
DELETED
package/dist/cli/publish.js
DELETED