@visulima/packem 2.0.0-alpha.78 → 2.0.0-alpha.79
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 +111 -0
- package/LICENSE.md +4451 -856
- package/dist/builder/typedoc/index.d.ts +5 -4
- package/dist/builder/typedoc/index.js +3 -3
- package/dist/cli/index.js +57 -46
- package/dist/config/index.d.ts +5 -4
- package/dist/config/preset/preact.d.ts +6 -5
- package/dist/config/preset/preact.js +2 -2
- package/dist/config/preset/react.d.ts +7 -6
- package/dist/config/preset/react.js +1 -1
- package/dist/config/preset/solid.d.ts +6 -5
- package/dist/config/preset/solid.js +1 -1
- package/dist/config/preset/svelte.d.ts +5 -4
- package/dist/config/preset/svelte.js +1 -1
- package/dist/config/preset/vue.d.ts +5 -4
- package/dist/config/preset/vue.js +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +41 -1
- package/dist/packem_shared/create-or-update-key-storage-DmqEu1wa.js +13 -0
- package/dist/packem_shared/default-DBXn1yym.js +1 -0
- package/dist/packem_shared/index-s0a8g2bx.js +251 -0
- package/dist/packem_shared/oxcResolvePlugin-DeIohkWk-RIbbT52m.js +170 -0
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-Bbz81VnA.js +4 -0
- package/dist/packem_shared/{types.d-CRug-s8c.d.ts → types.d-CcnkF-XF.d.ts} +21 -49
- package/dist/packem_shared/utils-XnLEq2wJ.js +1 -0
- package/dist/rollup/plugins/oxc/oxc-transformer.d.ts +1 -1
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/package.json +56 -62
- package/dist/packem_shared/create-or-update-key-storage-Ddq46eG8.js +0 -1
- package/dist/packem_shared/index-C9qgCdqa.js +0 -88
- /package/dist/{rollup/plugins/css → css}/loaders/less.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/less.js +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/lightningcss.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/lightningcss.js +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/postcss.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/postcss.js +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/sass.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/sass.js +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/sourcemap.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/sourcemap.js +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/stylus.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/stylus.js +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/tailwindcss.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/loaders/tailwindcss.js +0 -0
- /package/dist/{rollup/plugins/css → css}/minifiers/cssnano.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/minifiers/cssnano.js +0 -0
- /package/dist/{rollup/plugins/css → css}/minifiers/lightningcss.d.ts +0 -0
- /package/dist/{rollup/plugins/css → css}/minifiers/lightningcss.js +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { BuildContext } from '@visulima/packem-share/types';
|
|
2
|
-
import { I as InternalBuildOptions } from "../../packem_shared/types.d-
|
|
2
|
+
import { I as InternalBuildOptions } from "../../packem_shared/types.d-CcnkF-XF.js";
|
|
3
3
|
import '@arethetypeswrong/core';
|
|
4
|
+
import '@visulima/packem-plugins';
|
|
5
|
+
import '@visulima/packem-plugins/oxc';
|
|
6
|
+
import '@visulima/packem-plugins/plugin/externals';
|
|
7
|
+
import '@visulima/packem-plugins/plugin/native-modules';
|
|
4
8
|
import '@visulima/packem-rollup';
|
|
5
|
-
import '@visulima/packem-rollup/oxc';
|
|
6
|
-
import '@visulima/packem-rollup/plugin/native-modules';
|
|
7
9
|
import '@visulima/packem-share/utils';
|
|
8
10
|
import '@visulima/rollup-plugin-css';
|
|
9
11
|
import 'jiti';
|
|
10
12
|
import 'rollup';
|
|
11
13
|
import 'typedoc';
|
|
12
|
-
import '@visulima/pail';
|
|
13
14
|
declare const builder: (context: BuildContext<InternalBuildOptions>, cachePath: string | undefined, _: never, logged: boolean) => Promise<void>;
|
|
14
15
|
export { builder as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
${
|
|
3
|
-
`),
|
|
1
|
+
var $=Object.defineProperty;var m=(e,t)=>$(e,"name",{value:t,configurable:!0});import{$ as y,B as j,m as E,q as P}from"../../packem_shared/create-or-update-key-storage-DmqEu1wa.js";import{readdirSync as A}from"node:fs";import{replaceContentWithinMarker as _}from"@visulima/packem-share";import{Application as b}from"typedoc";import{_ as f}from"../../packem_shared/utils-XnLEq2wJ.js";var C=Object.defineProperty,h=m((e,t)=>C(e,"name",{value:t,configurable:!0}),"d");const F=h((e,t,o,i,n)=>{const a=A(e,{withFileTypes:!0}).filter(s=>s.isFile());let r="";for(const s of a)s.name==="README.md"&&t>1||(r+=y(f(e,s.name)).replaceAll(`<!-- ${o}`,`<!-- _REPLACE_${o}`).replaceAll("<!-- ${marker}",`<!-- _REPLACE_\\${o}`));if(r==="")return;const c=y(i),p=_(c,o,`
|
|
2
|
+
${r}`);if(!p){n.error({message:`Could not find the typedoc marker: <!-- ${o} --><!-- /${o} --> in ${i}`,prefix:"typedoc"});return}c!==p&&j(i,p.replaceAll(`<!-- _REPLACE_${o}`,`<!-- ${o}`).replaceAll(`<!-- _REPLACE_\\${o}`,"<!-- ${marker}"),{overwrite:!0})},"inlineMarkdownIntoReadme"),R=h((e,t,o,i)=>{if(e==="inline"&&o===void 0)throw new Error("The `readmePath` option is required when using the `inline` format.");if(e!=="inline"&&typeof o=="string"&&i.warn({message:"The `readmePath` option is only used when the `inline` format is used.",prefix:"typedoc"}),e==="json"&&!t?.endsWith(".json"))throw new Error(t===void 0?"The `jsonFileName` option is required when using the `json` format.":"The `jsonFileName` option must end with `.json`.");e!=="json"&&typeof t=="string"&&i.warn({message:"The `jsonFileName` option is only used when the `json` format is used.",prefix:"typedoc"})},"validateFormatOptions"),T=h(async(e,t,o,i)=>{if(t.length===0)return;const{format:n,jsonFileName:a,marker:r,output:c,plugin:p,readmePath:s,...g}=e;R(n,a,s,i);const k=t.map(v=>v.input),u=p??[];u.push("typedoc-plugin-rename-defaults"),(n==="inline"||n==="markdown")&&u.push("typedoc-plugin-markdown");const l=await b.bootstrapWithPlugins({...g,compilerOptions:{allowJs:!0,declaration:!1,declarationMap:!1,esModuleInterop:!0,module:99,moduleResolution:100,noEmit:!0,noImplicitAny:!1,skipLibCheck:!0,sourceMap:!1,target:99,...g.compilerOptions},entryPoints:k,hideGenerator:!0,out:o,plugin:u,...n==="inline"?{hideBreadcrumbs:!0,hidePageHeader:!0,navigation:!1,outputFileStrategy:"modules",useCodeBlocks:!0}:{}},[]),d=await l.convert();if(d){if(n==="json")await l.generateJson(d,a);else if(n==="html")await l.generateDocs(d,o);else if(await l.generateOutputs(d),n==="inline"){if(r===void 0)throw new Error("The `marker` option is required when using the `inline` format.");F(o,t.length,r,s,i)}}},"generateReferenceDocumentation");var D=Object.defineProperty,w=m((e,t)=>D(e,"name",{value:t,configurable:!0}),"p");const L=w(e=>e.logger,"getLogger"),H=w(async(e,t,o,i)=>{if(e.options.typedoc&&e.options.typedoc.format!==void 0){const n=L(e);let a="unknown";e.pkg.dependencies?.typedoc?a=e.pkg.dependencies.typedoc:e.pkg.devDependencies?.typedoc&&(a=e.pkg.devDependencies.typedoc),t&&E("typedoc",t,n,!0),i&&n.raw(`
|
|
3
|
+
`),n.info({message:`Using ${P("typedoc")} ${a} to generate reference documentation`,prefix:"typedoc"}),await e.hooks.callHook("typedoc:before",e);let r=e.options.rootDir;e.options.typedoc.output?r=e.options.typedoc.output:e.options.typedoc.format==="inline"&&t?r=f(t,"typedoc"):e.options.typedoc.format!=="json"&&(r=f(r,"api-docs")),await T(e.options.typedoc,e.options.entries,r,n),await e.hooks.callHook("typedoc:done",e)}},"builder");export{H as default};
|
package/dist/cli/index.js
CHANGED
|
@@ -1,65 +1,76 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var re=Object.defineProperty;var h=(t,e)=>re(t,"name",{value:e,configurable:!0});import{createCerebro as oe}from"@visulima/cerebro";import ce from"@visulima/cerebro/logger/pail";import{N as z,m as U,B as le,M as de,l as ue,d as pe,T as me,e as fe,A as ge,b as ye,h as we}from"../packem_shared/index-s0a8g2bx.js";import j,{cwd as A,exit as be}from"node:process";import{installPackage as C}from"@antfu/install-pkg";import{confirm as w,select as v,multiselect as J,spinner as I,cancel as F,isCancel as _,intro as H,log as N,outro as Y}from"@clack/prompts";import ve from"magic-string";import{exec as he}from"tinyexec";import{_ as S,L as T}from"../packem_shared/utils-XnLEq2wJ.js";import{PRODUCTION_ENV as X,DEVELOPMENT_ENV as ke}from"@visulima/packem-share/constants";import{createJiti as $e}from"jiti";import{writeFile as Q,readFile as Se}from"node:fs/promises";import{q as Ce,w as je,i as R,B as Pe}from"../packem_shared/create-or-update-key-storage-DmqEu1wa.js";import{existsSync as q}from"node:fs";import{parseEnv as G}from"node:util";import{createInterface as xe}from"node:readline/promises";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
3
3
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
4
|
-
var
|
|
5
|
-
preset: '${
|
|
6
|
-
transformer:`);else{const o=
|
|
7
|
-
preset: '${
|
|
4
|
+
var Ee="@visulima/packem",Z="1.28.3";const K={version:Z},ee={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","@csstools/css-parser-algorithms","@csstools/css-tokenizer","@csstools/postcss-slow-plugins","icss-utils","@visulima/css-style-inject"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"],tailwindcss:["@tailwindcss/node","@tailwindcss/oxide","tailwindcss"]};var De=Object.defineProperty,u=h((t,e)=>De(t,"name",{value:e,configurable:!0}),"i");const Me=/defineConfig\s*\(\s*\{/,Le=/preset:\s*['"][^'"]+['"]/,Oe=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults"],Ne=["@babel/core","@babel/preset-react"],Ie=["react","react-dom"],Te=["@babel/core","babel-preset-solid"],Be=["solid-js"],Ve=["@babel/core","@babel/preset-react","babel-plugin-transform-hook-names"],Re=["preact"],Ae=["unplugin-vue"],Fe=["vue"],qe=["rollup-plugin-svelte"],Ge=["svelte"],P=u((t,e,a)=>t.includes(`preset: '${e}'`)||t.includes(`preset: "${e}"`)||t.includes(`preset: '${e}',`)||t.includes(`preset: "${e}",`)||t.includes(a)||t.includes(`@visulima/packem/config/preset/${e}`),"checkPresetExists"),x=u((t,e)=>{const{logger:a,magic:s,packemConfig:i}=t,n=Me.exec(i);if(n?.index!==void 0){const o=n.index+n[0].length;if(i.includes("preset:")){const r=Le.exec(i);if(r)s.replace(r[0],`preset: '${e}'`);else throw a.warn(`A preset already exists in the config. Please manually set it to '${e}'.`),new Error("Preset exists but is not a string")}else s.appendLeft(o,`
|
|
5
|
+
preset: '${e}',`)}else if(i.includes("transformer:"))s.replace("transformer:",`preset: '${e}',
|
|
6
|
+
transformer:`);else{const o=i.indexOf("{");o!==-1&&s.appendLeft(o+1,`
|
|
7
|
+
preset: '${e}',`)}},"insertPreset"),Ke=u(async t=>{try{return((await he("git",["status","--porcelain"],{nodeOptions:{cwd:t,stdio:["pipe","pipe","pipe"]}})).stdout?.trim().length??0)>0}catch{return!1}},"checkGitDirty"),te=u(async t=>{const e=S(t,"package.json"),a=await z(e,{resolveCatalogs:!0});return!!(a.devDependencies?.typescript??a.dependencies?.typescript)},"checkTypeScriptInstalled"),We=u(async t=>{const e=await te(t),a=[...Ie],s=[...Ne];return e?s.push("@types/react","@types/react-dom"):await w({initialValue:!1,message:"Do you want to use TypeScript?"})&&s.push("typescript","@types/react","@types/react-dom"),{devPackages:s,packages:a}},"getReactTypeDependencies"),E=u(async(t,e,a)=>{const{rootDirectory:s,spinner:i}=t;i.start("Installing packages"),await C(a,{cwd:s,dev:!1,silent:!0}),await C(e,{cwd:s,dev:!0,silent:!0}),i.stop("Installed packages")},"installPackages"),ze=u(async t=>{const{logger:e,magic:a,packemConfig:s,packemConfigFormat:i,rootDirectory:n,spinner:o,transformerReplaceKey:r,transformerSearchKey:c}=t;if(s.includes("typedoc: typedocBuilder")||s.includes("@visulima/packem/builder/typedoc")){e.warn("Typedoc has already been added to the packem config.");return}i==="cjs"?a.prepend(`const typedocBuilder = require("@visulima/packem/builder/typedoc");
|
|
8
8
|
`):a.prepend(`import typedocBuilder from "@visulima/packem/builder/typedoc";
|
|
9
|
-
`),
|
|
9
|
+
`),s.includes("builder: {")?a.replace("builder: {",`builder: {
|
|
10
10
|
typedoc: typedocBuilder,
|
|
11
|
-
`):a.replace(
|
|
11
|
+
`):a.replace(c,`${r}
|
|
12
12
|
builder: {
|
|
13
13
|
typedoc: typedocBuilder,
|
|
14
|
-
},`),
|
|
15
|
-
Typedoc added!`)},"addTypedoc"),
|
|
16
|
-
React preset added!`)},"addReact"),
|
|
17
|
-
Solid preset added!`)},"addSolid"),
|
|
18
|
-
Preact preset added!`)},"addPreact"),
|
|
19
|
-
Vue preset added!`)},"addVue"),
|
|
20
|
-
Svelte preset added!`)},"addSvelte"),
|
|
21
|
-
`):
|
|
22
|
-
`)}
|
|
23
|
-
`):a.prepend(`import ${d}
|
|
24
|
-
`)
|
|
25
|
-
css: {${
|
|
26
|
-
minifier: ${
|
|
14
|
+
},`),e.info("Adding typedoc dependencies..."),o.start("Installing packages"),await C(Oe,{cwd:n,dev:!0,silent:!0}),o.stop("Installed packages"),e.success(`
|
|
15
|
+
Typedoc added!`)},"addTypedoc"),Ue=u(async t=>{const{logger:e,packemConfig:a}=t;if(P(a,"react","createReactPreset")){e.warn("React preset has already been added to the packem config.");return}x(t,"react");const{devPackages:s,packages:i}=await We(t.rootDirectory);e.info("Adding React dependencies..."),await E(t,s,i),e.success(`
|
|
16
|
+
React preset added!`)},"addReact"),Je=u(async t=>{const{logger:e,packemConfig:a}=t;if(P(a,"solid","createSolidPreset")){e.warn("Solid preset has already been added to the packem config.");return}x(t,"solid"),e.info("Adding Solid dependencies..."),await E(t,Te,Be),e.success(`
|
|
17
|
+
Solid preset added!`)},"addSolid"),_e=u(async t=>{const e=await te(t),a=[...Re],s=[...Ve];return e?s.push("@types/preact"):await w({initialValue:!1,message:"Do you want to use TypeScript?"})&&s.push("typescript","@types/preact"),{devPackages:s,packages:a}},"getPreactTypeDependencies"),He=u(async t=>{const{logger:e,packemConfig:a}=t;if(P(a,"preact","createPreactPreset")){e.warn("Preact preset has already been added to the packem config.");return}x(t,"preact");const{devPackages:s,packages:i}=await _e(t.rootDirectory);e.info("Adding Preact dependencies..."),await E(t,s,i),e.success(`
|
|
18
|
+
Preact preset added!`)},"addPreact"),Ye=u(async t=>{const{logger:e,packemConfig:a}=t;if(P(a,"vue","createVuePreset")){e.warn("Vue preset has already been added to the packem config.");return}x(t,"vue"),e.info("Adding Vue dependencies..."),await E(t,Ae,Fe),e.success(`
|
|
19
|
+
Vue preset added!`)},"addVue"),Xe=u(async t=>{const{logger:e,packemConfig:a}=t;if(P(a,"svelte","createSveltePreset")){e.warn("Svelte preset has already been added to the packem config.");return}x(t,"svelte"),e.info("Adding Svelte dependencies..."),await E(t,qe,Ge),e.success(`
|
|
20
|
+
Svelte preset added!`)},"addSvelte"),Qe=u(async()=>{const t=[],e=await v({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"},{hint:"Tailwind Css Oxide",label:"Tailwind CSS",value:"tailwindcss"}]});if(t.push(e),e!=="tailwindcss"){let a=await J({message:"Pick extra loaders",options:[{label:"Sass",value:"sass"},{label:"Stylus",value:"stylus"},{label:"Less",value:"less"}],required:!1});if(a.includes("sass")){const s=await v({message:"Pick a sass loader",options:[{hint:"recommended",label:"Sass embedded",value:"sass-embedded"},{label:"Sass",value:"sass"},{hint:"legacy",label:"Node Sass",value:"node-sass"}]});s!=="sass"&&(a=a.filter(i=>i!=="sass"),a.push(s))}t.push(...a)}return{cssLoaders:t,mainCssLoader:e}},"promptCssLoaders"),Ze=u(async(t,e,a,s)=>{if(!await w({initialValue:!1,message:"Do you want to minify your css?"}))return;const i=await v({message:"Pick a css minifier",options:[{label:"CSSNano",value:"cssnano"},{label:"Lightning CSS",value:"lightningcss"}]});return a.includes("lightningcss")||s.push(i),e==="cjs"?t.prepend(`const ${i}Minifier = require("@visulima/packem/css/minifier/${i.toLowerCase()}");
|
|
21
|
+
`):t.prepend(`import ${i}Minifier from "@visulima/packem/css/minifier/${i.toLowerCase()}";
|
|
22
|
+
`),i},"promptCssMinifier"),et=u(async t=>{const{logger:e,magic:a,packemConfig:s,packemConfigFormat:i,transformerReplaceKey:n,transformerSearchKey:o}=t;if(s.includes("css: {")||s.includes("@visulima/packem/css")){e.warn("Css loaders have already been added to the packem config.");return}const{cssLoaders:r,mainCssLoader:c}=await Qe(),l=[];for(const m of r)l.push(...ee[m]);c!=="tailwindcss"&&r.push("sourceMap");for(const m of r){const d=m==="sass-embedded"||m==="node-sass"?"sass":m;i==="cjs"?a.prepend(`const ${d}Loader = require("@visulima/packem/css/loader/${d.toLowerCase()}");
|
|
23
|
+
`):a.prepend(`import ${d}Loader from "@visulima/packem/css/loader/${d.toLowerCase()}";
|
|
24
|
+
`)}const p=await Ze(a,i,r,l),g=r.map(m=>m==="sass-embedded"||m==="node-sass"?"sass":`${m}Loader`).join(", ");s.includes("rollup: {")?a.replace("rollup: {",`rollup: {
|
|
25
|
+
css: {${p?`
|
|
26
|
+
minifier: ${p}Minifier,`:""}
|
|
27
27
|
loaders: [${g}],
|
|
28
28
|
},
|
|
29
|
-
`):a.replace(o,`${
|
|
29
|
+
`):a.replace(o,`${n}
|
|
30
30
|
rollup: {
|
|
31
|
-
css: {${
|
|
32
|
-
minifier: ${
|
|
31
|
+
css: {${p?`
|
|
32
|
+
minifier: ${p}Minifier,`:""}
|
|
33
33
|
loaders: [${g}],
|
|
34
34
|
},
|
|
35
|
-
},`),
|
|
36
|
-
CSS loaders added!`)},"addCss"),
|
|
37
|
-
|
|
35
|
+
},`),t.spinner.start("Installing packages"),await C(l,{cwd:t.rootDirectory,dev:!0,silent:!0}),t.spinner.stop("Installed packages"),e.success(`
|
|
36
|
+
CSS loaders added!`)},"addCss"),tt=u(t=>{t.addCommand({argument:{description:"Add a packem feature to your project",name:"feature",required:!0},description:"Add a optional packem feature to your project",execute:u(async({argument:e,logger:a,options:s})=>{const i=a,n=I(),o=T(A(),typeof s.dir=="string"?s.dir:".");let r;try{r=await U(o,s.config)}catch{i.error("Could not find a packem config file, please run `packem init` first.");return}if(await Ke(o)&&!await w({initialValue:!1,message:"Git repository has uncommitted changes. Do you want to proceed?"})){F("Operation cancelled.");return}const c=await le(r,{buffer:!1}),l=c.includes("import")?"esm":"cjs",p=new ve(c),g=" transformer,",m=c.includes(" transformer,")?" transformer,":" transformer",d={logger:i,magic:p,packemConfig:c,packemConfigFilePath:r,packemConfigFormat:l,rootDirectory:o,spinner:n,transformerReplaceKey:g,transformerSearchKey:m};e.includes("typedoc")&&await ze(d),e.includes("react")&&await Ue(d),e.includes("solid")&&await Je(d),e.includes("preact")&&await He(d),e.includes("vue")&&await Ye(d),e.includes("svelte")&&await Xe(d),e.includes("css")&&await et(d),await de(r,p.toString(),{overwrite:!0})},"execute"),name:"add",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{description:"Use a custom config file",name:"config",type:String}]})},"createAddCommand");var st=Object.defineProperty,D=h((t,e)=>st(t,"name",{value:e,configurable:!0}),"n");const at=D((t,e)=>`// Generated by \`packem\` first-run setup. See https://packem.dev for full options.
|
|
37
|
+
import { defineConfig } from "@visulima/packem/config";
|
|
38
|
+
import transformer from "@visulima/packem/transformer/${e}";
|
|
39
|
+
|
|
40
|
+
export default defineConfig({
|
|
41
|
+
bundler: "${t}",
|
|
42
|
+
declaration: true,
|
|
43
|
+
transformer,
|
|
44
|
+
});
|
|
45
|
+
`,"generatePackemConfig"),it=D(async()=>{const t=await v({initialValue:"rollup",message:"Which bundler do you want to use?",options:[{hint:"stable, full feature set, supports DTS",label:"rollup",value:"rollup"},{hint:"experimental, fast — falls back to rollup for DTS",label:"rolldown",value:"rolldown"}]});if(_(t))throw F("Setup cancelled."),new Error("Packem setup was cancelled.");return t},"promptBundler"),nt=D(async()=>{const t=await v({initialValue:"esbuild",message:"Which transformer do you want to use?",options:[{hint:"fast, widely used",label:"esbuild",value:"esbuild"},{hint:"fastest, Rust-based",label:"oxc",value:"oxc"},{hint:"TypeScript-aware, Rust-based",label:"swc",value:"swc"},{hint:"minimal, JS-based",label:"sucrase",value:"sucrase"}]});if(_(t))throw F("Setup cancelled."),new Error("Packem setup was cancelled.");return t},"promptTransformer"),rt=D(async(t,e)=>{if(t.length===0)return;const a=I();a.start(`Installing ${t.join(", ")}`);try{await C(t,{cwd:e,dev:!0,silent:!0}),a.stop(`Installed ${t.join(", ")}`)}catch(s){throw a.stop(`Failed to install ${t.join(", ")}`),s}},"installPackagesWithSpinner"),ot=D(async t=>{if(await ue(t))return;if(!(process.stdout.isTTY&&!process.env.CI)){const n=await pe(["rollup","esbuild"],t);throw new Error(`No packem.config found. Run packem in an interactive terminal to generate one, or install the defaults manually:
|
|
46
|
+
${n}
|
|
47
|
+
and create a packem.config.ts.`)}H(Ce("Packem first-run setup")),N.info("No packem.config found — let's create one.");const e=await it(),a=await nt(),s=[e];e==="rolldown"&&s.push("rollup"),s.push(me[a]),await rt(s,t);const i=S(t,"packem.config.ts");await Q(i,at(e,a),"utf8"),N.success(`Created ${i}`),Y("Setup complete — continuing with build.")},"runFirstRunWizard");var ct=Object.defineProperty,se=h((t,e)=>ct(t,"name",{value:e,configurable:!0}),"a$1");const lt=/^([^#:=]+)=(.*)$/,W=se((t,e="PACKEM_")=>{const a={};for(const s of t.split(`
|
|
48
|
+
`)){const i=s.trim();if(!i||i.startsWith("#"))continue;const n=lt.exec(i);if(n?.[1]){const o=n[1].trim();let r=n[2].trim();(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),(!e||o.startsWith(e))&&(a[`process.env.${o}`]=JSON.stringify(r))}}return a},"loadEnvFileManually"),dt=se(async(t,e,a="PACKEM_")=>{const s=T(e,t);if(!q(s))return{};const{readFile:i}=await import("node:fs/promises"),n=await i(s,"utf8"),o={};if(typeof G=="function")try{const r=G(n);for(const[c,l]of Object.entries(r))(!a||c.startsWith(a))&&(o[`process.env.${c}`]=JSON.stringify(l))}catch{return W(n,a)}else return W(n,a);return o},"loadEnvFile");var ut=Object.defineProperty,pt=h((t,e)=>ut(t,"name",{value:e,configurable:!0}),"e$2");const mt=pt(async(t,e,a,s,i)=>{const n=await U(e,i),o=await t.import(n,{default:!0,try:!0})??{};return{config:typeof o=="function"?await o(a,s):o,path:n}},"loadPackemConfig");var ft=Object.defineProperty,gt=h((t,e)=>ft(t,"name",{value:e,configurable:!0}),"e$1");const yt=gt(async(t,e)=>{switch(t){case"none":return{};case"preact":{const{createPreactPreset:a}=await import("../config/preset/preact.js");t=a();break}case"react":{const{createReactPreset:a}=await import("../config/preset/react.js");t=a();break}case"solid":{const{createSolidPreset:a}=await import("../config/preset/solid.js");t=a();break}case"svelte":{const{createSveltePreset:a}=await import("../config/preset/svelte.js");t=a();break}case"vue":{const{createVuePreset:a}=await import("../config/preset/vue.js");t=a();break}default:typeof t=="string"&&(t=await e.import(t)||{})}return typeof t=="function"&&(t=t()),t},"loadPreset");var wt=Object.defineProperty,b=h((t,e)=>wt(t,"name",{value:e,configurable:!0}),"o");const bt=b(t=>t.watch?"watch":t.jit?"jit":"build","resolveMode"),vt=b(t=>{let e;const a={};if(t.env)for(const s of t.env)s.key==="NODE_ENV"?e=s.value:a[`process.env.${s.key}`]=JSON.stringify(s.value);return{cliEnvVariables:a,nodeEnvironment:e}},"parseCliEnvVariables"),ht=b((t,e)=>{if(e!==void 0)return e;if(t.production)return X;if(t.development)return ke},"resolveNodeEnvironment"),kt=b(t=>{const e=[];if(t.external)for(const a of t.external)e.push(a.split(","));return e},"collectExternals"),$t=b(t=>{t.addCommand({description:"Demonstrate options required",execute:b(async({logger:e,options:a})=>{const s=a,i=bt(s),{cliEnvVariables:n,nodeEnvironment:o}=vt(s),r=ht(s,o),c=kt(s),l=T(A(),s.dir??".");await ot(l);const p=$e(l,{debug:s.debug}),{config:g,path:m}=await mt(p,l,r,i,s.config??void 0);e.debug("Using packem config found at",m);const d=s.envFile??g.envFile,L=s.envPrefix??g.envPrefix??"PACKEM_",$={};if(d){const k=await dt(d,l,L);Object.assign($,k)}Object.assign($,n);const B=await yt(g.preset??"none",p);s.minify&&s.sourcemap===void 0&&(s.sourcemap=!0);try{const k=fe()(g,ge,B,{analyze:s.analyze,bundler:s.bundler,cjsInterop:s.cjsInterop,clean:s.clean,dtsOnly:s.dtsOnly,externals:c,killSignal:s.killSignal,minify:s.minify??r===X,onSuccess:s.onSuccess,rollup:{esbuild:{target:s.target},license:{path:s.license},metafile:s.metafile,...Object.keys($).length>0||Object.keys(n).length>0?{replace:{values:$}}:{},resolveExternals:s.noExternal?{builtins:!1,deps:!1,devDeps:!1,optDeps:!1,peerDeps:!1}:{}},runtime:s.runtime,sourcemap:s.metafile||s.analyze||s.sourcemap,unbundle:s.unbundle,validation:s.validation===!1?!1:{},...s.exe?{exe:!0}:{},...s.typedoc?{typedoc:{format:"html"}}:{}});s.validation===!1&&!g.validation&&(k.validation=!1),await ye(l,i,r,e,s.debug??!1,k,s.tsconfig??void 0)}catch(k){e.error(k),be(1)}},"execute"),name:"build",options:[{description:"Specify the bundler to use (rollup or rolldown)",name:"bundler",type:b(e=>{if(e==="rollup"||e==="rolldown")return e;throw new Error("Invalid bundler. Use 'rollup' or 'rolldown'.")},"type")},{defaultValue:".",description:"The directory to build",name:"dir",type:String},{alias:"t",description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",name:"target"},{description:"Use a custom config file",name:"config",type:String},{description:"Path to the tsconfig.json file",name:"tsconfig",type:String},{description:"Minify the output",name:"minify",type:Boolean},{description:"Generate sourcemaps (experimental)",name:"sourcemap",type:Boolean},{conflicts:"jit",description:"Watch for changes",name:"watch",type:Boolean},{conflicts:"watch",description:"Stub the package for JIT compilation",name:"jit",type:Boolean},{description:"Compile-time environment variables (eg. --env.NODE_ENV=production)",multiple:!0,name:"env",type:b(e=>{const[a,s]=e.split("=");return{key:a,value:s}},"type")},{description:"Path to the .env file to load environment variables from",name:"env-file",type:String},{description:"Prefix for environment variables to load from .env file (default: PACKEM_)",name:"env-prefix",type:String},{defaultValue:!1,description:"Generate meta file (experimental)",name:"metafile",type:Boolean},{description:"Path to the license file",name:"license",type:String},{conflicts:"watch",description:"Visualize and analyze the bundle",name:"analyze",type:Boolean},{description:"CJS interop mode, can export default and named export, (experimental).",name:"cjsInterop",type:Boolean},{conflicts:"development",description:"Run code in production environment",name:"production",type:Boolean},{conflicts:"production",description:"Run code in development environment",name:"development",type:Boolean},{description:"Do not clean the dist directory before building",name:"no-clean",type:Boolean},{description:"Only generate .d.ts files",name:"dts-only",type:Boolean},{description:"Disable the output validation",name:"no-validation",type:Boolean},{description:"Disable the cache",name:"no-cache",type:Boolean},{description:"Generate type documentation",name:"typedoc",type:Boolean},{description:"Execute command after successful build, specially useful for watch mode",name:"onSuccess",type:String},{description:'Signal to kill child process, "SIGTERM" or "SIGKILL"',name:"killSignal",type:b(e=>{if(e==="SIGTERM"||e==="SIGKILL")return e;throw new Error("Invalid kill signal. Use 'SIGTERM' or 'SIGKILL'.")},"type")},{description:"Specify an external dependency, separate by comma (eg. --external lodash,react,react-dom)",multiple:!0,name:"external",typeLabel:"string[]"},{description:"do not bundle external dependencies",name:"no-external",type:Boolean},{description:"Specify the build runtime (nodejs, browser).",name:"runtime",type:b(e=>{if(e==="node"||e==="browser")return e;throw new Error("Invalid runtime. Use 'node' or 'browser'.")},"type")},{description:"Enable unbundle mode to preserve source file structure instead of bundling into a single file",name:"unbundle",type:Boolean},{description:"Bundle the output into a standalone executable via Node.js SEA (requires Node.js >= 25.7.0, single entry)",name:"exe",type:Boolean}]})},"createBuildCommand");var St=Object.defineProperty,f=h((t,e)=>St(t,"name",{value:e,configurable:!0}),"t");const ae=f(t=>t==="sass-embedded"||t==="node-sass"?"sass":t,"normalizeCssLoaderName"),Ct=f((t,e)=>{je(S(t,"tsconfig.json"),{compilerOptions:{esModuleInterop:!0,skipLibCheck:!0,target:"es2022",allowJs:!0,resolveJsonModule:!0,moduleDetection:"force",isolatedModules:!0,verbatimModuleSyntax:!0,strict:!0,noUncheckedIndexedAccess:!0,noImplicitOverride:!0,module:"NodeNext",outDir:"dist",sourceMap:!0,declaration:!0,lib:e?["es2022","dom","dom.iterable"]:["es2022"]}})},"writeTsconfig"),jt=f((t,e,a,s,i)=>{let n="";if(t)for(const o of e){const r=ae(o);n+=i?`import ${r}Loader from "@visulima/packem/css/loader/${r.toLowerCase()}";
|
|
49
|
+
`:`const ${r}Loader = require("@visulima/packem/css/loader/${r.toLowerCase()}");
|
|
50
|
+
`}return s&&a&&(n+=i?`import ${a}Minifier from "@visulima/packem/css/minifier/${a.toLowerCase()}";
|
|
51
|
+
`:`const ${a}Minifier = require("@visulima/packem/css/minifier/${a.toLowerCase()}");
|
|
52
|
+
`),n},"buildCssImports"),Pt=f((t,e,a,s)=>{if(!t&&!a)return"";let i=`,
|
|
38
53
|
rollup: {
|
|
39
|
-
css: {
|
|
40
|
-
loaders: [${
|
|
41
|
-
minifier: ${
|
|
54
|
+
css: {`;if(t){const n=s.map(o=>`${ae(o)}Loader`).join(", ");i+=`
|
|
55
|
+
loaders: [${n}],`}return a&&e&&(i+=`
|
|
56
|
+
minifier: ${e}Minifier,`),i+=`
|
|
42
57
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
import transformer from "@visulima/packem/transformer/${e.transformer}";
|
|
47
|
-
${c}
|
|
58
|
+
}`,i},"buildCssConfigBlock"),xt=f((t,e,a,s,i)=>t?`import { defineConfig } from "@visulima/packem/config";
|
|
59
|
+
import transformer from "@visulima/packem/transformer/${e}";
|
|
60
|
+
${s}
|
|
48
61
|
export default defineConfig({
|
|
49
|
-
runtime: "${
|
|
50
|
-
transformer${
|
|
62
|
+
runtime: "${a}",
|
|
63
|
+
transformer${i}
|
|
51
64
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const transformer = require("@visulima/packem/transformer/${e.transformer}");
|
|
56
|
-
${c}
|
|
65
|
+
`:`const { defineConfig } = require("@visulima/packem/config");
|
|
66
|
+
const transformer = require("@visulima/packem/transformer/${e}");
|
|
67
|
+
${s}
|
|
57
68
|
module.exports = defineConfig({
|
|
58
|
-
runtime: ${
|
|
59
|
-
transformer${
|
|
69
|
+
runtime: ${a},
|
|
70
|
+
transformer${i}
|
|
60
71
|
});
|
|
61
|
-
`}const
|
|
72
|
+
`,"buildConfigTemplate"),Et=f(t=>{const e=[];return t.dependencies&&e.push(...Object.keys(t.dependencies)),t.devDependencies&&e.push(...Object.keys(t.devDependencies)),e},"collectPackageNames"),Dt=f(async(t,e,a,s)=>{if(t===void 0&&!e){const n=await w({message:"Do you want to install TypeScript?"});return n&&s.push("typescript@latest"),n}const i=a.devDependencies?.typescript??a.dependencies?.typescript??"unknown";return N.message(`TypeScript version ${i} is already installed`),t},"setupTypescript"),Mt=f(async(t,e,a)=>{let s=t;return e.includes("esbuild")?s="esbuild":e.includes("@swc/core")?s="swc":e.includes("sucrase")&&(s="sucrase"),s!==void 0?(N.message(`Transformer ${s} is already installed.`),s):(s=await v({message:"Pick a transformer",options:[{label:"esbuild",value:"esbuild"},{label:"swc",value:"swc"},{label:"Sucrase",value:"sucrase"},{label:"OXC",value:"oxc"}]}),s&&s!=="oxc"&&!e.includes(s)&&await w({message:`Do you want to install ${s}?`})&&a.push(s==="swc"?"@swc/core":s),s)},"resolveTransformer"),Lt=f(async t=>{if(R(S(t,"tsconfig.json")))return;const e=await w({message:"Do you want to use generate a tsconfig.json?"}),a=await w({message:"Do you want to run your code in the DOM?"});if(e){const s=I();s.start("Generating tsconfig.json"),Ct(t,!!a),s.stop("")}},"maybeGenerateTsconfig"),Ot=f(async t=>{if(!t.includes("sass"))return t;const e=await v({message:"Pick a sass loader",options:[{hint:"recommended",label:"Sass embedded",value:"sass-embedded"},{label:"Sass",value:"sass"},{hint:"legacy",label:"Node Sass",value:"node-sass"}]});return e==="sass"?t:[...t.filter(a=>a!=="sass"),e]},"resolveSassLoader"),Nt=f(async t=>{const e=[],a=await v({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"}]});e.push(a);const s=await J({message:"Pick your loaders",options:[{label:"Sass",value:"sass"},{label:"Stylus",value:"stylus"},{label:"Less",value:"less"}],required:!1}),i=await Ot(s);if(e.push(...i),await w({message:`Do you want to install "${e.join('", "')}"?`}))for(const n of e)t.push(...ee[n]);return e.push("sourceMap"),e},"selectCssLoaders"),It=f(async(t,e)=>{const a=await v({message:"Pick a css minifier",options:[{label:"CSSNano",value:"cssnano"},{label:"Lightning CSS",value:"lightningcss"}]});return t.includes("lightningcss")||await w({message:`Do you want to install "${a}"?`})&&e.push(a),a},"selectCssMinifier"),Tt=f(t=>{t.addCommand({description:"Initialize packem configuration",execute:f(async({logger:e,options:a})=>{const s=a,i=e;if(H("Welcome to packem setup"),R(S(s.dir??".","packem.config.ts"))){i.info("Packem project already initialized, you can use `packem build` to build your project");return}const n=T(A(),s.dir??"."),o=S(n,"package.json");if(!R(o))throw new Error("No package.json found in the directory");const r=await z(o,{resolveCatalogs:!0}),c=Et(r),l=!!(r.devDependencies?.typescript??r.dependencies?.typescript),p=[];s.typescript=await Dt(s.typescript,l,r,p),await Lt(n),s.runtime??=await v({message:"Pick a build runtime",options:[{label:"Node",value:"node"},{label:"Browser",value:"browser"}]}),s.transformer=await Mt(s.transformer,c,p),s.css??=await w({initialValue:!1,message:"Do you want to use css in your project?"});const g=s.css?await Nt(p):[];s.cssMinifier??=await w({initialValue:!1,message:"Do you want to minify your css?"});const m=s.cssMinifier?await It(g,p):void 0,d=s.css??!1,L=s.cssMinifier??!1,$=l||r.type==="module",B=Pt(d,m,L,g),k=jt(d,g,m,L,$),ne=xt($,s.transformer??"",s.runtime??"",k,B),O=I(),V=l?"ts":"js";p.length>0&&(O.start("Installing packages"),await C(p,{cwd:n,dev:!0,silent:!0}),O.stop("Installed packages")),O.start(`Creating packem.config.${V}`),Pe(S(n,`packem.config.${V}`),ne),O.stop(`Created packem.config.${V}`),Y("Now you can run `packem build` to build your project")},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer",name:"transformer",type:f(e=>{if(typeof e=="string"&&["esbuild","sucrase","swc"].includes(e))return e;throw new Error("Invalid transformer, please choose one of 'swc', 'sucrase' or 'esbuild'")},"type")},{description:"Use CSS",name:"css",type:Boolean},{description:"Use CSS minifier",name:"css-minifier",type:Boolean},{description:"Use TypeScript",name:"typescript",type:Boolean},{description:"Specify the build runtime (nodejs, browser).",name:"runtime",type:f(e=>{if(e==="node"||e==="browser")return e;throw new Error("Invalid runtime. Use 'node' or 'browser'.")},"type")}]})},"createInitCommand");var Bt=Object.defineProperty,y=h((t,e)=>Bt(t,"name",{value:e,configurable:!0}),"r");const ie={bunchee:"@visulima/packem",tsup:"@visulima/packem","tsup-node":"@visulima/packem",unbuild:"@visulima/packem"},Vt={dependencies:`^${K.version}`,devDependencies:`^${K.version}`,peerDependencies:"*"},Rt=y((t,e,a,s)=>{const i={};for(const n of Object.keys(t))n===e?i[a]=s??t[e]:i[n]=t[n];return i},"renameKey"),At=/\bunbuild\b/g,Ft=/\bbunchee\b/g,qt=/\btsup(?:-node)?/g,Gt=/\bbuild\b/g,Kt=[{from:"tsup",rewrite:y(t=>t.replaceAll(qt,"packem build").replaceAll(Gt,"build"),"rewrite")},{from:"unbuild",rewrite:y(t=>t.replaceAll(At,"packem build"),"rewrite")},{from:"bunchee",rewrite:y(t=>t.replaceAll(Ft,"packem build"),"rewrite")}],Wt=y((t,e,a)=>{let s=e,i=!1;for(const n of Object.keys(ie))s.includes(n)&&(a.info(`Migrating \`${t}\` script from ${n} to packem`),i=!0,s=s.replaceAll(new RegExp(String.raw`\b${n}\b`,"g"),"packem").replaceAll(new RegExp(String.raw`\b${n}-node\b`,"g"),"packem"));for(const{from:n,rewrite:o}of Kt)s.includes(n)&&(a.info(`Migrating \`${t}\` script from ${n} to packem`),i=!0,s=o(s));return i?s:void 0},"migrateScript"),zt=y((t,e)=>{const a={...t};let s=!1;for(const i of Object.keys(a)){const n=Wt(i,a[i],e);n!==void 0&&(a[i]=n,s=!0)}return{found:s,scripts:a}},"migrateScripts"),Ut=y((t,e)=>{const a={...t};let s=!1;for(const[i,n]of Object.entries(Vt)){let o=a[i];for(const[r,c]of Object.entries(ie))o?.[r]&&(e.info(`Migrating \`${i}\` from ${r} to ${c}.`),s=!0,o=Rt(o,r,c,n),a[i]=o)}return{found:s,pkg:a}},"migrateDependencies"),Jt=y((t,e)=>{const a=["tsup","unbuild","bunchee"];for(const s of a)t[s]&&e.info(`Found \`${s}\` config field in package.json. Consider moving to packem.config.ts`)},"warnInlineConfigFields"),_t=y(async(t,e)=>{if(!q("package.json"))return e.error("No package.json found"),!1;const a=await Se("package.json","utf8"),s=JSON.parse(a),{found:i,pkg:n}=Ut(s,e);let o=i;if(n.scripts){const{found:c,scripts:l}=zt(n.scripts,e);c&&(n.scripts=l,o=!0)}if(Jt(n,e),!o)return e.warn("No migratable bundler dependencies found in package.json"),!1;const r=`${JSON.stringify(n,void 0,a.includes(" ")?" ":2)}
|
|
73
|
+
`;return t?(e.info("[dry-run] package.json changes:"),e.info("Old content:"),console.info(a),e.info("New content:"),console.info(r)):(await Q("package.json",r),e.success("Migrated `package.json`")),!0},"migratePackageJson"),Ht=["tsup.config.ts","tsup.config.cts","tsup.config.mts","tsup.config.js","tsup.config.cjs","tsup.config.mjs","tsup.config.json","build.config.ts","build.config.cts","build.config.mts","build.config.js","build.config.cjs","build.config.mjs","bunchee.config.ts","bunchee.config.cts","bunchee.config.mts","bunchee.config.js","bunchee.config.cjs","bunchee.config.mjs"],Yt=y(t=>{let e=!1;for(const a of Ht)q(a)&&(t.info(`Found config file \`${a}\`. Consider creating packem.config.ts instead.`),t.warn("Manual migration required for config files. See https://www.visulima.com/docs/package/packem"),e=!0);return e||t.warn("No bundler config files found"),e},"migrateConfigFiles"),Xt=y(async({cwd:t,dryRun:e,logger:a})=>{if(e)a.info("Dry run enabled. No changes will be made.");else{const i=xe({input:j.stdin,output:j.stdout});a.warn(`
|
|
62
74
|
|
|
63
75
|
Before proceeding, review the migration guide at https://www.visulima.com/docs/package/packem, as this process will modify your files.
|
|
64
|
-
Uncommitted changes will be lost. Use the --dry-run flag to preview changes without applying them.`);const
|
|
65
|
-
`;return s?(t.info("[dry-run] package.json changes:"),t.info("Old content:"),console.info(a),t.info("New content:"),console.info(o)):(await we("package.json",o),t.success("Migrated `package.json`")),!0},"migratePackageJson"),lt=["tsup.config.ts","tsup.config.cts","tsup.config.mts","tsup.config.js","tsup.config.cjs","tsup.config.mjs","tsup.config.json","build.config.ts","build.config.cts","build.config.mts","build.config.js","build.config.cjs","build.config.mjs","bunchee.config.ts","bunchee.config.cts","bunchee.config.mts","bunchee.config.js","bunchee.config.cjs","bunchee.config.mjs"],dt=j(async(s,t)=>{let a=!1;for(const e of lt)A(e)&&(t.info(`Found config file \`${e}\`. Consider creating packem.config.ts instead.`),t.warn("Manual migration required for config files. See https://www.visulima.com/docs/package/packem"),a=!0);return a||t.warn("No bundler config files found"),a},"migrateConfigFiles"),pt=j((s,t,a,e)=>{const n={};for(const r of Object.keys(s))r===t?n[a]=e||s[t]:n[r]=s[r];return n},"renameKey"),ut=j(s=>{s.addCommand({description:"Migrate from other bundlers (tsup, unbuild, bunchee, etc.) to packem",execute:j(async({logger:t,options:a})=>{const e=a;await rt({cwd:e.cwd,dryRun:e.dryRun,logger:t})},"execute"),name:"migrate",options:[{defaultValue:".",description:"The directory to migrate",name:"cwd",type:String},{description:"Preview changes without applying them",name:"dry-run",type:Boolean}]})},"createMigrateCommand");try{require("node:module")?.enableCompileCache?.()||require("v8-compile-cache")}catch{}const E=Z("packem",{logger:await ee({reporters:[new te({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem"}),packageName:ke,packageVersion:z});it(E);st(E);ze(E);ut(E);E.run({shouldExitProcess:!1});
|
|
76
|
+
Uncommitted changes will be lost. Use the --dry-run flag to preview changes without applying them.`);const n=await i.question("Continue? (Y/n) ");if(i.close(),!(n.toLowerCase()==="y"||n==="")){a.error("Migration cancelled."),j.exitCode=1;return}}t&&j.chdir(t);let s=!1;await _t(e,a)&&(s=!0),Yt(a)&&(s=!0),s?a.success("Migration completed. Remember to run install command with your package manager."):(a.error("No migration performed."),j.exitCode=1)},"migrate"),Qt=y(t=>{t.addCommand({description:"Migrate from other bundlers (tsup, unbuild, bunchee, etc.) to packem",execute:y(async({logger:e,options:a})=>{const s=a;await Xt({cwd:s.cwd,dryRun:s.dryRun,logger:e})},"execute"),name:"migrate",options:[{defaultValue:".",description:"The directory to migrate",name:"cwd",type:String},{description:"Preview changes without applying them",name:"dry-run",type:Boolean}]})},"createMigrateCommand");try{require("node:module").enableCompileCache?.()||require("v8-compile-cache")}catch{}const M=oe("packem",{logger:ce({reporters:[new we({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem"}),packageName:Ee,packageVersion:Z});Tt(M);$t(M);tt(M);Qt(M);M.run({shouldExitProcess:!1});
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { B as BuildConfig,
|
|
1
|
+
import { B as BuildConfig, a as BuildConfigFunction, d as BuildPreset } from "../packem_shared/types.d-CcnkF-XF.js";
|
|
2
2
|
export { type BuildHooks } from '@visulima/packem-share/types';
|
|
3
3
|
import '@arethetypeswrong/core';
|
|
4
|
+
import '@visulima/packem-plugins';
|
|
5
|
+
import '@visulima/packem-plugins/oxc';
|
|
6
|
+
import '@visulima/packem-plugins/plugin/externals';
|
|
7
|
+
import '@visulima/packem-plugins/plugin/native-modules';
|
|
4
8
|
import '@visulima/packem-rollup';
|
|
5
|
-
import '@visulima/packem-rollup/oxc';
|
|
6
|
-
import '@visulima/packem-rollup/plugin/native-modules';
|
|
7
9
|
import '@visulima/packem-share/utils';
|
|
8
10
|
import '@visulima/rollup-plugin-css';
|
|
9
11
|
import 'jiti';
|
|
10
12
|
import 'rollup';
|
|
11
13
|
import 'typedoc';
|
|
12
|
-
import '@visulima/pail';
|
|
13
14
|
/**
|
|
14
15
|
* Defines a build configuration for Packem.
|
|
15
16
|
* Supports both static configuration objects and dynamic configuration functions.
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { BabelPluginConfig } from '@visulima/packem-
|
|
2
|
-
import { B as BuildConfig } from "../../packem_shared/types.d-
|
|
1
|
+
import { BabelPluginConfig } from '@visulima/packem-plugins/babel';
|
|
2
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CcnkF-XF.js";
|
|
3
3
|
import '@arethetypeswrong/core';
|
|
4
|
+
import '@visulima/packem-plugins';
|
|
5
|
+
import '@visulima/packem-plugins/oxc';
|
|
6
|
+
import '@visulima/packem-plugins/plugin/externals';
|
|
7
|
+
import '@visulima/packem-plugins/plugin/native-modules';
|
|
4
8
|
import '@visulima/packem-rollup';
|
|
5
|
-
import '@visulima/packem-rollup/oxc';
|
|
6
|
-
import '@visulima/packem-rollup/plugin/native-modules';
|
|
7
9
|
import '@visulima/packem-share/types';
|
|
8
10
|
import '@visulima/packem-share/utils';
|
|
9
11
|
import '@visulima/rollup-plugin-css';
|
|
10
12
|
import 'jiti';
|
|
11
13
|
import 'rollup';
|
|
12
14
|
import 'typedoc';
|
|
13
|
-
import '@visulima/pail';
|
|
14
15
|
interface PreactPresetOptions {
|
|
15
16
|
/**
|
|
16
17
|
* Enable Preact devtools in production builds
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var A=Object.defineProperty;var f=(o,a)=>A(o,"name",{value:a,configurable:!0});var v=Object.defineProperty,l=f((o,a)=>v(o,"name",{value:a,configurable:!0}),"
|
|
2
|
-
${t}`,map:void 0}}}),"createPreactDevtoolsPlugin"),h=l((o={})=>{const{devtoolsInProd:a=!1,plugins:t
|
|
1
|
+
var A=Object.defineProperty;var f=(o,a)=>A(o,"name",{value:a,configurable:!0});var v=Object.defineProperty,l=f((o,a)=>v(o,"name",{value:a,configurable:!0}),"c");const j=l(()=>({name:"packem:preact-alias-transform",transform(o,a){if(a.includes("/node_modules/"))return;let t=!1,e=o;if((e.includes('from "react"')||e.includes("from 'react'"))&&(e=e.replaceAll(/from\s+["']react["']/g,'from "preact/compat"'),t=!0),(e.includes('from "react-dom"')||e.includes("from 'react-dom'"))&&(e=e.replaceAll(/from\s+["']react-dom["']/g,'from "preact/compat"'),t=!0),(e.includes('from "react-dom/test-utils"')||e.includes("from 'react-dom/test-utils'"))&&(e=e.replaceAll(/from\s+["']react-dom\/test-utils["']/g,'from "preact/test-utils"'),t=!0),(e.includes('from "react-dom/client"')||e.includes("from 'react-dom/client'"))&&(e=e.replaceAll(/from\s+["']react-dom\/client["']/g,'from "preact/compat"'),t=!0),(e.includes('from "react/jsx-runtime"')||e.includes("from 'react/jsx-runtime'"))&&(e=e.replaceAll(/from\s+["']react\/jsx-runtime["']/g,'from "preact/jsx-runtime"'),t=!0),!!t)return{code:e,map:void 0}}}),"createPreactAliasTransformPlugin"),P=l((o,a)=>({name:"packem:preact-devtools",transform(t,e){return!this.getModuleInfo(e)?.isEntry||a&&!o||t.includes("preact/debug")||t.includes("preact/devtools")?void 0:{code:`import "${a?"preact/devtools":"preact/debug"}";
|
|
2
|
+
${t}`,map:void 0}}}),"createPreactDevtoolsPlugin"),h=l((o={})=>{const{devtoolsInProd:a=!1,plugins:t,presets:e}=o,i=[],g=[["@babel/preset-react",{importSource:"preact",runtime:"automatic"}]];i.push("babel-plugin-transform-hook-names");const m=[...i,...Array.isArray(t)?t:[]],p=[...g,...Array.isArray(e)?e:[]];return{hooks:{"rollup:options":l((u,c)=>{const s=u.options.rollup.babel,d=u.environment==="production";if(s&&typeof s=="object"&&s.presets){const r=s.presets.findIndex(n=>Array.isArray(n)&&n[0]==="@babel/preset-react");if(r!==-1){const n=s.presets[r];s.presets[r]=[n[0],{...typeof n[1]=="object"&&n[1]!==null?n[1]:{},development:!d}]}}if(!c.input&&!c.plugins)return;Array.isArray(c.plugins)||(c.plugins=[]);const b=j();c.plugins.some(r=>typeof r=="object"&&r!==null&&"name"in r&&r.name==="packem:preact-alias-transform"||Array.isArray(r)&&r[0]&&typeof r[0]=="object"&&"name"in r[0]&&r[0].name==="packem:preact-alias-transform")||c.plugins.unshift(b);const y=P(a,d);c.plugins.some(r=>typeof r=="object"&&r!==null&&"name"in r&&r.name==="packem:preact-devtools"||Array.isArray(r)&&r[0]&&typeof r[0]=="object"&&"name"in r[0]&&r[0].name==="packem:preact-devtools")||c.plugins.push(y)},"rollup:options")},rollup:{alias:{entries:[{find:"react",replacement:"preact/compat"},{find:"react-dom",replacement:"preact/compat"},{find:"react-dom/test-utils",replacement:"preact/test-utils"},{find:"react/jsx-runtime",replacement:"preact/jsx-runtime"}]},babel:{plugins:m.length>0?m:void 0,presets:p.length>0?p:void 0}},validation:{dependencies:{hoisted:{exclude:["react","react-dom"]},unused:{exclude:["preact","react","react-dom"]}}}}},"createPreactPreset");export{h as createPreactPreset};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { BabelPluginConfig } from '@visulima/packem-
|
|
2
|
-
import { B as BuildConfig } from "../../packem_shared/types.d-
|
|
1
|
+
import { BabelPluginConfig } from '@visulima/packem-plugins/babel';
|
|
2
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CcnkF-XF.js";
|
|
3
3
|
import '@arethetypeswrong/core';
|
|
4
|
+
import '@visulima/packem-plugins';
|
|
5
|
+
import '@visulima/packem-plugins/oxc';
|
|
6
|
+
import '@visulima/packem-plugins/plugin/externals';
|
|
7
|
+
import '@visulima/packem-plugins/plugin/native-modules';
|
|
4
8
|
import '@visulima/packem-rollup';
|
|
5
|
-
import '@visulima/packem-rollup/oxc';
|
|
6
|
-
import '@visulima/packem-rollup/plugin/native-modules';
|
|
7
9
|
import '@visulima/packem-share/types';
|
|
8
10
|
import '@visulima/packem-share/utils';
|
|
9
11
|
import '@visulima/rollup-plugin-css';
|
|
10
12
|
import 'jiti';
|
|
11
13
|
import 'rollup';
|
|
12
14
|
import 'typedoc';
|
|
13
|
-
import '@visulima/pail';
|
|
14
15
|
interface ReactPresetOptions {
|
|
15
16
|
/**
|
|
16
17
|
* Enable React Compiler optimization
|
|
@@ -41,7 +42,7 @@ interface ReactPresetOptions {
|
|
|
41
42
|
* React preset for Packem. Configures Babel with React presets and optionally React Compiler.
|
|
42
43
|
* @description This preset configures Babel to run before your main transformer (esbuild/SWC/etc.).
|
|
43
44
|
* Babel handles JSX transformation, while TypeScript is handled by the transformer via parser plugins.
|
|
44
|
-
* This matches the approach used by
|
|
45
|
+
* This matches the approach used by `@vitejs/plugin-react`.
|
|
45
46
|
* @example
|
|
46
47
|
* ```typescript
|
|
47
48
|
* // Basic usage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m=Object.defineProperty;var d=(o,e)=>m(o,"name",{value:e,configurable:!0});var f=Object.defineProperty,b=d((o,e)=>f(o,"name",{value:e,configurable:!0}),"s");const v=b((o={})=>{const{compiler:e,plugins:i,presets:a}=o,l=[],p=[];if(e){const s=typeof e=="object"?e:{};l.push(["babel-plugin-react-compiler",{compilationMode:s.compilationMode??"infer",panicThreshold:s.panicThreshold??"critical_errors"}])}p.push(["@babel/preset-react",{runtime:"automatic"}]);const c=[...l,...Array.isArray(i)?i:[]],u=[...p,...Array.isArray(a)?a:[]];return{hooks:{"rollup:options":b((s,h)=>{const t=s.options.rollup.babel;if(t&&typeof t=="object"&&t.presets){const n=t.presets.findIndex(r=>Array.isArray(r)&&r[0]==="@babel/preset-react");if(n!==-1){const r=t.presets[n];t.presets[n]=[r[0],{...typeof r[1]=="object"&&r[1]!==null?r[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};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { BabelPluginConfig } from '@visulima/packem-
|
|
2
|
-
import { B as BuildConfig } from "../../packem_shared/types.d-
|
|
1
|
+
import { BabelPluginConfig } from '@visulima/packem-plugins/babel';
|
|
2
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CcnkF-XF.js";
|
|
3
3
|
import '@arethetypeswrong/core';
|
|
4
|
+
import '@visulima/packem-plugins';
|
|
5
|
+
import '@visulima/packem-plugins/oxc';
|
|
6
|
+
import '@visulima/packem-plugins/plugin/externals';
|
|
7
|
+
import '@visulima/packem-plugins/plugin/native-modules';
|
|
4
8
|
import '@visulima/packem-rollup';
|
|
5
|
-
import '@visulima/packem-rollup/oxc';
|
|
6
|
-
import '@visulima/packem-rollup/plugin/native-modules';
|
|
7
9
|
import '@visulima/packem-share/types';
|
|
8
10
|
import '@visulima/packem-share/utils';
|
|
9
11
|
import '@visulima/rollup-plugin-css';
|
|
10
12
|
import 'jiti';
|
|
11
13
|
import 'rollup';
|
|
12
14
|
import 'typedoc';
|
|
13
|
-
import '@visulima/pail';
|
|
14
15
|
interface SolidPresetOptions {
|
|
15
16
|
/**
|
|
16
17
|
* Pass any additional babel transform options. They will be merged with
|
|
@@ -1 +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}),"
|
|
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}),"g");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};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { B as BuildConfig } from "../../packem_shared/types.d-
|
|
1
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CcnkF-XF.js";
|
|
2
2
|
import '@arethetypeswrong/core';
|
|
3
|
+
import '@visulima/packem-plugins';
|
|
4
|
+
import '@visulima/packem-plugins/oxc';
|
|
5
|
+
import '@visulima/packem-plugins/plugin/externals';
|
|
6
|
+
import '@visulima/packem-plugins/plugin/native-modules';
|
|
3
7
|
import '@visulima/packem-rollup';
|
|
4
|
-
import '@visulima/packem-rollup/oxc';
|
|
5
|
-
import '@visulima/packem-rollup/plugin/native-modules';
|
|
6
8
|
import '@visulima/packem-share/types';
|
|
7
9
|
import '@visulima/packem-share/utils';
|
|
8
10
|
import '@visulima/rollup-plugin-css';
|
|
9
11
|
import 'jiti';
|
|
10
12
|
import 'rollup';
|
|
11
13
|
import 'typedoc';
|
|
12
|
-
import '@visulima/pail';
|
|
13
14
|
interface SveltePresetOptions {
|
|
14
15
|
/**
|
|
15
16
|
* Svelte plugin options
|
|
@@ -1 +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}),"
|
|
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}),"n");const c=/\.svelte$/,v=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??[c],preprocess:e.preprocess})}],resolve:{browser:!0,exportConditions:["svelte"],extensions:[...n,".svelte"]}},validation:{dependencies:{hoisted:{exclude:[]},unused:{exclude:["svelte"]}}}}},"createSveltePreset");export{v as createSveltePreset};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { B as BuildConfig } from "../../packem_shared/types.d-
|
|
1
|
+
import { B as BuildConfig } from "../../packem_shared/types.d-CcnkF-XF.js";
|
|
2
2
|
import '@arethetypeswrong/core';
|
|
3
|
+
import '@visulima/packem-plugins';
|
|
4
|
+
import '@visulima/packem-plugins/oxc';
|
|
5
|
+
import '@visulima/packem-plugins/plugin/externals';
|
|
6
|
+
import '@visulima/packem-plugins/plugin/native-modules';
|
|
3
7
|
import '@visulima/packem-rollup';
|
|
4
|
-
import '@visulima/packem-rollup/oxc';
|
|
5
|
-
import '@visulima/packem-rollup/plugin/native-modules';
|
|
6
8
|
import '@visulima/packem-share/types';
|
|
7
9
|
import '@visulima/packem-share/utils';
|
|
8
10
|
import '@visulima/rollup-plugin-css';
|
|
9
11
|
import 'jiti';
|
|
10
12
|
import 'rollup';
|
|
11
13
|
import 'typedoc';
|
|
12
|
-
import '@visulima/pail';
|
|
13
14
|
interface VuePresetOptions {
|
|
14
15
|
/**
|
|
15
16
|
* Vue plugin options
|
|
@@ -1 +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??[
|
|
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 o=/\.vue$/,a=c((t={})=>{const{pluginOptions:e={}}=t;return{rollup:{plugins:[{enforce:"pre",plugin:l({customElement:e.customElement??!1,exclude:e.exclude,include:e.include??[o],template:e.template})}]},validation:{dependencies:{hoisted:{exclude:[]},unused:{exclude:["vue"]}}}}},"createVuePreset");export{a as createVuePreset};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ConstructorOptions } from '@visulima/pail';
|
|
2
|
-
import { B as BuildConfig } from "./packem_shared/types.d-
|
|
3
|
-
export { type
|
|
4
|
-
export { type TransformerFn, type TransformerName } from '@visulima/packem-
|
|
2
|
+
import { B as BuildConfig } from "./packem_shared/types.d-CcnkF-XF.js";
|
|
3
|
+
export { type b as BuildEntry, type c as BuildOptions, type R as RollupBuildOptions } from "./packem_shared/types.d-CcnkF-XF.js";
|
|
4
|
+
export { type TransformerFn, type TransformerName } from '@visulima/packem-plugins';
|
|
5
5
|
import { Environment, Mode } from '@visulima/packem-share/types';
|
|
6
6
|
export { type BuildContext, type BuildContextBuildAssetAndChunk, type BuildContextBuildEntry, type BuildHooks, type Environment, type Mode, type Runtime } from '@visulima/packem-share/types';
|
|
7
7
|
import '@arethetypeswrong/core';
|
|
8
|
-
import '@visulima/packem-
|
|
9
|
-
import '@visulima/packem-
|
|
8
|
+
import '@visulima/packem-plugins/oxc';
|
|
9
|
+
import '@visulima/packem-plugins/plugin/externals';
|
|
10
|
+
import '@visulima/packem-plugins/plugin/native-modules';
|
|
11
|
+
import '@visulima/packem-rollup';
|
|
10
12
|
import '@visulima/packem-share/utils';
|
|
11
13
|
import '@visulima/rollup-plugin-css';
|
|
12
14
|
import 'jiti';
|
|
@@ -43,7 +45,7 @@ interface PackemOptions extends BuildConfig {
|
|
|
43
45
|
mode?: Mode;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
|
-
* Runs the Packem bundler with the specified options
|
|
48
|
+
* Runs the Packem bundler with the specified options.
|
|
47
49
|
* @param rootDirectory The root directory of the project to bundle
|
|
48
50
|
* @param options Configuration options for the bundler
|
|
49
51
|
* @returns Promise that resolves with the build result
|