@visulima/packem 1.0.0-alpha.1 → 1.0.0-alpha.11

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +3 -0
  3. package/dist/cli.cjs +1 -1
  4. package/dist/cli.mjs +1 -1
  5. package/dist/config.cjs +1 -1
  6. package/dist/config.d.cts +6 -2
  7. package/dist/config.d.mts +6 -2
  8. package/dist/config.d.ts +6 -2
  9. package/dist/create-bundler.cjs +52 -51
  10. package/dist/create-bundler.d.cts +6 -3
  11. package/dist/create-bundler.d.mts +6 -3
  12. package/dist/create-bundler.d.ts +6 -3
  13. package/dist/create-bundler.mjs +54 -53
  14. package/dist/rollup/plugins/esbuild/index.cjs +1 -0
  15. package/dist/rollup/plugins/esbuild/index.d.cts +9 -0
  16. package/dist/rollup/plugins/esbuild/index.d.mts +9 -0
  17. package/dist/rollup/plugins/esbuild/index.d.ts +9 -0
  18. package/dist/rollup/plugins/esbuild/index.mjs +9 -0
  19. package/dist/rollup/plugins/sucrase/index.cjs +1 -0
  20. package/dist/rollup/plugins/sucrase/index.d.cts +8 -0
  21. package/dist/rollup/plugins/sucrase/index.d.mts +8 -0
  22. package/dist/rollup/plugins/sucrase/index.d.ts +8 -0
  23. package/dist/rollup/plugins/sucrase/index.mjs +1 -0
  24. package/dist/rollup/plugins/swc/index.cjs +1 -0
  25. package/dist/rollup/plugins/swc/index.d.cts +7 -0
  26. package/dist/rollup/plugins/swc/index.d.mts +7 -0
  27. package/dist/rollup/plugins/swc/index.d.ts +7 -0
  28. package/dist/rollup/plugins/swc/index.mjs +1 -0
  29. package/dist/shared/packem.Bdmp1hC5.mjs +1 -0
  30. package/dist/shared/packem.Bj4QPFg7.mjs +1 -0
  31. package/dist/shared/{packem.gPxnaycf.d.cts → packem.C44tLE3n.d.cts} +3 -196
  32. package/dist/shared/{packem.gPxnaycf.d.mts → packem.C44tLE3n.d.mts} +3 -196
  33. package/dist/shared/{packem.gPxnaycf.d.ts → packem.C44tLE3n.d.ts} +3 -196
  34. package/dist/shared/packem.CAQMZ6ex.d.mts +176 -0
  35. package/dist/shared/packem.CEXB7aOL.cjs +1 -0
  36. package/dist/shared/packem.D09xRBAa.d.cts +25 -0
  37. package/dist/shared/packem.D09xRBAa.d.mts +25 -0
  38. package/dist/shared/packem.D09xRBAa.d.ts +25 -0
  39. package/dist/shared/packem.DZfoF9Bk.d.cts +176 -0
  40. package/dist/shared/packem.DvWhOdt5.d.cts +10 -0
  41. package/dist/shared/packem.DvWhOdt5.d.mts +10 -0
  42. package/dist/shared/packem.DvWhOdt5.d.ts +10 -0
  43. package/dist/shared/packem.aHRI8QbF.d.ts +176 -0
  44. package/dist/shared/packem.uvB0cQX0.cjs +1 -0
  45. package/package.json +35 -3
@@ -0,0 +1,176 @@
1
+ import { RollupAliasOptions } from '@rollup/plugin-alias';
2
+ import { RollupCommonJSOptions } from '@rollup/plugin-commonjs';
3
+ import { RollupJsonOptions } from '@rollup/plugin-json';
4
+ import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
5
+ import { RollupReplaceOptions } from '@rollup/plugin-replace';
6
+ import { RollupWasmOptions } from '@rollup/plugin-wasm';
7
+ import { FilterPattern } from '@rollup/pluginutils';
8
+ import { PackageJson, TsConfigResult } from '@visulima/package';
9
+ import { Pail } from '@visulima/pail';
10
+ import { Hookable } from 'hookable';
11
+ import { JITIOptions } from 'jiti';
12
+ import { RollupBuild, RollupOptions, RollupWatcher, Plugin, OutputOptions } from 'rollup';
13
+ import { Options } from 'rollup-plugin-dts';
14
+ import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
15
+ import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
16
+ import { E as EsbuildPluginConfig, O as Options$1 } from './packem.D09xRBAa.js';
17
+ import { S as SucrasePluginConfig } from './packem.DvWhOdt5.js';
18
+ import { S as SwcPluginConfig } from './packem.C44tLE3n.js';
19
+
20
+ interface CJSInteropOptions {
21
+ addDefaultProperty?: boolean;
22
+ }
23
+
24
+ type SingleTargetDesc = {
25
+ dest?: string;
26
+ exclude?: string[] | string;
27
+ src: string[] | string;
28
+ };
29
+ type MultipleTargetsDesc = SingleTargetDesc | SingleTargetDesc[] | string[] | string;
30
+ type CopyPluginOptions = {
31
+ copyOnce?: boolean;
32
+ exactFileNames?: boolean;
33
+ flatten?: boolean;
34
+ targets: MultipleTargetsDesc;
35
+ };
36
+
37
+ type JSXRemoveAttributesPlugin = {
38
+ attributes: string[];
39
+ };
40
+
41
+ interface LicenseOptions {
42
+ dtsMarker?: string;
43
+ dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
44
+ marker?: string;
45
+ path?: string;
46
+ template?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
47
+ }
48
+
49
+ interface RawLoaderOptions {
50
+ exclude?: FilterPattern;
51
+ include?: FilterPattern;
52
+ }
53
+
54
+ interface PatchTypesOptions {
55
+ identifierReplacements?: Record<string, Record<string, string>>;
56
+ }
57
+
58
+ type DeepPartial<T> = {
59
+ [P in keyof T]?: DeepPartial<T[P]>;
60
+ };
61
+ interface RollupDynamicImportVariablesOptions {
62
+ errorWhenNoFilesFound?: boolean;
63
+ exclude?: FilterPattern;
64
+ include?: FilterPattern;
65
+ warnOnError?: boolean;
66
+ }
67
+ interface RollupBuildOptions {
68
+ alias: RollupAliasOptions | false;
69
+ cjsInterop?: CJSInteropOptions;
70
+ commonjs: RollupCommonJSOptions | false;
71
+ copy?: CopyPluginOptions | false;
72
+ dts: Options;
73
+ dynamicVars?: RollupDynamicImportVariablesOptions | false;
74
+ esbuild: Options$1 | false;
75
+ json: RollupJsonOptions | false;
76
+ jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
77
+ license?: LicenseOptions | false;
78
+ metafile?: boolean;
79
+ output?: OutputOptions;
80
+ patchTypes: PatchTypesOptions | false;
81
+ polyfillNode?: NodePolyfillsOptions | false;
82
+ preserveDynamicImports?: boolean;
83
+ raw?: RawLoaderOptions | false;
84
+ replace: RollupReplaceOptions | false;
85
+ resolve: RollupNodeResolveOptions | false;
86
+ shim?: boolean;
87
+ sucrase?: SucrasePluginConfig | false;
88
+ swc?: SwcPluginConfig | false;
89
+ treeshake?: RollupOptions["treeshake"];
90
+ visualizer?: PluginVisualizerOptions | false;
91
+ watch?: RollupOptions["watch"];
92
+ wsam?: RollupWasmOptions | false;
93
+ }
94
+ type BuildEntry = {
95
+ declaration?: boolean | "compatible" | "node16";
96
+ input: string;
97
+ isExecutable?: boolean;
98
+ name?: string;
99
+ outDir?: string;
100
+ };
101
+ interface BuildOptions {
102
+ alias: Record<string, string>;
103
+ cjsInterop?: boolean;
104
+ clean: boolean;
105
+ declaration?: boolean | "compatible" | "node16";
106
+ dependencies: string[];
107
+ devDependencies: string[];
108
+ emitCJS?: boolean;
109
+ emitESM?: boolean;
110
+ entries: BuildEntry[];
111
+ externals: (RegExp | string)[];
112
+ failOnWarn?: boolean;
113
+ minify: boolean;
114
+ name: string;
115
+ optionalDependencies: string[];
116
+ outDir: string;
117
+ peerDependencies: string[];
118
+ replace: Record<string, string>;
119
+ rollup: RollupBuildOptions;
120
+ rootDir: string;
121
+ sourcemap: boolean;
122
+ stub: boolean;
123
+ stubOptions: {
124
+ jiti: Omit<JITIOptions, "onError" | "transform">;
125
+ };
126
+ transformer?: (config: SwcPluginConfig | SucrasePluginConfig | EsbuildPluginConfig) => Plugin;
127
+ }
128
+ interface BuildHooks {
129
+ "build:before": (context: BuildContext) => Promise<void> | void;
130
+ "build:done": (context: BuildContext) => Promise<void> | void;
131
+ "build:prepare": (context: BuildContext) => Promise<void> | void;
132
+ "rollup:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
133
+ "rollup:done": (context: BuildContext) => Promise<void> | void;
134
+ "rollup:dts:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
135
+ "rollup:dts:done": (context: BuildContext) => Promise<void> | void;
136
+ "rollup:dts:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
137
+ "rollup:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
138
+ "rollup:watch": (context: BuildContext, watcher: RollupWatcher) => Promise<void> | void;
139
+ }
140
+ type BuildContextBuildEntry = {
141
+ bytes?: number;
142
+ chunk?: boolean;
143
+ chunks?: string[];
144
+ exports?: string[];
145
+ modules?: {
146
+ bytes: number;
147
+ id: string;
148
+ }[];
149
+ path: string;
150
+ type?: "asset" | "chunk" | "entry";
151
+ };
152
+ interface InternalBuildOptions extends BuildOptions {
153
+ transformerName: "esbuild" | "sucrase" | "swc" | undefined;
154
+ }
155
+ interface BuildContext {
156
+ buildEntries: BuildContextBuildEntry[];
157
+ dependencyGraphMap: Map<string, Set<[string, string]>>;
158
+ hooks: Hookable<BuildHooks>;
159
+ logger: Pail<never, string>;
160
+ mode: Mode;
161
+ options: InternalBuildOptions;
162
+ pkg: PackageJson;
163
+ rootDir: string;
164
+ tsconfig?: TsConfigResult;
165
+ usedImports: Set<string>;
166
+ warnings: Set<string>;
167
+ }
168
+ type BuildPreset = BuildConfig | (() => BuildConfig);
169
+ interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
170
+ entries?: (BuildEntry | string)[];
171
+ hooks?: Partial<BuildHooks>;
172
+ preset?: BuildPreset | string;
173
+ }
174
+ type Mode = "build" | "jit" | "watch";
175
+
176
+ export type { BuildConfig as B, Mode as M, BuildPreset as a, BuildHooks as b };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("@rollup/plugin-node-resolve"),e=[...s.DEFAULTS.extensions,".cjs"],f=[...e,".ts",".cts",".mts",".tsx",".jsx"],i={".aac":"file",".cjs":"js",".css":"file",".cts":"ts",".eot":"file",".flac":"file",".gif":"file",".jpeg":"file",".jpg":"file",".js":"js",".json":"json",".jsx":"jsx",".mjs":"js",".mp3":"file",".mp4":"file",".mts":"ts",".ogg":"file",".otf":"file",".png":"file",".svg":"file",".ts":"ts",".tsx":"tsx",".ttf":"file",".wav":"file",".webm":"file",".webp":"file",".woff":"file",".woff2":"file"},E=/node_modules/;exports.DEFAULT_EXTENSIONS=f,exports.DEFAULT_LOADERS=i,exports.EXCLUDE_REGEXP=E;
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@visulima/packem",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.11",
4
4
  "description": "A fast and modern bundler for Node.js and TypeScript.",
5
5
  "keywords": [
6
6
  "anolilab",
7
7
  "visulima",
8
8
  "esbuild",
9
+ "swc",
10
+ "sucrase",
9
11
  "rollup",
10
12
  "zero config",
11
13
  "package.json",
@@ -60,6 +62,36 @@
60
62
  "default": "./dist/config.mjs"
61
63
  }
62
64
  },
65
+ "./transformer/esbuild": {
66
+ "require": {
67
+ "types": "./dist/rollup/plugins/esbuild/index.d.cts",
68
+ "default": "./dist/rollup/plugins/esbuild/index.cjs"
69
+ },
70
+ "import": {
71
+ "types": "./dist/rollup/plugins/esbuild/index.d.mts",
72
+ "default": "./dist/rollup/plugins/esbuild/index.mjs"
73
+ }
74
+ },
75
+ "./transformer/swc": {
76
+ "require": {
77
+ "types": "./dist/rollup/plugins/swc/index.d.cts",
78
+ "default": "./dist/rollup/plugins/swc/index.cjs"
79
+ },
80
+ "import": {
81
+ "types": "./dist/rollup/plugins/swc/index.d.mts",
82
+ "default": "./dist/rollup/plugins/swc/index.mjs"
83
+ }
84
+ },
85
+ "./transformer/sucrase": {
86
+ "require": {
87
+ "types": "./dist/rollup/plugins/sucrase/index.d.cts",
88
+ "default": "./dist/rollup/plugins/sucrase/index.cjs"
89
+ },
90
+ "import": {
91
+ "types": "./dist/rollup/plugins/sucrase/index.d.mts",
92
+ "default": "./dist/rollup/plugins/sucrase/index.mjs"
93
+ }
94
+ },
63
95
  "./package.json": "./package.json"
64
96
  },
65
97
  "main": "./dist/create-bundler.cjs",
@@ -156,8 +188,8 @@
156
188
  "vue": "^3.4.27"
157
189
  },
158
190
  "peerDependencies": {
159
- "@swc/core": "^1.4.17",
160
- "esbuild": "^0.20.2",
191
+ "@swc/core": "^1.5.7",
192
+ "esbuild": "^0.20.2 || ^0.21.3",
161
193
  "jiti": "^1.21.0",
162
194
  "sucrase": "^3.35.0",
163
195
  "typescript": "^4.5 || ^5.0"