histoire 0.17.16 → 1.0.0-alpha.1
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/client.d.ts +5 -5
- package/client.js +2 -2
- package/dist/controls.d.ts +1 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/node/alias.d.ts +1 -0
- package/dist/node/alias.d.ts.map +1 -0
- package/dist/node/alias.js +1 -1
- package/dist/node/bin.d.ts +1 -0
- package/dist/node/bin.d.ts.map +1 -0
- package/dist/node/bin.js +1 -1
- package/dist/node/build-serialize.d.ts +2 -1
- package/dist/node/build-serialize.d.ts.map +1 -0
- package/dist/node/build.d.ts +2 -1
- package/dist/node/build.d.ts.map +1 -0
- package/dist/node/build.js +11 -9
- package/dist/node/builtin-plugins/pinceau-tokens.d.ts +2 -1
- package/dist/node/builtin-plugins/pinceau-tokens.d.ts.map +1 -0
- package/dist/node/builtin-plugins/pinceau-tokens.js +4 -4
- package/dist/node/builtin-plugins/tailwind-tokens.d.ts +1 -0
- package/dist/node/builtin-plugins/tailwind-tokens.d.ts.map +1 -0
- package/dist/node/builtin-plugins/tailwind-tokens.js +5 -3
- package/dist/node/builtin-plugins/vanilla-support/MountStory.d.ts +5 -4
- package/dist/node/builtin-plugins/vanilla-support/MountStory.d.ts.map +1 -0
- package/dist/node/builtin-plugins/vanilla-support/MountStory.js +1 -1
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.d.ts +10 -9
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.d.ts.map +1 -0
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.js +3 -4
- package/dist/node/builtin-plugins/vanilla-support/client.d.ts +1 -0
- package/dist/node/builtin-plugins/vanilla-support/client.d.ts.map +1 -0
- package/dist/node/builtin-plugins/vanilla-support/collect.d.ts +1 -0
- package/dist/node/builtin-plugins/vanilla-support/collect.d.ts.map +1 -0
- package/dist/node/builtin-plugins/vanilla-support/plugin.d.ts +1 -0
- package/dist/node/builtin-plugins/vanilla-support/plugin.d.ts.map +1 -0
- package/dist/node/builtin-plugins/vanilla-support/plugin.js +1 -1
- package/dist/node/builtin-plugins/vanilla-support/types.d.ts +2 -1
- package/dist/node/builtin-plugins/vanilla-support/types.d.ts.map +1 -0
- package/dist/node/builtin-plugins/vanilla-support/vanilla.story.d.ts +1 -0
- package/dist/node/builtin-plugins/vanilla-support/vanilla.story.d.ts.map +1 -0
- package/dist/node/collect/index.d.ts +2 -1
- package/dist/node/collect/index.d.ts.map +1 -0
- package/dist/node/collect/index.js +7 -7
- package/dist/node/collect/run.d.ts +1 -0
- package/dist/node/collect/run.d.ts.map +1 -0
- package/dist/node/collect/worker.d.ts +2 -2
- package/dist/node/collect/worker.d.ts.map +1 -0
- package/dist/node/collect/worker.js +7 -7
- package/dist/node/colors.d.ts +1 -0
- package/dist/node/colors.d.ts.map +1 -0
- package/dist/node/colors.js +6 -6
- package/dist/node/commands/build.d.ts +1 -0
- package/dist/node/commands/build.d.ts.map +1 -0
- package/dist/node/commands/build.js +0 -2
- package/dist/node/commands/dev.d.ts +1 -0
- package/dist/node/commands/dev.d.ts.map +1 -0
- package/dist/node/commands/preview.d.ts +1 -0
- package/dist/node/commands/preview.d.ts.map +1 -0
- package/dist/node/config.d.ts +6 -5
- package/dist/node/config.d.ts.map +1 -0
- package/dist/node/config.js +18 -18
- package/dist/node/context.d.ts +3 -2
- package/dist/node/context.d.ts.map +1 -0
- package/dist/node/dom/dom-keys.d.ts +1 -0
- package/dist/node/dom/dom-keys.d.ts.map +1 -0
- package/dist/node/dom/env.d.ts +1 -0
- package/dist/node/dom/env.d.ts.map +1 -0
- package/dist/node/dom/env.js +6 -6
- package/dist/node/dom/util.d.ts +1 -0
- package/dist/node/dom/util.d.ts.map +1 -0
- package/dist/node/dom/util.js +8 -12
- package/dist/node/index.d.ts +3 -2
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +2 -2
- package/dist/node/load.d.ts +2 -1
- package/dist/node/load.d.ts.map +1 -0
- package/dist/node/load.js +3 -3
- package/dist/node/markdown.d.ts +2 -1
- package/dist/node/markdown.d.ts.map +1 -0
- package/dist/node/markdown.js +25 -16
- package/dist/node/plugin.d.ts +8 -5
- package/dist/node/plugin.d.ts.map +1 -0
- package/dist/node/plugin.js +1 -2
- package/dist/node/preview.d.ts +1 -0
- package/dist/node/preview.d.ts.map +1 -0
- package/dist/node/search.d.ts +4 -3
- package/dist/node/search.d.ts.map +1 -0
- package/dist/node/search.js +7 -49
- package/dist/node/server.d.ts +2 -1
- package/dist/node/server.d.ts.map +1 -0
- package/dist/node/server.js +10 -8
- package/dist/node/stories.d.ts +3 -3
- package/dist/node/stories.d.ts.map +1 -0
- package/dist/node/stories.js +15 -7
- package/dist/node/tree.d.ts +2 -1
- package/dist/node/tree.d.ts.map +1 -0
- package/dist/node/tree.js +1 -1
- package/dist/node/util/find-up.d.ts +1 -0
- package/dist/node/util/find-up.d.ts.map +1 -0
- package/dist/node/util/find-up.js +1 -1
- package/dist/node/util/fs.d.ts +1 -0
- package/dist/node/util/fs.d.ts.map +1 -0
- package/dist/node/util/log.d.ts +1 -0
- package/dist/node/util/log.d.ts.map +1 -0
- package/dist/node/util/slugify.d.ts +2 -1
- package/dist/node/util/slugify.d.ts.map +1 -0
- package/dist/node/util/slugify.js +3 -3
- package/dist/node/util/vendors.d.ts +1 -0
- package/dist/node/util/vendors.d.ts.map +1 -0
- package/dist/node/util/vendors.js +7 -2
- package/dist/node/vendors/controls.d.ts +1 -0
- package/dist/node/vendors/controls.d.ts.map +1 -0
- package/dist/node/vendors/vue.d.ts +1 -0
- package/dist/node/vendors/vue.d.ts.map +1 -0
- package/dist/node/virtual/index.d.ts +13 -12
- package/dist/node/virtual/index.d.ts.map +1 -0
- package/dist/node/virtual/index.js +19 -19
- package/dist/node/virtual/markdown.d.ts +2 -1
- package/dist/node/virtual/markdown.d.ts.map +1 -0
- package/dist/node/virtual/markdown.js +2 -2
- package/dist/node/virtual/noop.d.ts +1 -0
- package/dist/node/virtual/noop.d.ts.map +1 -0
- package/dist/node/virtual/resolved-commands.d.ts +2 -1
- package/dist/node/virtual/resolved-commands.d.ts.map +1 -0
- package/dist/node/virtual/resolved-commands.js +2 -2
- package/dist/node/virtual/resolved-config.d.ts +2 -1
- package/dist/node/virtual/resolved-config.d.ts.map +1 -0
- package/dist/node/virtual/resolved-config.js +2 -2
- package/dist/node/virtual/resolved-generated-global-setup.d.ts +2 -1
- package/dist/node/virtual/resolved-generated-global-setup.d.ts.map +1 -0
- package/dist/node/virtual/resolved-generated-global-setup.js +2 -2
- package/dist/node/virtual/resolved-generated-setup-code.d.ts +2 -1
- package/dist/node/virtual/resolved-generated-setup-code.d.ts.map +1 -0
- package/dist/node/virtual/resolved-generated-setup-code.js +2 -2
- package/dist/node/virtual/resolved-markdown-files.d.ts +2 -1
- package/dist/node/virtual/resolved-markdown-files.d.ts.map +1 -0
- package/dist/node/virtual/resolved-markdown-files.js +2 -2
- package/dist/node/virtual/resolved-stories.d.ts +2 -1
- package/dist/node/virtual/resolved-stories.d.ts.map +1 -0
- package/dist/node/virtual/resolved-stories.js +3 -3
- package/dist/node/virtual/resolved-support-plugins-client.d.ts +2 -1
- package/dist/node/virtual/resolved-support-plugins-client.d.ts.map +1 -0
- package/dist/node/virtual/resolved-support-plugins-client.js +2 -2
- package/dist/node/virtual/resolved-support-plugins-collect.d.ts +2 -1
- package/dist/node/virtual/resolved-support-plugins-collect.d.ts.map +1 -0
- package/dist/node/virtual/resolved-support-plugins-collect.js +2 -2
- package/dist/node/virtual/resolved-theme.d.ts +2 -1
- package/dist/node/virtual/resolved-theme.d.ts.map +1 -0
- package/dist/node/virtual/resolved-theme.js +2 -2
- package/dist/node/virtual/story-source.d.ts +2 -1
- package/dist/node/virtual/story-source.d.ts.map +1 -0
- package/dist/node/virtual/story-source.js +2 -2
- package/dist/node/virtual/story.d.ts +2 -1
- package/dist/node/virtual/story.d.ts.map +1 -0
- package/dist/node/virtual/story.js +2 -2
- package/dist/node/virtual/util.d.ts +1 -0
- package/dist/node/virtual/util.d.ts.map +1 -0
- package/dist/node/virtual/vite-plugin.d.ts +2 -1
- package/dist/node/virtual/vite-plugin.d.ts.map +1 -0
- package/dist/node/virtual/vite-plugin.js +121 -119
- package/dist/node/vite.d.ts +3 -2
- package/dist/node/vite.d.ts.map +1 -0
- package/dist/node/vite.js +7 -9
- package/package.json +39 -43
- package/plugin.d.ts +2 -2
- package/plugin.js +2 -2
- package/src/node/__tests__/markdown.spec.ts +11 -9
- package/src/node/__tests__/tree.spec.ts +7 -7
- package/src/node/alias.ts +1 -1
- package/src/node/bin.ts +1 -1
- package/src/node/build-serialize.ts +7 -7
- package/src/node/build.ts +34 -28
- package/src/node/builtin-plugins/pinceau-tokens.ts +9 -9
- package/src/node/builtin-plugins/tailwind-tokens.ts +12 -9
- package/src/node/builtin-plugins/vanilla-support/MountStory.ts +6 -7
- package/src/node/builtin-plugins/vanilla-support/RenderStory.ts +13 -14
- package/src/node/builtin-plugins/vanilla-support/client.ts +1 -1
- package/src/node/builtin-plugins/vanilla-support/collect.ts +3 -2
- package/src/node/builtin-plugins/vanilla-support/plugin.ts +4 -4
- package/src/node/builtin-plugins/vanilla-support/types.ts +2 -2
- package/src/node/collect/index.ts +21 -19
- package/src/node/collect/run.ts +1 -1
- package/src/node/collect/worker.ts +12 -12
- package/src/node/colors.ts +7 -7
- package/src/node/commands/build.ts +1 -4
- package/src/node/commands/dev.ts +5 -4
- package/src/node/commands/preview.ts +1 -1
- package/src/node/config.ts +40 -36
- package/src/node/context.ts +6 -5
- package/src/node/dom/env.ts +9 -9
- package/src/node/dom/util.ts +13 -13
- package/src/node/index.ts +2 -2
- package/src/node/load.ts +11 -10
- package/src/node/markdown.ts +48 -34
- package/src/node/plugin.ts +23 -24
- package/src/node/preview.ts +7 -5
- package/src/node/search.ts +14 -60
- package/src/node/server.ts +25 -18
- package/src/node/stories.ts +27 -17
- package/src/node/tree.ts +21 -16
- package/src/node/util/find-up.ts +2 -2
- package/src/node/util/log.ts +3 -2
- package/src/node/util/slugify.ts +2 -2
- package/src/node/util/vendors.ts +8 -3
- package/src/node/virtual/index.ts +19 -19
- package/src/node/virtual/markdown.ts +1 -1
- package/src/node/virtual/resolved-commands.ts +4 -3
- package/src/node/virtual/resolved-config.ts +1 -1
- package/src/node/virtual/resolved-generated-global-setup.ts +3 -2
- package/src/node/virtual/resolved-generated-setup-code.ts +1 -1
- package/src/node/virtual/resolved-markdown-files.ts +1 -1
- package/src/node/virtual/resolved-stories.ts +8 -8
- package/src/node/virtual/resolved-support-plugins-client.ts +2 -2
- package/src/node/virtual/resolved-support-plugins-collect.ts +2 -2
- package/src/node/virtual/resolved-theme.ts +2 -2
- package/src/node/virtual/story-source.ts +4 -3
- package/src/node/virtual/story.ts +1 -1
- package/src/node/virtual/vite-plugin.ts +134 -130
- package/src/node/vite.ts +35 -33
- package/tsconfig.json +21 -19
package/client.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @deprecated
|
|
3
3
|
*/
|
|
4
|
-
export function hstEvent
|
|
4
|
+
export function hstEvent(name: string, argument): void
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Logs an event to the 'Events' sidepane.
|
|
8
8
|
* @param name Event name
|
|
9
9
|
* @param argument Additional log data displayed when inspecting the event.
|
|
10
10
|
*/
|
|
11
|
-
export function logEvent
|
|
11
|
+
export function logEvent(name: string, argument): void
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Returns `true` when in the NodeJS server while collecting stories.
|
|
15
15
|
*/
|
|
16
|
-
export function isCollecting
|
|
16
|
+
export function isCollecting(): boolean
|
|
17
17
|
|
|
18
|
-
export function toggleDark
|
|
19
|
-
export function isDark
|
|
18
|
+
export function toggleDark(value?: boolean): boolean
|
|
19
|
+
export function isDark(): boolean
|
package/client.js
CHANGED
|
@@ -2,14 +2,14 @@ import { logEvent } from '@histoire/app'
|
|
|
2
2
|
|
|
3
3
|
export * from '@histoire/app'
|
|
4
4
|
|
|
5
|
-
export function isCollecting
|
|
5
|
+
export function isCollecting() {
|
|
6
6
|
return process.env.HST_COLLECT === 'true'
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated
|
|
11
11
|
*/
|
|
12
|
-
export function hstEvent
|
|
12
|
+
export function hstEvent(...args) {
|
|
13
13
|
console.warn(`'hstEvent' is deprecated. Use 'logEvent' instead.`)
|
|
14
14
|
return logEvent(...args)
|
|
15
15
|
}
|
package/dist/controls.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
package/dist/node/alias.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alias.d.ts","sourceRoot":"","sources":["../../src/node/alias.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,QAAoH,CAAA;AAEzI,eAAO,MAAM,SAAS,QAAwD,CAAA"}
|
package/dist/node/alias.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import path from 'pathe';
|
|
2
1
|
import { createRequire } from 'node:module';
|
|
2
|
+
import path from 'pathe';
|
|
3
3
|
const require = createRequire(import.meta.url);
|
|
4
4
|
export const APP_PATH = path.join(path.dirname(require.resolve('@histoire/app/package.json')), process.env.HISTOIRE_DEV ? 'src' : 'dist');
|
|
5
5
|
export const TEMP_PATH = path.join(process.cwd(), 'node_modules', '.histoire');
|
package/dist/node/bin.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/node/bin.ts"],"names":[],"mappings":""}
|
package/dist/node/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import { dirname, resolve } from 'pathe';
|
|
3
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname, resolve } from 'pathe';
|
|
4
4
|
import sade from 'sade';
|
|
5
5
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
6
|
const { version } = JSON.parse(fs.readFileSync(resolve(__dirname, '../../package.json'), 'utf8'));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Context } from './context.js';
|
|
2
1
|
import type { ServerStory } from '@histoire/shared';
|
|
2
|
+
import type { Context } from './context.js';
|
|
3
3
|
interface SerializedStory extends Omit<ServerStory, 'docsText'> {
|
|
4
4
|
relativePath: string;
|
|
5
5
|
supportPluginId: string;
|
|
@@ -19,3 +19,4 @@ interface SerializedStoryData {
|
|
|
19
19
|
}
|
|
20
20
|
export declare function getSerializedStoryData(ctx: Context): SerializedStoryData;
|
|
21
21
|
export {};
|
|
22
|
+
//# sourceMappingURL=build-serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-serialize.d.ts","sourceRoot":"","sources":["../../src/node/build-serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,UAAU,eAAgB,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IAC7D,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,sBAAsB,CAAA;CACtC;AAED,UAAU,sBAAsB;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,OAAO,CAAA;IACzB,WAAW,CAAC,EAAE,GAAG,CAAA;CAClB;AAED,UAAU,mBAAmB;IAC3B,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,aAAa,EAAE,sBAAsB,EAAE,CAAA;CACxC;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CAsCxE"}
|
package/dist/node/build.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/node/build.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AA+B3C,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,iBA6MvC"}
|
package/dist/node/build.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { build as viteBuild, createServer as createViteServer, mergeConfig as mergeViteConfig, } from 'vite';
|
|
1
|
+
import { performance } from 'node:perf_hooks';
|
|
3
2
|
import fs from 'fs-extra';
|
|
4
3
|
import { lookup as lookupMime } from 'mrmime';
|
|
4
|
+
import { join } from 'pathe';
|
|
5
5
|
import pc from 'picocolors';
|
|
6
|
-
import {
|
|
6
|
+
import { createServer as createViteServer, mergeConfig as mergeViteConfig, build as viteBuild, } from 'vite';
|
|
7
7
|
import { APP_PATH } from './alias.js';
|
|
8
|
-
import {
|
|
9
|
-
import { findAllStories } from './stories.js';
|
|
8
|
+
import { getSerializedStoryData } from './build-serialize.js';
|
|
10
9
|
import { useCollectStories } from './collect/index.js';
|
|
11
|
-
import { BuildPluginApi } from './plugin.js';
|
|
12
10
|
import { useModuleLoader } from './load.js';
|
|
13
|
-
import { startPreview } from './preview.js';
|
|
14
11
|
import { createMarkdownFilesWatcher } from './markdown.js';
|
|
15
|
-
import {
|
|
12
|
+
import { BuildPluginApi } from './plugin.js';
|
|
13
|
+
import { startPreview } from './preview.js';
|
|
14
|
+
import { findAllStories } from './stories.js';
|
|
15
|
+
import { getViteConfigWithPlugins } from './vite.js';
|
|
16
16
|
const PRELOAD_MODULES = [
|
|
17
17
|
'vendor',
|
|
18
18
|
];
|
|
@@ -30,7 +30,9 @@ export async function build(ctx) {
|
|
|
30
30
|
await stop();
|
|
31
31
|
}
|
|
32
32
|
const { viteConfig } = await getViteConfigWithPlugins(true, ctx);
|
|
33
|
-
const server = await createViteServer(viteConfig
|
|
33
|
+
const server = await createViteServer(mergeViteConfig(viteConfig, {
|
|
34
|
+
optimizeDeps: { include: [], noDiscovery: true },
|
|
35
|
+
}));
|
|
34
36
|
await server.pluginContainer.buildStart({});
|
|
35
37
|
const moduleLoader = useModuleLoader({
|
|
36
38
|
server,
|
|
@@ -3,4 +3,5 @@ export interface PinceauTokensOptions {
|
|
|
3
3
|
configOrPaths?: string | string[];
|
|
4
4
|
configFileName?: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function pinceauTokens(
|
|
6
|
+
export declare function pinceauTokens(_options?: PinceauTokensOptions): Plugin;
|
|
7
|
+
//# sourceMappingURL=pinceau-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pinceau-tokens.d.ts","sourceRoot":"","sources":["../../../src/node/builtin-plugins/pinceau-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,kBAAkB,CAAA;AAI7D,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACjC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,wBAAgB,aAAa,CAAC,QAAQ,GAAE,oBAAyB,GAAG,MAAM,CA2DzE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getInjectedImport } from '../util/vendors.js';
|
|
2
1
|
import { join } from 'pathe';
|
|
3
|
-
|
|
2
|
+
import { getInjectedImport } from '../util/vendors.js';
|
|
3
|
+
export function pinceauTokens(_options = {}) {
|
|
4
4
|
const themePath = join(process.cwd(), 'node_modules/.vite/pinceau/index.js');
|
|
5
5
|
async function generate(api) {
|
|
6
6
|
try {
|
|
@@ -54,7 +54,7 @@ export function pinceauTokens(options = {}) {
|
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
function storyTemplate(pinceauConfig) {
|
|
58
58
|
pinceauConfig = pinceauConfig?.theme || pinceauConfig?.default?.theme || {};
|
|
59
59
|
return `import 'histoire-style'
|
|
60
60
|
import './style.css'
|
|
@@ -419,7 +419,7 @@ export default {
|
|
|
419
419
|
},
|
|
420
420
|
],
|
|
421
421
|
}`;
|
|
422
|
-
}
|
|
422
|
+
}
|
|
423
423
|
const css = `.__hst-shade {
|
|
424
424
|
height: 80px;
|
|
425
425
|
border-radius: 4px;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind-tokens.d.ts","sourceRoot":"","sources":["../../../src/node/builtin-plugins/tailwind-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,kBAAkB,CAAA;AAI7D,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,MAAM,CA2E1E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getInjectedImport } from '../util/vendors.js';
|
|
2
1
|
import { findUp } from '../util/find-up.js';
|
|
2
|
+
import { getInjectedImport } from '../util/vendors.js';
|
|
3
3
|
export function tailwindTokens(options = {}) {
|
|
4
4
|
const tailwindConfigFile = options.configFile ?? findUp(process.cwd(), [
|
|
5
5
|
'tailwind.config.js',
|
|
@@ -19,7 +19,7 @@ export function tailwindTokens(options = {}) {
|
|
|
19
19
|
await api.fs.writeFile(api.path.resolve(api.pluginTempDir, 'style.css'), css);
|
|
20
20
|
const tailwindConfig = await api.moduleLoader.loadModule(tailwindConfigFile);
|
|
21
21
|
const { default: resolveConfig } = await import('tailwindcss/resolveConfig.js');
|
|
22
|
-
const resolvedTailwindConfig = resolveConfig(tailwindConfig);
|
|
22
|
+
const resolvedTailwindConfig = resolveConfig(tailwindConfig.default ?? tailwindConfig);
|
|
23
23
|
const storyFile = api.path.resolve(api.pluginTempDir, 'Tailwind.story.js');
|
|
24
24
|
await api.fs.writeFile(storyFile, storyTemplate(resolvedTailwindConfig));
|
|
25
25
|
api.addStoryFile(storyFile);
|
|
@@ -71,7 +71,8 @@ export function tailwindTokens(options = {}) {
|
|
|
71
71
|
},
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
function storyTemplate(tailwindConfig) {
|
|
75
|
+
return `import 'histoire-style'
|
|
75
76
|
import './style.css'
|
|
76
77
|
import { createApp, h, markRaw, ref } from ${getInjectedImport('@histoire/vendors/vue')}
|
|
77
78
|
import {
|
|
@@ -435,6 +436,7 @@ export default {
|
|
|
435
436
|
},
|
|
436
437
|
],
|
|
437
438
|
}`;
|
|
439
|
+
}
|
|
438
440
|
const css = `.__hst-shade {
|
|
439
441
|
height: 80px;
|
|
440
442
|
border-radius: 4px;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { PropType as _PropType } from '@histoire/vendors/vue';
|
|
2
1
|
import type { Story } from '@histoire/shared';
|
|
3
|
-
|
|
2
|
+
import type { PropType as _PropType } from '@histoire/vendors/vue';
|
|
3
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
4
4
|
story: {
|
|
5
5
|
type: _PropType<Story>;
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
}>, void, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
9
9
|
story: {
|
|
10
10
|
type: _PropType<Story>;
|
|
11
11
|
required: true;
|
|
12
12
|
};
|
|
13
|
-
}
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
14
14
|
export default _default;
|
|
15
|
+
//# sourceMappingURL=MountStory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MountStory.d.ts","sourceRoot":"","sources":["../../../../src/node/builtin-plugins/vanilla-support/MountStory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;;;cAS5C,SAAS,CAAC,KAAK,CAAC;;;;;cAAhB,SAAS,CAAC,KAAK,CAAC;;;;AALtC,wBA2CE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PropType as _PropType } from '@histoire/vendors/vue';
|
|
2
1
|
import type { Story, Variant } from '@histoire/shared';
|
|
3
|
-
|
|
2
|
+
import type { PropType as _PropType } from '@histoire/vendors/vue';
|
|
3
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
|
|
4
4
|
variant: {
|
|
5
5
|
type: _PropType<Variant>;
|
|
6
6
|
required: true;
|
|
@@ -13,11 +13,11 @@ declare const _default: import("@histoire/vendors/vue").DefineComponent<{
|
|
|
13
13
|
type: StringConstructor;
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
-
}
|
|
17
|
-
sandbox: import("@vue/reactivity").Ref<HTMLDivElement>;
|
|
18
|
-
},
|
|
16
|
+
}>, {
|
|
17
|
+
sandbox: import("@vue/reactivity").Ref<HTMLDivElement, HTMLDivElement>;
|
|
18
|
+
}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {
|
|
19
19
|
ready: () => true;
|
|
20
|
-
}, string, import("@
|
|
20
|
+
}, string, import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
|
|
21
21
|
variant: {
|
|
22
22
|
type: _PropType<Variant>;
|
|
23
23
|
required: true;
|
|
@@ -30,9 +30,10 @@ declare const _default: import("@histoire/vendors/vue").DefineComponent<{
|
|
|
30
30
|
type: StringConstructor;
|
|
31
31
|
default: string;
|
|
32
32
|
};
|
|
33
|
-
}>> & {
|
|
33
|
+
}>> & Readonly<{
|
|
34
34
|
onReady?: () => any;
|
|
35
|
-
}
|
|
35
|
+
}>, {
|
|
36
36
|
slotName: string;
|
|
37
|
-
}, {}>;
|
|
37
|
+
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
|
|
38
38
|
export default _default;
|
|
39
|
+
//# sourceMappingURL=RenderStory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderStory.d.ts","sourceRoot":"","sources":["../../../../src/node/builtin-plugins/vanilla-support/RenderStory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAA;;;cAoB5C,SAAS,CAAC,OAAO,CAAC;;;;cAKlB,SAAS,CAAC,KAAK,CAAC;;;;;;;;;;;;;cALhB,SAAS,CAAC,OAAO,CAAC;;;;cAKlB,SAAS,CAAC,KAAK,CAAC;;;;;;;;;;;;AAVtC,wBAmJE"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineComponent as _defineComponent, onBeforeUnmount as _onBeforeUnmount, onMounted as _onMounted, ref as _ref, watch as _watch, h as _h, } from '@histoire/vendors/vue';
|
|
3
|
-
// @ts-expect-error virtual module id
|
|
4
|
-
import * as setup from 'virtual:$histoire-setup';
|
|
1
|
+
import { defineComponent as _defineComponent, h as _h, onBeforeUnmount as _onBeforeUnmount, onMounted as _onMounted, ref as _ref, watch as _watch, } from '@histoire/vendors/vue';
|
|
5
2
|
// @ts-expect-error virtual module id
|
|
6
3
|
import * as generatedSetup from 'virtual:$histoire-generated-global-setup';
|
|
4
|
+
// @ts-expect-error virtual module id
|
|
5
|
+
import * as setup from 'virtual:$histoire-setup';
|
|
7
6
|
export default _defineComponent({
|
|
8
7
|
name: 'RenderStory',
|
|
9
8
|
props: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/node/builtin-plugins/vanilla-support/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAA;AAEtD,wBAAgB,kBAAkB,SAEjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../../../src/node/builtin-plugins/vanilla-support/collect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA8B,MAAM,kBAAkB,CAAA;AAGpF,wBAAsB,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,gBAAgB,iBAuC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/node/builtin-plugins/vanilla-support/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAM9C,wBAAgB,cAAc,IAAI,MAAM,CA4BvC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Awaitable, Story, StoryProps, Variant, VariantProps } from '@histoire/shared';
|
|
2
2
|
export interface App {
|
|
3
3
|
el: HTMLElement;
|
|
4
4
|
onMount?: () => void;
|
|
@@ -33,3 +33,4 @@ export interface VariantOptions extends Omit<VariantProps, 'setupApp'>, CommonPr
|
|
|
33
33
|
}
|
|
34
34
|
export declare function defineStory(story: StoryOptions): StoryOptions;
|
|
35
35
|
export {};
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/node/builtin-plugins/vanilla-support/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE3F,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,WAAW,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,WAAW,CAAA;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,OAAO,KAAK,SAAS,CAAC,IAAI,CAAC,CAAA;IAChD,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,OAAO,KAAK,SAAS,CAAC,IAAI,CAAC,CAAA;CAClD;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,SAAS,CAAC,IAAI,CAAC,CAAA;IAC5C,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,SAAS,CAAC,IAAI,CAAC,CAAA;CACrD;AAED,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAA;CAC9E;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,UAAU,GAAG;IACrF,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CAAC,GAAG;IACH,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;IAC3B,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,eAAe,CAAC,EAAE,KAAK,CAAA;CACxB,CAAC,CAAA;AAEF,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,EAAE,UAAU;CAE9F;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,gBAE9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vanilla.story.d.ts","sourceRoot":"","sources":["../../../../src/node/builtin-plugins/vanilla-support/vanilla.story.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;wBA8DtC,YAAY;AA5DjB,wBA4DiB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ViteDevServer } from 'vite';
|
|
2
1
|
import type { ServerStoryFile } from '@histoire/shared';
|
|
2
|
+
import type { ViteDevServer } from 'vite';
|
|
3
3
|
import type { Context } from '../context.js';
|
|
4
4
|
export interface UseCollectStoriesOptions {
|
|
5
5
|
server: ViteDevServer;
|
|
@@ -11,3 +11,4 @@ export declare function useCollectStories(options: UseCollectStoriesOptions, ctx
|
|
|
11
11
|
executeStoryFile: (storyFile: ServerStoryFile) => Promise<void>;
|
|
12
12
|
destroy: () => Promise<void>;
|
|
13
13
|
};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/collect/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAEzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAY5C,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,aAAa,CAAA;IACrB,UAAU,CAAC,EAAE,aAAa,CAAA;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,EAAE,GAAG,EAAE,OAAO;;kCAyEpC,eAAe;;EA+D3D"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { cpus } from 'node:os';
|
|
1
2
|
import { MessageChannel } from 'node:worker_threads';
|
|
2
|
-
import { ViteNodeServer } from 'vite-node/server';
|
|
3
|
-
import { relative } from 'pathe';
|
|
4
|
-
import pc from 'picocolors';
|
|
5
3
|
import Tinypool from '@akryum/tinypool';
|
|
6
4
|
import { createBirpc } from 'birpc';
|
|
7
|
-
import {
|
|
5
|
+
import { relative } from 'pathe';
|
|
6
|
+
import pc from 'picocolors';
|
|
7
|
+
import { ViteNodeServer } from 'vite-node/server';
|
|
8
8
|
import { createPath } from '../tree.js';
|
|
9
9
|
import { slash } from '../util/fs.js';
|
|
10
10
|
export function useCollectStories(options, ctx) {
|
|
@@ -14,8 +14,8 @@ export function useCollectStories(options, ctx) {
|
|
|
14
14
|
inline: [
|
|
15
15
|
/histoire\/dist/,
|
|
16
16
|
/histoire\/client/,
|
|
17
|
-
/@histoire\/[\w
|
|
18
|
-
/histoire-[\w
|
|
17
|
+
/@histoire\/[\w-]+\/dist/,
|
|
18
|
+
/histoire-[\w-]+\/dist/,
|
|
19
19
|
/@vue\/devtools-api/,
|
|
20
20
|
/vuetify/,
|
|
21
21
|
// @TODO temporary fix for https://github.com/histoire-dev/histoire/issues/409
|
|
@@ -47,7 +47,7 @@ export function useCollectStories(options, ctx) {
|
|
|
47
47
|
const port = channel.port2;
|
|
48
48
|
const workerPort = channel.port1;
|
|
49
49
|
createBirpc({
|
|
50
|
-
fetchModule:
|
|
50
|
+
fetchModule: id => node.fetchModule(id),
|
|
51
51
|
resolveId: (id, importer) => node.resolveId(id, importer),
|
|
52
52
|
}, {
|
|
53
53
|
post: data => port.postMessage(data),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/node/collect/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAIxD,wBAAsB,GAAG,CAAC,OAAO,EAAE,gBAAgB,gBAIlD"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ServerStory, ServerStoryFile } from '@histoire/shared';
|
|
2
2
|
import type { MessagePort } from 'node:worker_threads';
|
|
3
|
-
import type { ServerStoryFile, ServerStory } from '@histoire/shared';
|
|
4
3
|
export interface Payload {
|
|
5
4
|
root: string;
|
|
6
5
|
base: string;
|
|
@@ -12,3 +11,4 @@ export interface ReturnData {
|
|
|
12
11
|
}
|
|
13
12
|
declare const _default: (payload: Payload) => Promise<ReturnData>;
|
|
14
13
|
export default _default;
|
|
14
|
+
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/node/collect/worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAatD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,EAAE,eAAe,CAAA;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,WAAW,EAAE,CAAA;CACzB;kCAgB8B,OAAO,KAAG,OAAO,CAAC,UAAU,CAAC;AAA5D,wBAyDC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { performance } from 'node:perf_hooks';
|
|
1
2
|
import { fileURLToPath } from 'node:url';
|
|
2
3
|
import { parentPort } from 'node:worker_threads';
|
|
3
|
-
import { performance } from 'node:perf_hooks';
|
|
4
|
-
import { ModuleCacheMap, ViteNodeRunner } from 'vite-node/client';
|
|
5
4
|
import { createBirpc } from 'birpc';
|
|
6
5
|
import { dirname, resolve } from 'pathe';
|
|
7
6
|
import pc from 'picocolors';
|
|
7
|
+
import { ModuleCacheMap, ViteNodeRunner } from 'vite-node/client';
|
|
8
8
|
import { createDomEnv } from '../dom/env.js';
|
|
9
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
10
|
const _moduleCache = new ModuleCacheMap();
|
|
11
11
|
let _runner;
|
|
12
12
|
let _rpc;
|
|
13
13
|
// Cleanup module cache
|
|
14
|
-
parentPort.on('message', message => {
|
|
14
|
+
parentPort.on('message', (message) => {
|
|
15
15
|
if (message?.kind === 'hst:invalidate') {
|
|
16
16
|
_moduleCache.delete(message.file);
|
|
17
17
|
}
|
|
@@ -36,10 +36,10 @@ export default async (payload) => {
|
|
|
36
36
|
}));
|
|
37
37
|
const { destroy: destroyDomEnv } = createDomEnv();
|
|
38
38
|
const el = window.document.createElement('div');
|
|
39
|
-
const
|
|
39
|
+
const beforeExecuteTime = performance.now();
|
|
40
40
|
// Mount app to collect stories/variants
|
|
41
41
|
const { run } = (await runner.executeFile(resolve(__dirname, './run.js')));
|
|
42
|
-
const
|
|
42
|
+
const afterExecuteTime = performance.now();
|
|
43
43
|
const storyData = [];
|
|
44
44
|
await run({
|
|
45
45
|
file: payload.storyFile,
|
|
@@ -51,13 +51,13 @@ export default async (payload) => {
|
|
|
51
51
|
const el = document.createElement('div');
|
|
52
52
|
el.innerHTML = payload.storyFile.markdownFile.html;
|
|
53
53
|
const text = el.textContent;
|
|
54
|
-
storyData.forEach(s => {
|
|
54
|
+
storyData.forEach((s) => {
|
|
55
55
|
s.docsText = text;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
destroyDomEnv();
|
|
59
59
|
const endTime = performance.now();
|
|
60
|
-
console.log(pc.dim(`${payload.storyFile.relativePath} ${Math.round(endTime - startTime)}ms (setup:${Math.round(
|
|
60
|
+
console.log(pc.dim(`${payload.storyFile.relativePath} ${Math.round(endTime - startTime)}ms (setup:${Math.round(beforeExecuteTime - startTime)}ms, execute:${Math.round(afterExecuteTime - beforeExecuteTime)}ms, run:${Math.round(afterRunTime - afterExecuteTime)}ms)`));
|
|
61
61
|
return {
|
|
62
62
|
storyData,
|
|
63
63
|
};
|
package/dist/node/colors.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/node/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwRzB,CAAA;AAcD,wBAAgB,UAAU,CAAC,KAAK,KAAA;;;;EA6C/B"}
|
package/dist/node/colors.js
CHANGED
|
@@ -280,12 +280,12 @@ export const defaultColors = {
|
|
|
280
280
|
},
|
|
281
281
|
};
|
|
282
282
|
const HEX = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;
|
|
283
|
-
const SHORT_HEX = /^#([a-f\d])
|
|
283
|
+
const SHORT_HEX = /^#([a-f\d]){3,4}$/i;
|
|
284
284
|
const VALUE = `(?:\\d+|\\d*\\.\\d+)%?`;
|
|
285
285
|
const SEP = `(?:\\s*,\\s*|\\s+)`;
|
|
286
286
|
const ALPHA_SEP = `\\s*[,/]\\s*`;
|
|
287
287
|
const RGB = new RegExp(`^rgba?\\(\\s*(${VALUE})${SEP}(${VALUE})${SEP}(${VALUE})(?:${ALPHA_SEP}(${VALUE}))?\\s*\\)$`);
|
|
288
|
-
const HSL = new RegExp(`^hsla?\\(\\s*(
|
|
288
|
+
const HSL = new RegExp(`^hsla?\\(\\s*(${VALUE}(?:deg|rad|grad|turn)?)${SEP}(${VALUE})${SEP}(${VALUE})(?:${ALPHA_SEP}(${VALUE}))?\\s*\\)$`);
|
|
289
289
|
export function parseColor(value) {
|
|
290
290
|
if (typeof value !== 'string') {
|
|
291
291
|
return null;
|
|
@@ -300,15 +300,15 @@ export function parseColor(value) {
|
|
|
300
300
|
if (hex !== null) {
|
|
301
301
|
return {
|
|
302
302
|
mode: 'rgb',
|
|
303
|
-
color: [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)].map(
|
|
304
|
-
alpha: hex[4] ? (parseInt(hex[4], 16) / 255).toString() : undefined,
|
|
303
|
+
color: [Number.parseInt(hex[1], 16), Number.parseInt(hex[2], 16), Number.parseInt(hex[3], 16)].map(v => v.toString()),
|
|
304
|
+
alpha: hex[4] ? (Number.parseInt(hex[4], 16) / 255).toString() : undefined,
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
const rgbMatch = value.match(RGB);
|
|
308
308
|
if (rgbMatch !== null) {
|
|
309
309
|
return {
|
|
310
310
|
mode: 'rgb',
|
|
311
|
-
color: [rgbMatch[1], rgbMatch[2], rgbMatch[3]].map(
|
|
311
|
+
color: [rgbMatch[1], rgbMatch[2], rgbMatch[3]].map(v => v.toString()),
|
|
312
312
|
alpha: rgbMatch[4]?.toString?.(),
|
|
313
313
|
};
|
|
314
314
|
}
|
|
@@ -316,7 +316,7 @@ export function parseColor(value) {
|
|
|
316
316
|
if (hslMatch !== null) {
|
|
317
317
|
return {
|
|
318
318
|
mode: 'hsl',
|
|
319
|
-
color: [hslMatch[1], hslMatch[2], hslMatch[3]].map(
|
|
319
|
+
color: [hslMatch[1], hslMatch[2], hslMatch[3]].map(v => v.toString()),
|
|
320
320
|
alpha: hslMatch[4]?.toString?.(),
|
|
321
321
|
};
|
|
322
322
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/node/commands/build.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBAMvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/node/commands/dev.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,iBAmDnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/node/commands/preview.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,iBAa3D"}
|