Comparing version 2.4.0 to 2.4.1
#!/usr/bin/env node | ||
var l=Object.create;var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var h=(o,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u(t))!d.call(o,i)&&i!==e&&p(o,i,{get:()=>t[i],enumerable:!(a=m(t,i))||a.enumerable});return o};var s=(o,t,e)=>(e=o!=null?l(f(o)):{},h(t||!o||!o.__esModule?p(e,"default",{value:o,enumerable:!0}):e,o));var r=require("commander"),c=require("@techor/fs"),n=s(require("@techor/log")),{version:y,name:v,description:x}=(0,c.readJSONFileSync)("./package.json");r.program.command("pack [entryPaths...]").option("-f, --format [formats...]","The output format for the generated JavaScript files `iife`, `cjs`, `esm`",["cjs","esm"]).option("-w, --watch","Rebuild whenever a file changes",!1).option("-s, --sourcemap","Emit a source map",process.env.NODE_ENV==="production").option("-p, --platform <node,browser,neutral>","Platform target","browser").option("-o, --outdir <dir>","The output directory for the build operation","dist").option("--serve","Serve mode starts a web server that serves your code to your browser on your device",!1).option("--bundle","Inline any imported dependencies into the file itself",!1).option("-e, --external <packages...>","External packages to exclude from the build",[]).option("-re, --resolve-extensions [extensions...]","The resolution algorithm used by node supports implicit file extensions",[".tsx",".ts",".jsx",".js",".css",".json"]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).option("--cjs-ext <ext>","Specify CommonJS default file extension",".js").option("--iife-ext <ext>","Specify CommonJS default file extension",".js").option("--esm-ext <ext>","Specify CommonJS default file extension",".mjs").option("--srcdir <dir>","The source directory","src").option("--target [targets...]","This sets the target environment for the generated JavaScript and/or CSS code.").option("--mangle-props <regExp>","Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression").option("--entry-names <[dir]/[name]>","Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression").option("--no-declare","OFF: Emit typescript declarations").option("--no-minify","OFF: Minify the generated code").option("--no-clean","OFF: Clean up the previous output directory before the build starts").action(async function(o,t){try{let e=(await import("@techor/pack/actions/main")).default;await e(o,t)}catch(e){e.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@techor/pack** first`:console.error(e)}});r.program.command("version <version>").description("Bump to specific version for workspace's packages").option("-p, --prefix <symbol>","Version prefix `^`, `~`, `>`, `>=`, `<`, `<=` ","^").option("-w, --workspaces <paths>","Specific your workspaces").option("-ls, --list","List current bumpable dependency tree in workspaces",!1).option("--private","Bump private project version",!1).option("--no-public","Off: Bump public project version").action(async function(o,t){try{let e=(await import("@techor/version/actions/main")).default;await e(o,t)}catch(e){e.code==="ERR_MODULE_NOT_FOUND"?n.default.i`Please run **npm** **install** **@techor/version** first`:console.error(e)}});r.program.parse(process.argv);r.program.name(v);r.program.description(x);r.program.version(y); | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
// src/bin/index.ts | ||
var import_commander = require("commander"); | ||
var import_fs = require("@techor/fs"); | ||
var import_log = __toESM(require("@techor/log")); | ||
var import_path = __toESM(require("path")); | ||
var { version, name, description } = (0, import_fs.readJSONFileSync)(import_path.default.resolve(__dirname, "../../package.json")); | ||
var program = new import_commander.Command(); | ||
program.name(name).description(description).version(version || "0.0.0"); | ||
program.command("pack [entryPaths...]").option("-f, --format [formats...]", "The output format for the generated JavaScript files `iife`, `cjs`, `esm`", ["cjs", "esm"]).option("-w, --watch", "Rebuild whenever a file changes", false).option("-s, --sourcemap", "Emit a source map", process.env.NODE_ENV === "production").option("-p, --platform <node,browser,neutral>", "Platform target", "browser").option("-o, --outdir <dir>", "The output directory for the build operation", "dist").option("--serve", "Serve mode starts a web server that serves your code to your browser on your device", false).option("--bundle", "Inline any imported dependencies into the file itself", false).option("-e, --external <packages...>", "External packages to exclude from the build", []).option("-re, --resolve-extensions [extensions...]", "The resolution algorithm used by node supports implicit file extensions", [".tsx", ".ts", ".jsx", ".js", ".css", ".json"]).option("-kn, --keep-names", "Keep JavaScript function/class names", false).option("--cjs-ext <ext>", "Specify CommonJS default file extension", ".js").option("--iife-ext <ext>", "Specify CommonJS default file extension", ".js").option("--esm-ext <ext>", "Specify CommonJS default file extension", ".mjs").option("--srcdir <dir>", "The source directory", "src").option("--target [targets...]", "This sets the target environment for the generated JavaScript and/or CSS code.").option("--mangle-props <regExp>", "Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression").option("--entry-names <[dir]/[name]>", "Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression").option("--no-declare", "OFF: Emit typescript declarations").option("--no-minify", "OFF: Minify the generated code").option("--no-clean", "OFF: Clean up the previous output directory before the build starts").action(async function(args, options) { | ||
try { | ||
const action = require("@techor/pack/actions/main"); | ||
await action(args, options); | ||
} catch (error) { | ||
if (error.code === "ERR_MODULE_NOT_FOUND") { | ||
import_log.default.i`Please run **npm** **install** **@techor/pack** first`; | ||
} else { | ||
console.error(error); | ||
} | ||
} | ||
}); | ||
program.command("version <version>").description("Bump to specific version for workspace's packages").option("-p, --prefix <symbol>", "Version prefix `^`, `~`, `>`, `>=`, `<`, `<=` ", "^").option("-w, --workspaces <paths>", "Specific your workspaces").option("-ls, --list", "List current bumpable dependency tree in workspaces", false).option("--private", "Bump private project version", false).option("--no-public", "Off: Bump public project version").action(async function(args, options) { | ||
try { | ||
const action = require("@techor/version/actions/main"); | ||
await action(args, options); | ||
} catch (error) { | ||
if (error.code === "ERR_MODULE_NOT_FOUND") { | ||
import_log.default.i`Please run **npm** **install** **@techor/version** first`; | ||
} else { | ||
console.error(error); | ||
} | ||
} | ||
}); | ||
program.parse(); |
@@ -1,1 +0,1 @@ | ||
{"name":"techor","scripts":{"build":"esbuild src/bin/index.ts --bundle --outfile=dist/bin/index.bundle.js --format=cjs --minify --platform=node --external:@techor/fs --external:@techor/log --external:commander --external:@techor/version --external:@techor/pack","dev":"npm run build -- --watch","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"Author technology like a top leader","author":{"name":"Aron","email":"i@aron.tw","url":"https://aron.tw"},"homepage":"https://github.com/1aron/techor","bugs":{"url":"https://github.com/1aron/techor/issues"},"repository":{"type":"git","url":"https://github.com/1aron/techor.git","directory":"packages/techor"},"keywords":["author","technology","creator","config","opensource","plugin","package","framework","tool","software","pack","esbuild","version","bump","bundle","commonjs","esm","esmodule"],"bin":{"techor":"./dist/bin/index.bundle.js"},"files":["dist"],"sideEffects":false,"publishConfig":{"access":"public"},"dependencies":{"@techor/fs":"^2.4.0","@techor/log":"^2.4.0","commander":"^10.0.0"},"version":"2.4.0"} | ||
{"name":"techor","scripts":{"build":"esbuild src/bin/index.ts --bundle --outfile=dist/bin/index.bundle.js --format=cjs --target=esnext --platform=node --external:@techor/fs --external:@techor/log --external:commander --external:@techor/version --external:@techor/pack","dev":"npm run build -- --watch","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"Author technology like a top leader","author":{"name":"Aron","email":"i@aron.tw","url":"https://aron.tw"},"homepage":"https://github.com/1aron/techor","bugs":{"url":"https://github.com/1aron/techor/issues"},"repository":{"type":"git","url":"https://github.com/1aron/techor.git","directory":"packages/techor"},"keywords":["author","technology","creator","config","opensource","plugin","package","framework","tool","software","pack","esbuild","version","bump","bundle","commonjs","esm","esmodule"],"bin":{"techor":"./dist/bin/index.bundle.js"},"files":["dist"],"sideEffects":false,"publishConfig":{"access":"public"},"dependencies":{"@techor/fs":"^2.4.1","@techor/log":"^2.4.1","commander":"^11.0.0"},"version":"2.4.1"} |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
14477
63
0
+ Addedcommander@11.1.0(transitive)
- Removedcommander@10.0.1(transitive)
Updated@techor/fs@^2.4.1
Updated@techor/log@^2.4.1
Updatedcommander@^11.0.0