histoire 0.0.5 → 0.1.2

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.
@@ -44,6 +44,13 @@ export async function build(ctx) {
44
44
  join(APP_PATH, 'index.ts'),
45
45
  join(APP_PATH, 'sandbox.ts'),
46
46
  ],
47
+ output: {
48
+ manualChunks(id) {
49
+ if (!id.includes('histoire/dist/client') && id.includes('node_modules')) {
50
+ return 'vendor';
51
+ }
52
+ },
53
+ },
47
54
  },
48
55
  outDir: ctx.config.outDir,
49
56
  emptyOutDir: true,
@@ -10,7 +10,10 @@ export function getDefaultConfig() {
10
10
  return {
11
11
  outDir: 'histoire-dist',
12
12
  storyMatch: ['**/*.story.vue'],
13
- storyIgnored: ['**/node_modules/**'],
13
+ storyIgnored: [
14
+ '**/node_modules/**',
15
+ '**/dist/**',
16
+ ],
14
17
  tree: {
15
18
  file: 'title',
16
19
  order: 'asc',
@@ -1,4 +1,5 @@
1
- import { relative } from 'pathe';
1
+ import { createRequire } from 'module';
2
+ import { relative, dirname } from 'pathe';
2
3
  import { resolveConfig as resolveViteConfig } from 'vite';
3
4
  import { lookup as lookupMime } from 'mrmime';
4
5
  import { APP_PATH, DIST_CLIENT_PATH } from './alias.js';
@@ -6,6 +7,7 @@ import { notifyStoryChange } from './stories.js';
6
7
  import { makeTree } from './tree.js';
7
8
  import { parseColor } from './colors.js';
8
9
  import { createMarkdownRenderer } from './markdown.js';
10
+ const require = createRequire(import.meta.url);
9
11
  export const STORIES_ID = '$histoire-stories';
10
12
  export const RESOLVED_STORIES_ID = `/${STORIES_ID}-resolved`;
11
13
  export const SETUP_ID = '$histoire-setup';
@@ -37,7 +39,11 @@ export async function createVitePlugins(ctx) {
37
39
  // force include vue to avoid duplicated copies when linked + optimized
38
40
  include: [
39
41
  'vue',
40
- '@vue/runtime-core',
42
+ dirname(require.resolve('@vue/runtime-core/package.json')),
43
+ dirname(require.resolve('shiki/package.json')),
44
+ dirname(require.resolve('vscode-textmate/package.json')),
45
+ dirname(require.resolve('vscode-oniguruma/package.json')),
46
+ dirname(require.resolve('case/package.json')),
41
47
  ],
42
48
  },
43
49
  server: {
package/dist/style.css CHANGED
@@ -176,12 +176,6 @@
176
176
  left:-2px
177
177
  }
178
178
 
179
- .v-popper{
180
- width:-webkit-max-content;
181
- width:-moz-max-content;
182
- width:max-content
183
- }
184
-
185
179
  .v-popper--theme-dropdown .v-popper__inner{
186
180
  background:#fff;
187
181
  color:#000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "histoire",
3
- "version": "0.0.5",
3
+ "version": "0.1.2",
4
4
  "description": "A fast story book powered by Vite",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@iconify/vue": "^3.1.3",
37
- "@histoire/controls": "^0.0.5",
37
+ "@histoire/controls": "^0.1.2",
38
38
  "@vitejs/plugin-vue": "^2.2.0",
39
39
  "@vueuse/core": "^7.6.2",
40
40
  "case": "^1.6.3",
package/src/node/build.ts CHANGED
@@ -52,6 +52,13 @@ export async function build (ctx: Context) {
52
52
  join(APP_PATH, 'index.ts'),
53
53
  join(APP_PATH, 'sandbox.ts'),
54
54
  ],
55
+ output: {
56
+ manualChunks (id) {
57
+ if (!id.includes('histoire/dist/client') && id.includes('node_modules')) {
58
+ return 'vendor'
59
+ }
60
+ },
61
+ },
55
62
  },
56
63
  outDir: ctx.config.outDir,
57
64
  emptyOutDir: true,
@@ -135,7 +135,10 @@ export function getDefaultConfig (): HistoireConfig {
135
135
  return {
136
136
  outDir: 'histoire-dist',
137
137
  storyMatch: ['**/*.story.vue'],
138
- storyIgnored: ['**/node_modules/**'],
138
+ storyIgnored: [
139
+ '**/node_modules/**',
140
+ '**/dist/**',
141
+ ],
139
142
  tree: {
140
143
  file: 'title',
141
144
  order: 'asc',
@@ -1,4 +1,5 @@
1
- import { relative } from 'pathe'
1
+ import { createRequire } from 'module'
2
+ import { relative, dirname } from 'pathe'
2
3
  import { resolveConfig as resolveViteConfig, Plugin as VitePlugin } from 'vite'
3
4
  import { lookup as lookupMime } from 'mrmime'
4
5
  import { APP_PATH, DIST_CLIENT_PATH } from './alias.js'
@@ -8,6 +9,8 @@ import { makeTree } from './tree.js'
8
9
  import { parseColor } from './colors.js'
9
10
  import { createMarkdownRenderer } from './markdown.js'
10
11
 
12
+ const require = createRequire(import.meta.url)
13
+
11
14
  export const STORIES_ID = '$histoire-stories'
12
15
  export const RESOLVED_STORIES_ID = `/${STORIES_ID}-resolved`
13
16
  export const SETUP_ID = '$histoire-setup'
@@ -45,7 +48,11 @@ export async function createVitePlugins (ctx: Context): Promise<VitePlugin[]> {
45
48
  // force include vue to avoid duplicated copies when linked + optimized
46
49
  include: [
47
50
  'vue',
48
- '@vue/runtime-core',
51
+ dirname(require.resolve('@vue/runtime-core/package.json')),
52
+ dirname(require.resolve('shiki/package.json')),
53
+ dirname(require.resolve('vscode-textmate/package.json')),
54
+ dirname(require.resolve('vscode-oniguruma/package.json')),
55
+ dirname(require.resolve('case/package.json')),
49
56
  ],
50
57
  },
51
58
  server: {