jiek 2.2.7-alpha.1 → 2.2.7-alpha.4
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/.jiek-production-tag +0 -0
- package/bin-helper/index.cjs +1 -1
- package/dist/.internal/{getWD-BRJ3PK1S.js → .chunks/filterSupport.4rM7f6jB.cjs} +38 -29
- package/dist/.internal/{getWD-Cmxzjf-f.js → .chunks/filterSupport.BXWpLBpT.js} +37 -28
- package/dist/.internal/{+/utils/loadConfig.js → .chunks/loadConfig.CFfzkm_p.js} +24 -8
- package/dist/.internal/{+/utils/loadConfig.cjs → .chunks/loadConfig.OOKddvHF.cjs} +29 -12
- package/dist/.internal/bin/common.cjs +743 -0
- package/dist/.internal/bin/common.d.cts +18 -0
- package/dist/.internal/bin/common.d.ts +18 -0
- package/dist/.internal/bin/common.js +736 -0
- package/dist/.internal/{+/utils → utils}/filterSupport.cjs +1 -3
- package/dist/.internal/{+/utils → utils}/filterSupport.js +1 -3
- package/dist/.internal/utils/loadConfig.cjs +14 -0
- package/dist/.internal/{+/utils/getWD.js → utils/loadConfig.js} +5 -6
- package/dist/.internal/{+/utils → utils}/resolveExports.cjs +1 -1
- package/dist/.internal/{+/utils → utils}/resolveExports.js +1 -1
- package/dist/.internal/{+/utils → utils}/ts.cjs +1 -1
- package/dist/.internal/{+/utils → utils}/ts.js +1 -1
- package/dist/bin/build.cjs +3 -498
- package/dist/bin/index.cjs +56 -43
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/rollup/index.cjs +25 -31
- package/dist/rollup/index.js +25 -31
- package/package.json +12 -15
- package/src/bin/build.cts +2 -8
- package/src/bin/common.ts +3 -0
- package/src/bin/index.cts +2 -1
- package/src/commands/build.ts +9 -3
- package/src/commands/publish.ts +62 -39
- package/src/index.ts +6 -1
- package/src/rollup/index.ts +36 -33
- package/dist/.internal/+/commands/build/analyzer.cjs +0 -201
- package/dist/.internal/+/commands/build/analyzer.d.cts +0 -30
- package/dist/.internal/+/commands/build/analyzer.d.ts +0 -30
- package/dist/.internal/+/commands/build/analyzer.js +0 -195
- package/dist/.internal/+/commands/descriptions.cjs +0 -21
- package/dist/.internal/+/commands/descriptions.d.cts +0 -5
- package/dist/.internal/+/commands/descriptions.d.ts +0 -5
- package/dist/.internal/+/commands/descriptions.js +0 -17
- package/dist/.internal/+/commands/meta.cjs +0 -16
- package/dist/.internal/+/commands/meta.d.cts +0 -3
- package/dist/.internal/+/commands/meta.d.ts +0 -3
- package/dist/.internal/+/commands/meta.js +0 -15
- package/dist/.internal/+/commands/utils/optionParser.cjs +0 -8
- package/dist/.internal/+/commands/utils/optionParser.d.cts +0 -3
- package/dist/.internal/+/commands/utils/optionParser.d.ts +0 -3
- package/dist/.internal/+/commands/utils/optionParser.js +0 -6
- package/dist/.internal/+/server.cjs +0 -33
- package/dist/.internal/+/server.d.cts +0 -8
- package/dist/.internal/+/server.d.ts +0 -8
- package/dist/.internal/+/server.js +0 -27
- package/dist/.internal/+/utils/checkDependency.cjs +0 -39
- package/dist/.internal/+/utils/checkDependency.d.cts +0 -3
- package/dist/.internal/+/utils/checkDependency.d.ts +0 -3
- package/dist/.internal/+/utils/checkDependency.js +0 -34
- package/dist/.internal/+/utils/getRoot.cjs +0 -17
- package/dist/.internal/+/utils/getRoot.d.cts +0 -3
- package/dist/.internal/+/utils/getRoot.d.ts +0 -3
- package/dist/.internal/+/utils/getRoot.js +0 -11
- package/dist/.internal/+/utils/getWD.cjs +0 -15
- package/dist/.internal/+/utils/getWD.d.cts +0 -6
- package/dist/.internal/+/utils/getWD.d.ts +0 -6
- package/dist/.internal/+/utils/tsRegister.cjs +0 -25
- package/dist/.internal/+/utils/tsRegister.d.cts +0 -3
- package/dist/.internal/+/utils/tsRegister.d.ts +0 -3
- package/dist/.internal/+/utils/tsRegister.js +0 -26
- package/dist/.internal/jiek_create-require-CWFWNQHj.js +0 -5
- package/dist/.internal/jiek_create-require-CxSGbkTB.js +0 -5
- package/dist/.internal/package.json +0 -10
- /package/dist/.internal/{index-B6RQz1DZ.js → .chunks/index.B6RQz1DZ.js} +0 -0
- /package/dist/.internal/{index-DlHFuTjM.js → .chunks/index.DlHFuTjM.cjs} +0 -0
- /package/dist/.internal/{+/bin → bin}/parseArgv.cjs +0 -0
- /package/dist/.internal/{+/bin → bin}/parseArgv.d.cts +0 -0
- /package/dist/.internal/{+/bin → bin}/parseArgv.d.ts +0 -0
- /package/dist/.internal/{+/bin → bin}/parseArgv.js +0 -0
- /package/dist/.internal/{+/bridge.cjs → bridge.cjs} +0 -0
- /package/dist/.internal/{+/bridge.d.cts → bridge.d.cts} +0 -0
- /package/dist/.internal/{+/bridge.d.ts → bridge.d.ts} +0 -0
- /package/dist/.internal/{+/bridge.js → bridge.js} +0 -0
- /package/dist/.internal/{+/rollup → rollup}/base.cjs +0 -0
- /package/dist/.internal/{+/rollup → rollup}/base.d.cts +0 -0
- /package/dist/.internal/{+/rollup → rollup}/base.d.ts +0 -0
- /package/dist/.internal/{+/rollup → rollup}/base.js +0 -0
- /package/dist/.internal/{+/rollup → rollup}/bundle-analyzer.cjs +0 -0
- /package/dist/.internal/{+/rollup → rollup}/bundle-analyzer.d.cts +0 -0
- /package/dist/.internal/{+/rollup → rollup}/bundle-analyzer.d.ts +0 -0
- /package/dist/.internal/{+/rollup → rollup}/bundle-analyzer.js +0 -0
- /package/dist/.internal/{+/utils → utils}/filterSupport.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/filterSupport.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/getInternalModuleName.cjs +0 -0
- /package/dist/.internal/{+/utils → utils}/getInternalModuleName.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/getInternalModuleName.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/getInternalModuleName.js +0 -0
- /package/dist/.internal/{+/utils → utils}/intersection.cjs +0 -0
- /package/dist/.internal/{+/utils → utils}/intersection.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/intersection.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/intersection.js +0 -0
- /package/dist/.internal/{+/utils → utils}/loadConfig.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/loadConfig.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/recursiveListFiles.cjs +0 -0
- /package/dist/.internal/{+/utils → utils}/recursiveListFiles.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/recursiveListFiles.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/recursiveListFiles.js +0 -0
- /package/dist/.internal/{+/utils → utils}/resolveExports.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/resolveExports.d.ts +0 -0
- /package/dist/.internal/{+/utils → utils}/ts.d.cts +0 -0
- /package/dist/.internal/{+/utils → utils}/ts.d.ts +0 -0
@@ -1,195 +0,0 @@
|
|
1
|
-
import { parseBoolean } from '../utils/optionParser.js';
|
2
|
-
import { checkDependency } from '../../utils/checkDependency.js';
|
3
|
-
import { existsSync, mkdirSync, writeFileSync, statSync } from 'node:fs';
|
4
|
-
import path from 'node:path';
|
5
|
-
import '../../../jiek_create-require-CxSGbkTB.js';
|
6
|
-
import 'node:module';
|
7
|
-
import 'node:child_process';
|
8
|
-
import 'node:process';
|
9
|
-
import '@inquirer/prompts';
|
10
|
-
import '../../../getWD-Cmxzjf-f.js';
|
11
|
-
import '@jiek/utils/getWorkspaceDir';
|
12
|
-
import 'commander';
|
13
|
-
import 'js-yaml';
|
14
|
-
import '../../utils/getRoot.js';
|
15
|
-
|
16
|
-
function Main() {
|
17
|
-
const { useState, useMemo, useEffect, useCallback } = React;
|
18
|
-
const [path, setPath] = useState(() => location.pathname.replace(/^\/ana\/?/, ""));
|
19
|
-
const [pkgName, entry] = useMemo(() => {
|
20
|
-
const pkgName2 = /^(@[^/]+\/[^/]+|[^/]+)\/?/.exec(path)?.[1];
|
21
|
-
return [
|
22
|
-
pkgName2,
|
23
|
-
pkgName2 != null ? path.replace(`${pkgName2}/`, "") : void 0
|
24
|
-
];
|
25
|
-
}, [path]);
|
26
|
-
const push = useCallback((newPath) => {
|
27
|
-
setPath(newPath);
|
28
|
-
document.title = `${document.title.replace(/ - \/.*/, "")} - /${newPath}`;
|
29
|
-
history.pushState(null, "", `/ana/${newPath}`);
|
30
|
-
}, []);
|
31
|
-
const filterModules = useCallback((startWith) => {
|
32
|
-
const modules = analyzeModule.filter((m) => m.filename.startsWith(startWith));
|
33
|
-
dispatchEvent(new CustomEvent("send:filter", { detail: { analyzeModule: modules } }));
|
34
|
-
}, []);
|
35
|
-
useEffect(() => {
|
36
|
-
if (path !== "") {
|
37
|
-
document.title = `${document.title.replace(/ - \/.*/, "")} - /${path}`;
|
38
|
-
} else {
|
39
|
-
document.title = document.title.replace(/ - \/.*/, "");
|
40
|
-
}
|
41
|
-
filterModules(path);
|
42
|
-
}, [path, filterModules]);
|
43
|
-
useEffect(() => {
|
44
|
-
const offGraphClick = listen("graph:click", ({ detail }) => {
|
45
|
-
if (!detail) return;
|
46
|
-
let root = detail.node;
|
47
|
-
while (root.parent) {
|
48
|
-
root = root.parent;
|
49
|
-
}
|
50
|
-
if (root.filename === path) return;
|
51
|
-
push(root.filename);
|
52
|
-
});
|
53
|
-
return () => {
|
54
|
-
offGraphClick();
|
55
|
-
};
|
56
|
-
}, [push]);
|
57
|
-
function listen(type, listener) {
|
58
|
-
window.addEventListener(type, listener);
|
59
|
-
return () => {
|
60
|
-
window.removeEventListener(type, listener);
|
61
|
-
};
|
62
|
-
}
|
63
|
-
return /* @__PURE__ */ React.createElement(
|
64
|
-
"div",
|
65
|
-
{
|
66
|
-
style: {
|
67
|
-
padding: "12px 55px"
|
68
|
-
}
|
69
|
-
},
|
70
|
-
"/",
|
71
|
-
/* @__PURE__ */ React.createElement(
|
72
|
-
"select",
|
73
|
-
{
|
74
|
-
style: {
|
75
|
-
appearance: "none",
|
76
|
-
border: "none",
|
77
|
-
background: "none"
|
78
|
-
},
|
79
|
-
value: pkgName,
|
80
|
-
onChange: (e) => push(e.target.value)
|
81
|
-
},
|
82
|
-
/* @__PURE__ */ React.createElement("option", { value: "" }, "All"),
|
83
|
-
analyzeModule.map((m) => /^(@[^/]+\/[^/]+|[^/]+)\/?/.exec(m.filename)?.[1]).filter((v, i, a) => a.indexOf(v) === i).map((v) => /* @__PURE__ */ React.createElement("option", { key: v, value: v }, v))
|
84
|
-
),
|
85
|
-
pkgName != null && /* @__PURE__ */ React.createElement(React.Fragment, null, "/", /* @__PURE__ */ React.createElement(
|
86
|
-
"select",
|
87
|
-
{
|
88
|
-
style: {
|
89
|
-
appearance: "none",
|
90
|
-
border: "none",
|
91
|
-
background: "none"
|
92
|
-
},
|
93
|
-
value: entry,
|
94
|
-
onChange: (e) => push(`${pkgName}/${e.target.value}`)
|
95
|
-
},
|
96
|
-
/* @__PURE__ */ React.createElement("option", { value: "" }, "All"),
|
97
|
-
analyzeModule.filter((m) => m.filename.startsWith(`${pkgName}/`)).map((m) => m.filename.replace(`${pkgName}/`, "")).filter((v, i, a) => a.indexOf(v) === i).map((v) => /* @__PURE__ */ React.createElement("option", { key: v, value: v }, v))
|
98
|
-
))
|
99
|
-
);
|
100
|
-
}
|
101
|
-
|
102
|
-
function render() {
|
103
|
-
CUSTOM_SIDE_BAR = true;
|
104
|
-
window.addEventListener("client:ready", () => window.dispatchEvent(
|
105
|
-
new CustomEvent("send:ui", {
|
106
|
-
detail: { type: "Main", Component: __REPLACE_INJECT__ }
|
107
|
-
})
|
108
|
-
));
|
109
|
-
}
|
110
|
-
const CLIENT_CUSTOM_RENDER_SCRIPT = [
|
111
|
-
Main.toString(),
|
112
|
-
render.toString().replace("__REPLACE_INJECT__", Main.name),
|
113
|
-
`(${render.name})()`
|
114
|
-
].join("\n");
|
115
|
-
|
116
|
-
const registerAnalyzerCommandOptions = (command) => command.option("--ana", "Enable the bundle analyzer.", parseBoolean).option("--ana.dir <DIR>", "The directory of the bundle analyzer.", ".jk-analyses").option(
|
117
|
-
"--ana.mode <MODE>",
|
118
|
-
'The mode of the bundle analyzer, support "static", "json" and "server".',
|
119
|
-
"server"
|
120
|
-
).option("--ana.open", "Open the bundle analyzer in the browser.", parseBoolean).option(
|
121
|
-
"--ana.size <SIZE>",
|
122
|
-
'The default size of the bundle analyzer, support "stat", "parsed" and "gzip".',
|
123
|
-
"parsed"
|
124
|
-
);
|
125
|
-
const useAnalyzer = async (options, server) => {
|
126
|
-
const modules = [];
|
127
|
-
let bundleAnalyzerModule;
|
128
|
-
const analyzer = options.ana ? {
|
129
|
-
dir: options["ana.dir"],
|
130
|
-
mode: options["ana.mode"],
|
131
|
-
open: options["ana.open"],
|
132
|
-
size: options["ana.size"]
|
133
|
-
} : void 0;
|
134
|
-
if (options.ana && ![
|
135
|
-
"stat",
|
136
|
-
"parsed",
|
137
|
-
"gzip"
|
138
|
-
].includes(analyzer?.size ?? "")) {
|
139
|
-
throw new Error('The value of `ana.size` must be "stat", "parsed" or "gzip"');
|
140
|
-
}
|
141
|
-
if (analyzer) {
|
142
|
-
await checkDependency("vite-bundle-analyzer");
|
143
|
-
bundleAnalyzerModule = await import('vite-bundle-analyzer');
|
144
|
-
}
|
145
|
-
const refreshAnalyzer = async (cwd, applyModules) => {
|
146
|
-
if (!(analyzer && server && bundleAnalyzerModule)) return;
|
147
|
-
if (analyzer.mode === "json") {
|
148
|
-
const anaDir = path.resolve(cwd, analyzer.dir);
|
149
|
-
if (!existsSync(anaDir)) {
|
150
|
-
mkdirSync(anaDir, { recursive: true });
|
151
|
-
}
|
152
|
-
const gitIgnorePath = path.resolve(anaDir, ".gitignore");
|
153
|
-
if (!existsSync(gitIgnorePath)) {
|
154
|
-
writeFileSync(gitIgnorePath, "*\n!.gitignore\n");
|
155
|
-
}
|
156
|
-
const npmIgnorePath = path.resolve(anaDir, ".npmignore");
|
157
|
-
if (!existsSync(npmIgnorePath)) {
|
158
|
-
writeFileSync(npmIgnorePath, "*\n");
|
159
|
-
}
|
160
|
-
if (!statSync(anaDir).isDirectory()) {
|
161
|
-
throw new Error(`The directory '${anaDir}' is not a directory.`);
|
162
|
-
}
|
163
|
-
}
|
164
|
-
const { renderView, injectHTMLTag } = bundleAnalyzerModule;
|
165
|
-
applyModules.forEach((m) => {
|
166
|
-
const index = modules.findIndex(({ filename }) => filename === m.filename);
|
167
|
-
if (index === -1) {
|
168
|
-
modules.push(m);
|
169
|
-
} else {
|
170
|
-
modules[index] = m;
|
171
|
-
}
|
172
|
-
});
|
173
|
-
let html = await renderView(modules, {
|
174
|
-
title: `Jiek Analyzer`,
|
175
|
-
mode: analyzer.size
|
176
|
-
});
|
177
|
-
html = injectHTMLTag({
|
178
|
-
html,
|
179
|
-
injectTo: "body",
|
180
|
-
descriptors: [
|
181
|
-
{ kind: "script", text: CLIENT_CUSTOM_RENDER_SCRIPT }
|
182
|
-
]
|
183
|
-
});
|
184
|
-
void server.renderTo("/ana", html);
|
185
|
-
};
|
186
|
-
return {
|
187
|
-
modules,
|
188
|
-
refreshAnalyzer,
|
189
|
-
ANALYZER_ENV: {
|
190
|
-
JIEK_ANALYZER: analyzer ? JSON.stringify(analyzer) : void 0
|
191
|
-
}
|
192
|
-
};
|
193
|
-
};
|
194
|
-
|
195
|
-
export { registerAnalyzerCommandOptions, useAnalyzer };
|
@@ -1,21 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const entriesDescription = `
|
4
|
-
Specify the build entry-points of the package.json's 'exports' field.
|
5
|
-
Support glob pattern and array.
|
6
|
-
.e.g. '.', './*', './sub/*', './a,./b'.
|
7
|
-
`.trim();
|
8
|
-
const filterDescription = `
|
9
|
-
Filter the packages from the workspace.
|
10
|
-
Support fuzzy match and array.
|
11
|
-
.e.g. 'core,utils'.
|
12
|
-
`.trim();
|
13
|
-
const outdirDescription = `
|
14
|
-
The output directory of the build, which relative to the target subpackage root directory.
|
15
|
-
Support with variables: 'PKG_NAME',
|
16
|
-
.e.g. 'dist/{{PKG_NAME}}'.
|
17
|
-
`.trim();
|
18
|
-
|
19
|
-
exports.entriesDescription = entriesDescription;
|
20
|
-
exports.filterDescription = filterDescription;
|
21
|
-
exports.outdirDescription = outdirDescription;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
const entriesDescription = `
|
2
|
-
Specify the build entry-points of the package.json's 'exports' field.
|
3
|
-
Support glob pattern and array.
|
4
|
-
.e.g. '.', './*', './sub/*', './a,./b'.
|
5
|
-
`.trim();
|
6
|
-
const filterDescription = `
|
7
|
-
Filter the packages from the workspace.
|
8
|
-
Support fuzzy match and array.
|
9
|
-
.e.g. 'core,utils'.
|
10
|
-
`.trim();
|
11
|
-
const outdirDescription = `
|
12
|
-
The output directory of the build, which relative to the target subpackage root directory.
|
13
|
-
Support with variables: 'PKG_NAME',
|
14
|
-
.e.g. 'dist/{{PKG_NAME}}'.
|
15
|
-
`.trim();
|
16
|
-
|
17
|
-
export { entriesDescription, filterDescription, outdirDescription };
|
@@ -1,16 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var filterSupport = require('../../getWD-BRJ3PK1S.js');
|
4
|
-
require('@jiek/utils/getWorkspaceDir');
|
5
|
-
require('../../jiek_create-require-CWFWNQHj.js');
|
6
|
-
require('node:fs');
|
7
|
-
require('node:path');
|
8
|
-
require('node:process');
|
9
|
-
require('commander');
|
10
|
-
require('js-yaml');
|
11
|
-
require('../utils/getRoot.cjs');
|
12
|
-
|
13
|
-
const { notWorkspace } = filterSupport.getWD();
|
14
|
-
const IS_WORKSPACE = !notWorkspace;
|
15
|
-
|
16
|
-
exports.IS_WORKSPACE = IS_WORKSPACE;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { g as getWD } from '../../getWD-Cmxzjf-f.js';
|
2
|
-
import '@jiek/utils/getWorkspaceDir';
|
3
|
-
import '../../jiek_create-require-CxSGbkTB.js';
|
4
|
-
import 'node:module';
|
5
|
-
import 'node:fs';
|
6
|
-
import 'node:path';
|
7
|
-
import 'node:process';
|
8
|
-
import 'commander';
|
9
|
-
import 'js-yaml';
|
10
|
-
import '../utils/getRoot.js';
|
11
|
-
|
12
|
-
const { notWorkspace } = getWD();
|
13
|
-
const IS_WORKSPACE = !notWorkspace;
|
14
|
-
|
15
|
-
export { IS_WORKSPACE };
|
@@ -1,33 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var Koa = require('koa');
|
4
|
-
|
5
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
6
|
-
|
7
|
-
var Koa__default = /*#__PURE__*/_interopDefault(Koa);
|
8
|
-
|
9
|
-
const createServer = (port, host) => {
|
10
|
-
const app = new Koa__default.default();
|
11
|
-
app.listen(port, host);
|
12
|
-
const streams = /* @__PURE__ */ new Map();
|
13
|
-
app.use(async (ctx) => {
|
14
|
-
let stream = streams.get(ctx.path);
|
15
|
-
if (stream == null) {
|
16
|
-
const maybeKey = streams.keys().find((p) => ctx.path.startsWith(p));
|
17
|
-
stream = maybeKey != null ? streams.get(maybeKey) : void 0;
|
18
|
-
}
|
19
|
-
if (stream != null) {
|
20
|
-
ctx.body = stream;
|
21
|
-
}
|
22
|
-
});
|
23
|
-
return {
|
24
|
-
port,
|
25
|
-
host,
|
26
|
-
rootUrl: `http://${host}:${port}`,
|
27
|
-
renderTo: async (path, stream) => {
|
28
|
-
streams.set(path, stream);
|
29
|
-
}
|
30
|
-
};
|
31
|
-
};
|
32
|
-
|
33
|
-
exports.createServer = createServer;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import Koa from 'koa';
|
2
|
-
|
3
|
-
const createServer = (port, host) => {
|
4
|
-
const app = new Koa();
|
5
|
-
app.listen(port, host);
|
6
|
-
const streams = /* @__PURE__ */ new Map();
|
7
|
-
app.use(async (ctx) => {
|
8
|
-
let stream = streams.get(ctx.path);
|
9
|
-
if (stream == null) {
|
10
|
-
const maybeKey = streams.keys().find((p) => ctx.path.startsWith(p));
|
11
|
-
stream = maybeKey != null ? streams.get(maybeKey) : void 0;
|
12
|
-
}
|
13
|
-
if (stream != null) {
|
14
|
-
ctx.body = stream;
|
15
|
-
}
|
16
|
-
});
|
17
|
-
return {
|
18
|
-
port,
|
19
|
-
host,
|
20
|
-
rootUrl: `http://${host}:${port}`,
|
21
|
-
renderTo: async (path, stream) => {
|
22
|
-
streams.set(path, stream);
|
23
|
-
}
|
24
|
-
};
|
25
|
-
};
|
26
|
-
|
27
|
-
export { createServer };
|
@@ -1,39 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var jiek_createRequire = require('../../jiek_create-require-CWFWNQHj.js');
|
4
|
-
var node_child_process = require('node:child_process');
|
5
|
-
var process = require('node:process');
|
6
|
-
var prompts = require('@inquirer/prompts');
|
7
|
-
var filterSupport = require('../../getWD-BRJ3PK1S.js');
|
8
|
-
require('@jiek/utils/getWorkspaceDir');
|
9
|
-
require('node:fs');
|
10
|
-
require('node:path');
|
11
|
-
require('commander');
|
12
|
-
require('js-yaml');
|
13
|
-
require('./getRoot.cjs');
|
14
|
-
|
15
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
16
|
-
|
17
|
-
var process__default = /*#__PURE__*/_interopDefault(process);
|
18
|
-
|
19
|
-
async function checkDependency(dependency) {
|
20
|
-
try {
|
21
|
-
jiek_createRequire.require.resolve(dependency);
|
22
|
-
} catch {
|
23
|
-
console.error(`The package '${dependency}' is not installed, please install it first.`);
|
24
|
-
const { notWorkspace } = filterSupport.getWD();
|
25
|
-
const command = `pnpm add -${notWorkspace ? "" : "w"}D ${dependency}`;
|
26
|
-
if (await prompts.confirm({ message: `Do you want to add it now? (${command})` })) {
|
27
|
-
node_child_process.execSync(command, {
|
28
|
-
stdio: "inherit",
|
29
|
-
cwd: process__default.default.cwd(),
|
30
|
-
env: process__default.default.env
|
31
|
-
});
|
32
|
-
} else {
|
33
|
-
console.warn(`You can run the command '${command}' to install it manually.`);
|
34
|
-
process__default.default.exit(1);
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}
|
38
|
-
|
39
|
-
exports.checkDependency = checkDependency;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import { r as require } from '../../jiek_create-require-CxSGbkTB.js';
|
2
|
-
import { execSync } from 'node:child_process';
|
3
|
-
import process from 'node:process';
|
4
|
-
import { confirm } from '@inquirer/prompts';
|
5
|
-
import { g as getWD } from '../../getWD-Cmxzjf-f.js';
|
6
|
-
import 'node:module';
|
7
|
-
import '@jiek/utils/getWorkspaceDir';
|
8
|
-
import 'node:fs';
|
9
|
-
import 'node:path';
|
10
|
-
import 'commander';
|
11
|
-
import 'js-yaml';
|
12
|
-
import './getRoot.js';
|
13
|
-
|
14
|
-
async function checkDependency(dependency) {
|
15
|
-
try {
|
16
|
-
require.resolve(dependency);
|
17
|
-
} catch {
|
18
|
-
console.error(`The package '${dependency}' is not installed, please install it first.`);
|
19
|
-
const { notWorkspace } = getWD();
|
20
|
-
const command = `pnpm add -${notWorkspace ? "" : "w"}D ${dependency}`;
|
21
|
-
if (await confirm({ message: `Do you want to add it now? (${command})` })) {
|
22
|
-
execSync(command, {
|
23
|
-
stdio: "inherit",
|
24
|
-
cwd: process.cwd(),
|
25
|
-
env: process.env
|
26
|
-
});
|
27
|
-
} else {
|
28
|
-
console.warn(`You can run the command '${command}' to install it manually.`);
|
29
|
-
process.exit(1);
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
export { checkDependency };
|
@@ -1,17 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var path = require('node:path');
|
4
|
-
|
5
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
6
|
-
|
7
|
-
var path__default = /*#__PURE__*/_interopDefault(path);
|
8
|
-
|
9
|
-
let root;
|
10
|
-
function getRoot() {
|
11
|
-
if (root) return root;
|
12
|
-
const rootOption = process.env.JIEK_ROOT;
|
13
|
-
root = rootOption ? path__default.default.isAbsolute(rootOption) ? rootOption : path__default.default.resolve(process.cwd(), rootOption) : void 0;
|
14
|
-
return root;
|
15
|
-
}
|
16
|
-
|
17
|
-
exports.getRoot = getRoot;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import path from 'node:path';
|
2
|
-
|
3
|
-
let root;
|
4
|
-
function getRoot() {
|
5
|
-
if (root) return root;
|
6
|
-
const rootOption = process.env.JIEK_ROOT;
|
7
|
-
root = rootOption ? path.isAbsolute(rootOption) ? rootOption : path.resolve(process.cwd(), rootOption) : void 0;
|
8
|
-
return root;
|
9
|
-
}
|
10
|
-
|
11
|
-
export { getRoot };
|
@@ -1,15 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
require('@jiek/utils/getWorkspaceDir');
|
4
|
-
var filterSupport = require('../../getWD-BRJ3PK1S.js');
|
5
|
-
require('./getRoot.cjs');
|
6
|
-
require('../../jiek_create-require-CWFWNQHj.js');
|
7
|
-
require('node:fs');
|
8
|
-
require('node:path');
|
9
|
-
require('node:process');
|
10
|
-
require('commander');
|
11
|
-
require('js-yaml');
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
exports.getWD = filterSupport.getWD;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var jiek_createRequire = require('../../jiek_create-require-CWFWNQHj.js');
|
4
|
-
|
5
|
-
function packageIsExist(name) {
|
6
|
-
try {
|
7
|
-
jiek_createRequire.require.resolve(name);
|
8
|
-
return true;
|
9
|
-
} catch (e) {
|
10
|
-
return false;
|
11
|
-
}
|
12
|
-
}
|
13
|
-
exports.tsRegisterName = void 0;
|
14
|
-
const registers = [
|
15
|
-
process.env.JIEK_TS_REGISTER,
|
16
|
-
"esbuild-register",
|
17
|
-
"@swc-node/register",
|
18
|
-
"ts-node/register"
|
19
|
-
].filter(Boolean);
|
20
|
-
for (const register of registers) {
|
21
|
-
if (packageIsExist(register)) {
|
22
|
-
exports.tsRegisterName = register;
|
23
|
-
break;
|
24
|
-
}
|
25
|
-
}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import { r as require } from '../../jiek_create-require-CxSGbkTB.js';
|
2
|
-
import 'node:module';
|
3
|
-
|
4
|
-
function packageIsExist(name) {
|
5
|
-
try {
|
6
|
-
require.resolve(name);
|
7
|
-
return true;
|
8
|
-
} catch (e) {
|
9
|
-
return false;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
let tsRegisterName;
|
13
|
-
const registers = [
|
14
|
-
process.env.JIEK_TS_REGISTER,
|
15
|
-
"esbuild-register",
|
16
|
-
"@swc-node/register",
|
17
|
-
"ts-node/register"
|
18
|
-
].filter(Boolean);
|
19
|
-
for (const register of registers) {
|
20
|
-
if (packageIsExist(register)) {
|
21
|
-
tsRegisterName = register;
|
22
|
-
break;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
export { tsRegisterName };
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|