poveste 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controls.d.ts +0 -1
- package/dist/node/alias.d.ts +0 -1
- package/dist/node/bin.d.ts +0 -1
- package/dist/node/build-serialize.d.ts +0 -1
- package/dist/node/build.d.ts +0 -1
- package/dist/node/builtin-plugins/pinceau-tokens.d.ts +0 -1
- package/dist/node/builtin-plugins/vanilla-support/MountStory.d.ts +0 -1
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.d.ts +0 -1
- package/dist/node/builtin-plugins/vanilla-support/client.d.ts +0 -1
- package/dist/node/builtin-plugins/vanilla-support/collect.d.ts +0 -1
- package/dist/node/builtin-plugins/vanilla-support/plugin.d.ts +0 -1
- package/dist/node/builtin-plugins/vanilla-support/types.d.ts +0 -1
- package/dist/node/builtin-plugins/vanilla-support/vanilla.story.d.ts +0 -1
- package/dist/node/collect/index.d.ts +0 -1
- package/dist/node/collect/run.d.ts +0 -1
- package/dist/node/collect/worker.d.ts +0 -1
- package/dist/node/colors.d.ts +0 -1
- package/dist/node/commands/build.d.ts +0 -1
- package/dist/node/commands/dev.d.ts +0 -1
- package/dist/node/commands/port.d.ts +0 -1
- package/dist/node/commands/preview.d.ts +0 -1
- package/dist/node/config.d.ts +0 -1
- package/dist/node/context.d.ts +0 -1
- package/dist/node/dom/dom-keys.d.ts +0 -1
- package/dist/node/dom/env.d.ts +0 -1
- package/dist/node/dom/util.d.ts +0 -1
- package/dist/node/index.d.ts +0 -1
- package/dist/node/load.d.ts +0 -1
- package/dist/node/markdown.d.ts +0 -1
- package/dist/node/plugin.d.ts +0 -1
- package/dist/node/preview.d.ts +0 -1
- package/dist/node/search.d.ts +0 -1
- package/dist/node/server.d.ts +0 -1
- package/dist/node/stories.d.ts +0 -1
- package/dist/node/style-isolation/entry-css-merger.d.ts +0 -1
- package/dist/node/style-isolation/global-styles.d.ts +0 -1
- package/dist/node/style-isolation/index.d.ts +0 -1
- package/dist/node/style-isolation/scope-chrome.d.ts +0 -1
- package/dist/node/style-isolation/selectors.d.ts +0 -1
- package/dist/node/style-isolation/transforms.d.ts +0 -1
- package/dist/node/style-isolation/vite-plugin.d.ts +0 -1
- package/dist/node/tree.d.ts +0 -1
- package/dist/node/util/find-up.d.ts +0 -1
- package/dist/node/util/fs.d.ts +0 -1
- package/dist/node/util/head.d.ts +0 -1
- package/dist/node/util/log.d.ts +0 -1
- package/dist/node/util/slugify.d.ts +0 -1
- package/dist/node/util/vendors.d.ts +0 -1
- package/dist/node/util/watch-ignore.d.ts +0 -1
- package/dist/node/vendors/controls.d.ts +0 -1
- package/dist/node/vendors/vue.d.ts +0 -1
- package/dist/node/virtual/index.d.ts +0 -1
- package/dist/node/virtual/markdown.d.ts +0 -1
- package/dist/node/virtual/noop.d.ts +0 -1
- package/dist/node/virtual/resolved-commands.d.ts +0 -1
- package/dist/node/virtual/resolved-config.d.ts +0 -1
- package/dist/node/virtual/resolved-generated-global-setup.d.ts +0 -1
- package/dist/node/virtual/resolved-generated-setup-code.d.ts +0 -1
- package/dist/node/virtual/resolved-markdown-files.d.ts +0 -1
- package/dist/node/virtual/resolved-stories.d.ts +0 -1
- package/dist/node/virtual/resolved-support-plugins-client.d.ts +0 -1
- package/dist/node/virtual/resolved-support-plugins-collect.d.ts +0 -1
- package/dist/node/virtual/resolved-theme.d.ts +0 -1
- package/dist/node/virtual/story-source.d.ts +0 -1
- package/dist/node/virtual/story.d.ts +0 -1
- package/dist/node/virtual/util.d.ts +0 -1
- package/dist/node/virtual/vite-plugin.d.ts +0 -1
- package/dist/node/vite.d.ts +0 -1
- package/package.json +36 -6
- package/dist/controls.d.ts.map +0 -1
- package/dist/node/alias.d.ts.map +0 -1
- package/dist/node/bin.d.ts.map +0 -1
- package/dist/node/build-serialize.d.ts.map +0 -1
- package/dist/node/build.d.ts.map +0 -1
- package/dist/node/builtin-plugins/pinceau-tokens.d.ts.map +0 -1
- package/dist/node/builtin-plugins/vanilla-support/MountStory.d.ts.map +0 -1
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.d.ts.map +0 -1
- package/dist/node/builtin-plugins/vanilla-support/client.d.ts.map +0 -1
- package/dist/node/builtin-plugins/vanilla-support/collect.d.ts.map +0 -1
- package/dist/node/builtin-plugins/vanilla-support/plugin.d.ts.map +0 -1
- package/dist/node/builtin-plugins/vanilla-support/types.d.ts.map +0 -1
- package/dist/node/builtin-plugins/vanilla-support/vanilla.story.d.ts.map +0 -1
- package/dist/node/collect/index.d.ts.map +0 -1
- package/dist/node/collect/run.d.ts.map +0 -1
- package/dist/node/collect/worker.d.ts.map +0 -1
- package/dist/node/colors.d.ts.map +0 -1
- package/dist/node/commands/build.d.ts.map +0 -1
- package/dist/node/commands/dev.d.ts.map +0 -1
- package/dist/node/commands/port.d.ts.map +0 -1
- package/dist/node/commands/preview.d.ts.map +0 -1
- package/dist/node/config.d.ts.map +0 -1
- package/dist/node/context.d.ts.map +0 -1
- package/dist/node/dom/dom-keys.d.ts.map +0 -1
- package/dist/node/dom/env.d.ts.map +0 -1
- package/dist/node/dom/util.d.ts.map +0 -1
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/load.d.ts.map +0 -1
- package/dist/node/markdown.d.ts.map +0 -1
- package/dist/node/plugin.d.ts.map +0 -1
- package/dist/node/preview.d.ts.map +0 -1
- package/dist/node/search.d.ts.map +0 -1
- package/dist/node/server.d.ts.map +0 -1
- package/dist/node/stories.d.ts.map +0 -1
- package/dist/node/style-isolation/entry-css-merger.d.ts.map +0 -1
- package/dist/node/style-isolation/global-styles.d.ts.map +0 -1
- package/dist/node/style-isolation/index.d.ts.map +0 -1
- package/dist/node/style-isolation/scope-chrome.d.ts.map +0 -1
- package/dist/node/style-isolation/selectors.d.ts.map +0 -1
- package/dist/node/style-isolation/transforms.d.ts.map +0 -1
- package/dist/node/style-isolation/vite-plugin.d.ts.map +0 -1
- package/dist/node/tree.d.ts.map +0 -1
- package/dist/node/util/find-up.d.ts.map +0 -1
- package/dist/node/util/fs.d.ts.map +0 -1
- package/dist/node/util/head.d.ts.map +0 -1
- package/dist/node/util/log.d.ts.map +0 -1
- package/dist/node/util/slugify.d.ts.map +0 -1
- package/dist/node/util/vendors.d.ts.map +0 -1
- package/dist/node/util/watch-ignore.d.ts.map +0 -1
- package/dist/node/vendors/controls.d.ts.map +0 -1
- package/dist/node/vendors/vue.d.ts.map +0 -1
- package/dist/node/virtual/index.d.ts.map +0 -1
- package/dist/node/virtual/markdown.d.ts.map +0 -1
- package/dist/node/virtual/noop.d.ts.map +0 -1
- package/dist/node/virtual/resolved-commands.d.ts.map +0 -1
- package/dist/node/virtual/resolved-config.d.ts.map +0 -1
- package/dist/node/virtual/resolved-generated-global-setup.d.ts.map +0 -1
- package/dist/node/virtual/resolved-generated-setup-code.d.ts.map +0 -1
- package/dist/node/virtual/resolved-markdown-files.d.ts.map +0 -1
- package/dist/node/virtual/resolved-stories.d.ts.map +0 -1
- package/dist/node/virtual/resolved-support-plugins-client.d.ts.map +0 -1
- package/dist/node/virtual/resolved-support-plugins-collect.d.ts.map +0 -1
- package/dist/node/virtual/resolved-theme.d.ts.map +0 -1
- package/dist/node/virtual/story-source.d.ts.map +0 -1
- package/dist/node/virtual/story.d.ts.map +0 -1
- package/dist/node/virtual/util.d.ts.map +0 -1
- package/dist/node/virtual/vite-plugin.d.ts.map +0 -1
- package/dist/node/vite.d.ts.map +0 -1
- package/src/controls.ts +0 -1
- package/src/node/__tests__/config.spec.ts +0 -25
- package/src/node/__tests__/dom-env.spec.ts +0 -97
- package/src/node/__tests__/head.spec.ts +0 -32
- package/src/node/__tests__/markdown/test1.story.md +0 -7
- package/src/node/__tests__/markdown/test2.story.md +0 -5
- package/src/node/__tests__/markdown.spec.ts +0 -61
- package/src/node/__tests__/port.spec.ts +0 -65
- package/src/node/__tests__/tree.spec.ts +0 -109
- package/src/node/__tests__/virtual-setup.spec.ts +0 -61
- package/src/node/__tests__/watch-ignore.spec.ts +0 -33
- package/src/node/alias.ts +0 -8
- package/src/node/bin.ts +0 -46
- package/src/node/build-serialize.ts +0 -62
- package/src/node/build.ts +0 -339
- package/src/node/builtin-plugins/pinceau-tokens.ts +0 -523
- package/src/node/builtin-plugins/vanilla-support/MountStory.ts +0 -49
- package/src/node/builtin-plugins/vanilla-support/RenderStory.ts +0 -167
- package/src/node/builtin-plugins/vanilla-support/client.ts +0 -6
- package/src/node/builtin-plugins/vanilla-support/collect.ts +0 -43
- package/src/node/builtin-plugins/vanilla-support/plugin.ts +0 -35
- package/src/node/builtin-plugins/vanilla-support/types.ts +0 -42
- package/src/node/builtin-plugins/vanilla-support/vanilla.story.ts +0 -63
- package/src/node/collect/index.ts +0 -164
- package/src/node/collect/run.ts +0 -9
- package/src/node/collect/worker.ts +0 -103
- package/src/node/colors.ts +0 -340
- package/src/node/commands/build.ts +0 -14
- package/src/node/commands/dev.ts +0 -70
- package/src/node/commands/port.ts +0 -41
- package/src/node/commands/preview.ts +0 -30
- package/src/node/config.ts +0 -396
- package/src/node/context.ts +0 -60
- package/src/node/dom/dom-keys.ts +0 -238
- package/src/node/dom/env.ts +0 -123
- package/src/node/dom/util.ts +0 -83
- package/src/node/index.ts +0 -7
- package/src/node/load.ts +0 -59
- package/src/node/markdown.ts +0 -280
- package/src/node/plugin.ts +0 -95
- package/src/node/preview.ts +0 -45
- package/src/node/search.ts +0 -84
- package/src/node/server.ts +0 -258
- package/src/node/stories.ts +0 -145
- package/src/node/style-isolation/__tests__/entry-css-merger.spec.ts +0 -145
- package/src/node/style-isolation/__tests__/transforms.spec.ts +0 -200
- package/src/node/style-isolation/__tests__/vite-plugin.spec.ts +0 -39
- package/src/node/style-isolation/entry-css-merger.ts +0 -134
- package/src/node/style-isolation/global-styles.ts +0 -37
- package/src/node/style-isolation/index.ts +0 -5
- package/src/node/style-isolation/scope-chrome.ts +0 -42
- package/src/node/style-isolation/selectors.ts +0 -19
- package/src/node/style-isolation/transforms.ts +0 -163
- package/src/node/style-isolation/vite-plugin.ts +0 -75
- package/src/node/tree.ts +0 -158
- package/src/node/util/find-up.ts +0 -24
- package/src/node/util/fs.ts +0 -1
- package/src/node/util/head.ts +0 -12
- package/src/node/util/log.ts +0 -10
- package/src/node/util/slugify.ts +0 -26
- package/src/node/util/vendors.ts +0 -27
- package/src/node/util/watch-ignore.ts +0 -13
- package/src/node/vendors/controls.ts +0 -1
- package/src/node/vendors/vue.ts +0 -1
- package/src/node/virtual/index.ts +0 -50
- package/src/node/virtual/markdown.ts +0 -21
- package/src/node/virtual/noop.ts +0 -9
- package/src/node/virtual/resolved-commands.ts +0 -42
- package/src/node/virtual/resolved-config.ts +0 -12
- package/src/node/virtual/resolved-generated-global-setup.ts +0 -33
- package/src/node/virtual/resolved-generated-setup-code.ts +0 -7
- package/src/node/virtual/resolved-markdown-files.ts +0 -19
- package/src/node/virtual/resolved-stories.ts +0 -44
- package/src/node/virtual/resolved-support-plugins-client.ts +0 -14
- package/src/node/virtual/resolved-support-plugins-collect.ts +0 -14
- package/src/node/virtual/resolved-theme.ts +0 -14
- package/src/node/virtual/story-source.ts +0 -18
- package/src/node/virtual/story.ts +0 -9
- package/src/node/virtual/util.ts +0 -41
- package/src/node/virtual/vite-plugin.ts +0 -146
- package/src/node/vite.ts +0 -438
- package/tsconfig.json +0 -44
- package/vitest.config.ts +0 -10
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/node/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAG3C,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,OAAO;;;YA8CtB,MAAM;cAAQ,MAAM;;GAvBvD;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,OAAO;;;YAqBpB,MAAM;cAAQ,MAAM;;GAJvD;AAuBD,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG,UAexC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/node/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAc3C,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACxB;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,GAAE,mBAAwB;;;;GA4OjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stories.d.ts","sourceRoot":"","sources":["../../src/node/stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAQ3C,KAAK,kBAAkB,GAAG,CAAC,IAAI,CAAC,EAAE,eAAe,KAAK,OAAO,CAAA;AAG7D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,kBAAkB,QAExD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,eAAe,QAIvD;AAED,KAAK,sBAAsB,GAAG,MAAM,OAAO,CAAA;AAG3C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,QAEhE;AAED,wBAAgB,qBAAqB,SAIpC;AAID,wBAAsB,YAAY,CAAC,UAAU,EAAE,OAAO,yCAgCrD;AAMD,wBAAgB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,mBA0C5E;AAED,wBAAgB,WAAW,CAAC,gBAAgB,EAAE,MAAM,QAInD;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,OAAO,iBAWvD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-css-merger.d.ts","sourceRoot":"","sources":["../../../src/node/style-isolation/entry-css-merger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAKhD,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,OAAO,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,qBAAgD,GAAG,UAAU,CA8FvG;AAMD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAsBxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global-styles.d.ts","sourceRoot":"","sources":["../../../src/node/style-isolation/global-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAOhD,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,UAAU,CAoB9E;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/style-isolation/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scope-chrome.d.ts","sourceRoot":"","sources":["../../../src/node/style-isolation/scope-chrome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAKhD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,UAAU,CAgBlF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/node/style-isolation/selectors.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc,sBAAsB,CAAA;AACjD,eAAO,MAAM,gBAAgB,4BAA4B,CAAA;AAIzD,eAAO,MAAM,oBAAoB,mEAAmE,CAAA;AAGpG,eAAO,MAAM,aAAa,6BAA6B,CAAA;AACvD,eAAO,MAAM,cAAc,qBAAqB,CAAA;AAChD,eAAO,MAAM,kBAAkB,yBAAyB,CAAA;AAGxD,eAAO,MAAM,kBAAkB,yBAAyB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["../../../src/node/style-isolation/transforms.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,qGAAqG;IACrG,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,CAWlE;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAc7E;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAKlD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../src/node/style-isolation/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAIhD,eAAO,MAAM,mBAAmB,+BAA+B,CAAA;AAC/D,eAAO,MAAM,iBAAiB,6BAA6B,CAAA;AAE3D,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACvB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,UAAU,CAsB9E;AAsBD,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAG/C"}
|
package/dist/node/tree.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/node/tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,UAAU,EACV,cAAc,EAEf,MAAM,iBAAiB,CAAA;AAGxB,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,YAmBrE;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,cA+HvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-up.d.ts","sourceRoot":"","sources":["../../../src/node/util/find-up.ts"],"names":[],"mappings":"AAGA,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAsB,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAoB/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../src/node/util/fs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,QAAS,MAAM,WAA4B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"head.d.ts","sourceRoot":"","sources":["../../../src/node/util/head.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGhD,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAQtG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/node/util/log.ts"],"names":[],"mappings":"AAEA,wBAAsB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,iBAO/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../../src/node/util/slugify.ts"],"names":[],"mappings":"AASA,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgB3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vendors.d.ts","sourceRoot":"","sources":["../../../src/node/util/vendors.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,QAA+C,CAAA;AAQrE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,UAahD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"watch-ignore.d.ts","sourceRoot":"","sources":["../../../src/node/util/watch-ignore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAMpC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,UACvD,MAAM,UAAU,KAAK,KAAG,OAAO,CAK9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../src/node/vendors/controls.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../../src/node/vendors/vue.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,6BAA6B,CAAA;AACpD,eAAO,MAAM,mBAAmB,0CAA+B,CAAA;AAE/D,eAAO,MAAM,QAAQ,2BAA2B,CAAA;AAChD,eAAO,MAAM,OAAO,0BAA0B,CAAA;AAC9C,eAAO,MAAM,SAAS,4BAA4B,CAAA;AAElD,eAAO,MAAM,kBAAkB,8BAAmB,CAAA;AAClD,eAAO,MAAM,QAAQ,2BAA2B,CAAA;AAEhD,eAAO,MAAM,iBAAiB,iCAAsB,CAAA;AACpD,eAAO,MAAM,oBAAoB,uCAAuC,CAAA;AAExE,eAAO,MAAM,6BAA6B,yCAA8B,CAAA;AACxE,eAAO,MAAM,mBAAmB,sCAAsC,CAAA;AAEtE,eAAO,MAAM,4BAA4B,wCAA6B,CAAA;AACtE,eAAO,MAAM,sBAAsB,4CAA4C,CAAA;AAE/E,eAAO,MAAM,+BAA+B,8CAAgC,CAAA;AAC5E,eAAO,MAAM,oBAAoB,0CAA0C,CAAA;AAE3E,eAAO,MAAM,6BAA6B,4CAA8B,CAAA;AACxE,eAAO,MAAM,sBAAsB,4CAA4C,CAAA;AAE/E,eAAO,MAAM,+BAA+B,8CAAgC,CAAA;AAC5E,eAAO,MAAM,uBAAuB,6CAA6C,CAAA;AAEjF,eAAO,MAAM,gCAAgC,+CAAiC,CAAA;AAC9E,eAAO,MAAM,cAAc,oCAAoC,CAAA;AAE/D,eAAO,MAAM,uBAAuB,sCAAwB,CAAA;AAC5D,eAAO,MAAM,QAAQ,8BAA8B,CAAA;AACnD,eAAO,MAAM,iBAAiB,2CAA6B,CAAA;AAE3D,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sCAAsC,CAAA;AACpD,cAAc,oCAAoC,CAAA;AAClD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,uBAAuB,CAAA;AACrC,cAAc,sCAAsC,CAAA;AACpD,cAAc,uCAAuC,CAAA;AACrD,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,UAkBhD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/noop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,wBAAgB,IAAI,CAAC,GAAG,EAAE,OAAO,UAKhC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-commands.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAI5C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,UAY5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-config.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,UAS1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-generated-global-setup.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-generated-global-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAI5C,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,OAAO,UA4BxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-generated-setup-code.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-generated-setup-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,OAGlE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-markdown-files.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-markdown-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,UAejD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-stories.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,UAwC3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-support-plugins-client.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-support-plugins-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,OAAO,UAOxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-support-plugins-collect.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-support-plugins-collect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,OAAO,UAOzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolved-theme.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/resolved-theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,UAUzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"story-source.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/story-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAI5C,wBAAsB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,mBAazD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"story.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/story.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,UAM7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,YAE3C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO;;;IAK5C;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,UAEhD;AAED,eAAO,MAAM,gBAAgB,UAE5B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../src/node/virtual/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAyIjE,UAAU,CAChB"}
|
package/dist/node/vite.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/node/vite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAGb,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAuB3C,wBAAsB,sBAAsB,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,EAAE,OAAO,yBAmClF;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,YAAY,CAAA;IACxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B;AAED,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA+W9G"}
|
package/src/controls.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@poveste/controls'
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { getDefaultConfig, mergeConfig } from '../config.js'
|
|
3
|
-
|
|
4
|
-
// `mergeConfig(user, defaults)`: defu-style, the first argument wins.
|
|
5
|
-
describe('mergeConfig', () => {
|
|
6
|
-
it('adds user storyIgnored patterns to the defaults instead of replacing them', () => {
|
|
7
|
-
const merged = mergeConfig({ storyIgnored: ['**/fixtures/**'] }, getDefaultConfig())
|
|
8
|
-
|
|
9
|
-
expect(merged.storyIgnored).toEqual(expect.arrayContaining(['**/node_modules/**', '**/dist/**', '**/fixtures/**']))
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
it('does not duplicate a default a user spelled out again', () => {
|
|
13
|
-
const merged = mergeConfig({ storyIgnored: ['**/node_modules/**', '**/fixtures/**'] }, getDefaultConfig())
|
|
14
|
-
|
|
15
|
-
expect(merged.storyIgnored.filter(p => p === '**/node_modules/**')).toHaveLength(1)
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
// Narrowing the match is a real use — `src/**/*.story.vue` to skip binary
|
|
19
|
-
// folders — so the replace rule is the right one there.
|
|
20
|
-
it('still lets a user narrow storyMatch', () => {
|
|
21
|
-
const merged = mergeConfig({ storyMatch: ['src/**/*.story.vue'] }, getDefaultConfig())
|
|
22
|
-
|
|
23
|
-
expect(merged.storyMatch).toEqual(['src/**/*.story.vue'])
|
|
24
|
-
})
|
|
25
|
-
})
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
2
|
-
import { createDomEnv, resetDomEnv } from '../dom/env.js'
|
|
3
|
-
|
|
4
|
-
describe('createDomEnv', () => {
|
|
5
|
-
let env: ReturnType<typeof createDomEnv>
|
|
6
|
-
let errorSpy: ReturnType<typeof vi.spyOn>
|
|
7
|
-
|
|
8
|
-
afterEach(() => {
|
|
9
|
-
env?.destroy()
|
|
10
|
-
errorSpy?.mockRestore()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
describe('when a stylesheet contains CSS jsdom cannot parse', () => {
|
|
14
|
-
// An unparseable selector is one of the few inputs jsdom 28+ still reports
|
|
15
|
-
// a css-parsing jsdomError for, so it is what keeps this guard honest.
|
|
16
|
-
// Remove the suppression in `env.ts` and this test fails.
|
|
17
|
-
it('does not log a css-parsing jsdomError', () => {
|
|
18
|
-
errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
|
|
19
|
-
env = createDomEnv()
|
|
20
|
-
const style = env.window.document.createElement('style')
|
|
21
|
-
style.textContent = '.btn[[[ { color: red }'
|
|
22
|
-
|
|
23
|
-
env.window.document.head.appendChild(style)
|
|
24
|
-
|
|
25
|
-
expect(errorSpy).not.toHaveBeenCalled()
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
// The symptom that motivated the suppression. jsdom now drops the unknown
|
|
29
|
-
// at-rule silently and keeps the rest of the sheet, so this passes on its
|
|
30
|
-
// own merits — it is here to catch a regression, not to cover the guard.
|
|
31
|
-
it('parses a Tailwind v4 @theme sheet without complaining', () => {
|
|
32
|
-
errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
|
|
33
|
-
env = createDomEnv()
|
|
34
|
-
const style = env.window.document.createElement('style')
|
|
35
|
-
style.textContent = '@theme { --color-brand: oklch(0.7 0.1 200); }\n.btn { color: var(--color-brand) }'
|
|
36
|
-
|
|
37
|
-
env.window.document.head.appendChild(style)
|
|
38
|
-
|
|
39
|
-
expect(errorSpy).not.toHaveBeenCalled()
|
|
40
|
-
expect(env.window.document.styleSheets[0].cssRules).toHaveLength(1)
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
describe('when a script throws an unhandled exception', () => {
|
|
45
|
-
it('forwards the error to console.error', () => {
|
|
46
|
-
errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {})
|
|
47
|
-
env = createDomEnv()
|
|
48
|
-
const script = env.window.document.createElement('script')
|
|
49
|
-
script.textContent = 'throw new Error("boom from story script")'
|
|
50
|
-
|
|
51
|
-
env.window.document.head.appendChild(script)
|
|
52
|
-
|
|
53
|
-
expect(errorSpy).toHaveBeenCalledWith(expect.stringContaining('boom from story script'))
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
describe('resetDomEnv', () => {
|
|
59
|
-
let env: ReturnType<typeof createDomEnv>
|
|
60
|
-
|
|
61
|
-
afterEach(() => {
|
|
62
|
-
env?.destroy()
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('returns a dirtied environment to its pristine state', () => {
|
|
66
|
-
env = createDomEnv()
|
|
67
|
-
const doc = env.window.document
|
|
68
|
-
|
|
69
|
-
doc.body.classList.add('theme-dark')
|
|
70
|
-
doc.documentElement.setAttribute('lang', 'fr')
|
|
71
|
-
doc.body.append(doc.createElement('div'))
|
|
72
|
-
doc.head.append(doc.createElement('style'))
|
|
73
|
-
// Proxied onto the global only on some node versions.
|
|
74
|
-
env.window.localStorage?.setItem('seen', '1')
|
|
75
|
-
;(env.window as any).__setupInstalled = true
|
|
76
|
-
|
|
77
|
-
resetDomEnv(env)
|
|
78
|
-
|
|
79
|
-
expect(doc.body.getAttributeNames()).toEqual([])
|
|
80
|
-
expect(doc.documentElement.getAttributeNames()).toEqual([])
|
|
81
|
-
expect(doc.body.children).toHaveLength(0)
|
|
82
|
-
expect(doc.head.children).toHaveLength(0)
|
|
83
|
-
expect(env.window.localStorage?.getItem('seen') ?? null).toBeNull()
|
|
84
|
-
// A setup marking itself installed would skip later stories in the worker.
|
|
85
|
-
expect((env.window as any).__setupInstalled).toBeUndefined()
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
it('leaves the globals the environment itself installed', () => {
|
|
89
|
-
env = createDomEnv()
|
|
90
|
-
|
|
91
|
-
resetDomEnv(env)
|
|
92
|
-
|
|
93
|
-
expect(typeof env.window.ResizeObserver).toBe('function')
|
|
94
|
-
expect(typeof env.window.matchMedia).toBe('function')
|
|
95
|
-
expect(env.window.document.body).toBeTruthy()
|
|
96
|
-
})
|
|
97
|
-
})
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { applyHeadTransform } from '../util/head.js'
|
|
3
|
-
|
|
4
|
-
const BASE_HTML = '<!DOCTYPE html><html><head><meta charset="utf-8"></head><body></body></html>'
|
|
5
|
-
|
|
6
|
-
describe('applyHeadTransform', () => {
|
|
7
|
-
it('returns the html untouched when head is undefined', async () => {
|
|
8
|
-
expect(await applyHeadTransform(BASE_HTML, undefined)).toBe(BASE_HTML)
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('injects user-supplied link tags into the head', async () => {
|
|
12
|
-
const out = await applyHeadTransform(BASE_HTML, {
|
|
13
|
-
link: [{ rel: 'preconnect', href: 'https://fonts.googleapis.com' }],
|
|
14
|
-
})
|
|
15
|
-
expect(out).toContain('<link rel="preconnect" href="https://fonts.googleapis.com">')
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('injects user-supplied meta tags into the head', async () => {
|
|
19
|
-
const out = await applyHeadTransform(BASE_HTML, {
|
|
20
|
-
meta: [{ name: 'theme-color', content: '#10b981' }],
|
|
21
|
-
})
|
|
22
|
-
expect(out).toContain('<meta name="theme-color" content="#10b981">')
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('skips unhead default lang and viewport tags when head is provided', async () => {
|
|
26
|
-
const out = await applyHeadTransform(BASE_HTML, {
|
|
27
|
-
meta: [{ name: 'theme-color', content: '#10b981' }],
|
|
28
|
-
})
|
|
29
|
-
expect(out).not.toContain('lang="en"')
|
|
30
|
-
expect(out).not.toMatch(/<meta[^>]*name="viewport"/)
|
|
31
|
-
})
|
|
32
|
-
})
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Context } from '../context.js'
|
|
2
|
-
import { createWriteStream, unlinkSync } from 'node:fs'
|
|
3
|
-
import path from 'node:path'
|
|
4
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
5
|
-
import { createContext } from '../context.js'
|
|
6
|
-
import { createMarkdownFilesWatcher } from '../markdown.js'
|
|
7
|
-
import { watchStories } from '../stories.js'
|
|
8
|
-
|
|
9
|
-
describe('markdown', async () => {
|
|
10
|
-
vi.spyOn(process, 'cwd').mockReturnValue(path.resolve(__dirname, './markdown'))
|
|
11
|
-
|
|
12
|
-
let ctx: Context
|
|
13
|
-
let storyWatcher: Awaited<ReturnType<typeof watchStories>>
|
|
14
|
-
|
|
15
|
-
beforeEach(async () => {
|
|
16
|
-
ctx = await createContext({
|
|
17
|
-
mode: 'dev',
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
// create watch stories to set context root etc.
|
|
21
|
-
storyWatcher = await watchStories(ctx)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
afterEach(() => {
|
|
25
|
-
storyWatcher.close()
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('should not throw error or depend on - resolve order for linking', async () => {
|
|
29
|
-
// FileWatcher should pickup the test markdown files (test1 and test2)
|
|
30
|
-
// test1 links to test2 (issue previously as test1 resolved first)
|
|
31
|
-
// test 2 links to test1
|
|
32
|
-
const { stop } = await createMarkdownFilesWatcher(ctx)
|
|
33
|
-
expect(ctx.markdownFiles.length).toEqual(2)
|
|
34
|
-
stop()
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
it('should render html from md', async () => {
|
|
38
|
-
const { stop } = await createMarkdownFilesWatcher(ctx)
|
|
39
|
-
expect(ctx.markdownFiles[0].html).toContain('<p>')
|
|
40
|
-
stop()
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it('should throw error on missing [md] story file.', async () => {
|
|
44
|
-
const testFile3 = '/markdown/test3.story.md'
|
|
45
|
-
const writer = createWriteStream(__dirname.concat(testFile3))
|
|
46
|
-
// link to missing file.
|
|
47
|
-
writer.write(
|
|
48
|
-
'<!-- File should link to test1 file. -->\n'
|
|
49
|
-
+ '# Test3\n\n'
|
|
50
|
-
+ 'Link to test 4\n'
|
|
51
|
-
+ '[TEST](./test4.story.md)\n',
|
|
52
|
-
)
|
|
53
|
-
writer.end()
|
|
54
|
-
await new Promise(resolve => writer.on('finish', resolve))
|
|
55
|
-
|
|
56
|
-
// create markdownWatcher and check for error
|
|
57
|
-
await expect(async () => createMarkdownFilesWatcher(ctx)).rejects.toThrowError()
|
|
58
|
-
// delete test file, so failures are removed as well.
|
|
59
|
-
unlinkSync(__dirname.concat(testFile3))
|
|
60
|
-
})
|
|
61
|
-
})
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { hmrPortFor, resolvePort } from '../commands/port.js'
|
|
3
|
-
|
|
4
|
-
describe('resolvePort', () => {
|
|
5
|
-
it('returns undefined when the flag was not passed', () => {
|
|
6
|
-
expect(resolvePort(undefined, 'preview')).toBeUndefined()
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
it('parses the number sade hands over as a string', () => {
|
|
10
|
-
expect(resolvePort('4569', 'preview')).toBe(4569)
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('passes a number through', () => {
|
|
14
|
-
expect(resolvePort(6006, 'dev')).toBe(6006)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
// sade declares `--port <port>` but does not enforce the value, so a bare
|
|
18
|
-
// `--port` arrives as `true`. `Number(true)` is 1 — a valid port that binds
|
|
19
|
-
// to a privileged one — so this has to be rejected by type.
|
|
20
|
-
it.each([
|
|
21
|
-
['a valueless flag', true],
|
|
22
|
-
['a non-numeric value', 'abc'],
|
|
23
|
-
['an empty value', ''],
|
|
24
|
-
['a port above the range', '99999'],
|
|
25
|
-
['a fractional port', '80.5'],
|
|
26
|
-
])('rejects %s', (_name, value) => {
|
|
27
|
-
expect(() => resolvePort(value, 'preview')).toThrow(/--port needs a number/)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it('names the command in the message, so the hint is runnable', () => {
|
|
31
|
-
expect(() => resolvePort(true, 'dev')).toThrow(/poveste dev --port 6006/)
|
|
32
|
-
})
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
// `@nuxt/vite-builder` otherwise pins every server's HMR socket to the constant
|
|
36
|
-
// 24678, so two dev servers on different `--port`s collide and the second
|
|
37
|
-
// silently loses HMR (#221). The socket has to be as unique as the book port.
|
|
38
|
-
describe('hmrPortFor', () => {
|
|
39
|
-
it('derives a port distinct from the dev port', () => {
|
|
40
|
-
expect(hmrPortFor(6006)).not.toBe(6006)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it('gives distinct dev ports distinct sockets', () => {
|
|
44
|
-
expect(hmrPortFor(4567)).not.toBe(hmrPortFor(4568))
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
it('never lands on the framework default that collides', () => {
|
|
48
|
-
for (const p of [4567, 4568, 6006, 8080]) {
|
|
49
|
-
expect(hmrPortFor(p)).not.toBe(24678)
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
it('stays within the valid port range, even for a high dev port', () => {
|
|
54
|
-
for (const p of [1024, 6006, 45535, 45536, 65535]) {
|
|
55
|
-
const hmr = hmrPortFor(p)
|
|
56
|
-
expect(hmr).toBeGreaterThanOrEqual(0)
|
|
57
|
-
expect(hmr).toBeLessThanOrEqual(65535)
|
|
58
|
-
expect(hmr).not.toBe(p)
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
it('falls back to the default dev port when none was given', () => {
|
|
63
|
-
expect(hmrPortFor(undefined)).toBe(hmrPortFor(6006))
|
|
64
|
-
})
|
|
65
|
-
})
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import type { ServerStoryFile } from '@poveste/shared'
|
|
2
|
-
import { describe, expect, it } from 'vitest'
|
|
3
|
-
import { getDefaultConfig } from '../config.js'
|
|
4
|
-
import { makeTree } from '../tree.js'
|
|
5
|
-
|
|
6
|
-
let id = 0
|
|
7
|
-
|
|
8
|
-
interface StoryFileFactoryOptions {
|
|
9
|
-
treePath: string[]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function storyFileFactory(options: StoryFileFactoryOptions): ServerStoryFile {
|
|
13
|
-
return {
|
|
14
|
-
id: `id_${id++}`,
|
|
15
|
-
path: options.treePath.join('/'),
|
|
16
|
-
treePath: options.treePath,
|
|
17
|
-
fileName: 'fileName',
|
|
18
|
-
moduleId: 'moduleId',
|
|
19
|
-
relativePath: options.treePath.join('/'),
|
|
20
|
-
supportPluginId: 'supportPluginId',
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
describe('makeTree', () => {
|
|
25
|
-
it('should create an ascending ordered tree', () => {
|
|
26
|
-
const config = getDefaultConfig()
|
|
27
|
-
const files = [
|
|
28
|
-
{ treePath: ['hi'] },
|
|
29
|
-
{ treePath: ['hey'] },
|
|
30
|
-
{ treePath: ['hello', 'world'] },
|
|
31
|
-
{ treePath: ['hello', 'mom'] },
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
const tree = makeTree(config, files.map(storyFileFactory))
|
|
35
|
-
|
|
36
|
-
expect(tree).toEqual([
|
|
37
|
-
{
|
|
38
|
-
title: 'hello',
|
|
39
|
-
children: [
|
|
40
|
-
{ title: 'mom', index: 3 },
|
|
41
|
-
{ title: 'world', index: 2 },
|
|
42
|
-
],
|
|
43
|
-
},
|
|
44
|
-
{ title: 'hey', index: 1 },
|
|
45
|
-
{ title: 'hi', index: 0 },
|
|
46
|
-
])
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('should handle title conflict', () => {
|
|
50
|
-
const config = getDefaultConfig()
|
|
51
|
-
const files = [
|
|
52
|
-
{ treePath: ['hi'] },
|
|
53
|
-
{ treePath: ['hi'] },
|
|
54
|
-
{ treePath: ['hi'] },
|
|
55
|
-
]
|
|
56
|
-
|
|
57
|
-
const tree = makeTree(config, files.map(storyFileFactory))
|
|
58
|
-
|
|
59
|
-
expect(tree).toEqual([
|
|
60
|
-
{ title: 'hi', index: 0 },
|
|
61
|
-
{ title: 'hi-1', index: 1 },
|
|
62
|
-
{ title: 'hi-2', index: 2 },
|
|
63
|
-
])
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
it('should handle file-folder conflict when folder in first', () => {
|
|
67
|
-
const config = getDefaultConfig()
|
|
68
|
-
const files = [
|
|
69
|
-
{ treePath: ['hi', 'dad'] },
|
|
70
|
-
{ treePath: ['hi'] },
|
|
71
|
-
{ treePath: ['hi', 'mom'] },
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
const tree = makeTree(config, files.map(storyFileFactory))
|
|
75
|
-
|
|
76
|
-
expect(tree).toEqual([
|
|
77
|
-
{
|
|
78
|
-
title: 'hi',
|
|
79
|
-
children: [
|
|
80
|
-
{ title: 'dad', index: 0 },
|
|
81
|
-
{ title: 'mom', index: 2 },
|
|
82
|
-
],
|
|
83
|
-
},
|
|
84
|
-
{ title: 'hi-1', index: 1 },
|
|
85
|
-
])
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
it('should handle file-folder conflict when file in first', () => {
|
|
89
|
-
const config = getDefaultConfig()
|
|
90
|
-
const files = [
|
|
91
|
-
{ treePath: ['hi'] },
|
|
92
|
-
{ treePath: ['hi', 'dad'] },
|
|
93
|
-
{ treePath: ['hi', 'mom'] },
|
|
94
|
-
]
|
|
95
|
-
|
|
96
|
-
const tree = makeTree(config, files.map(storyFileFactory))
|
|
97
|
-
|
|
98
|
-
expect(tree).toEqual([
|
|
99
|
-
{
|
|
100
|
-
title: 'hi',
|
|
101
|
-
children: [
|
|
102
|
-
{ title: 'dad', index: 1 },
|
|
103
|
-
{ title: 'mom', index: 2 },
|
|
104
|
-
],
|
|
105
|
-
},
|
|
106
|
-
{ title: 'hi-1', index: 0 },
|
|
107
|
-
])
|
|
108
|
-
})
|
|
109
|
-
})
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Context } from '../context.js'
|
|
2
|
-
import { describe, expect, it } from 'vitest'
|
|
3
|
-
import { noop } from '../virtual/noop.js'
|
|
4
|
-
import { resolvedGeneratedGlobalSetup } from '../virtual/resolved-generated-global-setup.js'
|
|
5
|
-
|
|
6
|
-
function contextFactory(config: Partial<Context['config']> = {}): Context {
|
|
7
|
-
return {
|
|
8
|
-
config,
|
|
9
|
-
supportPlugins: [
|
|
10
|
-
{ setupFn: 'setupVanilla' },
|
|
11
|
-
{ setupFn: 'setupVue3' },
|
|
12
|
-
{ setupFn: ['setupSvelte4', 'setupSvelte5'] },
|
|
13
|
-
],
|
|
14
|
-
} as Context
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const SETUP_FN_NAMES = ['setupVanilla', 'setupVue3', 'setupSvelte4', 'setupSvelte5']
|
|
18
|
-
|
|
19
|
-
// Consumers read these hooks off a namespace import behind a `typeof === 'function'`
|
|
20
|
-
// guard. If the module doesn't declare them, Rollup can't resolve the member access
|
|
21
|
-
// statically and warns `"setupVue3" is not exported by ...` in every consumer build.
|
|
22
|
-
describe('virtual setup modules', () => {
|
|
23
|
-
describe('generated global setup', () => {
|
|
24
|
-
it('should declare every support plugin setup hook when there is no setup code', () => {
|
|
25
|
-
const code = resolvedGeneratedGlobalSetup(contextFactory())
|
|
26
|
-
|
|
27
|
-
for (const fnName of SETUP_FN_NAMES) {
|
|
28
|
-
expect(code).toContain(`export const ${fnName} = undefined`)
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
it('exports each plugin\'s canonical hook as a real function when there is setup code', () => {
|
|
33
|
-
const code = resolvedGeneratedGlobalSetup(contextFactory({ setupCode: ['export function setupVue3() {}'] }))
|
|
34
|
-
|
|
35
|
-
for (const canonical of ['setupVanilla', 'setupVue3', 'setupSvelte4']) {
|
|
36
|
-
expect(code).toContain(`export async function ${canonical} (payload)`)
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
// setupSvelte5 is an alias of setupSvelte4. Emitting both as functions made
|
|
41
|
-
// getSetupHook see two interchangeable hooks in poveste's own generated
|
|
42
|
-
// module and warn once per story (#231).
|
|
43
|
-
it('declares alias hooks undefined rather than as functions', () => {
|
|
44
|
-
const code = resolvedGeneratedGlobalSetup(contextFactory({ setupCode: ['export function setupVue3() {}'] }))
|
|
45
|
-
|
|
46
|
-
expect(code).toContain('export const setupSvelte5 = undefined')
|
|
47
|
-
expect(code).not.toContain('export async function setupSvelte5 (payload)')
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
describe('noop', () => {
|
|
52
|
-
it('should keep the default export and declare every setup hook', () => {
|
|
53
|
-
const code = noop(contextFactory())
|
|
54
|
-
|
|
55
|
-
expect(code).toContain('export default () => {}')
|
|
56
|
-
for (const fnName of SETUP_FN_NAMES) {
|
|
57
|
-
expect(code).toContain(`export const ${fnName} = undefined`)
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
})
|
|
61
|
-
})
|