jiek 2.0.2-alpha.1 → 2.0.2-alpha.10

Sign up to get free protection for your applications and to get access to all the features.
package/index.cjs ADDED
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const defineConfig = (config) => config;
4
+
5
+ exports.defineConfig = defineConfig;
package/index.d.cts ADDED
@@ -0,0 +1,112 @@
1
+ import * as _rollup_plugin_terser from '@rollup/plugin-terser';
2
+ import * as rollup_plugin_swc3 from 'rollup-plugin-swc3';
3
+ import * as rollup_plugin_esbuild from 'rollup-plugin-esbuild';
4
+ import { InputPluginOption, OutputOptions } from 'rollup';
5
+
6
+ type Mapping2ROO<K extends keyof OutputOptions> = OutputOptions[K] | {
7
+ js?: OutputOptions[K];
8
+ dts?: OutputOptions[K];
9
+ };
10
+ interface ConfigGenerateContext {
11
+ path: string;
12
+ name: string;
13
+ input: string;
14
+ output: string;
15
+ external: (string | RegExp)[];
16
+ pkgIsModule: boolean;
17
+ conditionals: string[];
18
+ }
19
+ type OutputControl = boolean | ((context: ConfigGenerateContext) => boolean);
20
+ declare const BUILDER_TYPES: readonly ["esbuild", "swc"];
21
+ interface TemplateOptions {
22
+ /**
23
+ * When the user configures type: module, the generated output from entry points that don't
24
+ * have cts as a suffix will automatically include the CJS version.
25
+ * if it is not configured, and the generated output from entry points that do not have mts
26
+ * as a suffix will automatically include the ESM version.
27
+ *
28
+ * @default true
29
+ */
30
+ crossModuleConvertor?: boolean;
31
+ /**
32
+ * Auto-detect the builder from the installed dependencies.
33
+ * If the builder is not installed, it will prompt the user to install it.
34
+ * If exists multiple builders, it will fall back to the 'esbuild'.
35
+ *
36
+ * @default 'esbuild'
37
+ */
38
+ builder?: typeof BUILDER_TYPES[number] | ({
39
+ type: 'esbuild';
40
+ } & rollup_plugin_esbuild.Options) | ({
41
+ type: 'swc';
42
+ } & rollup_plugin_swc3.PluginOptions);
43
+ output?: {
44
+ /**
45
+ * @default true
46
+ *
47
+ * When minify is set to true, the output will with minified files.
48
+ * When minify is set to 'only-minify', the output will direct output minified files.
49
+ */
50
+ minify?: boolean | 'only-minify';
51
+ minifyOptions?: typeof BUILDER_TYPES[number] | 'terser' | ({
52
+ type: 'terser';
53
+ } & _rollup_plugin_terser.Options) | ({
54
+ type: 'esbuild';
55
+ } & Parameters<typeof rollup_plugin_esbuild.minify>[0]) | ({
56
+ type: 'swc';
57
+ } & Parameters<typeof rollup_plugin_swc3.minify>[0]);
58
+ /**
59
+ * @default 'dist'
60
+ */
61
+ dir?: Mapping2ROO<'dir'>;
62
+ sourcemap?: Mapping2ROO<'sourcemap'>;
63
+ strict?: Mapping2ROO<'strict'>;
64
+ js?: OutputControl;
65
+ dts?: OutputControl;
66
+ };
67
+ /**
68
+ * Set the external dependencies of the package.
69
+ */
70
+ external?: (string | RegExp)[];
71
+ plugins?: InputPluginOption | ((type: 'js' | 'dts', context: ConfigGenerateContext) => InputPluginOption) | {
72
+ js: InputPluginOption;
73
+ dts?: InputPluginOption;
74
+ } | {
75
+ js?: InputPluginOption;
76
+ dts: InputPluginOption;
77
+ };
78
+ }
79
+
80
+ declare module 'jiek' {
81
+ interface Config {
82
+ build?: TemplateOptions & {
83
+ /**
84
+ * Whether to run in silent mode, only active when configured in the workspace root or cwd.
85
+ *
86
+ * @default false
87
+ */
88
+ silent?: boolean;
89
+ };
90
+ }
91
+ }
92
+
93
+ declare module 'jiek' {
94
+ interface Config {
95
+ publish?: {
96
+ /**
97
+ * @default false
98
+ */
99
+ withSuffix?: boolean;
100
+ /**
101
+ * @default true
102
+ */
103
+ withSource?: boolean;
104
+ };
105
+ }
106
+ }
107
+
108
+ interface Config {
109
+ }
110
+ declare const defineConfig: (config: Config) => Config;
111
+
112
+ export { type Config, defineConfig };
package/index.d.ts ADDED
@@ -0,0 +1,112 @@
1
+ import * as _rollup_plugin_terser from '@rollup/plugin-terser';
2
+ import * as rollup_plugin_swc3 from 'rollup-plugin-swc3';
3
+ import * as rollup_plugin_esbuild from 'rollup-plugin-esbuild';
4
+ import { InputPluginOption, OutputOptions } from 'rollup';
5
+
6
+ type Mapping2ROO<K extends keyof OutputOptions> = OutputOptions[K] | {
7
+ js?: OutputOptions[K];
8
+ dts?: OutputOptions[K];
9
+ };
10
+ interface ConfigGenerateContext {
11
+ path: string;
12
+ name: string;
13
+ input: string;
14
+ output: string;
15
+ external: (string | RegExp)[];
16
+ pkgIsModule: boolean;
17
+ conditionals: string[];
18
+ }
19
+ type OutputControl = boolean | ((context: ConfigGenerateContext) => boolean);
20
+ declare const BUILDER_TYPES: readonly ["esbuild", "swc"];
21
+ interface TemplateOptions {
22
+ /**
23
+ * When the user configures type: module, the generated output from entry points that don't
24
+ * have cts as a suffix will automatically include the CJS version.
25
+ * if it is not configured, and the generated output from entry points that do not have mts
26
+ * as a suffix will automatically include the ESM version.
27
+ *
28
+ * @default true
29
+ */
30
+ crossModuleConvertor?: boolean;
31
+ /**
32
+ * Auto-detect the builder from the installed dependencies.
33
+ * If the builder is not installed, it will prompt the user to install it.
34
+ * If exists multiple builders, it will fall back to the 'esbuild'.
35
+ *
36
+ * @default 'esbuild'
37
+ */
38
+ builder?: typeof BUILDER_TYPES[number] | ({
39
+ type: 'esbuild';
40
+ } & rollup_plugin_esbuild.Options) | ({
41
+ type: 'swc';
42
+ } & rollup_plugin_swc3.PluginOptions);
43
+ output?: {
44
+ /**
45
+ * @default true
46
+ *
47
+ * When minify is set to true, the output will with minified files.
48
+ * When minify is set to 'only-minify', the output will direct output minified files.
49
+ */
50
+ minify?: boolean | 'only-minify';
51
+ minifyOptions?: typeof BUILDER_TYPES[number] | 'terser' | ({
52
+ type: 'terser';
53
+ } & _rollup_plugin_terser.Options) | ({
54
+ type: 'esbuild';
55
+ } & Parameters<typeof rollup_plugin_esbuild.minify>[0]) | ({
56
+ type: 'swc';
57
+ } & Parameters<typeof rollup_plugin_swc3.minify>[0]);
58
+ /**
59
+ * @default 'dist'
60
+ */
61
+ dir?: Mapping2ROO<'dir'>;
62
+ sourcemap?: Mapping2ROO<'sourcemap'>;
63
+ strict?: Mapping2ROO<'strict'>;
64
+ js?: OutputControl;
65
+ dts?: OutputControl;
66
+ };
67
+ /**
68
+ * Set the external dependencies of the package.
69
+ */
70
+ external?: (string | RegExp)[];
71
+ plugins?: InputPluginOption | ((type: 'js' | 'dts', context: ConfigGenerateContext) => InputPluginOption) | {
72
+ js: InputPluginOption;
73
+ dts?: InputPluginOption;
74
+ } | {
75
+ js?: InputPluginOption;
76
+ dts: InputPluginOption;
77
+ };
78
+ }
79
+
80
+ declare module 'jiek' {
81
+ interface Config {
82
+ build?: TemplateOptions & {
83
+ /**
84
+ * Whether to run in silent mode, only active when configured in the workspace root or cwd.
85
+ *
86
+ * @default false
87
+ */
88
+ silent?: boolean;
89
+ };
90
+ }
91
+ }
92
+
93
+ declare module 'jiek' {
94
+ interface Config {
95
+ publish?: {
96
+ /**
97
+ * @default false
98
+ */
99
+ withSuffix?: boolean;
100
+ /**
101
+ * @default true
102
+ */
103
+ withSource?: boolean;
104
+ };
105
+ }
106
+ }
107
+
108
+ interface Config {
109
+ }
110
+ declare const defineConfig: (config: Config) => Config;
111
+
112
+ export { type Config, defineConfig };
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ const defineConfig = (config) => config;
2
+
3
+ export { defineConfig };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jiek",
3
3
  "type": "module",
4
- "version": "2.0.2-alpha.1",
4
+ "version": "2.0.2-alpha.10",
5
5
  "description": "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.",
6
6
  "author": "YiJie <yijie4188@gmail.com>",
7
7
  "repository": {
@@ -16,13 +16,6 @@
16
16
  "jiek-build": "bin/jiek-build.js",
17
17
  "jb": "bin/jiek-build.js"
18
18
  },
19
- "files": [
20
- "dist",
21
- "src",
22
- "bin",
23
- "LICENSE",
24
- "README.md"
25
- ],
26
19
  "exports": {
27
20
  "./package.json": "./package.json",
28
21
  ".": {
@@ -75,6 +68,23 @@
75
68
  "rollup-plugin-swc3": "^0.12.1",
76
69
  "typescript": "^4.0.0||^5.0.0"
77
70
  },
71
+ "devDependencies": {
72
+ "@npm/types": "^1.0.2",
73
+ "@pnpm/filter-workspace-packages": "^7.2.13",
74
+ "@pnpm/workspace.pkgs-graph": "^2.0.15",
75
+ "@rollup/plugin-terser": "^0.4.4",
76
+ "@types/cli-progress": "^3.11.5",
77
+ "@types/inquirer": "^9.0.7",
78
+ "@types/js-yaml": "^4.0.9",
79
+ "@types/micromatch": "^4.0.6",
80
+ "esbuild-register": "^3.5.0",
81
+ "micromatch": "^4.0.5",
82
+ "node-sass": "^9.0.0",
83
+ "postcss": "^8.4.47",
84
+ "rollup-plugin-postcss": "^4.0.2",
85
+ "rollup-plugin-esbuild": "^6.1.0",
86
+ "rollup-plugin-swc3": "^0.12.1"
87
+ },
78
88
  "peerDependenciesMeta": {
79
89
  "@rollup/plugin-terser": {
80
90
  "optional": true
@@ -101,40 +111,20 @@
101
111
  "optional": true
102
112
  }
103
113
  },
104
- "devDependencies": {
105
- "@npm/types": "^1.0.2",
106
- "@pnpm/filter-workspace-packages": "^7.2.13",
107
- "@pnpm/workspace.pkgs-graph": "^2.0.15",
108
- "@rollup/plugin-terser": "^0.4.4",
109
- "@types/cli-progress": "^3.11.5",
110
- "@types/inquirer": "^9.0.7",
111
- "@types/js-yaml": "^4.0.9",
112
- "@types/micromatch": "^4.0.6",
113
- "esbuild-register": "^3.5.0",
114
- "micromatch": "^4.0.5",
115
- "node-sass": "^9.0.0",
116
- "postcss": "^8.4.47",
117
- "rollup-plugin-postcss": "^4.0.2",
118
- "rollup-plugin-esbuild": "^6.1.0",
119
- "rollup-plugin-swc3": "^0.12.1"
120
- },
121
- "publishConfig": {
122
- "directory": "./dist"
123
- },
124
114
  "scripts": {
125
- "prepublish": "jb -nm -nc"
115
+ "prepublish": "jb -nm && jk"
126
116
  },
127
- "main": "./dist/index.cjs",
128
- "module": "./dist/index.js",
129
117
  "typesVersions": {
130
118
  "<5.0": {
131
119
  "*": [
132
120
  "*",
133
- "./dist/*",
134
- "./dist/*/index.d.ts",
135
- "./dist/*/index.d.mts",
136
- "./dist/*/index.d.cts"
121
+ "./*",
122
+ "./*/index.d.ts",
123
+ "./*/index.d.mts",
124
+ "./*/index.d.cts"
137
125
  ]
138
126
  }
139
- }
127
+ },
128
+ "main": "./dist/index.cjs",
129
+ "module": "./dist/index.js"
140
130
  }