@suseejs/types 0.1.1 → 0.1.3
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/commonjs/index.d.ts +160 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +6 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/index.d.ts +154 -111
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
- package/dist/index.cjs +0 -7
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -117
- package/dist/index.d.cts.map +0 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
declare const pkgName = "SU-SEE";
|
|
3
|
+
interface DepsFile {
|
|
4
|
+
file: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
interface NamesSet {
|
|
8
|
+
base: string;
|
|
9
|
+
file: string;
|
|
10
|
+
newName: string;
|
|
11
|
+
isEd?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type NamesSets = NamesSet[];
|
|
14
|
+
type DuplicatesNameMap = Map<string, Set<{
|
|
15
|
+
file: string;
|
|
16
|
+
}>>;
|
|
17
|
+
type BundleHandler = ({ file, content }: DepsFile) => DepsFile;
|
|
18
|
+
interface NamesMap {
|
|
19
|
+
base: string;
|
|
20
|
+
file: string;
|
|
21
|
+
short: string;
|
|
22
|
+
oldName: string;
|
|
23
|
+
}
|
|
24
|
+
type PostProcessExtension = {
|
|
25
|
+
type: "post-process";
|
|
26
|
+
async: true;
|
|
27
|
+
func: (code: string, file?: string) => Promise<string>;
|
|
28
|
+
} | {
|
|
29
|
+
type: "post-process";
|
|
30
|
+
async: false;
|
|
31
|
+
func: (code: string, file?: string) => string;
|
|
32
|
+
};
|
|
33
|
+
type PreProcessExtension = {
|
|
34
|
+
type: "pre-process";
|
|
35
|
+
async: true;
|
|
36
|
+
func: (code: string, file?: string) => Promise<string>;
|
|
37
|
+
} | {
|
|
38
|
+
type: "pre-process";
|
|
39
|
+
async: false;
|
|
40
|
+
func: (code: string, file?: string) => string;
|
|
41
|
+
};
|
|
42
|
+
type DependencyExtension = {
|
|
43
|
+
type: "dependency";
|
|
44
|
+
async: true;
|
|
45
|
+
func: (files: DepsFile[]) => Promise<DepsFile[]>;
|
|
46
|
+
} | {
|
|
47
|
+
type: "dependency";
|
|
48
|
+
async: false;
|
|
49
|
+
func: (files: DepsFile[]) => DepsFile[];
|
|
50
|
+
};
|
|
51
|
+
type ASTExtension = {
|
|
52
|
+
type: "ast";
|
|
53
|
+
async: true;
|
|
54
|
+
func: (sourceFile: ts.SourceFile) => Promise<ts.SourceFile>;
|
|
55
|
+
} | {
|
|
56
|
+
type: "ast";
|
|
57
|
+
async: false;
|
|
58
|
+
func: (sourceFile: ts.SourceFile) => ts.SourceFile;
|
|
59
|
+
};
|
|
60
|
+
type SuseeExtension = PostProcessExtension | PreProcessExtension | DependencyExtension | ASTExtension;
|
|
61
|
+
type OutFiles = {
|
|
62
|
+
commonjs: string | undefined;
|
|
63
|
+
commonjsTypes: string | undefined;
|
|
64
|
+
esm: string | undefined;
|
|
65
|
+
esmTypes: string | undefined;
|
|
66
|
+
main: string | undefined;
|
|
67
|
+
module: string | undefined;
|
|
68
|
+
types: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
type Target = "commonjs" | "esm" | "both";
|
|
71
|
+
type Exports = Record<string, {
|
|
72
|
+
import?: {
|
|
73
|
+
default: string;
|
|
74
|
+
types: string;
|
|
75
|
+
};
|
|
76
|
+
require?: {
|
|
77
|
+
default: string;
|
|
78
|
+
types: string;
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
81
|
+
type NodeJsOutput = {
|
|
82
|
+
target: "nodejs";
|
|
83
|
+
/**
|
|
84
|
+
* path for package
|
|
85
|
+
*
|
|
86
|
+
* required
|
|
87
|
+
*/
|
|
88
|
+
exportPath: "." | `./${string}`;
|
|
89
|
+
/**
|
|
90
|
+
* Output module type of package , commonjs,esm or both esm and commonjs
|
|
91
|
+
*
|
|
92
|
+
* default - esm
|
|
93
|
+
*/
|
|
94
|
+
format?: "commonjs" | "esm" | "both";
|
|
95
|
+
/**
|
|
96
|
+
* Allow bundler to update your package.json.
|
|
97
|
+
*
|
|
98
|
+
* default - true
|
|
99
|
+
*/
|
|
100
|
+
allowUpdatePackageJson?: boolean;
|
|
101
|
+
};
|
|
102
|
+
type WebOutput = {
|
|
103
|
+
target: "web";
|
|
104
|
+
outFile: string;
|
|
105
|
+
htmlTemplate: string;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Entry point for SuSee configuration
|
|
109
|
+
*/
|
|
110
|
+
type EntryPoint = {
|
|
111
|
+
/**
|
|
112
|
+
* Entry of file path of package
|
|
113
|
+
*
|
|
114
|
+
* required
|
|
115
|
+
*/
|
|
116
|
+
entry: string;
|
|
117
|
+
/**
|
|
118
|
+
* Info for output
|
|
119
|
+
*
|
|
120
|
+
* required
|
|
121
|
+
*/
|
|
122
|
+
output: NodeJsOutput | WebOutput;
|
|
123
|
+
/**
|
|
124
|
+
* Custom tsconfig.json path for package typescript compiler options
|
|
125
|
+
*
|
|
126
|
+
* Priority -
|
|
127
|
+
* 1. this custom tsconfig.json
|
|
128
|
+
* 2. tsconfig.json at root directory
|
|
129
|
+
* 3. default compiler options of susee
|
|
130
|
+
*
|
|
131
|
+
* default - undefined
|
|
132
|
+
*/
|
|
133
|
+
tsconfigFilePath?: string | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* When bundling , if there are duplicate declared names , susee will auto rename , if renameDuplicates = false exist with code 1.
|
|
136
|
+
*
|
|
137
|
+
* default - true
|
|
138
|
+
*/
|
|
139
|
+
renameDuplicates?: boolean;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Configuration for Susee Bundler
|
|
143
|
+
*/
|
|
144
|
+
interface SuSeeConfig {
|
|
145
|
+
/**
|
|
146
|
+
* Array of entry points object
|
|
147
|
+
*
|
|
148
|
+
* required
|
|
149
|
+
*/
|
|
150
|
+
entryPoints: EntryPoint[];
|
|
151
|
+
/**
|
|
152
|
+
* Array of susee extension
|
|
153
|
+
*
|
|
154
|
+
* default - []
|
|
155
|
+
*/
|
|
156
|
+
extensions?: SuseeExtension[];
|
|
157
|
+
}
|
|
158
|
+
export type { SuseeExtension, Target, EntryPoint, SuSeeConfig, DepsFile, DuplicatesNameMap, NamesMap, NamesSet, NamesSets, BundleHandler, Exports, OutFiles, };
|
|
159
|
+
export { pkgName };
|
|
160
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,QAAA,MAAM,OAAO,WAAW,CAAC;AAEzB,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AACD,KAAK,SAAS,GAAG,QAAQ,EAAE,CAAC;AAE5B,KAAK,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC;AAE5D,KAAK,aAAa,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,QAAQ,KAAK,QAAQ,CAAC;AAE/D,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,KAAK,oBAAoB,GACrB;IACE,IAAI,EAAE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EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E;;GAEG;AACH,KAAK,UAAU,GAAG;IAChB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;IACjC;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,UAAU,WAAW;IACnB;;;;OAIG;IACH,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED,YAAY,EACV,cAAc,EACd,MAAM,EACN,UAAU,EACV,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,aAAa,EACb,OAAO,EACP,QAAQ,GACT,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAEA,MAAM,OAAO,GAAG,QAAQ,CAAC;AA0LhB,0BAAO"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,117 +1,160 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
declare const pkgName = "SU-SEE";
|
|
3
|
+
interface DepsFile {
|
|
4
|
+
file: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
interface NamesSet {
|
|
8
|
+
base: string;
|
|
9
|
+
file: string;
|
|
10
|
+
newName: string;
|
|
11
|
+
isEd?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type NamesSets = NamesSet[];
|
|
14
|
+
type DuplicatesNameMap = Map<string, Set<{
|
|
15
|
+
file: string;
|
|
16
|
+
}>>;
|
|
17
|
+
type BundleHandler = ({ file, content }: DepsFile) => DepsFile;
|
|
18
|
+
interface NamesMap {
|
|
19
|
+
base: string;
|
|
20
|
+
file: string;
|
|
21
|
+
short: string;
|
|
22
|
+
oldName: string;
|
|
23
|
+
}
|
|
24
|
+
type PostProcessExtension = {
|
|
25
|
+
type: "post-process";
|
|
26
|
+
async: true;
|
|
27
|
+
func: (code: string, file?: string) => Promise<string>;
|
|
28
|
+
} | {
|
|
29
|
+
type: "post-process";
|
|
30
|
+
async: false;
|
|
31
|
+
func: (code: string, file?: string) => string;
|
|
32
|
+
};
|
|
33
|
+
type PreProcessExtension = {
|
|
34
|
+
type: "pre-process";
|
|
35
|
+
async: true;
|
|
36
|
+
func: (code: string, file?: string) => Promise<string>;
|
|
37
|
+
} | {
|
|
38
|
+
type: "pre-process";
|
|
39
|
+
async: false;
|
|
40
|
+
func: (code: string, file?: string) => string;
|
|
41
|
+
};
|
|
42
|
+
type DependencyExtension = {
|
|
43
|
+
type: "dependency";
|
|
44
|
+
async: true;
|
|
45
|
+
func: (files: DepsFile[]) => Promise<DepsFile[]>;
|
|
46
|
+
} | {
|
|
47
|
+
type: "dependency";
|
|
48
|
+
async: false;
|
|
49
|
+
func: (files: DepsFile[]) => DepsFile[];
|
|
50
|
+
};
|
|
51
|
+
type ASTExtension = {
|
|
52
|
+
type: "ast";
|
|
53
|
+
async: true;
|
|
54
|
+
func: (sourceFile: ts.SourceFile) => Promise<ts.SourceFile>;
|
|
55
|
+
} | {
|
|
56
|
+
type: "ast";
|
|
57
|
+
async: false;
|
|
58
|
+
func: (sourceFile: ts.SourceFile) => ts.SourceFile;
|
|
59
|
+
};
|
|
60
|
+
type SuseeExtension = PostProcessExtension | PreProcessExtension | DependencyExtension | ASTExtension;
|
|
61
|
+
type OutFiles = {
|
|
62
|
+
commonjs: string | undefined;
|
|
63
|
+
commonjsTypes: string | undefined;
|
|
64
|
+
esm: string | undefined;
|
|
65
|
+
esmTypes: string | undefined;
|
|
66
|
+
main: string | undefined;
|
|
67
|
+
module: string | undefined;
|
|
68
|
+
types: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
type Target = "commonjs" | "esm" | "both";
|
|
71
|
+
type Exports = Record<string, {
|
|
72
|
+
import?: {
|
|
73
|
+
default: string;
|
|
74
|
+
types: string;
|
|
29
75
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
commonjsTypes: string | undefined;
|
|
34
|
-
esm: string | undefined;
|
|
35
|
-
esmTypes: string | undefined;
|
|
36
|
-
main: string | undefined;
|
|
37
|
-
module: string | undefined;
|
|
38
|
-
types: string | undefined;
|
|
76
|
+
require?: {
|
|
77
|
+
default: string;
|
|
78
|
+
types: string;
|
|
39
79
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
80
|
+
}>;
|
|
81
|
+
type NodeJsOutput = {
|
|
82
|
+
target: "nodejs";
|
|
83
|
+
/**
|
|
84
|
+
* path for package
|
|
85
|
+
*
|
|
86
|
+
* required
|
|
87
|
+
*/
|
|
88
|
+
exportPath: "." | `./${string}`;
|
|
89
|
+
/**
|
|
90
|
+
* Output module type of package , commonjs,esm or both esm and commonjs
|
|
91
|
+
*
|
|
92
|
+
* default - esm
|
|
93
|
+
*/
|
|
94
|
+
format?: "commonjs" | "esm" | "both";
|
|
95
|
+
/**
|
|
96
|
+
* Allow bundler to update your package.json.
|
|
97
|
+
*
|
|
98
|
+
* default - true
|
|
99
|
+
*/
|
|
100
|
+
allowUpdatePackageJson?: boolean;
|
|
101
|
+
};
|
|
102
|
+
type WebOutput = {
|
|
103
|
+
target: "web";
|
|
104
|
+
outFile: string;
|
|
105
|
+
htmlTemplate: string;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Entry point for SuSee configuration
|
|
109
|
+
*/
|
|
110
|
+
type EntryPoint = {
|
|
111
|
+
/**
|
|
112
|
+
* Entry of file path of package
|
|
113
|
+
*
|
|
114
|
+
* required
|
|
115
|
+
*/
|
|
116
|
+
entry: string;
|
|
117
|
+
/**
|
|
118
|
+
* Info for output
|
|
119
|
+
*
|
|
120
|
+
* required
|
|
121
|
+
*/
|
|
122
|
+
output: NodeJsOutput | WebOutput;
|
|
123
|
+
/**
|
|
124
|
+
* Custom tsconfig.json path for package typescript compiler options
|
|
125
|
+
*
|
|
126
|
+
* Priority -
|
|
127
|
+
* 1. this custom tsconfig.json
|
|
128
|
+
* 2. tsconfig.json at root directory
|
|
129
|
+
* 3. default compiler options of susee
|
|
130
|
+
*
|
|
131
|
+
* default - undefined
|
|
132
|
+
*/
|
|
133
|
+
tsconfigFilePath?: string | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* When bundling , if there are duplicate declared names , susee will auto rename , if renameDuplicates = false exist with code 1.
|
|
136
|
+
*
|
|
137
|
+
* default - true
|
|
138
|
+
*/
|
|
139
|
+
renameDuplicates?: boolean;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Configuration for Susee Bundler
|
|
143
|
+
*/
|
|
144
|
+
interface SuSeeConfig {
|
|
145
|
+
/**
|
|
146
|
+
* Array of entry points object
|
|
147
|
+
*
|
|
148
|
+
* required
|
|
149
|
+
*/
|
|
150
|
+
entryPoints: EntryPoint[];
|
|
51
151
|
/**
|
|
52
|
-
*
|
|
152
|
+
* Array of susee extension
|
|
153
|
+
*
|
|
154
|
+
* default - []
|
|
53
155
|
*/
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Entry file to bundle.
|
|
57
|
-
*/
|
|
58
|
-
entry: string;
|
|
59
|
-
/**
|
|
60
|
-
* Output target: `"commonjs"`, `"esm"`, or `"both"`.
|
|
61
|
-
*
|
|
62
|
-
* default - "both"
|
|
63
|
-
*/
|
|
64
|
-
target?: Target;
|
|
65
|
-
/**
|
|
66
|
-
* Default export name if applicable.
|
|
67
|
-
* - Required when the entry has default export and `options.target` = `"commonjs"` or `"both"`
|
|
68
|
-
*
|
|
69
|
-
* Example :
|
|
70
|
-
*
|
|
71
|
-
* ```ts
|
|
72
|
-
* const foo = {bar:"foo"};
|
|
73
|
-
* export default foo; // defaultExportName = "foo"
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* default - undefined
|
|
77
|
-
*/
|
|
78
|
-
defaultExportName?: string | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Whether this build represents the main export , otherwise subpath export.
|
|
81
|
-
*
|
|
82
|
-
* default - true
|
|
83
|
-
*/
|
|
84
|
-
isMainExport?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Output directory.
|
|
87
|
-
*
|
|
88
|
-
* For a subpath export (not the main export), `outDir` must be a single-level
|
|
89
|
-
* nested folder under the main output directory.
|
|
90
|
-
*
|
|
91
|
-
* Example:
|
|
92
|
-
*
|
|
93
|
-
* ```ts
|
|
94
|
-
* const mainOutdir = "dist";
|
|
95
|
-
* const subpathOutdir = "dist/subpath"; // subpath export in package.json will be "./subpath"
|
|
96
|
-
* const fooOutdir = "dist/foo"; // subpath export in package.json will be "./foo"
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* default - "dist"
|
|
100
|
-
*/
|
|
101
|
-
outDir?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Identifiers to replace with blanks during compilation.
|
|
104
|
-
*
|
|
105
|
-
* default - []
|
|
106
|
-
*/
|
|
107
|
-
replaceWithBlank?: string[];
|
|
108
|
-
/**
|
|
109
|
-
* Array of hook functions executed during compilation.
|
|
110
|
-
*
|
|
111
|
-
* default - []
|
|
112
|
-
*/
|
|
113
|
-
hooks?: PostProcessHook[];
|
|
114
|
-
}
|
|
156
|
+
extensions?: SuseeExtension[];
|
|
115
157
|
}
|
|
116
|
-
export
|
|
158
|
+
export type { SuseeExtension, Target, EntryPoint, SuSeeConfig, DepsFile, DuplicatesNameMap, NamesMap, NamesSet, NamesSets, BundleHandler, Exports, OutFiles, };
|
|
159
|
+
export { pkgName };
|
|
117
160
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,QAAA,MAAM,OAAO,WAAW,CAAC;AAEzB,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AACD,KAAK,SAAS,GAAG,QAAQ,EAAE,CAAC;AAE5B,KAAK,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC;AAE5D,KAAK,aAAa,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,QAAQ,KAAK,QAAQ,CAAC;AAE/D,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EA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,KAAK,SAAS,GAAG;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E;;GAEG;AACH,KAAK,UAAU,GAAG;IAChB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;IACjC;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,UAAU,WAAW;IACnB;;;;OAIG;IACH,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED,YAAY,EACV,cAAc,EACd,MAAM,EACN,UAAU,EACV,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,aAAa,EACb,OAAO,EACP,QAAQ,GACT,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,OAAO,GAAG,QAAQ,CAAC;AA0LzB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suseejs/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Type definitions for suseejs",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.
|
|
6
|
+
"main": "dist/commonjs/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
|
-
"types": "dist/index.d.
|
|
8
|
+
"types": "dist/commonjs/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"require": {
|
|
12
|
-
"types": "./dist/index.
|
|
13
|
-
"default": "./dist/index.
|
|
12
|
+
"types": "./dist/commonjs/index.js",
|
|
13
|
+
"default": "./dist/commonjs/index.d.ts"
|
|
14
14
|
},
|
|
15
15
|
"import": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"
|
|
22
|
+
"commonjs": "tsc -p tsconfig.commonjs.json",
|
|
23
|
+
"esm": "tsc -p tsconfig.esm.json",
|
|
24
|
+
"build": "npm run esm && npm run commonjs"
|
|
23
25
|
},
|
|
24
26
|
"repository": {
|
|
25
27
|
"type": "git",
|
package/dist/index.cjs
DELETED
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":";AAAA,IAAU,KAAK,CAuHd;AAvHD,WAAU,KAAK;IACb,MAAM,OAAO,GAAG,QAAQ,CAAC;AAsH3B,CAAC,EAvHS,KAAK,KAAL,KAAK,QAuHd;AAED,iBAAS,KAAK,CAAC"}
|
package/dist/index.d.cts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
declare namespace SuSee {
|
|
2
|
-
interface DepsFile {
|
|
3
|
-
file: string;
|
|
4
|
-
content: string;
|
|
5
|
-
}
|
|
6
|
-
interface NamesSet {
|
|
7
|
-
base: string;
|
|
8
|
-
file: string;
|
|
9
|
-
newName: string;
|
|
10
|
-
isEd?: boolean;
|
|
11
|
-
}
|
|
12
|
-
type NamesSets = NamesSet[];
|
|
13
|
-
type DuplicatesNameMap = Map<string, Set<{
|
|
14
|
-
file: string;
|
|
15
|
-
}>>;
|
|
16
|
-
type BundleHandler = ({ file, content }: DepsFile) => DepsFile;
|
|
17
|
-
interface NamesMap {
|
|
18
|
-
base: string;
|
|
19
|
-
file: string;
|
|
20
|
-
short: string;
|
|
21
|
-
oldName: string;
|
|
22
|
-
}
|
|
23
|
-
type PostProcessHook = {
|
|
24
|
-
async: true;
|
|
25
|
-
func: (code: string, file?: string) => Promise<string>;
|
|
26
|
-
} | {
|
|
27
|
-
async: false;
|
|
28
|
-
func: (code: string, file?: string) => string;
|
|
29
|
-
};
|
|
30
|
-
type OutPutHookFunc = (...args: any[]) => PostProcessHook;
|
|
31
|
-
type OutFiles = {
|
|
32
|
-
commonjs: string | undefined;
|
|
33
|
-
commonjsTypes: string | undefined;
|
|
34
|
-
esm: string | undefined;
|
|
35
|
-
esmTypes: string | undefined;
|
|
36
|
-
main: string | undefined;
|
|
37
|
-
module: string | undefined;
|
|
38
|
-
types: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
type Target = "commonjs" | "esm" | "both";
|
|
41
|
-
type Exports = Record<string, {
|
|
42
|
-
import?: {
|
|
43
|
-
default: string;
|
|
44
|
-
types: string;
|
|
45
|
-
};
|
|
46
|
-
require?: {
|
|
47
|
-
default: string;
|
|
48
|
-
types: string;
|
|
49
|
-
};
|
|
50
|
-
}>;
|
|
51
|
-
/**
|
|
52
|
-
* Build configuration.
|
|
53
|
-
*/
|
|
54
|
-
interface BuildOptions {
|
|
55
|
-
/**
|
|
56
|
-
* Entry file to bundle.
|
|
57
|
-
*/
|
|
58
|
-
entry: string;
|
|
59
|
-
/**
|
|
60
|
-
* Output target: `"commonjs"`, `"esm"`, or `"both"`.
|
|
61
|
-
*
|
|
62
|
-
* default - "both"
|
|
63
|
-
*/
|
|
64
|
-
target?: Target;
|
|
65
|
-
/**
|
|
66
|
-
* Default export name if applicable.
|
|
67
|
-
* - Required when the entry has default export and `options.target` = `"commonjs"` or `"both"`
|
|
68
|
-
*
|
|
69
|
-
* Example :
|
|
70
|
-
*
|
|
71
|
-
* ```ts
|
|
72
|
-
* const foo = {bar:"foo"};
|
|
73
|
-
* export default foo; // defaultExportName = "foo"
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* default - undefined
|
|
77
|
-
*/
|
|
78
|
-
defaultExportName?: string | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Whether this build represents the main export , otherwise subpath export.
|
|
81
|
-
*
|
|
82
|
-
* default - true
|
|
83
|
-
*/
|
|
84
|
-
isMainExport?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Output directory.
|
|
87
|
-
*
|
|
88
|
-
* For a subpath export (not the main export), `outDir` must be a single-level
|
|
89
|
-
* nested folder under the main output directory.
|
|
90
|
-
*
|
|
91
|
-
* Example:
|
|
92
|
-
*
|
|
93
|
-
* ```ts
|
|
94
|
-
* const mainOutdir = "dist";
|
|
95
|
-
* const subpathOutdir = "dist/subpath"; // subpath export in package.json will be "./subpath"
|
|
96
|
-
* const fooOutdir = "dist/foo"; // subpath export in package.json will be "./foo"
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* default - "dist"
|
|
100
|
-
*/
|
|
101
|
-
outDir?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Identifiers to replace with blanks during compilation.
|
|
104
|
-
*
|
|
105
|
-
* default - []
|
|
106
|
-
*/
|
|
107
|
-
replaceWithBlank?: string[];
|
|
108
|
-
/**
|
|
109
|
-
* Array of hook functions executed during compilation.
|
|
110
|
-
*
|
|
111
|
-
* default - []
|
|
112
|
-
*/
|
|
113
|
-
hooks?: PostProcessHook[];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
export = SuSee;
|
|
117
|
-
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":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