@visulima/packem 2.0.0-alpha.7 → 2.0.0-alpha.70
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/CHANGELOG.md +923 -2
- package/LICENSE.md +552 -2582
- package/README.md +59 -32
- package/dist/builder/typedoc/index.d.ts +10 -23
- package/dist/builder/typedoc/index.js +3 -3
- package/dist/cli/index.js +47 -37
- package/dist/config/index.d.ts +54 -24
- package/dist/config/preset/preact.d.ts +30 -0
- package/dist/config/preset/preact.js +2 -0
- package/dist/config/preset/react.d.ts +71 -0
- package/dist/config/preset/react.js +1 -0
- package/dist/config/preset/solid.d.ts +113 -0
- package/dist/config/preset/solid.js +1 -0
- package/dist/config/preset/svelte.d.ts +83 -0
- package/dist/config/preset/svelte.js +1 -0
- package/dist/config/preset/vue.d.ts +65 -0
- package/dist/config/preset/vue.js +1 -0
- package/dist/index.d.ts +53 -30
- package/dist/index.js +1 -1
- package/dist/packem_shared/create-or-update-key-storage-Ddq46eG8.js +1 -0
- package/dist/packem_shared/index-CBiZaA3V.js +88 -0
- package/dist/packem_shared/types.d-CRug-s8c.d.ts +440 -0
- package/dist/rollup/plugins/css/loaders/less.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/less.js +1 -1
- package/dist/rollup/plugins/css/loaders/lightningcss.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/lightningcss.js +1 -1
- package/dist/rollup/plugins/css/loaders/postcss.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/postcss.js +1 -1
- package/dist/rollup/plugins/css/loaders/sass.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/sass.js +1 -1
- package/dist/rollup/plugins/css/loaders/sourcemap.d.ts +1 -8
- package/dist/rollup/plugins/css/loaders/sourcemap.js +1 -1
- package/dist/rollup/plugins/css/loaders/stylus.d.ts +1 -1
- package/dist/rollup/plugins/css/loaders/stylus.js +1 -1
- package/dist/rollup/plugins/css/loaders/tailwindcss.d.ts +1 -0
- package/dist/rollup/plugins/css/loaders/tailwindcss.js +1 -0
- package/dist/rollup/plugins/css/minifiers/cssnano.d.ts +1 -1
- package/dist/rollup/plugins/css/minifiers/cssnano.js +1 -1
- package/dist/rollup/plugins/css/minifiers/lightningcss.d.ts +1 -1
- package/dist/rollup/plugins/css/minifiers/lightningcss.js +1 -1
- package/dist/rollup/plugins/esbuild/index.d.ts +1 -24
- package/dist/rollup/plugins/esbuild/index.js +1 -1
- package/dist/rollup/plugins/oxc/oxc-transformer.d.ts +1 -20
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/dist/rollup/plugins/sucrase/index.d.ts +1 -19
- package/dist/rollup/plugins/sucrase/index.js +1 -1
- package/dist/rollup/plugins/swc/swc-plugin.d.ts +1 -26
- package/dist/rollup/plugins/swc/swc-plugin.js +1 -1
- package/files.d.ts +37 -0
- package/package.json +83 -45
- package/dist/packem_shared/browserslistToEsbuild-C0IWmbNe-C6xPL1oW.js +0 -1
- package/dist/packem_shared/create-or-update-key-storage-GwAIWW7R.js +0 -3
- package/dist/packem_shared/default-B6X7-Lx3.js +0 -1
- package/dist/packem_shared/default-B_dUKZ_J.js +0 -1
- package/dist/packem_shared/default-C3sdXf4G.js +0 -1
- package/dist/packem_shared/default-DR5Fia_R.js +0 -1
- package/dist/packem_shared/default-DqRcOUe1.js +0 -1
- package/dist/packem_shared/esbuildPlugin-BAwyhG6L-yty60jMl.js +0 -3
- package/dist/packem_shared/index-C-T6BXtW.js +0 -138
- package/dist/packem_shared/index-CUp9WuCG.js +0 -1
- package/dist/packem_shared/index-zikl8Yu3.d.ts +0 -5229
- package/dist/packem_shared/isolatedDeclarationsOxcTransformer-WbfE6cGu-NeZOx2Y7.js +0 -1
- package/dist/packem_shared/isolatedDeclarationsSwcTransformer-Ch2AgtWC-B-0lOgFf.js +0 -1
- package/dist/packem_shared/isolatedDeclarationsTypescriptTransformer-DkuEkofo-Cwe3ODMG.js +0 -3
- package/dist/packem_shared/oxcResolvePlugin-BJpi-eSG-BsYx9cDO.js +0 -1
- package/dist/packem_shared/oxcTransformPlugin-DfVQouIB-Cpfv95eA.js +0 -4
- package/dist/packem_shared/resolveTypescriptMjsCtsPlugin-DcZrZTmM-BEkYWTsH.js +0 -6
- package/dist/packem_shared/swcPlugin-Boip4lWG-CwJ-HVJc.js +0 -1
- package/dist/packem_shared/types-Dn9KmF6u.d.ts +0 -163
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +0 -25
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.js +0 -1
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts +0 -20
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.js +0 -1
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +0 -24
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.js +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { BabelPluginConfig } from '@visulima/packem-rollup/babel';
|
|
2
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CRug-s8c.js";
|
|
3
|
+
import '@arethetypeswrong/core';
|
|
4
|
+
import '@visulima/packem-rollup';
|
|
5
|
+
import '@visulima/packem-rollup/oxc';
|
|
6
|
+
import '@visulima/packem-rollup/plugin/native-modules';
|
|
7
|
+
import '@visulima/packem-share/types';
|
|
8
|
+
import '@visulima/packem-share/utils';
|
|
9
|
+
import '@visulima/rollup-plugin-css';
|
|
10
|
+
import 'jiti';
|
|
11
|
+
import 'rollup';
|
|
12
|
+
import 'typedoc';
|
|
13
|
+
import '@visulima/pail';
|
|
14
|
+
interface ReactPresetOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Enable React Compiler optimization
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
compiler?: boolean | {
|
|
20
|
+
/**
|
|
21
|
+
* React Compiler compilation mode
|
|
22
|
+
* @default "infer"
|
|
23
|
+
*/
|
|
24
|
+
compilationMode?: "infer" | "annotation";
|
|
25
|
+
/**
|
|
26
|
+
* React Compiler panic threshold
|
|
27
|
+
* @default "critical_errors"
|
|
28
|
+
*/
|
|
29
|
+
panicThreshold?: "critical_errors" | "all_errors";
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Custom Babel plugins to add
|
|
33
|
+
*/
|
|
34
|
+
plugins?: BabelPluginConfig["plugins"];
|
|
35
|
+
/**
|
|
36
|
+
* Custom Babel presets to add
|
|
37
|
+
*/
|
|
38
|
+
presets?: BabelPluginConfig["presets"];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* React preset for Packem. Configures Babel with React presets and optionally React Compiler.
|
|
42
|
+
* @description This preset configures Babel to run before your main transformer (esbuild/SWC/etc.).
|
|
43
|
+
* Babel handles JSX transformation, while TypeScript is handled by the transformer via parser plugins.
|
|
44
|
+
* This matches the approach used by @vitejs/plugin-react.
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* // Basic usage
|
|
48
|
+
* export default defineConfig({
|
|
49
|
+
* preset: "react"
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* // With React Compiler
|
|
53
|
+
* import { createReactPreset } from "@visulima/packem/config/preset/react";
|
|
54
|
+
* export default defineConfig({
|
|
55
|
+
* preset: createReactPreset({
|
|
56
|
+
* compiler: true
|
|
57
|
+
* })
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* // With custom options
|
|
61
|
+
* export default defineConfig({
|
|
62
|
+
* preset: createReactPreset({
|
|
63
|
+
* compiler: {
|
|
64
|
+
* compilationMode: "annotation"
|
|
65
|
+
* }
|
|
66
|
+
* })
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare const createReactPreset: (options?: ReactPresetOptions) => BuildConfig;
|
|
71
|
+
export { ReactPresetOptions, createReactPreset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var d=(o,e)=>f(o,"name",{value:e,configurable:!0});var m=Object.defineProperty,b=d((o,e)=>m(o,"name",{value:e,configurable:!0}),"s");const v=b((o={})=>{const{compiler:e=!1,plugins:a=[],presets:l=[]}=o,i=[],p=[];if(e){const s=typeof e=="object"?e:{};i.push(["babel-plugin-react-compiler",{compilationMode:s.compilationMode??"infer",panicThreshold:s.panicThreshold??"critical_errors"}])}p.push(["@babel/preset-react",{runtime:"automatic"}]);const c=[...i,...Array.isArray(a)?a:[]],u=[...p,...Array.isArray(l)?l:[]];return{hooks:{"rollup:options":b((s,h)=>{const r=s.options.rollup.babel;if(r&&typeof r=="object"&&r.presets){const n=r.presets.findIndex(t=>Array.isArray(t)&&t[0]==="@babel/preset-react");if(n!==-1){const t=r.presets[n];r.presets[n]=[t[0],{...typeof t[1]=="object"&&t[1]!==null?t[1]:{},development:s.environment==="development"}]}}},"rollup:options")},rollup:{babel:{plugins:c.length>0?c:void 0,presets:u.length>0?u:void 0}},validation:{dependencies:{hoisted:{exclude:[]},unused:{exclude:["react","react-dom"]}}}}},"createReactPreset");export{v as createReactPreset};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { BabelPluginConfig } from '@visulima/packem-rollup/babel';
|
|
2
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CRug-s8c.js";
|
|
3
|
+
import '@arethetypeswrong/core';
|
|
4
|
+
import '@visulima/packem-rollup';
|
|
5
|
+
import '@visulima/packem-rollup/oxc';
|
|
6
|
+
import '@visulima/packem-rollup/plugin/native-modules';
|
|
7
|
+
import '@visulima/packem-share/types';
|
|
8
|
+
import '@visulima/packem-share/utils';
|
|
9
|
+
import '@visulima/rollup-plugin-css';
|
|
10
|
+
import 'jiti';
|
|
11
|
+
import 'rollup';
|
|
12
|
+
import 'typedoc';
|
|
13
|
+
import '@visulima/pail';
|
|
14
|
+
interface SolidPresetOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Pass any additional babel transform options. They will be merged with
|
|
17
|
+
* the transformations required by Solid.
|
|
18
|
+
*/
|
|
19
|
+
babel?: BabelPluginConfig | ((source: string, id: string) => BabelPluginConfig | Promise<BabelPluginConfig>);
|
|
20
|
+
/**
|
|
21
|
+
* Custom Babel plugins to add
|
|
22
|
+
*/
|
|
23
|
+
plugins?: BabelPluginConfig["plugins"];
|
|
24
|
+
/**
|
|
25
|
+
* Custom Babel presets to add
|
|
26
|
+
*/
|
|
27
|
+
presets?: BabelPluginConfig["presets"];
|
|
28
|
+
/**
|
|
29
|
+
* SolidJS-specific options for babel-preset-solid
|
|
30
|
+
*/
|
|
31
|
+
solidOptions?: {
|
|
32
|
+
/**
|
|
33
|
+
* Array of Component exports from module, that aren't included by default with the library.
|
|
34
|
+
* This plugin will automatically import them if it comes across them in the JSX.
|
|
35
|
+
* @default ["For","Show","Switch","Match","Suspense","SuspenseList","Portal","Index","Dynamic","ErrorBoundary"]
|
|
36
|
+
*/
|
|
37
|
+
builtIns?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* Boolean indicates whether to set current render context on Custom Elements and slots.
|
|
40
|
+
* Useful for seemless Context API with Web Components.
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
contextToCustomElements?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Boolean to indicate whether to enable automatic event delegation on camelCase.
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
delegateEvents?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The output mode of the compiler.
|
|
51
|
+
* Can be:
|
|
52
|
+
* - "dom" is standard output
|
|
53
|
+
* - "ssr" is for server side rendering of strings.
|
|
54
|
+
* - "universal" is for using custom renderers from solid-js/universal
|
|
55
|
+
* @default "dom"
|
|
56
|
+
*/
|
|
57
|
+
generate?: "ssr" | "dom" | "universal";
|
|
58
|
+
/**
|
|
59
|
+
* Indicate whether the output should contain hydratable markers.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
hydratable?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The name of the runtime module to import the methods from.
|
|
65
|
+
* @default "solid-js/web"
|
|
66
|
+
*/
|
|
67
|
+
moduleName?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Boolean indicates whether smart conditional detection should be used.
|
|
70
|
+
* This optimizes simple boolean expressions and ternaries in JSX.
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
wrapConditionals?: boolean;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* SolidJS preset for Packem. Configures Babel with babel-preset-solid.
|
|
78
|
+
* @description This preset configures Babel to run before your main transformer (esbuild/SWC/etc.).
|
|
79
|
+
* Babel handles JSX transformation for SolidJS using babel-preset-solid. TypeScript is handled
|
|
80
|
+
* automatically via parser plugins based on file extensions (no preset needed).
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* // Basic usage
|
|
84
|
+
* export default defineConfig({
|
|
85
|
+
* preset: "solid"
|
|
86
|
+
* });
|
|
87
|
+
*
|
|
88
|
+
* // With custom Solid options
|
|
89
|
+
* import { createSolidPreset } from "@visulima/packem/config/preset/solid";
|
|
90
|
+
* export default defineConfig({
|
|
91
|
+
* preset: createSolidPreset({
|
|
92
|
+
* solidOptions: {
|
|
93
|
+
* generate: "ssr",
|
|
94
|
+
* hydratable: true
|
|
95
|
+
* }
|
|
96
|
+
* })
|
|
97
|
+
* });
|
|
98
|
+
*
|
|
99
|
+
* // With custom Babel options
|
|
100
|
+
* export default defineConfig({
|
|
101
|
+
* preset: createSolidPreset({
|
|
102
|
+
* solidOptions: {
|
|
103
|
+
* moduleName: "solid-js/web"
|
|
104
|
+
* },
|
|
105
|
+
* babel: {
|
|
106
|
+
* // Additional babel options
|
|
107
|
+
* }
|
|
108
|
+
* })
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
declare const createSolidPreset: (options?: SolidPresetOptions) => BuildConfig;
|
|
113
|
+
export { SolidPresetOptions, createSolidPreset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.defineProperty;var g=(o,e)=>j(o,"name",{value:e,configurable:!0});var O=Object.defineProperty,a=g((o,e)=>O(o,"name",{value:e,configurable:!0}),"a");const N=a(o=>{const e={contextToCustomElements:o?.contextToCustomElements??!0,delegateEvents:o?.delegateEvents??!0,generate:o?.generate??"dom",hydratable:o?.hydratable??!1,moduleName:o?.moduleName??"solid-js/web",wrapConditionals:o?.wrapConditionals??!0};return o?.builtIns!==void 0&&(e.builtIns=o.builtIns),e},"buildSolidPresetOptions"),E=a((o,e,n,l)=>{if(!e||typeof e=="function")return o;let s=n;if(e.plugins){const i=Array.isArray(e.plugins)?e.plugins:[];s=[...n||[],...i]}let r=l;if(e.presets){const i=Array.isArray(e.presets)?e.presets:[];r=[...l||[],...i]}return{...o,...e,plugins:s&&s.length>0?s:void 0,presets:r&&r.length>0?r:void 0}},"mergeUserBabelOptions"),x=a((o={})=>{const{babel:e,plugins:n=[],presets:l=[],solidOptions:s={}}=o,r=[],i=[],m=["babel-preset-solid",N(s)];i.push(m);const u=[...r,...Array.isArray(n)?n:[]],d=[...i,...Array.isArray(l)?l:[]],b={ast:!1,babelrc:!1,configFile:!1,plugins:u.length>0?u:void 0,presets:d.length>0?d:void 0,sourceMaps:!0},f={babel:E(b,e,u,d),resolve:{exportConditions:["solid"]}};return{externals:["solid-js","solid-js/web","solid-js/store"],hooks:{"rollup:options":a((t,h)=>{const c=t.environment==="development"?"development":"production",p=c==="development",{runtime:y}=t.options,v=y==="node";t.options.rollup.replace||(t.options.rollup.replace={preventAssignment:!0,values:{}}),t.options.rollup.replace.values||(t.options.rollup.replace.values={});const S={[["import","meta","env","DEV"].join(".")]:p,[["import","meta","env","NODE_ENV"].join(".")]:JSON.stringify(c),[["import","meta","env","PROD"].join(".")]:!p,[["import","meta","env","SSR"].join(".")]:v,[["process","env","DEV"].join(".")]:JSON.stringify(String(p)),[["process","env","NODE_ENV"].join(".")]:JSON.stringify(c),[["process","env","PROD"].join(".")]:JSON.stringify(String(!p)),[["process","env","SSR"].join(".")]:JSON.stringify(String(v))};Object.assign(t.options.rollup.replace.values,S)},"rollup:options")},rollup:f,validation:{dependencies:{hoisted:{exclude:[]},unused:{exclude:["solid-js"]}}}}},"createSolidPreset");export{x as createSolidPreset};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CRug-s8c.js";
|
|
2
|
+
import '@arethetypeswrong/core';
|
|
3
|
+
import '@visulima/packem-rollup';
|
|
4
|
+
import '@visulima/packem-rollup/oxc';
|
|
5
|
+
import '@visulima/packem-rollup/plugin/native-modules';
|
|
6
|
+
import '@visulima/packem-share/types';
|
|
7
|
+
import '@visulima/packem-share/utils';
|
|
8
|
+
import '@visulima/rollup-plugin-css';
|
|
9
|
+
import 'jiti';
|
|
10
|
+
import 'rollup';
|
|
11
|
+
import 'typedoc';
|
|
12
|
+
import '@visulima/pail';
|
|
13
|
+
interface SveltePresetOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Svelte plugin options
|
|
16
|
+
*/
|
|
17
|
+
pluginOptions?: {
|
|
18
|
+
/**
|
|
19
|
+
* Svelte compiler options
|
|
20
|
+
*/
|
|
21
|
+
compilerOptions?: {
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
/**
|
|
24
|
+
* Custom element mode
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
customElement?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Enable dev mode
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
dev?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Generate mode: "client" for client-side rendering, "server" for SSR
|
|
35
|
+
* @default "client"
|
|
36
|
+
*/
|
|
37
|
+
generate?: "client" | "server" | false;
|
|
38
|
+
/**
|
|
39
|
+
* Enable hydratable output
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
hydratable?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Exclude patterns for Svelte files
|
|
46
|
+
*/
|
|
47
|
+
exclude?: RegExp | RegExp[];
|
|
48
|
+
/**
|
|
49
|
+
* Include patterns for Svelte files
|
|
50
|
+
* @default [/\.svelte$/]
|
|
51
|
+
*/
|
|
52
|
+
include?: RegExp | RegExp[];
|
|
53
|
+
/**
|
|
54
|
+
* Preprocessor options
|
|
55
|
+
*/
|
|
56
|
+
preprocess?: unknown;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Svelte preset for Packem. Configures Rollup with rollup-plugin-svelte.
|
|
61
|
+
* @description This preset configures the Svelte plugin to handle .svelte file compilation.
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* // Basic usage
|
|
65
|
+
* export default defineConfig({
|
|
66
|
+
* preset: "svelte"
|
|
67
|
+
* });
|
|
68
|
+
*
|
|
69
|
+
* // With custom options
|
|
70
|
+
* import { createSveltePreset } from "@visulima/packem/config/preset/svelte";
|
|
71
|
+
* export default defineConfig({
|
|
72
|
+
* preset: createSveltePreset({
|
|
73
|
+
* pluginOptions: {
|
|
74
|
+
* compilerOptions: {
|
|
75
|
+
* hydratable: true
|
|
76
|
+
* }
|
|
77
|
+
* }
|
|
78
|
+
* })
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
declare const createSveltePreset: (options?: SveltePresetOptions) => BuildConfig;
|
|
83
|
+
export { SveltePresetOptions, createSveltePreset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var t=(r,e)=>s(r,"name",{value:e,configurable:!0});import{DEFAULT_EXTENSIONS as n}from"@visulima/packem-share/constants";import o from"rollup-plugin-svelte";var l=Object.defineProperty,i=t((r,e)=>l(r,"name",{value:e,configurable:!0}),"t");const d=i((r={})=>{const{pluginOptions:e={}}=r;return{rollup:{plugins:[{enforce:"pre",plugin:o({compilerOptions:{generate:"client",runes:!0,...e.compilerOptions},emitCss:!1,exclude:e.exclude,extensions:[".svelte"],include:e.include??[/\.svelte$/],preprocess:e.preprocess})}],resolve:{browser:!0,exportConditions:["svelte"],extensions:[...n,".svelte"]}},validation:{dependencies:{hoisted:{exclude:[]},unused:{exclude:["svelte"]}}}}},"createSveltePreset");export{d as createSveltePreset};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CRug-s8c.js";
|
|
2
|
+
import '@arethetypeswrong/core';
|
|
3
|
+
import '@visulima/packem-rollup';
|
|
4
|
+
import '@visulima/packem-rollup/oxc';
|
|
5
|
+
import '@visulima/packem-rollup/plugin/native-modules';
|
|
6
|
+
import '@visulima/packem-share/types';
|
|
7
|
+
import '@visulima/packem-share/utils';
|
|
8
|
+
import '@visulima/rollup-plugin-css';
|
|
9
|
+
import 'jiti';
|
|
10
|
+
import 'rollup';
|
|
11
|
+
import 'typedoc';
|
|
12
|
+
import '@visulima/pail';
|
|
13
|
+
interface VuePresetOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Vue plugin options
|
|
16
|
+
*/
|
|
17
|
+
pluginOptions?: {
|
|
18
|
+
/**
|
|
19
|
+
* Enable custom elements mode
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
customElement?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Exclude patterns for Vue files
|
|
25
|
+
*/
|
|
26
|
+
exclude?: RegExp | RegExp[];
|
|
27
|
+
/**
|
|
28
|
+
* Include patterns for Vue files
|
|
29
|
+
* @default [/\.vue$/]
|
|
30
|
+
*/
|
|
31
|
+
include?: RegExp | RegExp[];
|
|
32
|
+
/**
|
|
33
|
+
* Template compiler options
|
|
34
|
+
*/
|
|
35
|
+
template?: {
|
|
36
|
+
compilerOptions?: {
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
isCustomElement?: (tag: string) => boolean;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Vue preset for Packem. Configures Rollup with unplugin-vue.
|
|
45
|
+
* @description This preset configures the Vue plugin to handle .vue file compilation.
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* // Basic usage
|
|
49
|
+
* export default defineConfig({
|
|
50
|
+
* preset: "vue"
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // With custom options
|
|
54
|
+
* import { createVuePreset } from "@visulima/packem/config/preset/vue";
|
|
55
|
+
* export default defineConfig({
|
|
56
|
+
* preset: createVuePreset({
|
|
57
|
+
* pluginOptions: {
|
|
58
|
+
* customElement: true
|
|
59
|
+
* }
|
|
60
|
+
* })
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare const createVuePreset: (options?: VuePresetOptions) => BuildConfig;
|
|
65
|
+
export { VuePresetOptions, createVuePreset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=Object.defineProperty;var u=(t,e)=>n(t,"name",{value:e,configurable:!0});import l from"unplugin-vue/rollup";var r=Object.defineProperty,c=u((t,e)=>r(t,"name",{value:e,configurable:!0}),"n");const a=c((t={})=>{const{pluginOptions:e={}}=t;return{rollup:{plugins:[{enforce:"pre",plugin:l({customElement:e.customElement??!1,exclude:e.exclude,include:e.include??[/\.vue$/],template:e.template})}]},validation:{dependencies:{hoisted:{exclude:[]},unused:{exclude:["vue"]}}}}},"createVuePreset");export{a as createVuePreset};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,59 @@
|
|
|
1
1
|
import { ConstructorOptions } from '@visulima/pail';
|
|
2
|
-
import { B as BuildConfig } from
|
|
3
|
-
export { a as BuildEntry, b as BuildOptions, R as RollupBuildOptions } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { B as BuildConfig } from "./packem_shared/types.d-CRug-s8c.js";
|
|
3
|
+
export { type a as BuildEntry, type b as BuildOptions, type R as RollupBuildOptions } from "./packem_shared/types.d-CRug-s8c.js";
|
|
4
|
+
export { type TransformerFn, type TransformerName } from '@visulima/packem-rollup';
|
|
5
|
+
import { Environment, Mode } from '@visulima/packem-share/types';
|
|
6
|
+
export { type BuildContext, type BuildContextBuildAssetAndChunk, type BuildContextBuildEntry, type BuildHooks, type Environment, type Mode, type Runtime } from '@visulima/packem-share/types';
|
|
7
|
+
import '@arethetypeswrong/core';
|
|
8
|
+
import '@visulima/packem-rollup/oxc';
|
|
9
|
+
import '@visulima/packem-rollup/plugin/native-modules';
|
|
10
|
+
import '@visulima/packem-share/utils';
|
|
11
|
+
import '@visulima/rollup-plugin-css';
|
|
7
12
|
import 'jiti';
|
|
8
|
-
import 'typedoc';
|
|
9
|
-
import '@rollup/plugin-alias';
|
|
10
|
-
import '@rollup/plugin-commonjs';
|
|
11
|
-
import '@rollup/plugin-json';
|
|
12
|
-
import '@rollup/plugin-node-resolve';
|
|
13
|
-
import '@rollup/plugin-replace';
|
|
14
|
-
import '@rollup/plugin-wasm';
|
|
15
|
-
import '@rollup/pluginutils';
|
|
16
13
|
import 'rollup';
|
|
17
|
-
import '
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import '@visulima/colorize';
|
|
24
|
-
import 'oxc-resolver';
|
|
25
|
-
import 'oxc-transform';
|
|
26
|
-
import 'sucrase';
|
|
27
|
-
|
|
14
|
+
import 'typedoc';
|
|
15
|
+
/**
|
|
16
|
+
* Configuration options for Packem bundler.
|
|
17
|
+
* @interface PackemOptions
|
|
18
|
+
* @augments {BuildConfig}
|
|
19
|
+
*/
|
|
28
20
|
interface PackemOptions extends BuildConfig {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The environment to build for
|
|
23
|
+
* Determines the build environment configuration
|
|
24
|
+
* @default "production"
|
|
25
|
+
* @type {Environment}
|
|
26
|
+
* @memberof PackemOptions
|
|
27
|
+
*/
|
|
28
|
+
environment?: Environment;
|
|
29
|
+
/**
|
|
30
|
+
* Logger configuration options
|
|
31
|
+
* Used to customize the logging behavior and output format
|
|
32
|
+
* @type {ConstructorOptions<string, string>}
|
|
33
|
+
* @memberof PackemOptions
|
|
34
|
+
*/
|
|
35
|
+
logger?: ConstructorOptions<string, string>;
|
|
36
|
+
/**
|
|
37
|
+
* The mode to run Packem in
|
|
38
|
+
* Controls how the bundler processes and optimizes the code
|
|
39
|
+
* @default "build"
|
|
40
|
+
* @type {Mode}
|
|
41
|
+
* @memberof PackemOptions
|
|
42
|
+
*/
|
|
43
|
+
mode?: Mode;
|
|
32
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Runs the Packem bundler with the specified options
|
|
47
|
+
* @param rootDirectory The root directory of the project to bundle
|
|
48
|
+
* @param options Configuration options for the bundler
|
|
49
|
+
* @returns Promise that resolves with the build result
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const result = await packem("./src", {
|
|
53
|
+
* mode: "build",
|
|
54
|
+
* environment: "production"
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
33
58
|
declare const packem: (rootDirectory: string, options?: PackemOptions) => Promise<void>;
|
|
34
|
-
|
|
35
|
-
export { Environment, Mode, packem };
|
|
36
|
-
export type { PackemOptions };
|
|
59
|
+
export { PackemOptions, packem };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var o=(e,r)=>c(e,"name",{value:r,configurable:!0});import{createPail as s}from"@visulima/pail";import{SimpleReporter as u}from"@visulima/pail/reporter";import{
|
|
1
|
+
var c=Object.defineProperty;var o=(e,r)=>c(e,"name",{value:r,configurable:!0});import{createPail as s}from"@visulima/pail";import{SimpleReporter as u}from"@visulima/pail/reporter/simple";import{S as g}from"./packem_shared/index-CBiZaA3V.js";var f=Object.defineProperty,l=o((e,r)=>f(e,"name",{value:r,configurable:!0}),"r");const C=l(async(e,r={})=>{const{debug:t,environment:i,logger:a,mode:n,tsconfigPath:m,...d}={debug:!1,environment:"production",logger:{},mode:"build",tsconfigPath:void 0,...r},p=s({reporters:[new u({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem",...a});await g(e,n,i,p,t,d,m)},"packem");export{C as packem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var a=(t,r)=>s(t,"name",{value:r,configurable:!0});import{isAccessibleSync as i,readJsonSync as m,writeJsonSync as y}from"@visulima/fs";import{join as g}from"@visulima/path";var p=Object.defineProperty,S=a((t,r)=>p(t,"name",{value:r,configurable:!0}),"o");const v=S((t,r,c,n)=>{try{let e={};const o=g(r,"keystore.json");n&&i(o)&&(e=m(o)),e[t]===void 0&&(e[t]=new Date().toISOString()),y(o,e,{overwrite:!0})}catch(e){c.debug({context:[e],message:e.message,prefix:"cache-key-store"})}},"createOrUpdateKeyStorage");export{v as m};
|