@suseejs/types 0.1.1 → 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.
package/dist/index.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
- var SuSee;
3
- (function (SuSee) {
4
- const pkgName = "SU-SEE";
5
- })(SuSee || (SuSee = {}));
6
- module.exports = SuSee;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ts = require("typescript");
4
+ const pkgName = "SU-SEE";
7
5
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":";;AAAA,iCAAkC;AAElC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
package/dist/index.d.cts CHANGED
@@ -1,117 +1,156 @@
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;
1
+ import ts = require("typescript");
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 PostProcessExtension = {
24
+ type: "post-process";
25
+ async: true;
26
+ func: (code: string, file?: string) => Promise<string>;
27
+ } | {
28
+ type: "post-process";
29
+ async: false;
30
+ func: (code: string, file?: string) => string;
31
+ };
32
+ type PreProcessExtension = {
33
+ type: "pre-process";
34
+ async: true;
35
+ func: (code: string, file?: string) => Promise<string>;
36
+ } | {
37
+ type: "pre-process";
38
+ async: false;
39
+ func: (code: string, file?: string) => string;
40
+ };
41
+ type DependencyExtension = {
42
+ type: "dependency";
43
+ async: true;
44
+ func: (files: DepsFile[]) => Promise<DepsFile[]>;
45
+ } | {
46
+ type: "dependency";
47
+ async: false;
48
+ func: (files: DepsFile[]) => DepsFile[];
49
+ };
50
+ type ASTExtension = {
51
+ type: "ast";
52
+ async: true;
53
+ func: (sourceFile: ts.SourceFile) => Promise<ts.SourceFile>;
54
+ } | {
55
+ type: "ast";
56
+ async: false;
57
+ func: (sourceFile: ts.SourceFile) => ts.SourceFile;
58
+ };
59
+ type SuseeExtension = PostProcessExtension | PreProcessExtension | DependencyExtension | ASTExtension;
60
+ type OutFiles = {
61
+ commonjs: string | undefined;
62
+ commonjsTypes: string | undefined;
63
+ esm: string | undefined;
64
+ esmTypes: string | undefined;
65
+ main: string | undefined;
66
+ module: string | undefined;
67
+ types: string | undefined;
68
+ };
69
+ type Target = "commonjs" | "esm" | "both";
70
+ type Exports = Record<string, {
71
+ import?: {
72
+ default: string;
73
+ types: string;
29
74
  };
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;
75
+ require?: {
76
+ default: string;
77
+ types: string;
39
78
  };
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
- }>;
79
+ }>;
80
+ type NodeJsOutput = {
81
+ target: "nodejs";
82
+ /**
83
+ * path for package
84
+ *
85
+ * required
86
+ */
87
+ Path: "." | `./${string}`;
88
+ /**
89
+ * Output module type of package , commonjs,esm or both esm and commonjs
90
+ *
91
+ * default - esm
92
+ */
93
+ format?: "commonjs" | "esm" | "both";
94
+ };
95
+ type WebOutput = {
96
+ target: "web";
97
+ };
98
+ /**
99
+ * Entry point for SuSee configuration
100
+ */
101
+ type EntryPoint = {
102
+ /**
103
+ * Entry of file path of package
104
+ *
105
+ * required
106
+ */
107
+ entry: string;
108
+ /**
109
+ * Info for output
110
+ *
111
+ * required
112
+ */
113
+ output: NodeJsOutput | WebOutput;
114
+ /**
115
+ * Custom tsconfig.json path for package typescript compiler options
116
+ *
117
+ * Priority -
118
+ * 1. this custom tsconfig.json
119
+ * 2. tsconfig.json at root directory
120
+ * 3. default compiler options of susee
121
+ *
122
+ * default - undefined
123
+ */
124
+ tsconfigFilePath?: string | undefined;
125
+ /**
126
+ * When bundling , if there are duplicate declared names , susee will auto rename , if renameDuplicates = false exist with code 1.
127
+ *
128
+ * default - true
129
+ */
130
+ renameDuplicates?: boolean;
131
+ };
132
+ /**
133
+ * Configuration for Susee Bundler
134
+ */
135
+ interface SuSeeConfig {
136
+ /**
137
+ * Array of entry points object
138
+ *
139
+ * required
140
+ */
141
+ entryPoints: EntryPoint[];
142
+ /**
143
+ * Array of susee extension
144
+ *
145
+ * default - []
146
+ */
147
+ extensions?: SuseeExtension[];
51
148
  /**
52
- * Build configuration.
149
+ * Allow bundler to update your package.json.
150
+ *
151
+ * default - true
53
152
  */
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
- }
153
+ allowUpdatePackageJson?: boolean;
115
154
  }
116
- export = SuSee;
155
+ export type { SuseeExtension, Target, EntryPoint, SuSeeConfig, DepsFile, DuplicatesNameMap, NamesMap, NamesSet, NamesSets, BundleHandler, Exports, OutFiles, };
117
156
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":"AAAA,kBAAU,KAAK,CAAC;IAGd,UAAiB,QAAQ;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB;IACD,UAAiB,QAA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AEF,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,QAAQ,CAAC;IACjB;;;;OAIG;IACH,IAAI,EAAE,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;CACtC,CAAC;AAEF,KAAK,SAAS,GAAG;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnC;;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;IAC9B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;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"}
package/dist/index.d.ts CHANGED
@@ -1,117 +1,156 @@
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;
1
+ import ts from "typescript";
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 PostProcessExtension = {
24
+ type: "post-process";
25
+ async: true;
26
+ func: (code: string, file?: string) => Promise<string>;
27
+ } | {
28
+ type: "post-process";
29
+ async: false;
30
+ func: (code: string, file?: string) => string;
31
+ };
32
+ type PreProcessExtension = {
33
+ type: "pre-process";
34
+ async: true;
35
+ func: (code: string, file?: string) => Promise<string>;
36
+ } | {
37
+ type: "pre-process";
38
+ async: false;
39
+ func: (code: string, file?: string) => string;
40
+ };
41
+ type DependencyExtension = {
42
+ type: "dependency";
43
+ async: true;
44
+ func: (files: DepsFile[]) => Promise<DepsFile[]>;
45
+ } | {
46
+ type: "dependency";
47
+ async: false;
48
+ func: (files: DepsFile[]) => DepsFile[];
49
+ };
50
+ type ASTExtension = {
51
+ type: "ast";
52
+ async: true;
53
+ func: (sourceFile: ts.SourceFile) => Promise<ts.SourceFile>;
54
+ } | {
55
+ type: "ast";
56
+ async: false;
57
+ func: (sourceFile: ts.SourceFile) => ts.SourceFile;
58
+ };
59
+ type SuseeExtension = PostProcessExtension | PreProcessExtension | DependencyExtension | ASTExtension;
60
+ type OutFiles = {
61
+ commonjs: string | undefined;
62
+ commonjsTypes: string | undefined;
63
+ esm: string | undefined;
64
+ esmTypes: string | undefined;
65
+ main: string | undefined;
66
+ module: string | undefined;
67
+ types: string | undefined;
68
+ };
69
+ type Target = "commonjs" | "esm" | "both";
70
+ type Exports = Record<string, {
71
+ import?: {
72
+ default: string;
73
+ types: string;
29
74
  };
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;
75
+ require?: {
76
+ default: string;
77
+ types: string;
39
78
  };
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
- }>;
79
+ }>;
80
+ type NodeJsOutput = {
81
+ target: "nodejs";
82
+ /**
83
+ * path for package
84
+ *
85
+ * required
86
+ */
87
+ Path: "." | `./${string}`;
88
+ /**
89
+ * Output module type of package , commonjs,esm or both esm and commonjs
90
+ *
91
+ * default - esm
92
+ */
93
+ format?: "commonjs" | "esm" | "both";
94
+ };
95
+ type WebOutput = {
96
+ target: "web";
97
+ };
98
+ /**
99
+ * Entry point for SuSee configuration
100
+ */
101
+ type EntryPoint = {
102
+ /**
103
+ * Entry of file path of package
104
+ *
105
+ * required
106
+ */
107
+ entry: string;
108
+ /**
109
+ * Info for output
110
+ *
111
+ * required
112
+ */
113
+ output: NodeJsOutput | WebOutput;
114
+ /**
115
+ * Custom tsconfig.json path for package typescript compiler options
116
+ *
117
+ * Priority -
118
+ * 1. this custom tsconfig.json
119
+ * 2. tsconfig.json at root directory
120
+ * 3. default compiler options of susee
121
+ *
122
+ * default - undefined
123
+ */
124
+ tsconfigFilePath?: string | undefined;
125
+ /**
126
+ * When bundling , if there are duplicate declared names , susee will auto rename , if renameDuplicates = false exist with code 1.
127
+ *
128
+ * default - true
129
+ */
130
+ renameDuplicates?: boolean;
131
+ };
132
+ /**
133
+ * Configuration for Susee Bundler
134
+ */
135
+ interface SuSeeConfig {
136
+ /**
137
+ * Array of entry points object
138
+ *
139
+ * required
140
+ */
141
+ entryPoints: EntryPoint[];
142
+ /**
143
+ * Array of susee extension
144
+ *
145
+ * default - []
146
+ */
147
+ extensions?: SuseeExtension[];
51
148
  /**
52
- * Build configuration.
149
+ * Allow bundler to update your package.json.
150
+ *
151
+ * default - true
53
152
  */
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
- }
153
+ allowUpdatePackageJson?: boolean;
115
154
  }
116
- export default SuSee;
155
+ export type { SuseeExtension, Target, EntryPoint, SuSeeConfig, DepsFile, DuplicatesNameMap, NamesMap, NamesSet, NamesSets, BundleHandler, Exports, OutFiles, };
117
156
  //# sourceMappingURL=index.d.ts.map
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E;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C,CACF,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,QAAQ,CAAC;IACjB;;;;OAIG;IACH,IAAI,EAAE,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;CACtC,CAAC;AAEF,KAAK,SAAS,GAAG;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnC;;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;IAC9B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;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"}
package/dist/index.js CHANGED
@@ -1,6 +1,3 @@
1
- var SuSee;
2
- (function (SuSee) {
3
- const pkgName = "SU-SEE";
4
- })(SuSee || (SuSee = {}));
5
- export default SuSee;
1
+ import ts from "typescript";
2
+ const pkgName = "SU-SEE";
6
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,IAAU,KAAK,CAuHd;AAvHD,WAAU,KAAK;IACb,MAAM,OAAO,GAAG,QAAQ,CAAC;AAsH3B,CAAC,EAvHS,KAAK,KAAL,KAAK,QAuHd;AAED,eAAe,KAAK,CAAC"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suseejs/types",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Type definitions for suseejs",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",