@storybook/angular 10.0.0-beta.1 → 10.0.0-beta.10
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/build-schema.json +26 -9
- package/dist/_node-chunks/{chunk-Z7HIDXSI.js → chunk-CBOYJP35.js} +15 -57
- package/dist/_node-chunks/chunk-H6IEZNJJ.js +58 -0
- package/dist/_node-chunks/chunk-MDHUCIBM.js +17 -0
- package/dist/builders/build-storybook/index.js +21 -17
- package/dist/builders/start-storybook/index.js +21 -17
- package/dist/node/index.js +7 -7
- package/dist/preset.js +11 -10
- package/dist/server/framework-preset-angular-cli.js +11 -10
- package/dist/server/framework-preset-angular-ivy.js +7 -7
- package/package.json +5 -6
- package/start-schema.json +26 -9
- package/template/cli/button.stories.ts +1 -1
- package/dist/_node-chunks/chunk-2MYYSDON.js +0 -17
- package/dist/_node-chunks/chunk-QEVN44EN.js +0 -330
- package/preset.js +0 -1
package/build-schema.json
CHANGED
|
@@ -67,18 +67,27 @@
|
|
|
67
67
|
"compodocArgs": {
|
|
68
68
|
"type": "array",
|
|
69
69
|
"description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
|
|
70
|
-
"default": [
|
|
70
|
+
"default": [
|
|
71
|
+
"-e",
|
|
72
|
+
"json"
|
|
73
|
+
],
|
|
71
74
|
"items": {
|
|
72
75
|
"type": "string"
|
|
73
76
|
}
|
|
74
77
|
},
|
|
75
78
|
"webpackStatsJson": {
|
|
76
|
-
"type": [
|
|
79
|
+
"type": [
|
|
80
|
+
"boolean",
|
|
81
|
+
"string"
|
|
82
|
+
],
|
|
77
83
|
"description": "Write Webpack Stats JSON to disk",
|
|
78
84
|
"default": false
|
|
79
85
|
},
|
|
80
86
|
"statsJson": {
|
|
81
|
-
"type": [
|
|
87
|
+
"type": [
|
|
88
|
+
"boolean",
|
|
89
|
+
"string"
|
|
90
|
+
],
|
|
82
91
|
"description": "Write stats JSON to disk",
|
|
83
92
|
"default": false
|
|
84
93
|
},
|
|
@@ -116,14 +125,16 @@
|
|
|
116
125
|
}
|
|
117
126
|
},
|
|
118
127
|
"sourceMap": {
|
|
119
|
-
"type": [
|
|
128
|
+
"type": [
|
|
129
|
+
"boolean",
|
|
130
|
+
"object"
|
|
131
|
+
],
|
|
120
132
|
"description": "Configure sourcemaps. See: https://angular.io/guide/workspace-config#source-map-configuration",
|
|
121
133
|
"default": false
|
|
122
134
|
},
|
|
123
135
|
"experimentalZoneless": {
|
|
124
136
|
"type": "boolean",
|
|
125
|
-
"description": "Experimental: Use zoneless change detection."
|
|
126
|
-
"default": false
|
|
137
|
+
"description": "Experimental: Use zoneless change detection."
|
|
127
138
|
}
|
|
128
139
|
},
|
|
129
140
|
"additionalProperties": false,
|
|
@@ -159,7 +170,11 @@
|
|
|
159
170
|
}
|
|
160
171
|
},
|
|
161
172
|
"additionalProperties": false,
|
|
162
|
-
"required": [
|
|
173
|
+
"required": [
|
|
174
|
+
"glob",
|
|
175
|
+
"input",
|
|
176
|
+
"output"
|
|
177
|
+
]
|
|
163
178
|
},
|
|
164
179
|
{
|
|
165
180
|
"type": "string"
|
|
@@ -187,7 +202,9 @@
|
|
|
187
202
|
}
|
|
188
203
|
},
|
|
189
204
|
"additionalProperties": false,
|
|
190
|
-
"required": [
|
|
205
|
+
"required": [
|
|
206
|
+
"input"
|
|
207
|
+
]
|
|
191
208
|
},
|
|
192
209
|
{
|
|
193
210
|
"type": "string",
|
|
@@ -196,4 +213,4 @@
|
|
|
196
213
|
]
|
|
197
214
|
}
|
|
198
215
|
}
|
|
199
|
-
}
|
|
216
|
+
}
|
|
@@ -1,68 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
up
|
|
14
|
+
} from "./chunk-H6IEZNJJ.js";
|
|
12
15
|
import {
|
|
13
16
|
__name
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
|
|
16
|
-
// ../../node_modules/walk-up-path/dist/mjs/index.js
|
|
17
|
-
import { dirname, resolve } from "path";
|
|
18
|
-
var walkUp = /* @__PURE__ */ __name(function* (path) {
|
|
19
|
-
for (path = resolve(path); path; ) {
|
|
20
|
-
yield path;
|
|
21
|
-
const pp = dirname(path);
|
|
22
|
-
if (pp === path) {
|
|
23
|
-
break;
|
|
24
|
-
} else {
|
|
25
|
-
path = pp;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}, "walkUp");
|
|
17
|
+
} from "./chunk-MDHUCIBM.js";
|
|
29
18
|
|
|
30
|
-
// ../../node_modules/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function fileExistsSync(path) {
|
|
34
|
-
try {
|
|
35
|
-
const stats = statSync(path);
|
|
36
|
-
return stats.isFile();
|
|
37
|
-
} catch (_err) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
__name(fileExistsSync, "fileExistsSync");
|
|
42
|
-
function findPackagePathSync(cwd) {
|
|
43
|
-
for (const path of walkUp(cwd)) {
|
|
44
|
-
const packagePath = resolve2(path, "package.json");
|
|
45
|
-
const hasPackageJson = fileExistsSync(packagePath);
|
|
46
|
-
if (hasPackageJson) {
|
|
47
|
-
return packagePath;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
__name(findPackagePathSync, "findPackagePathSync");
|
|
53
|
-
function findPackageSync(cwd) {
|
|
54
|
-
const packagePath = findPackagePathSync(cwd);
|
|
55
|
-
if (!packagePath) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
const source = readFileSync(packagePath, { encoding: "utf8" });
|
|
60
|
-
return JSON.parse(source);
|
|
61
|
-
} catch (_err) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
19
|
+
// ../../node_modules/empathic/package.mjs
|
|
20
|
+
function up2(options) {
|
|
21
|
+
return up("package.json", options);
|
|
64
22
|
}
|
|
65
|
-
__name(
|
|
23
|
+
__name(up2, "up");
|
|
66
24
|
|
|
67
25
|
// src/builders/utils/error-handler.ts
|
|
68
26
|
import { logger, instance as npmLog } from "storybook/internal/node-logger";
|
|
@@ -128,7 +86,7 @@ var runCompodoc = /* @__PURE__ */ __name(({ compodocArgs, tsconfig }, context) =
|
|
|
128
86
|
}, "runCompodoc");
|
|
129
87
|
|
|
130
88
|
export {
|
|
131
|
-
|
|
89
|
+
up2 as up,
|
|
132
90
|
printErrorDetails,
|
|
133
91
|
errorSummary,
|
|
134
92
|
runCompodoc
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
__name
|
|
14
|
+
} from "./chunk-MDHUCIBM.js";
|
|
15
|
+
|
|
16
|
+
// ../../node_modules/empathic/find.mjs
|
|
17
|
+
import { join as join2 } from "node:path";
|
|
18
|
+
import { existsSync, statSync } from "node:fs";
|
|
19
|
+
|
|
20
|
+
// ../../node_modules/empathic/walk.mjs
|
|
21
|
+
import { dirname } from "node:path";
|
|
22
|
+
|
|
23
|
+
// ../../node_modules/empathic/resolve.mjs
|
|
24
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
25
|
+
function absolute(input, root) {
|
|
26
|
+
return isAbsolute(input) ? input : resolve(root || ".", input);
|
|
27
|
+
}
|
|
28
|
+
__name(absolute, "absolute");
|
|
29
|
+
|
|
30
|
+
// ../../node_modules/empathic/walk.mjs
|
|
31
|
+
function up(base, options) {
|
|
32
|
+
let { last, cwd } = options || {};
|
|
33
|
+
let tmp = absolute(base, cwd);
|
|
34
|
+
let root = absolute(last || "/", cwd);
|
|
35
|
+
let prev, arr = [];
|
|
36
|
+
while (prev !== root) {
|
|
37
|
+
arr.push(tmp);
|
|
38
|
+
tmp = dirname(prev = tmp);
|
|
39
|
+
if (tmp === prev) break;
|
|
40
|
+
}
|
|
41
|
+
return arr;
|
|
42
|
+
}
|
|
43
|
+
__name(up, "up");
|
|
44
|
+
|
|
45
|
+
// ../../node_modules/empathic/find.mjs
|
|
46
|
+
function up2(name, options) {
|
|
47
|
+
let dir, tmp;
|
|
48
|
+
let start = options && options.cwd || "";
|
|
49
|
+
for (dir of up(start, options)) {
|
|
50
|
+
tmp = join2(dir, name);
|
|
51
|
+
if (existsSync(tmp)) return tmp;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
__name(up2, "up");
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
up2 as up
|
|
58
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
__name
|
|
17
|
+
};
|
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
errorSummary,
|
|
14
|
-
findPackageSync,
|
|
15
14
|
printErrorDetails,
|
|
16
|
-
runCompodoc
|
|
17
|
-
|
|
15
|
+
runCompodoc,
|
|
16
|
+
up as up2
|
|
17
|
+
} from "../../_node-chunks/chunk-CBOYJP35.js";
|
|
18
18
|
import {
|
|
19
|
-
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
19
|
+
up
|
|
20
|
+
} from "../../_node-chunks/chunk-H6IEZNJJ.js";
|
|
21
21
|
import {
|
|
22
22
|
__name
|
|
23
|
-
} from "../../_node-chunks/chunk-
|
|
23
|
+
} from "../../_node-chunks/chunk-MDHUCIBM.js";
|
|
24
24
|
|
|
25
25
|
// src/builders/build-storybook/index.ts
|
|
26
|
+
import { readFileSync } from "node:fs";
|
|
26
27
|
import { getEnvConfig, getProjectRoot, versions } from "storybook/internal/common";
|
|
27
28
|
import { buildStaticStandalone, withTelemetry } from "storybook/internal/core-server";
|
|
28
29
|
import { addToGlobalContext } from "storybook/internal/telemetry";
|
|
29
30
|
import { createBuilder, targetFromTargetString } from "@angular-devkit/architect";
|
|
30
31
|
import { from, of, throwError } from "rxjs";
|
|
31
32
|
import { catchError, map, mapTo, switchMap } from "rxjs/operators";
|
|
33
|
+
import { VERSION } from "@angular/core";
|
|
32
34
|
addToGlobalContext("cliVersion", versions.storybook);
|
|
33
35
|
var commandBuilder = /* @__PURE__ */ __name((options, context) => {
|
|
34
36
|
const builder = from(setup(options, context)).pipe(
|
|
35
37
|
switchMap(({ tsConfig }) => {
|
|
36
|
-
const docTSConfig =
|
|
38
|
+
const docTSConfig = up("tsconfig.doc.json", {
|
|
37
39
|
cwd: options.configDir,
|
|
38
|
-
|
|
40
|
+
last: getProjectRoot()
|
|
39
41
|
});
|
|
40
42
|
const runCompodoc$ = options.compodoc ? runCompodoc(
|
|
41
43
|
{ compodocArgs: options.compodocArgs, tsconfig: docTSConfig ?? tsConfig },
|
|
@@ -68,10 +70,12 @@ var commandBuilder = /* @__PURE__ */ __name((options, context) => {
|
|
|
68
70
|
previewUrl,
|
|
69
71
|
sourceMap = false,
|
|
70
72
|
preserveSymlinks = false,
|
|
71
|
-
experimentalZoneless =
|
|
73
|
+
experimentalZoneless = !!(VERSION.major && Number(VERSION.major) >= 21)
|
|
72
74
|
} = options;
|
|
75
|
+
const packageJsonPath = up2({ cwd: __dirname });
|
|
76
|
+
const packageJson = packageJsonPath != null ? JSON.parse(readFileSync(packageJsonPath, "utf8")) : null;
|
|
73
77
|
const standaloneOptions = {
|
|
74
|
-
packageJson
|
|
78
|
+
packageJson,
|
|
75
79
|
configDir,
|
|
76
80
|
...docs ? { docs } : {},
|
|
77
81
|
loglevel,
|
|
@@ -117,7 +121,7 @@ async function setup(options, context) {
|
|
|
117
121
|
);
|
|
118
122
|
}
|
|
119
123
|
return {
|
|
120
|
-
tsConfig: options.tsConfig ??
|
|
124
|
+
tsConfig: options.tsConfig ?? up("tsconfig.json", { cwd: options.configDir, last: getProjectRoot() }) ?? browserOptions.tsConfig
|
|
121
125
|
};
|
|
122
126
|
}
|
|
123
127
|
__name(setup, "setup");
|
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
errorSummary,
|
|
14
|
-
findPackageSync,
|
|
15
14
|
printErrorDetails,
|
|
16
|
-
runCompodoc
|
|
17
|
-
|
|
15
|
+
runCompodoc,
|
|
16
|
+
up as up2
|
|
17
|
+
} from "../../_node-chunks/chunk-CBOYJP35.js";
|
|
18
18
|
import {
|
|
19
|
-
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
19
|
+
up
|
|
20
|
+
} from "../../_node-chunks/chunk-H6IEZNJJ.js";
|
|
21
21
|
import {
|
|
22
22
|
__name
|
|
23
|
-
} from "../../_node-chunks/chunk-
|
|
23
|
+
} from "../../_node-chunks/chunk-MDHUCIBM.js";
|
|
24
24
|
|
|
25
25
|
// src/builders/start-storybook/index.ts
|
|
26
|
+
import { readFileSync } from "node:fs";
|
|
26
27
|
import { getEnvConfig, getProjectRoot, versions } from "storybook/internal/common";
|
|
27
28
|
import { buildDevStandalone, withTelemetry } from "storybook/internal/core-server";
|
|
28
29
|
import { addToGlobalContext } from "storybook/internal/telemetry";
|
|
29
30
|
import { createBuilder, targetFromTargetString } from "@angular-devkit/architect";
|
|
30
31
|
import { Observable, from, of } from "rxjs";
|
|
31
32
|
import { map, mapTo, switchMap } from "rxjs/operators";
|
|
33
|
+
import { VERSION } from "@angular/core";
|
|
32
34
|
addToGlobalContext("cliVersion", versions.storybook);
|
|
33
35
|
var commandBuilder = /* @__PURE__ */ __name((options, context) => {
|
|
34
36
|
const builder = from(setup(options, context)).pipe(
|
|
35
37
|
switchMap(({ tsConfig }) => {
|
|
36
|
-
const docTSConfig =
|
|
38
|
+
const docTSConfig = up("tsconfig.doc.json", {
|
|
37
39
|
cwd: options.configDir,
|
|
38
|
-
|
|
40
|
+
last: getProjectRoot()
|
|
39
41
|
});
|
|
40
42
|
const runCompodoc$ = options.compodoc ? runCompodoc(
|
|
41
43
|
{
|
|
@@ -82,10 +84,12 @@ var commandBuilder = /* @__PURE__ */ __name((options, context) => {
|
|
|
82
84
|
previewUrl,
|
|
83
85
|
sourceMap = false,
|
|
84
86
|
preserveSymlinks = false,
|
|
85
|
-
experimentalZoneless =
|
|
87
|
+
experimentalZoneless = !!(VERSION.major && Number(VERSION.major) >= 21)
|
|
86
88
|
} = options;
|
|
89
|
+
const packageJsonPath = up2({ cwd: __dirname });
|
|
90
|
+
const packageJson = packageJsonPath != null ? JSON.parse(readFileSync(packageJsonPath, "utf8")) : null;
|
|
87
91
|
const standaloneOptions = {
|
|
88
|
-
packageJson
|
|
92
|
+
packageJson,
|
|
89
93
|
ci,
|
|
90
94
|
configDir,
|
|
91
95
|
...docs ? { docs } : {},
|
|
@@ -139,7 +143,7 @@ async function setup(options, context) {
|
|
|
139
143
|
);
|
|
140
144
|
}
|
|
141
145
|
return {
|
|
142
|
-
tsConfig: options.tsConfig ??
|
|
146
|
+
tsConfig: options.tsConfig ?? up("tsconfig.json", { cwd: options.configDir }) ?? browserOptions.tsConfig
|
|
143
147
|
};
|
|
144
148
|
}
|
|
145
149
|
__name(setup, "setup");
|
package/dist/node/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-MDHUCIBM.js";
|
|
15
15
|
|
|
16
16
|
// src/node/index.ts
|
|
17
17
|
function defineMain(config) {
|
package/dist/preset.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-MDHUCIBM.js";
|
|
15
15
|
|
|
16
16
|
// src/preset.ts
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
17
18
|
var addons = [
|
|
18
|
-
import.meta.resolve("@storybook/angular/server/framework-preset-angular-cli"),
|
|
19
|
-
import.meta.resolve("@storybook/angular/server/framework-preset-angular-ivy")
|
|
19
|
+
fileURLToPath(import.meta.resolve("@storybook/angular/server/framework-preset-angular-cli")),
|
|
20
|
+
fileURLToPath(import.meta.resolve("@storybook/angular/server/framework-preset-angular-ivy"))
|
|
20
21
|
];
|
|
21
22
|
var previewAnnotations = /* @__PURE__ */ __name(async (entries = [], options) => {
|
|
22
|
-
const config = import.meta.resolve("@storybook/angular/client/config");
|
|
23
|
+
const config = fileURLToPath(import.meta.resolve("@storybook/angular/client/config"));
|
|
23
24
|
const annotations = [...entries, config];
|
|
24
25
|
if (options.enableProdMode) {
|
|
25
26
|
const previewProdPath = import.meta.resolve("@storybook/angular/client/preview-prod");
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
|
-
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
13
|
+
up
|
|
14
|
+
} from "../_node-chunks/chunk-H6IEZNJJ.js";
|
|
15
15
|
import {
|
|
16
16
|
__name
|
|
17
|
-
} from "../_node-chunks/chunk-
|
|
17
|
+
} from "../_node-chunks/chunk-MDHUCIBM.js";
|
|
18
18
|
|
|
19
19
|
// src/server/framework-preset-angular-cli.ts
|
|
20
20
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -298,8 +298,9 @@ async function getBuilderOptions(options, builderContext) {
|
|
|
298
298
|
builderContext.target
|
|
299
299
|
);
|
|
300
300
|
const builderOptions = deepMerge(browserTargetOptions, explicitAngularBuilderOptions || {});
|
|
301
|
-
builderOptions.tsConfig = options.tsConfig ??
|
|
301
|
+
builderOptions.tsConfig = options.tsConfig ?? up("tsconfig.json", { cwd: options.configDir, last: getProjectRoot() }) ?? browserTargetOptions.tsConfig;
|
|
302
302
|
logger.info(`=> Using angular project with "tsConfig:${builderOptions.tsConfig}"`);
|
|
303
|
+
builderOptions.experimentalZoneless = options.angularBuilderOptions?.experimentalZoneless;
|
|
303
304
|
return builderOptions;
|
|
304
305
|
}
|
|
305
306
|
__name(getBuilderOptions, "getBuilderOptions");
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_edvipkgj0ir from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_edvipkgj0ir from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_edvipkgj0ir from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_edvipkgj0ir.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_edvipkgj0ir.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_edvipkgj0ir.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__name
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-MDHUCIBM.js";
|
|
15
15
|
|
|
16
16
|
// src/server/framework-preset-angular-ivy.ts
|
|
17
17
|
import { join } from "node:path";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular",
|
|
3
|
-
"version": "10.0.0-beta.
|
|
3
|
+
"version": "10.0.0-beta.10",
|
|
4
4
|
"description": "Storybook for Angular: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@storybook/builder-webpack5": "10.0.0-beta.
|
|
64
|
+
"@storybook/builder-webpack5": "10.0.0-beta.10",
|
|
65
65
|
"@storybook/global": "^5.0.0",
|
|
66
66
|
"telejson": "8.0.0",
|
|
67
67
|
"ts-dedent": "^2.0.0",
|
|
@@ -81,10 +81,9 @@
|
|
|
81
81
|
"@angular/forms": "^19.1.1",
|
|
82
82
|
"@angular/platform-browser": "^19.1.1",
|
|
83
83
|
"@angular/platform-browser-dynamic": "^19.1.1",
|
|
84
|
-
"@storybook/core-webpack": "10.0.0-beta.
|
|
84
|
+
"@storybook/core-webpack": "10.0.0-beta.10",
|
|
85
85
|
"@types/node": "^22.0.0",
|
|
86
|
-
"
|
|
87
|
-
"find-up": "^7.0.0",
|
|
86
|
+
"empathic": "^2.0.0",
|
|
88
87
|
"rimraf": "^6.0.1",
|
|
89
88
|
"typescript": "^5.8.3",
|
|
90
89
|
"webpack": "5",
|
|
@@ -104,7 +103,7 @@
|
|
|
104
103
|
"@angular/platform-browser": ">=18.0.0 < 21.0.0",
|
|
105
104
|
"@angular/platform-browser-dynamic": ">=18.0.0 < 21.0.0",
|
|
106
105
|
"rxjs": "^6.5.3 || ^7.4.0",
|
|
107
|
-
"storybook": "^10.0.0-beta.
|
|
106
|
+
"storybook": "^10.0.0-beta.10",
|
|
108
107
|
"typescript": "^4.9.0 || ^5.0.0",
|
|
109
108
|
"zone.js": ">=0.14.0"
|
|
110
109
|
},
|
package/start-schema.json
CHANGED
|
@@ -93,7 +93,10 @@
|
|
|
93
93
|
"compodocArgs": {
|
|
94
94
|
"type": "array",
|
|
95
95
|
"description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
|
|
96
|
-
"default": [
|
|
96
|
+
"default": [
|
|
97
|
+
"-e",
|
|
98
|
+
"json"
|
|
99
|
+
],
|
|
97
100
|
"items": {
|
|
98
101
|
"type": "string"
|
|
99
102
|
}
|
|
@@ -132,12 +135,18 @@
|
|
|
132
135
|
"description": "URL path to be appended when visiting Storybook for the first time"
|
|
133
136
|
},
|
|
134
137
|
"webpackStatsJson": {
|
|
135
|
-
"type": [
|
|
138
|
+
"type": [
|
|
139
|
+
"boolean",
|
|
140
|
+
"string"
|
|
141
|
+
],
|
|
136
142
|
"description": "Write Webpack Stats JSON to disk",
|
|
137
143
|
"default": false
|
|
138
144
|
},
|
|
139
145
|
"statsJson": {
|
|
140
|
-
"type": [
|
|
146
|
+
"type": [
|
|
147
|
+
"boolean",
|
|
148
|
+
"string"
|
|
149
|
+
],
|
|
141
150
|
"description": "Write stats JSON to disk",
|
|
142
151
|
"default": false
|
|
143
152
|
},
|
|
@@ -151,14 +160,16 @@
|
|
|
151
160
|
"pattern": "(silly|verbose|info|warn|silent)"
|
|
152
161
|
},
|
|
153
162
|
"sourceMap": {
|
|
154
|
-
"type": [
|
|
163
|
+
"type": [
|
|
164
|
+
"boolean",
|
|
165
|
+
"object"
|
|
166
|
+
],
|
|
155
167
|
"description": "Configure sourcemaps. See: https://angular.io/guide/workspace-config#source-map-configuration",
|
|
156
168
|
"default": false
|
|
157
169
|
},
|
|
158
170
|
"experimentalZoneless": {
|
|
159
171
|
"type": "boolean",
|
|
160
|
-
"description": "Experimental: Use zoneless change detection."
|
|
161
|
-
"default": false
|
|
172
|
+
"description": "Experimental: Use zoneless change detection."
|
|
162
173
|
}
|
|
163
174
|
},
|
|
164
175
|
"additionalProperties": false,
|
|
@@ -194,7 +205,11 @@
|
|
|
194
205
|
}
|
|
195
206
|
},
|
|
196
207
|
"additionalProperties": false,
|
|
197
|
-
"required": [
|
|
208
|
+
"required": [
|
|
209
|
+
"glob",
|
|
210
|
+
"input",
|
|
211
|
+
"output"
|
|
212
|
+
]
|
|
198
213
|
},
|
|
199
214
|
{
|
|
200
215
|
"type": "string"
|
|
@@ -222,7 +237,9 @@
|
|
|
222
237
|
}
|
|
223
238
|
},
|
|
224
239
|
"additionalProperties": false,
|
|
225
|
-
"required": [
|
|
240
|
+
"required": [
|
|
241
|
+
"input"
|
|
242
|
+
]
|
|
226
243
|
},
|
|
227
244
|
{
|
|
228
245
|
"type": "string",
|
|
@@ -231,4 +248,4 @@
|
|
|
231
248
|
]
|
|
232
249
|
}
|
|
233
250
|
}
|
|
234
|
-
}
|
|
251
|
+
}
|
|
@@ -13,7 +13,7 @@ const meta: Meta<ButtonComponent> = {
|
|
|
13
13
|
control: 'color',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#
|
|
16
|
+
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
|
|
17
17
|
args: { onClick: fn() },
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_x1uj59add6 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_x1uj59add6 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_x1uj59add6 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_x1uj59add6.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_x1uj59add6.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_x1uj59add6.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
var __defProp = Object.defineProperty;
|
|
13
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
__name
|
|
17
|
-
};
|
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_x1uj59add6 from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_x1uj59add6 from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_x1uj59add6 from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_x1uj59add6.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_x1uj59add6.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_x1uj59add6.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./chunk-2MYYSDON.js";
|
|
15
|
-
|
|
16
|
-
// ../../node_modules/find-up/index.js
|
|
17
|
-
import path2 from "node:path";
|
|
18
|
-
|
|
19
|
-
// ../../node_modules/locate-path/index.js
|
|
20
|
-
import process from "node:process";
|
|
21
|
-
import path from "node:path";
|
|
22
|
-
import fs, { promises as fsPromises } from "node:fs";
|
|
23
|
-
import { fileURLToPath } from "node:url";
|
|
24
|
-
|
|
25
|
-
// ../../node_modules/yocto-queue/index.js
|
|
26
|
-
var Node = class {
|
|
27
|
-
static {
|
|
28
|
-
__name(this, "Node");
|
|
29
|
-
}
|
|
30
|
-
value;
|
|
31
|
-
next;
|
|
32
|
-
constructor(value) {
|
|
33
|
-
this.value = value;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var Queue = class {
|
|
37
|
-
static {
|
|
38
|
-
__name(this, "Queue");
|
|
39
|
-
}
|
|
40
|
-
#head;
|
|
41
|
-
#tail;
|
|
42
|
-
#size;
|
|
43
|
-
constructor() {
|
|
44
|
-
this.clear();
|
|
45
|
-
}
|
|
46
|
-
enqueue(value) {
|
|
47
|
-
const node = new Node(value);
|
|
48
|
-
if (this.#head) {
|
|
49
|
-
this.#tail.next = node;
|
|
50
|
-
this.#tail = node;
|
|
51
|
-
} else {
|
|
52
|
-
this.#head = node;
|
|
53
|
-
this.#tail = node;
|
|
54
|
-
}
|
|
55
|
-
this.#size++;
|
|
56
|
-
}
|
|
57
|
-
dequeue() {
|
|
58
|
-
const current = this.#head;
|
|
59
|
-
if (!current) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
this.#head = this.#head.next;
|
|
63
|
-
this.#size--;
|
|
64
|
-
return current.value;
|
|
65
|
-
}
|
|
66
|
-
peek() {
|
|
67
|
-
if (!this.#head) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
return this.#head.value;
|
|
71
|
-
}
|
|
72
|
-
clear() {
|
|
73
|
-
this.#head = void 0;
|
|
74
|
-
this.#tail = void 0;
|
|
75
|
-
this.#size = 0;
|
|
76
|
-
}
|
|
77
|
-
get size() {
|
|
78
|
-
return this.#size;
|
|
79
|
-
}
|
|
80
|
-
*[Symbol.iterator]() {
|
|
81
|
-
let current = this.#head;
|
|
82
|
-
while (current) {
|
|
83
|
-
yield current.value;
|
|
84
|
-
current = current.next;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
*drain() {
|
|
88
|
-
while (this.#head) {
|
|
89
|
-
yield this.dequeue();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// ../../node_modules/locate-path/node_modules/p-limit/index.js
|
|
95
|
-
function pLimit(concurrency) {
|
|
96
|
-
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
97
|
-
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
98
|
-
}
|
|
99
|
-
const queue = new Queue();
|
|
100
|
-
let activeCount = 0;
|
|
101
|
-
const next = /* @__PURE__ */ __name(() => {
|
|
102
|
-
activeCount--;
|
|
103
|
-
if (queue.size > 0) {
|
|
104
|
-
queue.dequeue()();
|
|
105
|
-
}
|
|
106
|
-
}, "next");
|
|
107
|
-
const run = /* @__PURE__ */ __name(async (fn, resolve, args) => {
|
|
108
|
-
activeCount++;
|
|
109
|
-
const result = (async () => fn(...args))();
|
|
110
|
-
resolve(result);
|
|
111
|
-
try {
|
|
112
|
-
await result;
|
|
113
|
-
} catch {
|
|
114
|
-
}
|
|
115
|
-
next();
|
|
116
|
-
}, "run");
|
|
117
|
-
const enqueue = /* @__PURE__ */ __name((fn, resolve, args) => {
|
|
118
|
-
queue.enqueue(run.bind(void 0, fn, resolve, args));
|
|
119
|
-
(async () => {
|
|
120
|
-
await Promise.resolve();
|
|
121
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
122
|
-
queue.dequeue()();
|
|
123
|
-
}
|
|
124
|
-
})();
|
|
125
|
-
}, "enqueue");
|
|
126
|
-
const generator = /* @__PURE__ */ __name((fn, ...args) => new Promise((resolve) => {
|
|
127
|
-
enqueue(fn, resolve, args);
|
|
128
|
-
}), "generator");
|
|
129
|
-
Object.defineProperties(generator, {
|
|
130
|
-
activeCount: {
|
|
131
|
-
get: /* @__PURE__ */ __name(() => activeCount, "get")
|
|
132
|
-
},
|
|
133
|
-
pendingCount: {
|
|
134
|
-
get: /* @__PURE__ */ __name(() => queue.size, "get")
|
|
135
|
-
},
|
|
136
|
-
clearQueue: {
|
|
137
|
-
value: /* @__PURE__ */ __name(() => {
|
|
138
|
-
queue.clear();
|
|
139
|
-
}, "value")
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
return generator;
|
|
143
|
-
}
|
|
144
|
-
__name(pLimit, "pLimit");
|
|
145
|
-
|
|
146
|
-
// ../../node_modules/locate-path/node_modules/p-locate/index.js
|
|
147
|
-
var EndError = class extends Error {
|
|
148
|
-
static {
|
|
149
|
-
__name(this, "EndError");
|
|
150
|
-
}
|
|
151
|
-
constructor(value) {
|
|
152
|
-
super();
|
|
153
|
-
this.value = value;
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
var testElement = /* @__PURE__ */ __name(async (element, tester) => tester(await element), "testElement");
|
|
157
|
-
var finder = /* @__PURE__ */ __name(async (element) => {
|
|
158
|
-
const values = await Promise.all(element);
|
|
159
|
-
if (values[1] === true) {
|
|
160
|
-
throw new EndError(values[0]);
|
|
161
|
-
}
|
|
162
|
-
return false;
|
|
163
|
-
}, "finder");
|
|
164
|
-
async function pLocate(iterable, tester, {
|
|
165
|
-
concurrency = Number.POSITIVE_INFINITY,
|
|
166
|
-
preserveOrder = true
|
|
167
|
-
} = {}) {
|
|
168
|
-
const limit = pLimit(concurrency);
|
|
169
|
-
const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
|
|
170
|
-
const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);
|
|
171
|
-
try {
|
|
172
|
-
await Promise.all(items.map((element) => checkLimit(finder, element)));
|
|
173
|
-
} catch (error) {
|
|
174
|
-
if (error instanceof EndError) {
|
|
175
|
-
return error.value;
|
|
176
|
-
}
|
|
177
|
-
throw error;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
__name(pLocate, "pLocate");
|
|
181
|
-
|
|
182
|
-
// ../../node_modules/locate-path/index.js
|
|
183
|
-
var typeMappings = {
|
|
184
|
-
directory: "isDirectory",
|
|
185
|
-
file: "isFile"
|
|
186
|
-
};
|
|
187
|
-
function checkType(type) {
|
|
188
|
-
if (Object.hasOwnProperty.call(typeMappings, type)) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
throw new Error(`Invalid type specified: ${type}`);
|
|
192
|
-
}
|
|
193
|
-
__name(checkType, "checkType");
|
|
194
|
-
var matchType = /* @__PURE__ */ __name((type, stat) => stat[typeMappings[type]](), "matchType");
|
|
195
|
-
var toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath, "toPath");
|
|
196
|
-
async function locatePath(paths, {
|
|
197
|
-
cwd = process.cwd(),
|
|
198
|
-
type = "file",
|
|
199
|
-
allowSymlinks = true,
|
|
200
|
-
concurrency,
|
|
201
|
-
preserveOrder
|
|
202
|
-
} = {}) {
|
|
203
|
-
checkType(type);
|
|
204
|
-
cwd = toPath(cwd);
|
|
205
|
-
const statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;
|
|
206
|
-
return pLocate(paths, async (path_) => {
|
|
207
|
-
try {
|
|
208
|
-
const stat = await statFunction(path.resolve(cwd, path_));
|
|
209
|
-
return matchType(type, stat);
|
|
210
|
-
} catch {
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
}, { concurrency, preserveOrder });
|
|
214
|
-
}
|
|
215
|
-
__name(locatePath, "locatePath");
|
|
216
|
-
function locatePathSync(paths, {
|
|
217
|
-
cwd = process.cwd(),
|
|
218
|
-
type = "file",
|
|
219
|
-
allowSymlinks = true
|
|
220
|
-
} = {}) {
|
|
221
|
-
checkType(type);
|
|
222
|
-
cwd = toPath(cwd);
|
|
223
|
-
const statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;
|
|
224
|
-
for (const path_ of paths) {
|
|
225
|
-
try {
|
|
226
|
-
const stat = statFunction(path.resolve(cwd, path_), {
|
|
227
|
-
throwIfNoEntry: false
|
|
228
|
-
});
|
|
229
|
-
if (!stat) {
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
if (matchType(type, stat)) {
|
|
233
|
-
return path_;
|
|
234
|
-
}
|
|
235
|
-
} catch {
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
__name(locatePathSync, "locatePathSync");
|
|
240
|
-
|
|
241
|
-
// ../../node_modules/find-up/node_modules/unicorn-magic/node.js
|
|
242
|
-
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
243
|
-
function toPath2(urlOrPath) {
|
|
244
|
-
return urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
|
|
245
|
-
}
|
|
246
|
-
__name(toPath2, "toPath");
|
|
247
|
-
|
|
248
|
-
// ../../node_modules/find-up/index.js
|
|
249
|
-
var findUpStop = Symbol("findUpStop");
|
|
250
|
-
async function findUpMultiple(name, options = {}) {
|
|
251
|
-
let directory = path2.resolve(toPath2(options.cwd) ?? "");
|
|
252
|
-
const { root } = path2.parse(directory);
|
|
253
|
-
const stopAt = path2.resolve(directory, toPath2(options.stopAt ?? root));
|
|
254
|
-
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
255
|
-
const paths = [name].flat();
|
|
256
|
-
const runMatcher = /* @__PURE__ */ __name(async (locateOptions) => {
|
|
257
|
-
if (typeof name !== "function") {
|
|
258
|
-
return locatePath(paths, locateOptions);
|
|
259
|
-
}
|
|
260
|
-
const foundPath = await name(locateOptions.cwd);
|
|
261
|
-
if (typeof foundPath === "string") {
|
|
262
|
-
return locatePath([foundPath], locateOptions);
|
|
263
|
-
}
|
|
264
|
-
return foundPath;
|
|
265
|
-
}, "runMatcher");
|
|
266
|
-
const matches = [];
|
|
267
|
-
while (true) {
|
|
268
|
-
const foundPath = await runMatcher({ ...options, cwd: directory });
|
|
269
|
-
if (foundPath === findUpStop) {
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
if (foundPath) {
|
|
273
|
-
matches.push(path2.resolve(directory, foundPath));
|
|
274
|
-
}
|
|
275
|
-
if (directory === stopAt || matches.length >= limit) {
|
|
276
|
-
break;
|
|
277
|
-
}
|
|
278
|
-
directory = path2.dirname(directory);
|
|
279
|
-
}
|
|
280
|
-
return matches;
|
|
281
|
-
}
|
|
282
|
-
__name(findUpMultiple, "findUpMultiple");
|
|
283
|
-
function findUpMultipleSync(name, options = {}) {
|
|
284
|
-
let directory = path2.resolve(toPath2(options.cwd) ?? "");
|
|
285
|
-
const { root } = path2.parse(directory);
|
|
286
|
-
const stopAt = path2.resolve(directory, toPath2(options.stopAt) ?? root);
|
|
287
|
-
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
288
|
-
const paths = [name].flat();
|
|
289
|
-
const runMatcher = /* @__PURE__ */ __name((locateOptions) => {
|
|
290
|
-
if (typeof name !== "function") {
|
|
291
|
-
return locatePathSync(paths, locateOptions);
|
|
292
|
-
}
|
|
293
|
-
const foundPath = name(locateOptions.cwd);
|
|
294
|
-
if (typeof foundPath === "string") {
|
|
295
|
-
return locatePathSync([foundPath], locateOptions);
|
|
296
|
-
}
|
|
297
|
-
return foundPath;
|
|
298
|
-
}, "runMatcher");
|
|
299
|
-
const matches = [];
|
|
300
|
-
while (true) {
|
|
301
|
-
const foundPath = runMatcher({ ...options, cwd: directory });
|
|
302
|
-
if (foundPath === findUpStop) {
|
|
303
|
-
break;
|
|
304
|
-
}
|
|
305
|
-
if (foundPath) {
|
|
306
|
-
matches.push(path2.resolve(directory, foundPath));
|
|
307
|
-
}
|
|
308
|
-
if (directory === stopAt || matches.length >= limit) {
|
|
309
|
-
break;
|
|
310
|
-
}
|
|
311
|
-
directory = path2.dirname(directory);
|
|
312
|
-
}
|
|
313
|
-
return matches;
|
|
314
|
-
}
|
|
315
|
-
__name(findUpMultipleSync, "findUpMultipleSync");
|
|
316
|
-
async function findUp(name, options = {}) {
|
|
317
|
-
const matches = await findUpMultiple(name, { ...options, limit: 1 });
|
|
318
|
-
return matches[0];
|
|
319
|
-
}
|
|
320
|
-
__name(findUp, "findUp");
|
|
321
|
-
function findUpSync(name, options = {}) {
|
|
322
|
-
const matches = findUpMultipleSync(name, { ...options, limit: 1 });
|
|
323
|
-
return matches[0];
|
|
324
|
-
}
|
|
325
|
-
__name(findUpSync, "findUpSync");
|
|
326
|
-
|
|
327
|
-
export {
|
|
328
|
-
findUp,
|
|
329
|
-
findUpSync
|
|
330
|
-
};
|
package/preset.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dist/preset.js';
|