@visulima/packem 1.0.0-alpha.80 → 1.0.0-alpha.82
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 +18 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/create-bundler.cjs +65 -65
- package/dist/create-bundler.d.cts +1 -1
- package/dist/create-bundler.d.mts +1 -1
- package/dist/create-bundler.mjs +67 -67
- package/dist/rollup/plugins/esbuild/index.cjs +1 -1
- package/dist/rollup/plugins/esbuild/index.mjs +1 -1
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.cts +1 -1
- package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.mts +1 -1
- package/dist/rollup/plugins/sucrase/index.cjs +1 -1
- package/dist/rollup/plugins/sucrase/index.mjs +1 -1
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.cts +1 -1
- package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.mts +1 -1
- package/dist/rollup/plugins/swc/swc-plugin.cjs +1 -1
- package/dist/rollup/plugins/swc/swc-plugin.mjs +1 -1
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.cts +1 -1
- package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.mts +1 -1
- package/dist/shared/{packem.D0iDqbKr.d.mts → packem.CQpBRH1_.d.mts} +2 -1
- package/dist/shared/packem.DcRh98q_.mjs +1 -0
- package/dist/shared/{packem.VNV8N0gL.d.cts → packem.eayQ8TSJ.d.cts} +2 -1
- package/dist/shared/packem.lwnJ_PjR.cjs +1 -0
- package/package.json +2 -1
- package/dist/shared/packem.CFplOoR-.cjs +0 -1
- package/dist/shared/packem.C_T1EDp8.mjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## @visulima/packem [1.0.0-alpha.82](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.81...@visulima/packem@1.0.0-alpha.82) (2024-08-28)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* improved rollup caching ([02e89e2](https://github.com/visulima/packem/commit/02e89e204257310a089bca22a983d597666074fb))
|
|
6
|
+
* improved splitting based on package.json exports ([aba0a20](https://github.com/visulima/packem/commit/aba0a2058f15a4ceebdb30c8b0db31c646d0eb21))
|
|
7
|
+
|
|
8
|
+
## @visulima/packem [1.0.0-alpha.81](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.80...@visulima/packem@1.0.0-alpha.81) (2024-08-21)
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* improved the file alias handling ([e94155a](https://github.com/visulima/packem/commit/e94155afd6f4d6422af773798f3e95d4edec9e8f))
|
|
13
|
+
* more test for packem ([75139c1](https://github.com/visulima/packem/commit/75139c1ec27c09cce82e7f56f1371417c79c17e8))
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* fixed correct finding of source files ([6e25ff0](https://github.com/visulima/packem/commit/6e25ff0b6e6a39adc66a4f27671e01c3375aeb6f))
|
|
18
|
+
|
|
1
19
|
## @visulima/packem [1.0.0-alpha.80](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.79...@visulima/packem@1.0.0-alpha.80) (2024-08-20)
|
|
2
20
|
|
|
3
21
|
### Features
|
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var h=Object.defineProperty;var p=(n,o)=>h(n,"name",{value:o,configurable:!0});const k=require("@visulima/cerebro"),E=require("@visulima/pail/reporter"),d=require("node:process"),l=require("./shared/packem.
|
|
2
|
+
"use strict";var h=Object.defineProperty;var p=(n,o)=>h(n,"name",{value:o,configurable:!0});const k=require("@visulima/cerebro"),E=require("@visulima/pail/reporter"),d=require("node:process"),l=require("./shared/packem.lwnJ_PjR.cjs"),b=require("./create-bundler.cjs"),j=require("@antfu/install-pkg"),a=require("@clack/prompts"),m=require("@visulima/fs"),w=require("@visulima/package/package-json"),u=require("@visulima/path"),N=p(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),C=N(k),V="@visulima/packem",O="1.0.0-alpha.81";var D=Object.defineProperty,g=p((n,o)=>D(n,"name",{value:o,configurable:!0}),"a");const P=g(n=>{n.addCommand({description:"Demonstrate options required",execute:g(async({logger:o,options:e})=>{let s="build";e.watch?s="watch":e.jit&&(s="jit");const r={};let t;if(d.env.NODE_ENV&&[l.DEVELOPMENT_ENV,l.PRODUCTION_ENV].includes(d.env.NODE_ENV)&&(t=d.env.NODE_ENV),e.env)for(const i of e.env)if(i.key==="NODE_ENV"){if(t)throw new Error("NODE_ENV was already set, this can't be overridden.");t=i.value}else r["process.env."+i.key]=JSON.stringify(i.value);t===void 0&&(e.production?t=l.PRODUCTION_ENV:e.development&&(t=l.DEVELOPMENT_ENV));try{await b(e.dir,s,t,o,{cjsInterop:e.cjsInterop,clean:e.clean,configPath:e.config??void 0,debug:e.debug,minify:e.minify===void 0?t===l.PRODUCTION_ENV:e.minify,replace:{...r},rollup:{esbuild:{target:e.target},license:{path:e.license},metafile:e.metafile,...e.analyze?{visualizer:{}}:{visualizer:!1}},sourcemap:e.sourcemap,tsconfigPath:e.tsconfig??void 0})}catch(i){o.error(i),d.exit(1)}},"execute"),name:"build",options:[{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:g(o=>{const[e,s]=o.split("=");return{key:e,value:s}},"type")},{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}]})},"createBuildCommand");var S=Object.defineProperty,v=p((n,o)=>S(n,"name",{value:o,configurable:!0}),"m");const _=v(n=>{n.addCommand({description:"Initialize packem configuration",execute:v(async({logger:o,options:e})=>{if(a.intro("Welcome to packem setup"),m.isAccessibleSync(u.join(e.dir,"packem.config.ts"))){o.info("Packem project already initialized, you can use `packem build` to build your project");return}if(a.isCancel(e.transformer)){a.cancel("Operation cancelled");return}const s=u.join(e.dir,"package.json");if(!m.isAccessibleSync(s))throw new Error("No package.json found in the directory");const r=w.parsePackageJson(s),t=[];if(r.dependencies&&t.push(...Object.keys(r.dependencies)),r.devDependencies&&t.push(...Object.keys(r.devDependencies)),e.transformer===void 0&&(e.transformer=await a.select({message:"Pick a transformer",options:[{label:"esbuild",value:"esbuild"},{label:"swc",value:"swc"},{label:"Sucrase",value:"sucrase"}]}),!t.includes(e.transformer)&&await a.confirm({message:"Do you want to install "+e.transformer+"?"}))){const i=a.spinner();i.start("Installing "+e.transformer),await j.installPackage(e.transformer==="swc"?"@swc/core":e.transformer,{cwd:e.dir,dev:!0,silent:!0}),i.stop("")}if(t.includes("typescript")||r.type==="module"){const i=`import { defineConfig } from "@visulima/packem/config";
|
|
3
3
|
import transformer from "@visulima/packem/transformer/${e.transformer}";
|
|
4
4
|
|
|
5
5
|
export default defineConfig({
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var b=Object.defineProperty;var m=(n,i)=>b(n,"name",{value:i,configurable:!0});import w from"@visulima/cerebro";import{SimpleReporter as
|
|
2
|
+
var b=Object.defineProperty;var m=(n,i)=>b(n,"name",{value:i,configurable:!0});import w from"@visulima/cerebro";import{SimpleReporter as j}from"@visulima/pail/reporter";import{env as l,exit as E}from"node:process";import{b as y,P as d}from"./shared/packem.DcRh98q_.mjs";import C from"./create-bundler.mjs";import{installPackage as N}from"@antfu/install-pkg";import{intro as V,isCancel as O,cancel as D,select as P,confirm as x,spinner as f,outro as S}from"@clack/prompts";import{isAccessibleSync as v,writeFileSync as h}from"@visulima/fs";import{parsePackageJson as B}from"@visulima/package/package-json";import{join as s}from"@visulima/path";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
3
3
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
4
|
-
const z="@visulima/packem",I="1.0.0-alpha.
|
|
4
|
+
const z="@visulima/packem",I="1.0.0-alpha.81";var _=Object.defineProperty,u=m((n,i)=>_(n,"name",{value:i,configurable:!0}),"a");const T=u(n=>{n.addCommand({description:"Demonstrate options required",execute:u(async({logger:i,options:e})=>{let a="build";e.watch?a="watch":e.jit&&(a="jit");const r={};let o;if(l.NODE_ENV&&[y,d].includes(l.NODE_ENV)&&(o=l.NODE_ENV),e.env)for(const t of e.env)if(t.key==="NODE_ENV"){if(o)throw new Error("NODE_ENV was already set, this can't be overridden.");o=t.value}else r["process.env."+t.key]=JSON.stringify(t.value);o===void 0&&(e.production?o=d:e.development&&(o=y));try{await C(e.dir,a,o,i,{cjsInterop:e.cjsInterop,clean:e.clean,configPath:e.config??void 0,debug:e.debug,minify:e.minify===void 0?o===d:e.minify,replace:{...r},rollup:{esbuild:{target:e.target},license:{path:e.license},metafile:e.metafile,...e.analyze?{visualizer:{}}:{visualizer:!1}},sourcemap:e.sourcemap,tsconfigPath:e.tsconfig??void 0})}catch(t){i.error(t),E(1)}},"execute"),name:"build",options:[{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:u(i=>{const[e,a]=i.split("=");return{key:e,value:a}},"type")},{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}]})},"createBuildCommand");var J=Object.defineProperty,k=m((n,i)=>J(n,"name",{value:i,configurable:!0}),"m");const R=k(n=>{n.addCommand({description:"Initialize packem configuration",execute:k(async({logger:i,options:e})=>{if(V("Welcome to packem setup"),v(s(e.dir,"packem.config.ts"))){i.info("Packem project already initialized, you can use `packem build` to build your project");return}if(O(e.transformer)){D("Operation cancelled");return}const a=s(e.dir,"package.json");if(!v(a))throw new Error("No package.json found in the directory");const r=B(a),o=[];if(r.dependencies&&o.push(...Object.keys(r.dependencies)),r.devDependencies&&o.push(...Object.keys(r.devDependencies)),e.transformer===void 0&&(e.transformer=await P({message:"Pick a transformer",options:[{label:"esbuild",value:"esbuild"},{label:"swc",value:"swc"},{label:"Sucrase",value:"sucrase"}]}),!o.includes(e.transformer)&&await x({message:"Do you want to install "+e.transformer+"?"}))){const t=f();t.start("Installing "+e.transformer),await N(e.transformer==="swc"?"@swc/core":e.transformer,{cwd:e.dir,dev:!0,silent:!0}),t.stop("")}if(o.includes("typescript")||r.type==="module"){const t=`import { defineConfig } from "@visulima/packem/config";
|
|
5
5
|
import transformer from "@visulima/packem/transformer/${e.transformer}";
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
@@ -13,4 +13,4 @@ const transformer = require("@visulima/packem/transformer/${e.transformer}");
|
|
|
13
13
|
module.exports = defineConfig({
|
|
14
14
|
transformer
|
|
15
15
|
});
|
|
16
|
-
`,c=f();c.start("Creating packem.config.js"),h(s(e.dir,"packem.config.js"),t),c.stop("Created packem.config.js")}S("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 to use for packem",name:"transformer",type:String}]})},"createInitCommand"),g=new w("packem",{logger:{reporters:[new
|
|
16
|
+
`,c=f();c.start("Creating packem.config.js"),h(s(e.dir,"packem.config.js"),t),c.stop("Created packem.config.js")}S("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 to use for packem",name:"transformer",type:String}]})},"createInitCommand"),g=new w("packem",{logger:{reporters:[new j({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem"},packageName:z,packageVersion:I});R(g);T(g);g.run({shouldExitProcess:!1});
|
package/dist/config.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BuildConfig, a as BuildPreset, E as Environment, M as Mode } from './shared/packem.
|
|
2
|
-
export { b as BuildHooks } from './shared/packem.
|
|
1
|
+
import { B as BuildConfig, a as BuildPreset, E as Environment, M as Mode } from './shared/packem.eayQ8TSJ.cjs';
|
|
2
|
+
export { b as BuildHooks } from './shared/packem.eayQ8TSJ.cjs';
|
|
3
3
|
import '@rollup/plugin-alias';
|
|
4
4
|
import '@rollup/plugin-commonjs';
|
|
5
5
|
import '@rollup/plugin-json';
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BuildConfig, a as BuildPreset, E as Environment, M as Mode } from './shared/packem.
|
|
2
|
-
export { b as BuildHooks } from './shared/packem.
|
|
1
|
+
import { B as BuildConfig, a as BuildPreset, E as Environment, M as Mode } from './shared/packem.CQpBRH1_.mjs';
|
|
2
|
+
export { b as BuildHooks } from './shared/packem.CQpBRH1_.mjs';
|
|
3
3
|
import '@rollup/plugin-alias';
|
|
4
4
|
import '@rollup/plugin-commonjs';
|
|
5
5
|
import '@rollup/plugin-json';
|