@histoire/shared 0.17.16 → 0.17.17
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/codegen/const.js +15 -1
- package/dist/codegen/serialize-js.js +5 -5
- package/dist/codegen/util.js +2 -3
- package/dist/types/plugin.d.ts +5 -5
- package/dist/types/prompt.d.ts +1 -1
- package/package.json +9 -9
- package/src/codegen/const.ts +15 -1
- package/src/codegen/serialize-js.ts +32 -22
- package/src/codegen/util.ts +7 -9
- package/src/state.ts +11 -7
- package/src/types/command.ts +1 -1
- package/src/types/config.ts +1 -1
- package/src/types/plugin.ts +5 -5
- package/src/types/prompt.ts +3 -2
- package/tsconfig.json +21 -21
package/dist/codegen/const.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
export const voidElements = [
|
|
2
|
-
'area',
|
|
2
|
+
'area',
|
|
3
|
+
'base',
|
|
4
|
+
'br',
|
|
5
|
+
'col',
|
|
6
|
+
'embed',
|
|
7
|
+
'hr',
|
|
8
|
+
'img',
|
|
9
|
+
'input',
|
|
10
|
+
'keygen',
|
|
11
|
+
'link',
|
|
12
|
+
'meta',
|
|
13
|
+
'param',
|
|
14
|
+
'source',
|
|
15
|
+
'track',
|
|
16
|
+
'wbr',
|
|
3
17
|
];
|
|
@@ -38,9 +38,9 @@ function objectToSourceLines(object, seen, indentCount = 0) {
|
|
|
38
38
|
else {
|
|
39
39
|
seen.add(object);
|
|
40
40
|
}
|
|
41
|
-
return createLines(indentCount, lines => {
|
|
41
|
+
return createLines(indentCount, (lines) => {
|
|
42
42
|
lines.push('{');
|
|
43
|
-
lines.push(...createLines(1, lines => {
|
|
43
|
+
lines.push(...createLines(1, (lines) => {
|
|
44
44
|
for (const key in object) {
|
|
45
45
|
const value = object[key];
|
|
46
46
|
let printedKey = key;
|
|
@@ -60,8 +60,8 @@ function arrayToSourceLines(array, seen, indentCount = 0) {
|
|
|
60
60
|
else {
|
|
61
61
|
seen.add(array);
|
|
62
62
|
}
|
|
63
|
-
return createLines(indentCount, lines => {
|
|
64
|
-
const contentLines = createLines(1, lines => {
|
|
63
|
+
return createLines(indentCount, (lines) => {
|
|
64
|
+
const contentLines = createLines(1, (lines) => {
|
|
65
65
|
for (const value of array) {
|
|
66
66
|
addLinesFromValue(lines, value, '', ',', seen);
|
|
67
67
|
}
|
|
@@ -84,7 +84,7 @@ function arrayToSourceLines(array, seen, indentCount = 0) {
|
|
|
84
84
|
function createLines(indentCount, handler) {
|
|
85
85
|
const lines = [];
|
|
86
86
|
handler(lines);
|
|
87
|
-
return lines.map(line => {
|
|
87
|
+
return lines.map((line) => {
|
|
88
88
|
if (line.spaces != null) {
|
|
89
89
|
line.spaces += indentCount;
|
|
90
90
|
return line;
|
package/dist/codegen/util.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
1
|
export function indent(lines, count = 1) {
|
|
3
2
|
return lines.map(line => `${' '.repeat(count)}${line}`);
|
|
4
3
|
}
|
|
@@ -25,7 +24,7 @@ export function createAutoBuildingObject(format, specialKeysHandler, key = '', d
|
|
|
25
24
|
if (depth > 32)
|
|
26
25
|
return { key, cache, target: {}, proxy: () => key };
|
|
27
26
|
const target = () => {
|
|
28
|
-
const k = key
|
|
27
|
+
const k = `${key}()`;
|
|
29
28
|
return format ? format(k) : k;
|
|
30
29
|
};
|
|
31
30
|
const proxy = new Proxy(target, {
|
|
@@ -43,7 +42,7 @@ export function createAutoBuildingObject(format, specialKeysHandler, key = '', d
|
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
if (p === 'toString') {
|
|
46
|
-
const k = key
|
|
45
|
+
const k = `${key}.toString()`;
|
|
47
46
|
return () => format ? format(k) : k;
|
|
48
47
|
}
|
|
49
48
|
if (p === Symbol.toPrimitive) {
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import type fs from 'fs-extra';
|
|
|
3
3
|
import type pc from 'picocolors';
|
|
4
4
|
import type chokidar from 'chokidar';
|
|
5
5
|
import type { InlineConfig as ViteInlineConfig } from 'vite';
|
|
6
|
-
import type { ServerStoryFile, ServerStory, ServerVariant } from './story.js';
|
|
7
|
-
import type { HistoireConfig, ConfigMode } from './config.js';
|
|
8
|
-
import type { PluginCommand } from './command.js';
|
|
9
6
|
import type { Awaitable } from '../type-utils.js';
|
|
7
|
+
import type { ServerStory, ServerStoryFile, ServerVariant } from './story.js';
|
|
8
|
+
import type { ConfigMode, HistoireConfig } from './config.js';
|
|
9
|
+
import type { PluginCommand } from './command.js';
|
|
10
10
|
export interface SupportPlugin {
|
|
11
11
|
id: string;
|
|
12
12
|
moduleName: string;
|
|
@@ -30,9 +30,9 @@ export interface PluginApiBase {
|
|
|
30
30
|
log: (...msg: any[]) => void;
|
|
31
31
|
warn: (...msg: any[]) => void;
|
|
32
32
|
error: (...msg: any[]) => void;
|
|
33
|
-
getStories()
|
|
33
|
+
getStories: () => ServerStory[];
|
|
34
34
|
addStoryFile: (file: string) => void;
|
|
35
|
-
getConfig()
|
|
35
|
+
getConfig: () => HistoireConfig;
|
|
36
36
|
}
|
|
37
37
|
export interface PluginApiDev extends PluginApiBase {
|
|
38
38
|
watcher: typeof chokidar;
|
package/dist/types/prompt.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/shared",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.17.17",
|
|
4
5
|
"description": "Shared utilities for Histoire",
|
|
5
|
-
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Guillaume Chau"
|
|
8
8
|
},
|
|
9
|
+
"license": "MIT",
|
|
9
10
|
"repository": {
|
|
10
11
|
"url": "https://github.com/Akryum/histoire.git",
|
|
11
12
|
"type": "git",
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
"publishConfig": {
|
|
15
16
|
"access": "public"
|
|
16
17
|
},
|
|
17
|
-
"
|
|
18
|
+
"sideEffects": false,
|
|
18
19
|
"exports": {
|
|
19
20
|
".": "./dist/index.js",
|
|
20
21
|
"./*": "./*",
|
|
@@ -23,20 +24,19 @@
|
|
|
23
24
|
"main": "./dist/index.js",
|
|
24
25
|
"module": "./dist/index.js",
|
|
25
26
|
"types": "./dist/index.d.ts",
|
|
26
|
-
"
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"vite": "^2.9.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
|
|
29
|
+
},
|
|
27
30
|
"dependencies": {
|
|
28
31
|
"@types/fs-extra": "^9.0.13",
|
|
29
32
|
"@types/markdown-it": "^12.2.3",
|
|
30
33
|
"chokidar": "^3.5.3",
|
|
31
34
|
"pathe": "^1.1.1",
|
|
32
35
|
"picocolors": "^1.0.0",
|
|
33
|
-
"@histoire/vendors": "^0.17.
|
|
34
|
-
},
|
|
35
|
-
"peerDependencies": {
|
|
36
|
-
"vite": "^2.9.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
|
|
36
|
+
"@histoire/vendors": "^0.17.17"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"typescript": "^4.
|
|
39
|
+
"typescript": "^5.4.4",
|
|
40
40
|
"vite": "^5.0.11"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
package/src/codegen/const.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
export const voidElements = [
|
|
2
|
-
'area',
|
|
2
|
+
'area',
|
|
3
|
+
'base',
|
|
4
|
+
'br',
|
|
5
|
+
'col',
|
|
6
|
+
'embed',
|
|
7
|
+
'hr',
|
|
8
|
+
'img',
|
|
9
|
+
'input',
|
|
10
|
+
'keygen',
|
|
11
|
+
'link',
|
|
12
|
+
'meta',
|
|
13
|
+
'param',
|
|
14
|
+
'source',
|
|
15
|
+
'track',
|
|
16
|
+
'wbr',
|
|
3
17
|
]
|
|
@@ -6,7 +6,7 @@ interface Line {
|
|
|
6
6
|
line: string
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function serializeJs
|
|
9
|
+
export function serializeJs(value: any): string {
|
|
10
10
|
const seen = new Set()
|
|
11
11
|
|
|
12
12
|
if (value === undefined) {
|
|
@@ -36,20 +36,21 @@ export function serializeJs (value: any): string {
|
|
|
36
36
|
return value.toString()
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
function printLines
|
|
39
|
+
function printLines(lines: Line[]) {
|
|
40
40
|
return lines.map(line => ' '.repeat(line.spaces) + line.line).join('\n')
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function objectToSourceLines
|
|
43
|
+
function objectToSourceLines(object, seen: Set<unknown>, indentCount = 0) {
|
|
44
44
|
if (seen.has(object)) {
|
|
45
45
|
object = {}
|
|
46
|
-
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
47
48
|
seen.add(object)
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
return createLines(indentCount, lines => {
|
|
51
|
+
return createLines(indentCount, (lines) => {
|
|
51
52
|
lines.push('{')
|
|
52
|
-
lines.push(...createLines(1, lines => {
|
|
53
|
+
lines.push(...createLines(1, (lines) => {
|
|
53
54
|
for (const key in object) {
|
|
54
55
|
const value = object[key]
|
|
55
56
|
|
|
@@ -65,37 +66,40 @@ function objectToSourceLines (object, seen: Set<unknown>, indentCount = 0) {
|
|
|
65
66
|
})
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
function arrayToSourceLines
|
|
69
|
+
function arrayToSourceLines(array: any[], seen: Set<unknown>, indentCount = 0): Array<Line> {
|
|
69
70
|
if (seen.has(array)) {
|
|
70
71
|
array = []
|
|
71
|
-
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
72
74
|
seen.add(array)
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
return createLines(indentCount, lines => {
|
|
76
|
-
const contentLines = createLines(1, lines => {
|
|
77
|
+
return createLines(indentCount, (lines) => {
|
|
78
|
+
const contentLines = createLines(1, (lines) => {
|
|
77
79
|
for (const value of array) {
|
|
78
80
|
addLinesFromValue(lines, value, '', ',', seen)
|
|
79
81
|
}
|
|
80
82
|
})
|
|
81
83
|
if (contentLines.length === 0) {
|
|
82
84
|
lines.push('[]')
|
|
83
|
-
}
|
|
85
|
+
}
|
|
86
|
+
else if (contentLines.length <= MAX_SINGLE_LINE_ARRAY_LENGTH && !contentLines.some(line => line.spaces > 1)) {
|
|
84
87
|
const [first] = contentLines
|
|
85
88
|
first.line = contentLines.map(({ line }) => line.substring(0, line.length - 1)).join(', ')
|
|
86
89
|
first.line = `[${first.line}]`
|
|
87
90
|
first.spaces--
|
|
88
91
|
lines.push(first)
|
|
89
|
-
}
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
90
94
|
lines.push('[', ...contentLines, ']')
|
|
91
95
|
}
|
|
92
96
|
})
|
|
93
97
|
}
|
|
94
98
|
|
|
95
|
-
function createLines
|
|
99
|
+
function createLines(indentCount: number, handler: (lines: any[]) => unknown): Array<Line> {
|
|
96
100
|
const lines: any[] = []
|
|
97
101
|
handler(lines)
|
|
98
|
-
return lines.map(line => {
|
|
102
|
+
return lines.map((line) => {
|
|
99
103
|
if (line.spaces != null) {
|
|
100
104
|
line.spaces += indentCount
|
|
101
105
|
return line
|
|
@@ -104,29 +108,35 @@ function createLines (indentCount: number, handler: (lines: any[]) => unknown):
|
|
|
104
108
|
})
|
|
105
109
|
}
|
|
106
110
|
|
|
107
|
-
function addLinesFromValue
|
|
111
|
+
function addLinesFromValue(lines: Line[], value, before, after, seen) {
|
|
108
112
|
let result
|
|
109
113
|
if (Array.isArray(value)) {
|
|
110
114
|
lines.push(...wrap(arrayToSourceLines(value, seen), before, after))
|
|
111
115
|
return
|
|
112
|
-
}
|
|
116
|
+
}
|
|
117
|
+
else if (value && typeof value === 'object') {
|
|
113
118
|
lines.push(...wrap(objectToSourceLines(value, seen), before, after))
|
|
114
119
|
return
|
|
115
|
-
}
|
|
120
|
+
}
|
|
121
|
+
else if (typeof value === 'string') {
|
|
116
122
|
result = value.includes('\'') ? `\`${value}\`` : `'${value}'`
|
|
117
|
-
}
|
|
123
|
+
}
|
|
124
|
+
else if (typeof value === 'undefined') {
|
|
118
125
|
result = 'undefined'
|
|
119
|
-
}
|
|
126
|
+
}
|
|
127
|
+
else if (value === null) {
|
|
120
128
|
result = 'null'
|
|
121
|
-
}
|
|
129
|
+
}
|
|
130
|
+
else if (typeof value === 'boolean') {
|
|
122
131
|
result = value ? 'true' : 'false'
|
|
123
|
-
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
124
134
|
result = value
|
|
125
135
|
}
|
|
126
136
|
lines.push(before + result + after)
|
|
127
137
|
}
|
|
128
138
|
|
|
129
|
-
function wrap
|
|
139
|
+
function wrap(lines: Line[], before: string, after: string) {
|
|
130
140
|
lines[0].line = before + lines[0].line
|
|
131
141
|
lines[lines.length - 1].line += after
|
|
132
142
|
return lines
|
package/src/codegen/util.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export function indent (lines: string[], count = 1) {
|
|
1
|
+
export function indent(lines: string[], count = 1) {
|
|
4
2
|
return lines.map(line => `${' '.repeat(count)}${line}`)
|
|
5
3
|
}
|
|
6
4
|
|
|
7
|
-
export function unindent
|
|
5
|
+
export function unindent(code: string) {
|
|
8
6
|
const lines = code.split('\n')
|
|
9
7
|
let indentLevel = -1
|
|
10
8
|
let indentText: string
|
|
@@ -30,15 +28,15 @@ interface AutoBuildingOject {
|
|
|
30
28
|
proxy: any
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
export function createAutoBuildingObject
|
|
31
|
+
export function createAutoBuildingObject(format?: (key: string) => string, specialKeysHandler?: (target: any, p: string | symbol) => (() => unknown) | null, key = '', depth = 0): AutoBuildingOject {
|
|
34
32
|
const cache: Record<string | symbol, AutoBuildingOject> = {}
|
|
35
33
|
if (depth > 32) return { key, cache, target: {}, proxy: () => key }
|
|
36
34
|
const target: any = () => {
|
|
37
|
-
const k = key
|
|
35
|
+
const k = `${key}()`
|
|
38
36
|
return format ? format(k) : k
|
|
39
37
|
}
|
|
40
38
|
const proxy = new Proxy(target, {
|
|
41
|
-
get
|
|
39
|
+
get(_, p) {
|
|
42
40
|
if (p === '__autoBuildingObject') {
|
|
43
41
|
return true
|
|
44
42
|
}
|
|
@@ -52,7 +50,7 @@ export function createAutoBuildingObject (format?: (key: string) => string, spec
|
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
if (p === 'toString') {
|
|
55
|
-
const k = key
|
|
53
|
+
const k = `${key}.toString()`
|
|
56
54
|
return () => format ? format(k) : k
|
|
57
55
|
}
|
|
58
56
|
if (p === Symbol.toPrimitive) {
|
|
@@ -65,7 +63,7 @@ export function createAutoBuildingObject (format?: (key: string) => string, spec
|
|
|
65
63
|
}
|
|
66
64
|
return cache[p].proxy
|
|
67
65
|
},
|
|
68
|
-
apply
|
|
66
|
+
apply(_, thisArg, args) {
|
|
69
67
|
const k = `${key}(${args.join(', ')})`
|
|
70
68
|
return format ? format(k) : k
|
|
71
69
|
},
|
package/src/state.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
export function clone
|
|
1
|
+
export function clone(data) {
|
|
2
2
|
try {
|
|
3
3
|
return structuredClone(data)
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
catch (e) {
|
|
5
6
|
console.warn(e, `Fallback to JSON cloning`)
|
|
6
7
|
try {
|
|
7
8
|
return JSON.parse(JSON.stringify(data))
|
|
8
|
-
}
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
9
11
|
console.error(e)
|
|
10
12
|
}
|
|
11
13
|
return data
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
export function omit
|
|
17
|
+
export function omit(data, keys: string[]) {
|
|
16
18
|
const copy = {}
|
|
17
19
|
for (const key in data) {
|
|
18
20
|
if (!keys.includes(key)) {
|
|
@@ -22,15 +24,17 @@ export function omit (data, keys: string[]) {
|
|
|
22
24
|
return copy
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
export function applyState
|
|
27
|
+
export function applyState(target: any, state: any, override = false) {
|
|
26
28
|
for (const key in state) {
|
|
27
29
|
// iframe sync needs to update properties without overriding them
|
|
28
30
|
if (!override && target[key] && !key.startsWith('_h') && typeof target[key] === 'object' && !Array.isArray(target[key])) {
|
|
29
31
|
Object.assign(target[key], state[key])
|
|
30
|
-
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
31
34
|
try {
|
|
32
35
|
target[key] = state[key]
|
|
33
|
-
}
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
34
38
|
// noop
|
|
35
39
|
}
|
|
36
40
|
}
|
package/src/types/command.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface ClientCommandContext {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export interface PluginCommand<
|
|
34
|
-
TParams = Record<string, any
|
|
34
|
+
TParams = Record<string, any>,
|
|
35
35
|
> extends Command {
|
|
36
36
|
serverAction?: (params: TParams) => unknown // @TODO ctx
|
|
37
37
|
clientSetupFile?: string | { file: string, importName: string }
|
package/src/types/config.ts
CHANGED
package/src/types/plugin.ts
CHANGED
|
@@ -3,19 +3,19 @@ import type fs from 'fs-extra'
|
|
|
3
3
|
import type pc from 'picocolors'
|
|
4
4
|
import type chokidar from 'chokidar'
|
|
5
5
|
import type { InlineConfig as ViteInlineConfig } from 'vite'
|
|
6
|
+
import type { Awaitable } from '../type-utils.js'
|
|
6
7
|
import type {
|
|
7
|
-
ServerStoryFile,
|
|
8
8
|
ServerStory,
|
|
9
|
+
ServerStoryFile,
|
|
9
10
|
ServerVariant,
|
|
10
11
|
} from './story.js'
|
|
11
12
|
import type {
|
|
12
|
-
HistoireConfig,
|
|
13
13
|
ConfigMode,
|
|
14
|
+
HistoireConfig,
|
|
14
15
|
} from './config.js'
|
|
15
16
|
import type {
|
|
16
17
|
PluginCommand,
|
|
17
18
|
} from './command.js'
|
|
18
|
-
import type { Awaitable } from '../type-utils.js'
|
|
19
19
|
|
|
20
20
|
export interface SupportPlugin {
|
|
21
21
|
id: string
|
|
@@ -47,10 +47,10 @@ export interface PluginApiBase {
|
|
|
47
47
|
warn: (...msg) => void
|
|
48
48
|
error: (...msg) => void
|
|
49
49
|
|
|
50
|
-
getStories ()
|
|
50
|
+
getStories: () => ServerStory[]
|
|
51
51
|
addStoryFile: (file: string) => void
|
|
52
52
|
|
|
53
|
-
getConfig ()
|
|
53
|
+
getConfig: () => HistoireConfig
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export interface PluginApiDev extends PluginApiBase {
|
package/src/types/prompt.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Awaitable } from '../type-utils.js'
|
|
1
|
+
import type { Awaitable } from '../type-utils.js'
|
|
2
2
|
|
|
3
3
|
export interface PromptBase<TValue> {
|
|
4
4
|
field: string
|
|
@@ -18,5 +18,6 @@ export interface SelectPrompt extends PromptBase<string> {
|
|
|
18
18
|
options: SelectPromptOption[] | ((search: string, answers: Record<string, any>) => Awaitable<SelectPromptOption[]>)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
21
22
|
export type Prompt<TValue = any> = TextPrompt
|
|
22
|
-
| SelectPrompt
|
|
23
|
+
| SelectPrompt
|
package/tsconfig.json
CHANGED
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "ESNext",
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
"outDir": "dist",
|
|
7
|
-
"rootDir": "src",
|
|
8
|
-
"baseUrl": ".",
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"removeComments": false,
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
4
|
+
// Volar
|
|
5
|
+
"jsx": "preserve",
|
|
14
6
|
"lib": [
|
|
15
7
|
"ESNext",
|
|
16
8
|
"DOM"
|
|
17
9
|
],
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"noImplicitThis": true,
|
|
23
|
-
"alwaysStrict": true,
|
|
24
|
-
"strictBindCallApply": true,
|
|
25
|
-
"strictFunctionTypes": true,
|
|
26
|
-
// Volar
|
|
27
|
-
"jsx": "preserve",
|
|
10
|
+
"baseUrl": ".",
|
|
11
|
+
"rootDir": "src",
|
|
12
|
+
"module": "ESNext",
|
|
13
|
+
"moduleResolution": "node",
|
|
28
14
|
// Alias
|
|
29
15
|
"paths": {
|
|
30
16
|
"floating-vue": ["node_modules/@histoire/vendors/floating-vue"],
|
|
@@ -34,7 +20,21 @@
|
|
|
34
20
|
"vue-router": ["node_modules/@histoire/vendors/vue-router"],
|
|
35
21
|
"@vueuse/core": ["node_modules/@histoire/vendors/vue-use"],
|
|
36
22
|
"vue": ["node_modules/@histoire/vendors/vue"]
|
|
37
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"resolveJsonModule": true,
|
|
25
|
+
"strictBindCallApply": true,
|
|
26
|
+
"strictFunctionTypes": true,
|
|
27
|
+
"alwaysStrict": true,
|
|
28
|
+
// Strict
|
|
29
|
+
"noImplicitAny": false,
|
|
30
|
+
"noImplicitThis": true,
|
|
31
|
+
"outDir": "dist",
|
|
32
|
+
"removeComments": false,
|
|
33
|
+
"sourceMap": false,
|
|
34
|
+
"allowSyntheticDefaultImports": true,
|
|
35
|
+
"esModuleInterop": true,
|
|
36
|
+
"skipLibCheck": true,
|
|
37
|
+
"preserveWatchOutput": true
|
|
38
38
|
},
|
|
39
39
|
"include": [
|
|
40
40
|
"src"
|