jiek 0.2.5 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/jiek.js +1 -1
- package/dist/{cli.cjs.min.js → cli.cjs} +1 -1
- package/dist/cli.cjs.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{rollup.cjs.min.js → rollup.cjs} +2 -2
- package/dist/rollup.cjs.map +1 -0
- package/dist/rollup.esm.js +1 -1
- package/dist/rollup.esm.js.map +1 -1
- package/dist/rollup.esm.min.js +1 -1
- package/dist/rollup.esm.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli.cjs.js +0 -668
- package/dist/cli.cjs.js.map +0 -1
- package/dist/cli.cjs.min.js.map +0 -1
- package/dist/index.cjs.js +0 -6
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.cjs.min.js +0 -2
- package/dist/index.cjs.min.js.map +0 -1
- package/dist/rollup.cjs.js +0 -227
- package/dist/rollup.cjs.js.map +0 -1
- package/dist/rollup.cjs.min.js.map +0 -1
package/bin/jiek.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
"use strict";var e=require("node:fs"),t=require("node:path"),r=require("@pnpm/filter-workspace-packages"),n=require("commander"),o=require("js-yaml"),a=require("@jiek/utils/getWorkspaceDir"),i=require("node:child_process"),s=require("@jiek/pkger"),l=require("detect-indent"),c=require("inquirer"),p=require("jsonc-parser"),u=require("micromatch"),f=require("@jiek/utils/bumper");function d(e){return e&&e.__esModule?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var g=d(e),y=d(t),w=m(i),k=d(l),h=d(c);let b,j;function v(){if(b)return b;const e=n.program.getOptionValue("root");return b=e?y.default.isAbsolute(e)?e:y.default.resolve(process.cwd(),e):process.cwd(),b}let S=!1;function $(){if(j)return{wd:j,notWorkspace:S};const e=v();try{j=a.getWorkspaceDir(e,q)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;j=e,S=!0}return{wd:j,notWorkspace:S}}let E,O,q="";try{require.resolve("@pnpm/filter-workspace-packages"),q="pnpm"}catch{}async function x(){let e=n.program.getOptionValue("filter");const t=v(),{wd:a,notWorkspace:i}=$();if(!i&&"pnpm"===q){const n=y.default.resolve(a,"pnpm-workspace.yaml"),i=g.default.readFileSync(n,"utf-8"),s=o.load(i);if(t===a&&!e)throw new Error("root path is workspace root, please provide a filter");if(t!==a&&!e){if(!g.default.existsSync(y.default.resolve(t,"package.json")))throw new Error("root path is not workspace root, please provide a filter");const r=JSON.parse(g.default.readFileSync(y.default.resolve(t,"package.json"),"utf-8"));if(!r.name)throw new Error("root path is not workspace root, please provide a filter");e=r.name}const{selectedProjectsGraph:l}=await r.filterPackagesFromDir(a,[{filter:e??"",followProdDepsOnly:!0}],{prefix:t,workspaceDir:a,patterns:s.packages});return{wd:a,root:t,value:Object.entries(l).reduce(((e,[t,r])=>(e[t]=r.package.manifest,e)),{})}}return{wd:a,root:t,value:{[a]:JSON.parse(g.default.readFileSync(y.default.resolve(a,"package.json"),"utf-8"))}}}function F(){E()}function _(){new Promise((e=>E=e))}function A(e,t){const{jiek:{cwd:r,...n}={}}=e;let{exports:o}=e,a=!1;"string"==typeof o&&(a=!0,o={".":o}),void 0===o&&(o={".":"./src/index.ts"}),"object"==typeof o&&(a=!!(Array.isArray(o)&&o.length>0)||!!o["."]);const i=Array.isArray(o)?o:Object.entries(o).reduce(((e,[t,r])=>{if("string"==typeof r)return"."===t?[r,...e]:e.concat(r);if(Array.isArray(r))return e.concat(r);throw new TypeError(`Unexpected value type for key "${t}" in exports, expected string, got ${typeof r}`)}),[]);if(0===i.length)throw new Error("No inputs found");const l=i.map((e=>y.default.isAbsolute(e)?e:y.default.resolve(t,e)));let c=y.default.dirname(l[0]);l.length>1&&(c=function(e,t=process.cwd()){const r=e.map((e=>y.default.isAbsolute(e)?e:y.default.resolve(t,e))),[n=""]=r,o=n.split("/");let a="";for(let e=0;e<o.length;e++){const t=o[e];if(!r.every((e=>e.startsWith(a+t))))break;a+=t+"/"}return a}(l,t));const p=l.map((e=>y.default.relative(c,e)));return{...e,...s.pkger({cwd:t,noIndex:!a,source:y.default.relative(t,c),inputs:p,...n})}}function J(e){try{return require.resolve(e),!0}catch(e){return!1}}""!==q&&n.program.option("-f, --filter <filter>","filter packages");const N=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of N)if(J(e)){O=e;break}const P=e=>`\nconst pkg = ${JSON.stringify(e,null,2)}\nconst { jiek = {} } = pkg\nconst templateArg = jiek.templateArgFilePath\n ? require.resolve(jiek.templateArgFilePath)\n : {\n styled: jiek.styled\n }\nmodule.exports = require('jiek/rollup').template(templateArg, pkg)\n`.trimStart();n.program.command("build").action((async()=>{_();const{wd:e,value:t={}}=await x()??{};if(0===Object.keys(t).length)throw new Error("no package found");const r=(...t)=>y.default.resolve(e,"node_modules/.jiek",...t);g.default.existsSync(r())||g.default.mkdirSync(r());const n=require.resolve("rollup").replace(/dist\/rollup.js$/,"dist/bin/rollup");let o=0;for(const[e,a]of Object.entries(t)){const t=A(a,e),i=a.name?.replace(/^@/g,"").replace(/\//g,"+"),s=r(`${i??"anonymous-"+o++}.rollup.config.js`);g.default.writeFileSync(s,P(t));let l="";O&&(l=`node -r ${O} `),w.execSync(`${l}${n} -c ${s}`,{cwd:e,stdio:"inherit"})}F()}));let D="jiek.config";function M(){const{wd:e,notWorkspace:t}=$();if(t)throw new Error("not in workspace");let r=n.program.getOptionValue("configPath");if(r){if(!g.default.existsSync(r))throw new Error(`config file not found: ${r}`);y.default.isAbsolute(r)||(r=y.default.resolve(e,r))}else r=function(e){const t=!!O;function r(t){const r=[y.default.resolve(e,`${D}.${t}`),y.default.resolve(e,`.${D}.${t}`)];for(const e of r)if(g.default.existsSync(e)&&g.default.lstatSync(e).isFile())return e}return D=r("js")??D,D=r("json")??D,D=r("yaml")??D,t&&(D=r("ts")??D),y.default.resolve(e,D)}(e);const a=y.default.extname(r);let i;switch(a){case".js":i=require(r);break;case".json":return require(r);case".yaml":return o.load(g.default.readFileSync(r,"utf-8"));case".ts":if(O){require(O),i=require(r);break}throw new Error("ts config file is not supported without ts register, please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register");case".config":i={};break;default:throw new Error(`unsupported config file type: ${a}`)}if(!i)throw new Error("config file is empty");return i.default??i}const W='{\n "name": "",\n "version": "0.0.1",\n "description": "",\n "license": "",\n "author": "",\n "files": ["dist"],\n "exports": {\n ".": "./src/index.ts"\n },\n "scripts": {\n },\n "homepage": "",\n "repository": "",\n "bugs": ""\n}'.trimStart(),I="# $name\n\n## Installation\n\n```bash\nnpm install $name\n# or\npnpm install $name\n# or\nyarn add $name\n```\n\n## Usage\n\n\n## License\n\n$license\n".trimStart();const R=new Map;function T(e,t){if(R.has(e))return R.get(e)[t];const r=y.default.resolve(e,"package.json"),n=JSON.parse(g.default.readFileSync(r,"utf-8"));return R.set(e,n),n[t]}n.program.command("init [name]").option("-t, --template <template>","the package.json template file path or file content").action((async()=>{const[,e]=n.program.args,t=process.cwd(),{init:r={}}=M()??{},{wd:o}=$(),a=y.default.basename(o),{named:i,template:s,bug:l={},readme:c=I,readmeTemplate:f}=r,d={template:"bug_report.yml",labels:["bug"],...l};let m=c;if(f){const e=y.default.resolve(o,f);m=g.default.readFileSync(e,"utf-8")}const w=function(e,t){let r=t??W,n=!1;try{t&&JSON.parse(t)}catch(e){n=!0}if(n){const n=y.default.resolve(e,t);r=g.default.readFileSync(n,"utf-8")}return r}(o,s),{indent:b=" "}=k.default(w),j={tabSize:b.length,insertSpaces:!0},v=["license","author"];let S=w;for(const e of v)S=p.applyEdits(S,p.modify(S,[e],T(o,e),{formattingOptions:j}));let[E,O]=await async function(e,t,{wd:r,cwd:n,workspaceName:o}){const a=n.replace(`${r}/`,"");let i=y.default.basename(n);if("function"==typeof e)return e(t,{full:r,relative:n});let s,l,c=!1;if("object"==typeof e)if(n===r){const{rule:t}=await h.default.prompt({type:"list",name:"rule",message:"choose a rule",default:"default",choices:["default"].concat(Object.keys(e))});"default"!==t&&(s=t,l=e[t])}else for(const[t,r]of Object.entries(e)){if(u.isMatch(a,t)){s=t,l=r;break}if(u.isMatch(`${a}/jiek_ignore_dont_use_same_file_name`,t)){c=!0,s=t,l=r;break}}if(l||(s="packages/*",l=`@${o}/$basename`),!l)throw new Error("no matched rule");if(!t&&c&&(i=await h.default.prompt({type:"input",name:"name",message:`the matched rule is \`${String(l)}\`, please input the basename\n`}).then((({name:e})=>e))),"function"==typeof l)return l(t,{full:r,relative:n,basename:i});if("string"==typeof l){const e=t??i;return[l.replace(/\$basename/g,e),s?.replace(/\/\*$/g,`/${e}`)]}throw new Error("no matched rule")}(i,e,{wd:o,cwd:t,workspaceName:a});if(!O){const{dir:t}=await h.default.prompt({type:"input",name:"dir",message:"package directory",default:e});O=t}if(!E){const{name:t}=await h.default.prompt({type:"input",name:"name",message:"package name",default:e});E=t}S=p.applyEdits(S,p.modify(S,["name"],E,{formattingOptions:j}));let q=T(o,"repository");"string"==typeof q&&(q={type:"git",url:q,directory:O}),S=p.applyEdits(S,p.modify(S,["repository"],q,{formattingOptions:j}));const x=`${q?.url}/blob/master/${O}/README.md`;S=p.applyEdits(S,p.modify(S,["homepage"],x,{formattingOptions:j}));let F=d.labels;"function"==typeof F&&(F=F({name:E,dir:O})),F.push(`scope:${E}`);const _=`${q?.url}/issues/new?template=${d.template}&labels=${F.join(",")}`;function A(e){if(!O)throw new Error("pkgDir is not defined");return y.default.resolve(O,e)}S=p.applyEdits(S,p.modify(S,["bugs"],_,{formattingOptions:j})),g.default.existsSync(O)||g.default.mkdirSync(O);const J=A("package.json");if(g.default.existsSync(J))throw new Error("package.json already exists");g.default.writeFileSync(J,S),console.log(S,"written to",J);const N=T(o,"license"),P=A("README.md");"function"==typeof m&&(m=m({dir:O,packageJson:JSON.parse(S)}));const D=m.replace(/\$name/g,E).replace(/\$license/g,N);g.default.writeFileSync(P,D)})),n.program.command("publish").aliases(["pub","p"]).option("-b, --bumper <bumper>","bump version","patch").option("-p, --preview","preview publish").action((async({preview:e,bumper:t,...r})=>{_();const{value:n={}}=await x()??{},o=Object.entries(n);if(0===o.length)throw new Error("no packages selected");const a=o.map((([e,t])=>[e,A(t,e)])),i=Object.entries(r).reduce(((e,[t,r])=>(r&&e.push(`--${t}`,r),e)),[]);for(const[r,n]of a){const o=g.default.readFileSync(y.default.join(r,"package.json"),"utf-8"),a=JSON.parse(o)??"0.0.0",s=f.bump(a.version,t),{indent:l=" "}=k.default(o),c={tabSize:l.length,insertSpaces:!0};let u=o;u=p.applyEdits(u,p.modify(u,["version"],s,{formattingOptions:c}));for(const[e,t]of Object.entries(n))JSON.stringify(t)!==JSON.stringify(a[e])&&(u=p.applyEdits(u,p.modify(u,["publishConfig",e],t,{formattingOptions:c})));try{if(g.default.renameSync(y.default.join(r,"package.json"),y.default.join(r,"package.json.bak")),g.default.writeFileSync(y.default.join(r,"package.json"),u),console.log(u),e){console.warn("preview mode");continue}w.execSync(["pnpm","publish","--access","public","--no-git-checks",...i].join(" "),{cwd:r,stdio:"inherit"});const t=p.applyEdits(o,p.modify(o,["version"],s,{}));g.default.writeFileSync(y.default.join(r,"package.json.bak"),t)}finally{g.default.unlinkSync(y.default.join(r,"package.json")),g.default.renameSync(y.default.join(r,"package.json.bak"),y.default.join(r,"package.json"))}}F()}));const z=require("../package.json");n.program.version(z.version).description(z.description).option("--root <root>","root path").option("-c, --config-path <configPath>","config path"),n.program.parse(process.argv);
|
2
|
-
//# sourceMappingURL=cli.cjs.
|
2
|
+
//# sourceMappingURL=cli.cjs.map
|
package/dist/cli.cjs.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cli.cjs","sources":["../src/utils/getRoot.ts","../src/utils/getWD.ts","../src/utils/filterSupport.ts","../src/inner.ts","../src/utils/tsRegister.ts","../src/merge-package-json.ts","../src/utils/commondir.ts","../src/commands/build.ts","../src/utils/loadConfig.ts","../src/commands/init.ts","../src/commands/publish.ts","../src/cli.ts"],"sourcesContent":["import path from 'node:path'\n\nimport { program } from 'commander'\n\nlet root: string\nexport function getRoot() {\n if (root) return root\n\n const rootOption = program.getOptionValue('root')\n root = rootOption\n ? path.isAbsolute(rootOption)\n ? rootOption\n : path.resolve(process.cwd(), rootOption)\n : process.cwd()\n return root\n}\n","import { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\n\nimport { type } from './filterSupport'\nimport { getRoot } from './getRoot'\n\nlet wd: string\nlet notWorkspace = false\n\nexport function getWD() {\n if (wd) return { wd, notWorkspace }\n\n const root = getRoot()\n try {\n wd = getWorkspaceDir(root, type)\n } catch (e) {\n // @ts-ignore\n if ('message' in e && e.message === 'workspace root not found') {\n wd = root\n notWorkspace = true\n } else {\n throw e\n }\n }\n return { wd, notWorkspace }\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport { filterPackagesFromDir } from '@pnpm/filter-workspace-packages'\nimport { program } from 'commander'\nimport { load } from 'js-yaml'\n\nimport { getRoot } from './getRoot'\nimport { getWD } from './getWD'\n\nexport let type = ''\n\ntry {\n require.resolve('@pnpm/filter-workspace-packages')\n type = 'pnpm'\n} catch { /* empty */ }\nif (type !== '') {\n program\n .option('-f, --filter <filter>', 'filter packages')\n}\n\ninterface ProjectsGraph {\n wd: string\n root: string\n value?: Record<string, {\n name?: string\n }>\n}\n\nexport async function getSelectedProjectsGraph(): Promise<ProjectsGraph> {\n let filter = program.getOptionValue('filter')\n const root = getRoot()\n const { wd, notWorkspace } = getWD()\n if (!notWorkspace && type === 'pnpm') {\n const pnpmWorkspaceFilePath = path.resolve(wd, 'pnpm-workspace.yaml')\n const pnpmWorkspaceFileContent = fs.readFileSync(pnpmWorkspaceFilePath, 'utf-8')\n const pnpmWorkspace = load(pnpmWorkspaceFileContent) as {\n packages: string[]\n }\n if (root === wd && !filter) {\n throw new Error('root path is workspace root, please provide a filter')\n // TODO inquirer prompt support user select packages\n }\n if (root !== wd && !filter) {\n const packageJSONIsExist = fs.existsSync(path.resolve(root, 'package.json'))\n if (!packageJSONIsExist) {\n throw new Error('root path is not workspace root, please provide a filter')\n }\n const packageJSON = JSON.parse(fs.readFileSync(path.resolve(root, 'package.json'), 'utf-8'))\n if (!packageJSON.name) {\n throw new Error('root path is not workspace root, please provide a filter')\n }\n filter = packageJSON.name\n }\n const { selectedProjectsGraph } = await filterPackagesFromDir(wd, [{\n filter: filter ?? '',\n followProdDepsOnly: true\n }], {\n prefix: root,\n workspaceDir: wd,\n patterns: pnpmWorkspace.packages\n })\n return {\n wd, root,\n value: Object.entries(selectedProjectsGraph)\n .reduce((acc, [key, value]) => {\n acc[key] = value.package.manifest\n return acc\n }, {} as NonNullable<ProjectsGraph['value']>)\n }\n }\n return {\n wd, root,\n value: {\n [wd]: JSON.parse(fs.readFileSync(path.resolve(wd, 'package.json'), 'utf-8'))\n }\n }\n}\n","let resolve: () => void\n\nexport let actionFuture: Promise<void>\n\nexport function actionDone() {\n resolve()\n}\n\nexport function actionRestore() {\n actionFuture = new Promise<void>(r => resolve = r)\n}\n","function packageIsExist(name: string) {\n try {\n require.resolve(name)\n return true\n } catch (e) {\n return false\n }\n}\n\nexport let tsRegisterName: string | undefined\nconst registers = [\n process.env.JIEK_TS_REGISTER,\n 'esbuild-register',\n '@swc-node/register',\n 'ts-node/register'\n].filter(Boolean) as string[]\nfor (const register of registers) {\n if (packageIsExist(register)) {\n tsRegisterName = register\n break\n }\n}\n","import path from 'node:path'\n\nimport { type Options, pkger } from '@jiek/pkger'\nimport type { Manifest } from '@pnpm/workspace.pkgs-graph'\n\nimport { commondir } from './utils/commondir'\n\nexport function mergePackageJson(manifest: Manifest & {\n jiek?: Options\n exports?: unknown | unknown[]\n}, cwd: string) {\n const {\n jiek: { cwd: _, ...jiek } = {}\n } = manifest\n let { exports } = manifest\n let includeIndex = false\n if (typeof exports === 'string') {\n includeIndex = true\n exports = { '.': exports }\n }\n if (exports === undefined) {\n exports = { '.': './src/index.ts' }\n }\n if (typeof exports === 'object') {\n if (Array.isArray(exports) && exports.length > 0) {\n includeIndex = true\n } else {\n includeIndex = !!(<Record<string, unknown>>exports)['.']\n }\n }\n const inputs = Array.isArray(exports)\n ? exports as string[]\n : Object\n .entries(<Record<string, unknown>>exports)\n .reduce((acc, [key, value]) => {\n if (typeof value === 'string') return key === '.'\n ? [value, ...acc]\n : acc.concat(value)\n if (Array.isArray(value)) return acc.concat(value)\n\n throw new TypeError(`Unexpected value type for key \"${key}\" in exports, expected string, got ${typeof value}`)\n }, [] as string[])\n if (inputs.length === 0)\n throw new Error('No inputs found')\n\n const absoluteInputs = inputs.map(input => path.isAbsolute(input)\n ? input\n : path.resolve(cwd, input)\n )\n let cDir = path.dirname(absoluteInputs[0])\n if (absoluteInputs.length > 1) {\n cDir = commondir(absoluteInputs, cwd)\n }\n const resolvedInputs = absoluteInputs.map(input => {\n return path.relative(cDir, input)\n })\n return {\n ...manifest,\n ...pkger({\n cwd,\n noIndex: !includeIndex,\n source: path.relative(cwd, cDir),\n inputs: resolvedInputs,\n ...jiek\n })\n }\n}\n","import path from 'node:path'\n\nexport function commondir(files: string[], cwd = process.cwd()): string {\n const resolvedFiles = files.map(file => {\n if (path.isAbsolute(file)) return file\n return path.resolve(cwd, file)\n })\n const sep = '/'\n const [first = ''] = resolvedFiles\n const parts = first.split(sep)\n let common = ''\n for (let i = 0; i < parts.length; i++) {\n const segment = parts[i]\n if (resolvedFiles.every(file => file.startsWith(common + segment))) {\n common += segment + sep\n } else {\n break\n }\n }\n return common\n}\n","import * as childProcess from 'node:child_process'\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\n\nimport { actionDone, actionRestore } from '../inner'\nimport { mergePackageJson } from '../merge-package-json'\nimport { getSelectedProjectsGraph } from '../utils/filterSupport'\nimport { tsRegisterName } from '../utils/tsRegister'\n\nconst FILE_TEMPLATE = (manifest: unknown) => `\nconst pkg = ${JSON.stringify(manifest, null, 2)}\nconst { jiek = {} } = pkg\nconst templateArg = jiek.templateArgFilePath\n ? require.resolve(jiek.templateArgFilePath)\n : {\n styled: jiek.styled\n }\nmodule.exports = require('jiek/rollup').template(templateArg, pkg)\n`.trimStart()\n\nprogram\n .command('build')\n .action(async () => {\n actionRestore()\n const {\n wd, value = {}\n } = await getSelectedProjectsGraph() ?? {}\n\n if (Object.keys(value).length === 0) {\n throw new Error('no package found')\n }\n const jiekTempDir = (...paths: string[]) => path.resolve(wd, 'node_modules/.jiek', ...paths)\n if (!fs.existsSync(jiekTempDir())) fs.mkdirSync(jiekTempDir())\n\n const rollupBinaryPath = require.resolve('rollup')\n .replace(/dist\\/rollup.js$/, 'dist/bin/rollup')\n let i = 0\n for (const [dir, manifest] of Object.entries(value)) {\n const newManifest = mergePackageJson(manifest, dir)\n // TODO support auto build child packages in workspaces\n const escapeManifestName = manifest.name?.replace(/^@/g, '').replace(/\\//g, '+')\n const configFile = jiekTempDir(\n `${escapeManifestName ?? `anonymous-${i++}`}.rollup.config.js`\n )\n fs.writeFileSync(configFile, FILE_TEMPLATE(newManifest))\n let prefix = ''\n if (tsRegisterName) {\n prefix = `node -r ${tsRegisterName} `\n }\n // TODO replace with `spawn` to support watch mode\n childProcess.execSync(`${prefix}${rollupBinaryPath} -c ${configFile}`, {\n cwd: dir, stdio: 'inherit'\n })\n }\n\n actionDone()\n })\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\nimport { load } from 'js-yaml'\n\nimport { getWD } from './getWD'\nimport { tsRegisterName } from './tsRegister'\n\nlet configName = 'jiek.config'\n\nfunction getConfigPath(root: string) {\n const isSupportTsLoader = !!tsRegisterName\n function configWithExtIsExist(ext: string) {\n const filenames = [\n path.resolve(root, `${configName}.${ext}`),\n path.resolve(root, `.${configName}.${ext}`)\n ]\n for (const filename of filenames) {\n if (\n fs.existsSync(filename) &&\n fs.lstatSync(filename)\n .isFile()\n ) {\n return filename\n }\n }\n return\n }\n configName = configWithExtIsExist('js') ?? configName\n configName = configWithExtIsExist('json') ?? configName\n configName = configWithExtIsExist('yaml') ?? configName\n if (isSupportTsLoader) {\n configName = configWithExtIsExist('ts') ?? configName\n }\n return path.resolve(root, configName)\n}\n\nexport function loadConfig() {\n const { wd: root, notWorkspace } = getWD()\n if (notWorkspace)\n throw new Error('not in workspace')\n\n let configPath = program.getOptionValue('configPath')\n\n if (!configPath) {\n configPath = getConfigPath(root)\n } else {\n if (!fs.existsSync(configPath))\n throw new Error(`config file not found: ${configPath}`)\n if (!path.isAbsolute(configPath))\n configPath = path.resolve(root, configPath)\n }\n const ext = path.extname(configPath)\n\n let module: any\n switch (ext) {\n case '.js':\n module = require(configPath)\n break\n case '.json':\n return require(configPath)\n case '.yaml':\n return load(fs.readFileSync(configPath, 'utf-8'))\n case '.ts':\n if (tsRegisterName) {\n require(tsRegisterName)\n module = require(configPath)\n break\n }\n throw new Error(\n 'ts config file is not supported without ts register, ' +\n 'please install esbuild-register or set JIEK_TS_REGISTER env for custom ts register'\n )\n case '.config':\n module = {}\n break\n default:\n throw new Error(`unsupported config file type: ${ext}`)\n }\n if (!module) throw new Error('config file is empty')\n\n return module.default ?? module\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\nimport detectIndent from 'detect-indent'\nimport inquirer from 'inquirer'\nimport { applyEdits, modify } from 'jsonc-parser'\nimport { isMatch } from 'micromatch'\n\nimport type { Config, InitNamed } from '../base'\nimport { getWD } from '../utils/getWD'\nimport { loadConfig } from '../utils/loadConfig'\n\nconst PACKAGE_JSON_TEMPLATE = `{\n \"name\": \"\",\n \"version\": \"0.0.1\",\n \"description\": \"\",\n \"license\": \"\",\n \"author\": \"\",\n \"files\": [\"dist\"],\n \"exports\": {\n \".\": \"./src/index.ts\"\n },\n \"scripts\": {\n },\n \"homepage\": \"\",\n \"repository\": \"\",\n \"bugs\": \"\"\n}`.trimStart()\nconst README_TEMPLATE = `# $name\n\n## Installation\n\n\\`\\`\\`bash\nnpm install $name\n# or\npnpm install $name\n# or\nyarn add $name\n\\`\\`\\`\n\n## Usage\n\n\n## License\n\n$license\n`.trimStart()\n\nfunction getTemplateStr(wd: string, template: string | undefined) {\n let templateString = template ?? PACKAGE_JSON_TEMPLATE\n let isTemplateFile = false\n try {\n if (template) JSON.parse(template)\n } catch (e) {\n isTemplateFile = true\n }\n if (isTemplateFile) {\n const templatePath = path.resolve(wd, template!)\n templateString = fs.readFileSync(templatePath, 'utf-8')\n }\n return templateString\n}\nconst wdCache = new Map<string, Record<string, any>>()\nfunction getWDPackageJSONFiled(wd: string, field: string) {\n if (wdCache.has(wd)) {\n return wdCache.get(wd)![field]\n }\n const packageJSONPath = path.resolve(wd, 'package.json')\n const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, 'utf-8'))\n wdCache.set(wd, packageJSON)\n return packageJSON[field]\n}\nasync function getName(\n named: InitNamed | undefined,\n name: string,\n {\n wd, cwd,\n workspaceName\n }: {\n wd: string\n cwd: string\n workspaceName: string\n }\n): Promise<[name?: string, path?: string]> {\n const relativePath = cwd.replace(`${wd}/`, '')\n let basename = path.basename(cwd)\n\n if (typeof named === 'function') {\n return named(name, {\n full: wd,\n relative: cwd\n })\n }\n\n let isParentMatched = false\n let matchedKey: string | undefined\n let matchedRule: NonNullable<typeof named>[string] | undefined\n if (typeof named === 'object') {\n const isWD = cwd === wd\n if (isWD) {\n const { rule } = await inquirer.prompt<{ rule: string }>({\n type: 'list',\n name: 'rule',\n message: 'choose a rule',\n default: 'default',\n choices: ['default'].concat(Object.keys(named))\n })\n if (rule !== 'default') {\n matchedKey = rule\n matchedRule = named[rule]\n }\n } else for (const [key, value] of Object.entries(named)) {\n if (isMatch(relativePath, key)) {\n matchedKey = key\n matchedRule = value\n break\n }\n if (isMatch(`${relativePath}/jiek_ignore_dont_use_same_file_name`, key)) {\n isParentMatched = true\n matchedKey = key\n matchedRule = value\n break\n }\n }\n }\n if (!matchedRule) {\n matchedKey = 'packages/*'\n matchedRule = `@${workspaceName}/$basename`\n }\n if (!matchedRule)\n throw new Error('no matched rule')\n if (!name && isParentMatched) {\n basename = await inquirer.prompt<{ name: string }>({\n type: 'input',\n name: 'name',\n message: `the matched rule is \\`${String(matchedRule)}\\`, please input the basename\\n`\n }).then(({ name }) => name)\n }\n\n if (typeof matchedRule === 'function') {\n return matchedRule(name, {\n full: wd,\n relative: cwd,\n basename: basename\n })\n }\n if (typeof matchedRule === 'string') {\n const dirName = name ?? basename\n return [\n matchedRule.replace(/\\$basename/g, dirName),\n matchedKey?.replace(/\\/\\*$/g, `/${dirName}`)\n ]\n }\n throw new Error('no matched rule')\n}\n\nprogram\n .command('init [name]')\n .option('-t, --template <template>', 'the package.json template file path or file content')\n .action(async () => {\n const [, name] = program.args\n const cwd = process.cwd()\n const { init = {} }: Config = loadConfig() ?? {}\n const { wd } = getWD()\n const workspaceName = path.basename(wd)\n\n const {\n named,\n template,\n bug = {},\n readme: _readme = README_TEMPLATE,\n readmeTemplate\n } = init\n const resolvedBug = {\n template: 'bug_report.yml',\n labels: ['bug'],\n ...bug\n }\n let readme = _readme\n if (readmeTemplate) {\n const readmeTemplatePath = path.resolve(wd, readmeTemplate)\n readme = fs.readFileSync(readmeTemplatePath, 'utf-8')\n }\n\n const templateString = getTemplateStr(wd, template)\n // TODO detectIndent by editorconfig\n const { indent = ' ' } = detectIndent(templateString)\n const formattingOptions = {\n tabSize: indent.length,\n insertSpaces: true\n }\n const passFields = [\n 'license', 'author'\n ]\n let newJSONString = templateString\n for (const field of passFields) {\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, [field], getWDPackageJSONFiled(wd, field), { formattingOptions }\n ))\n }\n let [pkgName, pkgDir] = await getName(named, name, {\n wd, cwd,\n workspaceName\n })\n if (!pkgDir) {\n const { dir } = await inquirer.prompt<{ dir: string }>({\n type: 'input',\n name: 'dir',\n message: 'package directory',\n default: name\n })\n pkgDir = dir\n }\n if (!pkgName) {\n const { name: inputName } = await inquirer.prompt<{\n name: string\n }>({\n type: 'input',\n name: 'name',\n message: 'package name',\n default: name\n })\n pkgName = inputName\n }\n newJSONString = applyEdits(newJSONString, modify(newJSONString, ['name'], pkgName, { formattingOptions }))\n\n let pkgRepo = getWDPackageJSONFiled(wd, 'repository')\n if (typeof pkgRepo === 'string') {\n pkgRepo = {\n type: 'git',\n url: pkgRepo,\n directory: pkgDir\n }\n }\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['repository'], pkgRepo, { formattingOptions }\n ))\n const homepage = `${pkgRepo?.url}/blob/master/${pkgDir}/README.md`\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['homepage'], homepage, { formattingOptions }\n ))\n let labels = resolvedBug.labels\n if (typeof labels === 'function') labels = labels({\n name: pkgName, dir: pkgDir\n })\n labels.push(`scope:${pkgName}`)\n const bugs = `${pkgRepo?.url}/issues/new?template=${\n resolvedBug.template\n }&labels=${\n labels.join(',')\n }`\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['bugs'], bugs, { formattingOptions }\n ))\n\n function pkgDirTo(to: string) {\n if (!pkgDir) throw new Error('pkgDir is not defined')\n\n return path.resolve(pkgDir, to)\n }\n if (!fs.existsSync(pkgDir)) fs.mkdirSync(pkgDir)\n const pkgJSONFilePath = pkgDirTo('package.json')\n if (fs.existsSync(pkgJSONFilePath)) {\n throw new Error('package.json already exists')\n }\n fs.writeFileSync(pkgJSONFilePath, newJSONString)\n console.log(newJSONString, 'written to', pkgJSONFilePath)\n\n const license = getWDPackageJSONFiled(wd, 'license')\n const readmeFilePath = pkgDirTo('README.md')\n if (typeof readme === 'function') {\n readme = readme({\n dir: pkgDir,\n packageJson: JSON.parse(newJSONString)\n })\n }\n const readmeContent = readme\n .replace(/\\$name/g, pkgName)\n .replace(/\\$license/g, license)\n fs.writeFileSync(readmeFilePath, readmeContent)\n })\n","import * as childProcess from 'node:child_process'\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport { bump, type BumperType } from '@jiek/utils/bumper'\nimport { program } from 'commander'\nimport detectIndent from 'detect-indent'\nimport { applyEdits, modify } from 'jsonc-parser'\n\nimport { actionDone, actionRestore } from '../inner'\nimport { mergePackageJson } from '../merge-package-json'\nimport { getSelectedProjectsGraph } from '../utils/filterSupport'\n\nprogram\n .command('publish')\n .aliases(['pub', 'p'])\n .option('-b, --bumper <bumper>', 'bump version', 'patch')\n .option('-p, --preview', 'preview publish')\n .action(async ({ preview, bumper, ...options }: {\n preview?: boolean\n bumper: BumperType\n }) => {\n actionRestore()\n\n const { value = {} } = await getSelectedProjectsGraph() ?? {}\n const selectedProjectsGraphEntries = Object.entries(value)\n if (selectedProjectsGraphEntries.length === 0) {\n throw new Error('no packages selected')\n }\n const mainfests = selectedProjectsGraphEntries\n .map(([dir, manifest]) => [\n dir, mergePackageJson(manifest, dir)\n ] as const)\n const passArgs = Object\n .entries(options)\n .reduce((acc, [key, value]) => {\n if (value) {\n acc.push(`--${key}`, value as string)\n }\n return acc\n }, [] as string[])\n for (const [dir, manifest] of mainfests) {\n const oldJSONString = fs.readFileSync(path.join(dir, 'package.json'), 'utf-8')\n const oldJSON = JSON.parse(oldJSONString) ?? '0.0.0'\n const newVersion = bump(oldJSON.version, bumper)\n // TODO detectIndent by editorconfig\n const { indent = ' ' } = detectIndent(oldJSONString)\n const formattingOptions = {\n tabSize: indent.length,\n insertSpaces: true\n }\n let newJSONString = oldJSONString\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['version'], newVersion, { formattingOptions }\n ))\n for (const [key, value] of Object.entries(manifest)) {\n if (JSON.stringify(value) === JSON.stringify(oldJSON[key])) continue\n\n newJSONString = applyEdits(newJSONString, modify(\n newJSONString, ['publishConfig', key], value, { formattingOptions }\n ))\n }\n try {\n fs.renameSync(path.join(dir, 'package.json'), path.join(dir, 'package.json.bak'))\n fs.writeFileSync(path.join(dir, 'package.json'), newJSONString)\n console.log(newJSONString)\n if (preview) {\n console.warn('preview mode')\n continue\n }\n childProcess.execSync(['pnpm', 'publish', '--access', 'public', '--no-git-checks', ...passArgs].join(' '), {\n cwd: dir,\n stdio: 'inherit'\n })\n const modifyVersionPackageJSON = applyEdits(oldJSONString, modify(oldJSONString, ['version'], newVersion, {}))\n fs.writeFileSync(path.join(dir, 'package.json.bak'), modifyVersionPackageJSON)\n } finally {\n fs.unlinkSync(path.join(dir, 'package.json'))\n fs.renameSync(path.join(dir, 'package.json.bak'), path.join(dir, 'package.json'))\n }\n }\n actionDone()\n })\n","import './utils/filterSupport'\nimport './commands/build'\nimport './commands/init'\nimport './commands/publish'\n\nimport { program } from 'commander'\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nconst pkg = require('../package.json')\n\nprogram\n .version(pkg.version)\n .description(pkg.description)\n .option('--root <root>', 'root path')\n .option('-c, --config-path <configPath>', 'config path')\n\nprogram.parse(process.argv)\n"],"names":["root","wd","getRoot","rootOption","program","getOptionValue","path","default","isAbsolute","resolve","process","cwd","notWorkspace","getWD","getWorkspaceDir","type","e","message","tsRegisterName","require","async","getSelectedProjectsGraph","filter","pnpmWorkspaceFilePath","pnpmWorkspaceFileContent","fs","readFileSync","pnpmWorkspace","load","Error","existsSync","packageJSON","JSON","parse","name","selectedProjectsGraph","filterPackagesFromDir","followProdDepsOnly","prefix","workspaceDir","patterns","packages","value","Object","entries","reduce","acc","key","package","manifest","actionDone","actionRestore","Promise","r","mergePackageJson","jiek","_","exports","includeIndex","Array","isArray","length","inputs","concat","TypeError","absoluteInputs","map","input","cDir","dirname","files","resolvedFiles","file","first","parts","split","common","i","segment","every","startsWith","commondir","resolvedInputs","relative","pkger","noIndex","source","packageIsExist","option","registers","env","JIEK_TS_REGISTER","Boolean","register","FILE_TEMPLATE","stringify","trimStart","command","action","keys","jiekTempDir","paths","mkdirSync","rollupBinaryPath","replace","dir","newManifest","escapeManifestName","configFile","writeFileSync","childProcess","execSync","stdio","configName","loadConfig","configPath","isSupportTsLoader","configWithExtIsExist","ext","filenames","filename","lstatSync","isFile","getConfigPath","extname","module","PACKAGE_JSON_TEMPLATE","README_TEMPLATE","wdCache","Map","getWDPackageJSONFiled","field","has","get","packageJSONPath","set","args","init","workspaceName","basename","named","template","bug","readme","_readme","readmeTemplate","resolvedBug","labels","readmeTemplatePath","templateString","isTemplateFile","templatePath","getTemplateStr","indent","detectIndent","formattingOptions","tabSize","insertSpaces","passFields","newJSONString","applyEdits","modify","pkgName","pkgDir","relativePath","full","matchedKey","matchedRule","isParentMatched","rule","inquirer","prompt","choices","isMatch","String","then","dirName","getName","inputName","pkgRepo","url","directory","homepage","push","bugs","join","pkgDirTo","to","pkgJSONFilePath","console","log","license","readmeFilePath","packageJson","readmeContent","aliases","preview","bumper","options","selectedProjectsGraphEntries","mainfests","passArgs","oldJSONString","oldJSON","newVersion","bump","version","renameSync","warn","modifyVersionPackageJSON","unlinkSync","pkg","description","argv"],"mappings":"ovBAIA,IAAIA,ECCAC,EDAG,SAASC,IACV,GAAAF,EAAa,OAAAA,EAEX,MAAAG,EAAaC,EAAAA,QAAQC,eAAe,QAMnC,OALPL,EAAOG,EACHG,EAAAC,QAAKC,WAAWL,GACdA,EACAG,EAAAA,QAAKG,QAAQC,QAAQC,MAAOR,GAC9BO,QAAQC,MACLX,CACT,CCTA,IAAIY,GAAe,EAEZ,SAASC,IACV,GAAAZ,EAAW,MAAA,CAAEA,KAAIW,gBAErB,MAAMZ,EAAOE,IACT,IACGD,EAAAa,EAAAA,gBAAgBd,EAAMe,SACpBC,GAEP,KAAI,YAAaA,IAAmB,6BAAdA,EAAEC,QAIhB,MAAAD,EAHDf,EAAAD,EACUY,GAAA,CAInB,CACO,MAAA,CAAEX,KAAIW,eACf,CCbO,ICXHH,ECSOS,EFEAH,EAAO,GAElB,IACEI,QAAQV,QAAQ,mCACTM,EAAA,MACT,CAAQ,MAAc,CActBK,eAAsBC,IAChB,IAAAC,EAASlB,EAAAA,Q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AAlB,QAAGsG,cAAcvG,UAAKmL,KAAKhF,EAAK,oBAAqBwG,EAAwB,CAC7E,QACAxL,EAAAlB,QAAG2M,WAAW5M,EAAAC,QAAKkL,KAAKhF,EAAK,iBAC1BhF,EAAAA,QAAAsL,WAAWzM,UAAKmL,KAAKhF,EAAK,oBAAqBnG,EAAAA,QAAKmL,KAAKhF,EAAK,gBACnE,CACF,CACWvD,GAAA,ICzEf,MAAMiK,EAAMhM,QAAQ,mBAEpBf,EAAAA,QACG0M,QAAQK,EAAIL,SACZM,YAAYD,EAAIC,aAChB5H,OAAO,gBAAiB,aACxBA,OAAO,iCAAkC,eAE5CpF,EAAAA,QAAQ6B,MAAMvB,QAAQ2M"}
|
package/dist/index.cjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { Config } from './base'\n\nexport const defineConfig = (config: Config) => config\n\nexport * from './base'\n"],"names":["config"],"mappings":"kCAE6BA,GAAmBA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";var e=require("node:path"),t=require("@jiek/utils/getWorkspaceDir"),r=require("@rollup/plugin-json"),s=require("autoprefixer"),n=require("rollup-plugin-dts"),i=require("rollup-plugin-esbuild"),o=require("rollup-plugin-postcss"),a=require("@rollup/plugin-terser");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r),p=l(s),c=l(i),d=l(o),m=l(a);function f(e){return e.startsWith("node:")?e.slice(5):e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase()))}var g=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const j={dir:"dist",exports:"named",interop:"auto",sourcemap:!0};function x(e){return[e,{...e,entryFileNames:e.entryFileNames?.replace(/(\.js)$/,".min$1"),plugins:[...e.plugins??[],m.default()]}]}const y=t.getWorkspaceDir();exports.template=({styled:t=!1,plugins:{index:r=[],entry:s=[],dts:i=[]}={}}={},o)=>{const{jiek:{browser:a=!1}={}}=o;if(!o.name)throw new Error("pkg.name is required");const l=o.name.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())),m=Object.fromEntries(Object.entries(o.exports??{}).filter((([e])=>!/\.(json|css|scss)$/.test(e))).filter((([,e])=>"object"==typeof e&&e["inner-src"]&&e.import)).map((([e,t])=>[e.replace(/^\.$/,"index").replace(/^\.\//,""),"string"==typeof t?t:t["inner-src"]]))),[$,b]=function(){let e={};const t=new Set([]);return[({external:r}={})=>({name:"globals",resolveId:e=>r?.some((t=>t instanceof RegExp?t.test(e):t===e))?(t.add(e),{id:e,external:!0}):null,outputOptions:r=>(e=[...t].reduce(((e,t)=>({...e,[t]:f(t)})),{}),{...r,globals:e})}),{outputOptions:t=>({...t,globals:e})}]}(),k=function(){const e=process.cwd(),t=require(`${e}/package.json`),{dependencies:r={},peerDependencies:s={},optionalDependencies:n={}}=t;return Object.keys(r).concat(Object.keys(s)).concat(Object.keys(n)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(),q=[u.default()];return[{input:m,output:[...x({...j,format:"esm",entryFileNames:"[name].esm.js",preserveModules:!0})],plugins:[q,$({external:k}),t&&g({patterns:[/\.s?css$/]}),c.default(),r]},...Object.entries(m).map((([e,r])=>{const n=l+("index"===e?"":e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())));return{input:r,output:a?[...x({...j,name:n,format:"iife",entryFileNames:`${e}.iife.js`}),...x({...j,name:n,format:"umd",entryFileNames:`${e}.umd.js`})]:[...x({...j,name:n,format:"cjs",entryFileNames:`${e}.cjs
|
2
|
-
//# sourceMappingURL=rollup.cjs.
|
1
|
+
"use strict";var e=require("node:path"),t=require("@jiek/utils/getWorkspaceDir"),r=require("@rollup/plugin-json"),s=require("autoprefixer"),n=require("rollup-plugin-dts"),i=require("rollup-plugin-esbuild"),o=require("rollup-plugin-postcss"),a=require("@rollup/plugin-terser");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r),p=l(s),c=l(i),d=l(o),m=l(a);function f(e){return e.startsWith("node:")?e.slice(5):e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase()))}var g=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const j={dir:"dist",exports:"named",interop:"auto",sourcemap:!0};function x(e){return[e,{...e,entryFileNames:e.entryFileNames?.replace(/(\.js)$/,".min$1"),plugins:[...e.plugins??[],m.default()]}]}const y=t.getWorkspaceDir();exports.template=({styled:t=!1,plugins:{index:r=[],entry:s=[],dts:i=[]}={}}={},o)=>{const{jiek:{browser:a=!1}={}}=o;if(!o.name)throw new Error("pkg.name is required");const l=o.name.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())),m=Object.fromEntries(Object.entries(o.exports??{}).filter((([e])=>!/\.(json|css|scss)$/.test(e))).filter((([,e])=>"object"==typeof e&&e["inner-src"]&&e.import)).map((([e,t])=>[e.replace(/^\.$/,"index").replace(/^\.\//,""),"string"==typeof t?t:t["inner-src"]]))),[$,b]=function(){let e={};const t=new Set([]);return[({external:r}={})=>({name:"globals",resolveId:e=>r?.some((t=>t instanceof RegExp?t.test(e):t===e))?(t.add(e),{id:e,external:!0}):null,outputOptions:r=>(e=[...t].reduce(((e,t)=>({...e,[t]:f(t)})),{}),{...r,globals:e})}),{outputOptions:t=>({...t,globals:e})}]}(),k=function(){const e=process.cwd(),t=require(`${e}/package.json`),{dependencies:r={},peerDependencies:s={},optionalDependencies:n={}}=t;return Object.keys(r).concat(Object.keys(s)).concat(Object.keys(n)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(),q=[u.default()];return[{input:m,output:[...x({...j,format:"esm",entryFileNames:"[name].esm.js",preserveModules:!0})],plugins:[q,$({external:k}),t&&g({patterns:[/\.s?css$/]}),c.default(),r]},...Object.entries(m).map((([e,r])=>{const n=l+("index"===e?"":e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())));return{input:r,output:a?[...x({...j,name:n,format:"iife",entryFileNames:`${e}.iife.js`}),...x({...j,name:n,format:"umd",entryFileNames:`${e}.umd.js`})]:[...x({...j,name:n,format:"cjs",entryFileNames:`${e}.cjs`})],plugins:[q,b,t&&d.default({plugins:[p.default],minimize:!0,sourceMap:!0,extract:`${e}.css`}),c.default(),s],external:k}})),{input:m,output:[{dir:"dist",entryFileNames:({name:e})=>`${e.replace(/^src\//,"")}.esm.d.ts`,preserveModules:!0},{dir:"dist"}],plugins:[q,t&&g({patterns:[/\.s?css$/]}),n.dts({tsconfig:(v="tsconfig.dts.json",e.resolve(y,v))}),{name:"rollup-plugin-declare-module-replacer",generateBundle(e,t){for(const e of Object.values(t))"code"in e&&(e.code=e.code.replace(/declare module ['|"]\..*['|"]/g,`declare module '${o.name}'`))}},i],external:k}];var v};
|
2
|
+
//# sourceMappingURL=rollup.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rollup.cjs","sources":["../src/rollup/utils/globalResolver.ts","../src/rollup/plugins/skip.ts","../src/rollup/utils/commonOptions.ts","../src/rollup/utils/withMinify.ts","../src/rollup/index.ts","../src/rollup/plugins/globals.ts","../src/rollup/utils/externalResolver.ts"],"sourcesContent":["export default function (external: string) {\n // a/b => AB\n // a-b => AB\n // a@b => AB\n // a@b/c => ABC\n // node:a => a\n // node:a_b => a_b\n if (external.startsWith('node:')) {\n return external.slice(5)\n }\n return external\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n}\n","import type { PluginImpl } from 'rollup'\n\ninterface Options {\n patterns?: (string | RegExp)[]\n}\n\nexport default ((options = {}) => {\n return {\n name: 'skip',\n // skip the specified files by `options.patterns`\n load(id) {\n if (\n options.patterns?.some((pattern) =>\n typeof pattern === 'string'\n ? id.includes(pattern)\n : pattern.test(id)\n )\n ) {\n return ''\n }\n }\n }\n}) as PluginImpl<Options>\n","import type { OutputOptions } from 'rollup'\n\nconst defineOutput = <O extends OutputOptions>(output: O) => output\n\nexport const commonOutputOptions = defineOutput({\n dir: 'dist',\n exports: 'named',\n interop: 'auto',\n sourcemap: true\n})\n","import terser from '@rollup/plugin-terser'\nimport type { OutputOptions, OutputPlugin } from 'rollup'\n\nexport default function (output: OutputOptions & {\n entryFileNames?: string\n plugins?: OutputPlugin[]\n}): OutputOptions[] {\n return [\n output,\n {\n ...output,\n entryFileNames: output.entryFileNames?.replace(/(\\.js)$/, '.min$1'),\n plugins: [...(output.plugins ?? []), terser()]\n }\n ]\n}\n","import { resolve } from 'node:path'\n\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport autoprefixer from 'autoprefixer'\nimport type { InputPluginOption, RollupOptions } from 'rollup'\nimport { dts } from 'rollup-plugin-dts'\nimport esbuild from 'rollup-plugin-esbuild'\nimport postcss from 'rollup-plugin-postcss'\n\nimport { createGlobalsLinkage } from './plugins/globals'\nimport skip from './plugins/skip'\nimport { commonOutputOptions } from './utils/commonOptions'\nimport externalResolver from './utils/externalResolver'\nimport withMinify from './utils/withMinify'\n\nconst workspaceRoot = getWorkspaceDir()\nfunction resolveWorkspacePath(p: string) {\n return resolve(workspaceRoot, p)\n}\n\nexport const template = (\n {\n styled = false,\n plugins: {\n index: indexPlugins = [],\n entry: entryPlugins = [],\n dts: dtsPlugins = []\n } = {}\n }: {\n /**\n * include styles files\n */\n styled?: boolean\n plugins?: {\n index?: InputPluginOption\n entry?: InputPluginOption\n dts?: InputPluginOption\n }\n } = {},\n pkg: {\n name?: string\n jiek?: {\n browser?: boolean\n }\n exports?: Record<string, string | {\n import: string\n 'inner-src': string\n }>\n }\n) => {\n const { jiek: {\n browser = false\n } = {} } = pkg\n if (!pkg.name) {\n throw new Error('pkg.name is required')\n }\n const namePrefix = pkg\n .name\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n const exportsEntries = Object.fromEntries(\n Object.entries(pkg.exports ?? {})\n // filter static files\n .filter(([key]) => !/\\.(json|css|scss)$/.test(key))\n // filter no `inner-src` or `import` field entries\n .filter(([, value]) => typeof value === 'object' && value['inner-src'] && value['import'])\n .map(([key, value]) => [\n key\n .replace(/^\\.$/, 'index')\n .replace(/^\\.\\//, ''),\n typeof value === 'string' ? value : value['inner-src']\n ])\n )\n\n const [globalsRegister, globalsOutput] = createGlobalsLinkage()\n const external = externalResolver()\n\n const commonPlugins = [\n json()\n ]\n return [\n {\n input: exportsEntries,\n output: [\n ...withMinify({\n ...commonOutputOptions,\n format: 'esm',\n entryFileNames: '[name].esm.js',\n preserveModules: true\n })\n ],\n plugins: [\n commonPlugins,\n globalsRegister({ external }),\n styled && skip({ patterns: [/\\.s?css$/] }),\n esbuild(),\n indexPlugins\n ]\n },\n ...Object.entries(exportsEntries).map(([name, input]) => {\n const outputName = namePrefix + (\n name === 'index' ? '' : (\n name.replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n )\n )\n return {\n input: input,\n output: browser ? [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'iife',\n entryFileNames: `${name}.iife.js`\n }),\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'umd',\n entryFileNames: `${name}.umd.js`\n })\n ] : [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'cjs',\n entryFileNames: `${name}.cjs`\n })\n ],\n plugins: [\n commonPlugins,\n globalsOutput,\n styled && postcss({\n plugins: [autoprefixer],\n minimize: true,\n sourceMap: true,\n extract: `${name}.css`\n }),\n esbuild(),\n entryPlugins\n ],\n external\n }\n }),\n {\n input: exportsEntries,\n output: [\n {\n dir: 'dist',\n entryFileNames: ({ name }) => `${name.replace(/^src\\//, '')}.esm.d.ts`,\n preserveModules: true\n },\n {\n dir: 'dist'\n }\n ],\n plugins: [\n commonPlugins,\n styled && skip({ patterns: [/\\.s?css$/] }),\n dts({ tsconfig: resolveWorkspacePath('tsconfig.dts.json') }),\n {\n name: 'rollup-plugin-declare-module-replacer',\n /**\n * replace relative path `declare module './xxx'` to `declare module '{{package name}}'`\n * in output file generated\n */\n generateBundle(_, bundle) {\n for (const file of Object.values(bundle)) {\n if (!('code' in file)) continue\n\n file.code = file.code.replace(\n /declare module ['|\"]\\..*['|\"]/g,\n `declare module '${pkg.name}'`\n )\n }\n }\n },\n dtsPlugins\n ],\n external\n }\n ] as RollupOptions[]\n}\n","import type { Plugin, PluginImpl } from 'rollup'\n\nimport globalResolver from '../utils/globalResolver'\n\ninterface GlobalsOptions {\n external?: (string | RegExp)[]\n}\n\nexport function createGlobalsLinkage() {\n let globals = {}\n const dependencies = new Set<string>([])\n return [\n (({ external } = {}) => {\n return {\n name: 'globals',\n resolveId(id) {\n if (external?.some(dep => dep instanceof RegExp ? dep.test(id) : dep === id)) {\n dependencies.add(id)\n return { id, external: true }\n }\n return null\n },\n outputOptions(options) {\n globals = [...dependencies].reduce((acc, value) => ({\n ...acc,\n [value]: globalResolver(value)\n }), {})\n return { ...options, globals }\n }\n }\n }) as PluginImpl<GlobalsOptions>,\n { outputOptions: options => ({ ...options, globals }) } as Plugin\n ] as const\n}\n","export default function () {\n const cwd = process.cwd()\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const pkg = require(`${cwd}/package.json`)\n const { dependencies = {}, peerDependencies = {}, optionalDependencies = {} } = pkg\n const external = <(string | RegExp)[]>Object\n .keys(dependencies)\n .concat(Object.keys(peerDependencies))\n .concat(Object.keys(optionalDependencies))\n return external\n .map(dep => new RegExp(`^${dep}(/.*)?$`))\n .concat([\n /^node:/\n ])\n}\n"],"names":["globalResolver","external","startsWith","slice","replace","_","$1","toUpperCase","skip","options","name","load","id","patterns","some","pattern","includes","test","commonOutputOptions","dir","exports","interop","sourcemap","withMinify","output","entryFileNames","plugins","terser","workspaceRoot","getWorkspaceDir","styled","index","indexPlugins","entry","entryPlugins","dts","dtsPlugins","pkg","jiek","browser","Error","namePrefix","exportsEntries","Object","fromEntries","entries","filter","key","value","map","globalsRegister","globalsOutput","globals","dependencies","Set","resolveId","dep","RegExp","add","outputOptions","reduce","acc","createGlobalsLinkage","cwd","process","require","peerDependencies","optionalDependencies","keys","concat","externalResolver","commonPlugins","json","input","format","preserveModules","esbuild","outputName","postcss","autoprefixer","minimize","sourceMap","extract","tsconfig","p","resolve","generateBundle","bundle","file","values","code"],"mappings":"8WAAA,SAAAA,EAAyBC,GAOnB,OAAAA,EAASC,WAAW,SACfD,EAASE,MAAM,GAEjBF,EACJG,QAAQ,eAAe,CAACC,EAAGC,IAAOA,EAAGC,eAC1C,CCNA,IAAAC,EAAgB,CAACC,EAAU,CAAA,KAClB,CACLC,KAAM,OAEN,IAAAC,CAAKC,GACH,GACEH,EAAQI,UAAUC,MAAMC,GACH,iBAAZA,EACHH,EAAGI,SAASD,GACZA,EAAQE,KAAKL,KAGZ,MAAA,EAEX,IClBJ,MAEaM,EAAmC,CAC9CC,IAAK,OACLC,QAAS,QACTC,QAAS,OACTC,WAAW,GCLb,SAAAC,EAAyBC,GAIhB,MAAA,CACLA,EACA,IACKA,EACHC,eAAgBD,EAAOC,gBAAgBrB,QAAQ,UAAW,UAC1DsB,QAAS,IAAKF,EAAOE,SAAW,GAAKC,cAG3C,CCCA,MAAMC,EAAgBC,EAAgBA,mCAKd,EAEpBC,UAAS,EACTJ,SACEK,MAAOC,EAAe,GACtBC,MAAOC,EAAe,GACtBC,IAAKC,EAAa,IAChB,CAAC,GAWH,CAAA,EACJC,KAWA,MAAQC,MAAMC,QACZA,GAAU,GACR,CAAA,GAAOF,EACP,IAACA,EAAI3B,KACD,MAAA,IAAI8B,MAAM,wBAEZ,MAAAC,EAAaJ,EAChB3B,KACAN,QAAQ,eAAe,CAACC,EAAGC,IAAOA,EAAGC,gBAClCmC,EAAiBC,OAAOC,YAC5BD,OAAOE,QAAQR,EAAIjB,SAAW,CAAA,GAE3B0B,QAAO,EAAEC,MAAU,qBAAqB9B,KAAK8B,KAE7CD,QAAO,EAAI,CAAAE,KAA4B,iBAAVA,GAAsBA,EAAM,cAAgBA,EAAc,SACvFC,KA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MI,EAAapC,GACR,UAAT/B,EAAmB,GACjBA,EAAKN,QAAQ,eAAe,CAACC,EAAGC,IAAOA,EAAGC,iBAGvC,MAAA,CACLkE,QACAjD,OAAQe,EAAU,IACbhB,EAAW,IACTL,EACHR,KAAMmE,EACNH,OAAQ,OACRjD,eAAgB,GAAGf,iBAElBa,EAAW,IACTL,EACHR,KAAMmE,EACNH,OAAQ,MACRjD,eAAgB,GAAGf,cAEnB,IACCa,EAAW,IACTL,EACHR,KAAMmE,EACNH,OAAQ,MACRjD,eAAgB,GAAGf,WAGvBgB,QAAS,CACP6C,EACApB,EACArB,GAAUgD,EAAAA,QAAQ,CAChBpD,QAAS,CAACqD,EAAAA,SACVC,UAAU,EACVC,WAAW,EACXC,QAAS,GAAGxE,UAEdkE,YACA1C,GAEFjC,WACF,IAEF,CACEwE,MAAO/B,EACPlB,OAAQ,CACN,CACEL,IAAK,OACLM,eAAgB,EAAGf,UAAW,GAAGA,EAAKN,QAAQ,SAAU,eACxDuE,iBAAiB,GAEnB,CACExD,IAAK,SAGTO,QAAS,CACP6C,EACAzC,GAAUtB,EAAK,CAAEK,SAAU,CAAC,cAC5BsB,EAAAA,IAAI,CAAEgD,UA7IgBC,EA6Ie,oBA5IpCC,EAAAA,QAAQzD,EAAewD,MA6IxB,CACE1E,KAAM,wCAKN,cAAA4E,CAAejF,EAAGkF,GAChB,IAAA,MAAWC,KAAQ7C,OAAO8C,OAAOF,GACzB,SAAUC,IAEXA,EAAAE,KAAOF,EAAKE,KAAKtF,QACpB,iCACA,mBAAmBiC,EAAI3B,SAG7B,GAEF0B,GAEFnC,aAjKN,IAA8BmF,CAmK5B"}
|
package/dist/rollup.esm.js
CHANGED
package/dist/rollup.esm.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rollup.esm.js","sources":["../src/rollup/index.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport autoprefixer from 'autoprefixer'\nimport type { InputPluginOption, RollupOptions } from 'rollup'\nimport { dts } from 'rollup-plugin-dts'\nimport esbuild from 'rollup-plugin-esbuild'\nimport postcss from 'rollup-plugin-postcss'\n\nimport { createGlobalsLinkage } from './plugins/globals'\nimport skip from './plugins/skip'\nimport { commonOutputOptions } from './utils/commonOptions'\nimport externalResolver from './utils/externalResolver'\nimport withMinify from './utils/withMinify'\n\nconst workspaceRoot = getWorkspaceDir()\nfunction resolveWorkspacePath(p: string) {\n return resolve(workspaceRoot, p)\n}\n\nexport const template = (\n {\n styled = false,\n plugins: {\n index: indexPlugins = [],\n entry: entryPlugins = [],\n dts: dtsPlugins = []\n } = {}\n }: {\n /**\n * include styles files\n */\n styled?: boolean\n plugins?: {\n index?: InputPluginOption\n entry?: InputPluginOption\n dts?: InputPluginOption\n }\n } = {},\n pkg: {\n name?: string\n jiek?: {\n browser?: boolean\n }\n exports?: Record<string, string | {\n import: string\n 'inner-src': string\n }>\n }\n) => {\n const { jiek: {\n browser = false\n } = {} } = pkg\n if (!pkg.name) {\n throw new Error('pkg.name is required')\n }\n const namePrefix = pkg\n .name\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n const exportsEntries = Object.fromEntries(\n Object.entries(pkg.exports ?? {})\n // filter static files\n .filter(([key]) => !/\\.(json|css|scss)$/.test(key))\n // filter no `inner-src` or `import` field entries\n .filter(([, value]) => typeof value === 'object' && value['inner-src'] && value['import'])\n .map(([key, value]) => [\n key\n .replace(/^\\.$/, 'index')\n .replace(/^\\.\\//, ''),\n typeof value === 'string' ? value : value['inner-src']\n ])\n )\n\n const [globalsRegister, globalsOutput] = createGlobalsLinkage()\n const external = externalResolver()\n\n const commonPlugins = [\n json()\n ]\n return [\n {\n input: exportsEntries,\n output: [\n ...withMinify({\n ...commonOutputOptions,\n format: 'esm',\n entryFileNames: '[name].esm.js',\n preserveModules: true\n })\n ],\n plugins: [\n commonPlugins,\n globalsRegister({ external }),\n styled && skip({ patterns: [/\\.s?css$/] }),\n esbuild(),\n indexPlugins\n ]\n },\n ...Object.entries(exportsEntries).map(([name, input]) => {\n const outputName = namePrefix + (\n name === 'index' ? '' : (\n name.replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n )\n )\n return {\n input: input,\n output: browser ? [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'iife',\n entryFileNames: `${name}.iife.js`\n }),\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'umd',\n entryFileNames: `${name}.umd.js`\n })\n ] : [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'cjs',\n entryFileNames: `${name}.cjs
|
1
|
+
{"version":3,"file":"rollup.esm.js","sources":["../src/rollup/index.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport autoprefixer from 'autoprefixer'\nimport type { InputPluginOption, RollupOptions } from 'rollup'\nimport { dts } from 'rollup-plugin-dts'\nimport esbuild from 'rollup-plugin-esbuild'\nimport postcss from 'rollup-plugin-postcss'\n\nimport { createGlobalsLinkage } from './plugins/globals'\nimport skip from './plugins/skip'\nimport { commonOutputOptions } from './utils/commonOptions'\nimport externalResolver from './utils/externalResolver'\nimport withMinify from './utils/withMinify'\n\nconst workspaceRoot = getWorkspaceDir()\nfunction resolveWorkspacePath(p: string) {\n return resolve(workspaceRoot, p)\n}\n\nexport const template = (\n {\n styled = false,\n plugins: {\n index: indexPlugins = [],\n entry: entryPlugins = [],\n dts: dtsPlugins = []\n } = {}\n }: {\n /**\n * include styles files\n */\n styled?: boolean\n plugins?: {\n index?: InputPluginOption\n entry?: InputPluginOption\n dts?: InputPluginOption\n }\n } = {},\n pkg: {\n name?: string\n jiek?: {\n browser?: boolean\n }\n exports?: Record<string, string | {\n import: string\n 'inner-src': string\n }>\n }\n) => {\n const { jiek: {\n browser = false\n } = {} } = pkg\n if (!pkg.name) {\n throw new Error('pkg.name is required')\n }\n const namePrefix = pkg\n .name\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n const exportsEntries = Object.fromEntries(\n Object.entries(pkg.exports ?? {})\n // filter static files\n .filter(([key]) => !/\\.(json|css|scss)$/.test(key))\n // filter no `inner-src` or `import` field entries\n .filter(([, value]) => typeof value === 'object' && value['inner-src'] && value['import'])\n .map(([key, value]) => [\n key\n .replace(/^\\.$/, 'index')\n .replace(/^\\.\\//, ''),\n typeof value === 'string' ? value : value['inner-src']\n ])\n )\n\n const [globalsRegister, globalsOutput] = createGlobalsLinkage()\n const external = externalResolver()\n\n const commonPlugins = [\n json()\n ]\n return [\n {\n input: exportsEntries,\n output: [\n ...withMinify({\n ...commonOutputOptions,\n format: 'esm',\n entryFileNames: '[name].esm.js',\n preserveModules: true\n })\n ],\n plugins: [\n commonPlugins,\n globalsRegister({ external }),\n styled && skip({ patterns: [/\\.s?css$/] }),\n esbuild(),\n indexPlugins\n ]\n },\n ...Object.entries(exportsEntries).map(([name, input]) => {\n const outputName = namePrefix + (\n name === 'index' ? '' : (\n name.replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n )\n )\n return {\n input: input,\n output: browser ? [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'iife',\n entryFileNames: `${name}.iife.js`\n }),\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'umd',\n entryFileNames: `${name}.umd.js`\n })\n ] : [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'cjs',\n entryFileNames: `${name}.cjs`\n })\n ],\n plugins: [\n commonPlugins,\n globalsOutput,\n styled && postcss({\n plugins: [autoprefixer],\n minimize: true,\n sourceMap: true,\n extract: `${name}.css`\n }),\n esbuild(),\n entryPlugins\n ],\n external\n }\n }),\n {\n input: exportsEntries,\n output: [\n {\n dir: 'dist',\n entryFileNames: ({ name }) => `${name.replace(/^src\\//, '')}.esm.d.ts`,\n preserveModules: true\n },\n {\n dir: 'dist'\n }\n ],\n plugins: [\n commonPlugins,\n styled && skip({ patterns: [/\\.s?css$/] }),\n dts({ tsconfig: resolveWorkspacePath('tsconfig.dts.json') }),\n {\n name: 'rollup-plugin-declare-module-replacer',\n /**\n * replace relative path `declare module './xxx'` to `declare module '{{package name}}'`\n * in output file generated\n */\n generateBundle(_, bundle) {\n for (const file of Object.values(bundle)) {\n if (!('code' in file)) continue\n\n file.code = file.code.replace(\n /declare module ['|\"]\\..*['|\"]/g,\n `declare module '${pkg.name}'`\n )\n }\n }\n },\n dtsPlugins\n ],\n external\n }\n ] as RollupOptions[]\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,gBAAgB,eAAgB,EAAA,CAAA;AACtC,SAAS,qBAAqB,CAAW,EAAA;AACvC,EAAO,OAAA,OAAA,CAAQ,eAAe,CAAC,CAAA,CAAA;AACjC,CAAA;AAEO,MAAM,WAAW,CACtB;AAAA,EACE,MAAS,GAAA,KAAA;AAAA,EACT,OAAS,EAAA;AAAA,IACP,KAAA,EAAO,eAAe,EAAC;AAAA,IACvB,KAAA,EAAO,eAAe,EAAC;AAAA,IACvB,GAAA,EAAK,aAAa,EAAC;AAAA,MACjB,EAAC;AACP,CAUI,GAAA,IACJ,GAUG,KAAA;AACH,EAAA,MAAM,EAAE,IAAM,EAAA;AAAA,IACZ,OAAU,GAAA,KAAA;AAAA,GACZ,GAAI,EAAC,EAAM,GAAA,GAAA,CAAA;AACX,EAAI,IAAA,CAAC,IAAI,IAAM,EAAA;AACb,IAAM,MAAA,IAAI,MAAM,sBAAsB,CAAA,CAAA;AAAA,GACxC;AACA,EAAM,MAAA,UAAA,GAAa,GAChB,CAAA,IAAA,CACA,OAAQ,CAAA,aAAA,EAAe,CAAC,CAAG,EAAA,EAAA,KAAO,EAAG,CAAA,WAAA,EAAa,CAAA,CAAA;AACrD,EAAA,MAAM,iBAAiB,MAAO,CAAA,WAAA;AAAA,IAC5B,OAAO,OAAQ,C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A;AAAA,OACF,CAAA;AAAA,KACD,CAAA;AAAA,IACD;AAAA,MACE,KAAO,EAAA,cAAA;AAAA,MACP,MAAQ,EAAA;AAAA,QACN;AAAA,UACE,GAAK,EAAA,MAAA;AAAA,UACL,cAAA,EAAgB,CAAC,EAAE,IAAK,EAAA,KAAM,GAAG,IAAK,CAAA,OAAA,CAAQ,QAAU,EAAA,EAAE,CAAC,CAAA,SAAA,CAAA;AAAA,UAC3D,eAAiB,EAAA,IAAA;AAAA,SACnB;AAAA,QACA;AAAA,UACE,GAAK,EAAA,MAAA;AAAA,SACP;AAAA,OACF;AAAA,MACA,OAAS,EAAA;AAAA,QACP,aAAA;AAAA,QACA,UAAU,IAAK,CAAA,EAAE,UAAU,CAAC,UAAU,GAAG,CAAA;AAAA,QACzC,IAAI,EAAE,QAAA,EAAU,oBAAqB,CAAA,mBAAmB,GAAG,CAAA;AAAA,QAC3D;AAAA,UACE,IAAM,EAAA,uCAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKN,cAAA,CAAe,GAAG,MAAQ,EAAA;AACxB,YAAA,KAAA,MAAW,IAAQ,IAAA,MAAA,CAAO,MAAO,CAAA,MAAM,CAAG,EAAA;AACxC,cAAA,IAAI,EAAE,MAAU,IAAA,IAAA,CAAA;AAAO,gBAAA,SAAA;AAEvB,cAAK,IAAA,CAAA,IAAA,GAAO,KAAK,IAAK,CAAA,OAAA;AAAA,gBACpB,gCAAA;AAAA,gBACA,CAAA,gBAAA,EAAmB,IAAI,IAAI,CAAA,CAAA,CAAA;AAAA,eAC7B,CAAA;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,QACA,UAAA;AAAA,OACF;AAAA,MACA,QAAA;AAAA,KACF;AAAA,GACF,CAAA;AACF;;;;"}
|
package/dist/rollup.esm.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import{resolve as e}from"node:path";import{getWorkspaceDir as r}from"@jiek/utils/getWorkspaceDir";import s from"@rollup/plugin-json";import t from"autoprefixer";import{dts as o}from"rollup-plugin-dts";import i from"rollup-plugin-esbuild";import n from"rollup-plugin-postcss";import{createGlobalsLinkage as p}from"./rollup/plugins/globals.esm.min.js";import l from"./rollup/plugins/skip.esm.min.js";import{commonOutputOptions as m}from"./rollup/utils/commonOptions.esm.min.js";import u from"./rollup/utils/externalResolver.esm.min.js";import a from"./rollup/utils/withMinify.esm.min.js";const c=r();const f=({styled:r=!1,plugins:{index:f=[],entry:d=[],dts:g=[]}={}}={},j)=>{const{jiek:{browser:x=!1}={}}=j;if(!j.name)throw new Error("pkg.name is required");const y=j.name.replace(/[@|/-](\w)/g,((e,r)=>r.toUpperCase())),$=Object.fromEntries(Object.entries(j.exports??{}).filter((([e])=>!/\.(json|css|scss)$/.test(e))).filter((([,e])=>"object"==typeof e&&e["inner-src"]&&e.import)).map((([e,r])=>[e.replace(/^\.$/,"index").replace(/^\.\//,""),"string"==typeof r?r:r["inner-src"]]))),[b,w]=p(),k=u(),v=[s()];return[{input:$,output:[...a({...m,format:"esm",entryFileNames:"[name].esm.js",preserveModules:!0})],plugins:[v,b({external:k}),r&&l({patterns:[/\.s?css$/]}),i(),f]},...Object.entries($).map((([e,s])=>{const o=y+("index"===e?"":e.replace(/[@|/-](\w)/g,((e,r)=>r.toUpperCase())));return{input:s,output:x?[...a({...m,name:o,format:"iife",entryFileNames:`${e}.iife.js`}),...a({...m,name:o,format:"umd",entryFileNames:`${e}.umd.js`})]:[...a({...m,name:o,format:"cjs",entryFileNames:`${e}.cjs
|
1
|
+
import{resolve as e}from"node:path";import{getWorkspaceDir as r}from"@jiek/utils/getWorkspaceDir";import s from"@rollup/plugin-json";import t from"autoprefixer";import{dts as o}from"rollup-plugin-dts";import i from"rollup-plugin-esbuild";import n from"rollup-plugin-postcss";import{createGlobalsLinkage as p}from"./rollup/plugins/globals.esm.min.js";import l from"./rollup/plugins/skip.esm.min.js";import{commonOutputOptions as m}from"./rollup/utils/commonOptions.esm.min.js";import u from"./rollup/utils/externalResolver.esm.min.js";import a from"./rollup/utils/withMinify.esm.min.js";const c=r();const f=({styled:r=!1,plugins:{index:f=[],entry:d=[],dts:g=[]}={}}={},j)=>{const{jiek:{browser:x=!1}={}}=j;if(!j.name)throw new Error("pkg.name is required");const y=j.name.replace(/[@|/-](\w)/g,((e,r)=>r.toUpperCase())),$=Object.fromEntries(Object.entries(j.exports??{}).filter((([e])=>!/\.(json|css|scss)$/.test(e))).filter((([,e])=>"object"==typeof e&&e["inner-src"]&&e.import)).map((([e,r])=>[e.replace(/^\.$/,"index").replace(/^\.\//,""),"string"==typeof r?r:r["inner-src"]]))),[b,w]=p(),k=u(),v=[s()];return[{input:$,output:[...a({...m,format:"esm",entryFileNames:"[name].esm.js",preserveModules:!0})],plugins:[v,b({external:k}),r&&l({patterns:[/\.s?css$/]}),i(),f]},...Object.entries($).map((([e,s])=>{const o=y+("index"===e?"":e.replace(/[@|/-](\w)/g,((e,r)=>r.toUpperCase())));return{input:s,output:x?[...a({...m,name:o,format:"iife",entryFileNames:`${e}.iife.js`}),...a({...m,name:o,format:"umd",entryFileNames:`${e}.umd.js`})]:[...a({...m,name:o,format:"cjs",entryFileNames:`${e}.cjs`})],plugins:[v,w,r&&n({plugins:[t],minimize:!0,sourceMap:!0,extract:`${e}.css`}),i(),d],external:k}})),{input:$,output:[{dir:"dist",entryFileNames:({name:e})=>`${e.replace(/^src\//,"")}.esm.d.ts`,preserveModules:!0},{dir:"dist"}],plugins:[v,r&&l({patterns:[/\.s?css$/]}),o({tsconfig:(F="tsconfig.dts.json",e(c,F))}),{name:"rollup-plugin-declare-module-replacer",generateBundle(e,r){for(const e of Object.values(r))"code"in e&&(e.code=e.code.replace(/declare module ['|"]\..*['|"]/g,`declare module '${j.name}'`))}},g],external:k}];var F};export{f as template};
|
2
2
|
//# sourceMappingURL=rollup.esm.min.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rollup.esm.min.js","sources":["../src/rollup/index.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport autoprefixer from 'autoprefixer'\nimport type { InputPluginOption, RollupOptions } from 'rollup'\nimport { dts } from 'rollup-plugin-dts'\nimport esbuild from 'rollup-plugin-esbuild'\nimport postcss from 'rollup-plugin-postcss'\n\nimport { createGlobalsLinkage } from './plugins/globals'\nimport skip from './plugins/skip'\nimport { commonOutputOptions } from './utils/commonOptions'\nimport externalResolver from './utils/externalResolver'\nimport withMinify from './utils/withMinify'\n\nconst workspaceRoot = getWorkspaceDir()\nfunction resolveWorkspacePath(p: string) {\n return resolve(workspaceRoot, p)\n}\n\nexport const template = (\n {\n styled = false,\n plugins: {\n index: indexPlugins = [],\n entry: entryPlugins = [],\n dts: dtsPlugins = []\n } = {}\n }: {\n /**\n * include styles files\n */\n styled?: boolean\n plugins?: {\n index?: InputPluginOption\n entry?: InputPluginOption\n dts?: InputPluginOption\n }\n } = {},\n pkg: {\n name?: string\n jiek?: {\n browser?: boolean\n }\n exports?: Record<string, string | {\n import: string\n 'inner-src': string\n }>\n }\n) => {\n const { jiek: {\n browser = false\n } = {} } = pkg\n if (!pkg.name) {\n throw new Error('pkg.name is required')\n }\n const namePrefix = pkg\n .name\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n const exportsEntries = Object.fromEntries(\n Object.entries(pkg.exports ?? {})\n // filter static files\n .filter(([key]) => !/\\.(json|css|scss)$/.test(key))\n // filter no `inner-src` or `import` field entries\n .filter(([, value]) => typeof value === 'object' && value['inner-src'] && value['import'])\n .map(([key, value]) => [\n key\n .replace(/^\\.$/, 'index')\n .replace(/^\\.\\//, ''),\n typeof value === 'string' ? value : value['inner-src']\n ])\n )\n\n const [globalsRegister, globalsOutput] = createGlobalsLinkage()\n const external = externalResolver()\n\n const commonPlugins = [\n json()\n ]\n return [\n {\n input: exportsEntries,\n output: [\n ...withMinify({\n ...commonOutputOptions,\n format: 'esm',\n entryFileNames: '[name].esm.js',\n preserveModules: true\n })\n ],\n plugins: [\n commonPlugins,\n globalsRegister({ external }),\n styled && skip({ patterns: [/\\.s?css$/] }),\n esbuild(),\n indexPlugins\n ]\n },\n ...Object.entries(exportsEntries).map(([name, input]) => {\n const outputName = namePrefix + (\n name === 'index' ? '' : (\n name.replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n )\n )\n return {\n input: input,\n output: browser ? [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'iife',\n entryFileNames: `${name}.iife.js`\n }),\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'umd',\n entryFileNames: `${name}.umd.js`\n })\n ] : [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'cjs',\n entryFileNames: `${name}.cjs
|
1
|
+
{"version":3,"file":"rollup.esm.min.js","sources":["../src/rollup/index.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport autoprefixer from 'autoprefixer'\nimport type { InputPluginOption, RollupOptions } from 'rollup'\nimport { dts } from 'rollup-plugin-dts'\nimport esbuild from 'rollup-plugin-esbuild'\nimport postcss from 'rollup-plugin-postcss'\n\nimport { createGlobalsLinkage } from './plugins/globals'\nimport skip from './plugins/skip'\nimport { commonOutputOptions } from './utils/commonOptions'\nimport externalResolver from './utils/externalResolver'\nimport withMinify from './utils/withMinify'\n\nconst workspaceRoot = getWorkspaceDir()\nfunction resolveWorkspacePath(p: string) {\n return resolve(workspaceRoot, p)\n}\n\nexport const template = (\n {\n styled = false,\n plugins: {\n index: indexPlugins = [],\n entry: entryPlugins = [],\n dts: dtsPlugins = []\n } = {}\n }: {\n /**\n * include styles files\n */\n styled?: boolean\n plugins?: {\n index?: InputPluginOption\n entry?: InputPluginOption\n dts?: InputPluginOption\n }\n } = {},\n pkg: {\n name?: string\n jiek?: {\n browser?: boolean\n }\n exports?: Record<string, string | {\n import: string\n 'inner-src': string\n }>\n }\n) => {\n const { jiek: {\n browser = false\n } = {} } = pkg\n if (!pkg.name) {\n throw new Error('pkg.name is required')\n }\n const namePrefix = pkg\n .name\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n const exportsEntries = Object.fromEntries(\n Object.entries(pkg.exports ?? {})\n // filter static files\n .filter(([key]) => !/\\.(json|css|scss)$/.test(key))\n // filter no `inner-src` or `import` field entries\n .filter(([, value]) => typeof value === 'object' && value['inner-src'] && value['import'])\n .map(([key, value]) => [\n key\n .replace(/^\\.$/, 'index')\n .replace(/^\\.\\//, ''),\n typeof value === 'string' ? value : value['inner-src']\n ])\n )\n\n const [globalsRegister, globalsOutput] = createGlobalsLinkage()\n const external = externalResolver()\n\n const commonPlugins = [\n json()\n ]\n return [\n {\n input: exportsEntries,\n output: [\n ...withMinify({\n ...commonOutputOptions,\n format: 'esm',\n entryFileNames: '[name].esm.js',\n preserveModules: true\n })\n ],\n plugins: [\n commonPlugins,\n globalsRegister({ external }),\n styled && skip({ patterns: [/\\.s?css$/] }),\n esbuild(),\n indexPlugins\n ]\n },\n ...Object.entries(exportsEntries).map(([name, input]) => {\n const outputName = namePrefix + (\n name === 'index' ? '' : (\n name.replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n )\n )\n return {\n input: input,\n output: browser ? [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'iife',\n entryFileNames: `${name}.iife.js`\n }),\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'umd',\n entryFileNames: `${name}.umd.js`\n })\n ] : [\n ...withMinify({\n ...commonOutputOptions,\n name: outputName,\n format: 'cjs',\n entryFileNames: `${name}.cjs`\n })\n ],\n plugins: [\n commonPlugins,\n globalsOutput,\n styled && postcss({\n plugins: [autoprefixer],\n minimize: true,\n sourceMap: true,\n extract: `${name}.css`\n }),\n esbuild(),\n entryPlugins\n ],\n external\n }\n }),\n {\n input: exportsEntries,\n output: [\n {\n dir: 'dist',\n entryFileNames: ({ name }) => `${name.replace(/^src\\//, '')}.esm.d.ts`,\n preserveModules: true\n },\n {\n dir: 'dist'\n }\n ],\n plugins: [\n commonPlugins,\n styled && skip({ patterns: [/\\.s?css$/] }),\n dts({ tsconfig: resolveWorkspacePath('tsconfig.dts.json') }),\n {\n name: 'rollup-plugin-declare-module-replacer',\n /**\n * replace relative path `declare module './xxx'` to `declare module '{{package name}}'`\n * in output file generated\n */\n generateBundle(_, bundle) {\n for (const file of Object.values(bundle)) {\n if (!('code' in file)) continue\n\n file.code = file.code.replace(\n /declare module ['|\"]\\..*['|\"]/g,\n `declare module '${pkg.name}'`\n )\n }\n }\n },\n dtsPlugins\n ],\n external\n }\n ] as RollupOptions[]\n}\n"],"names":["workspaceRoot","getWorkspaceDir","template","styled","plugins","index","indexPlugins","entry","entryPlugins","dts","dtsPlugins","pkg","jiek","browser","name","Error","namePrefix","replace","_","$1","toUpperCase","exportsEntries","Object","fromEntries","entries","exports","filter","key","test","value","map","globalsRegister","globalsOutput","createGlobalsLinkage","external","externalResolver","commonPlugins","json","input","output","withMinify","commonOutputOptions","format","entryFileNames","preserveModules","skip","patterns","esbuild","outputName","postcss","autoprefixer","minimize","sourceMap","extract","dir","tsconfig","p","resolve","generateBundle","bundle","file","values","code"],"mappings":"0kBAgBA,MAAMA,EAAgBC,IAKf,MAAMC,EAAW,EAEpBC,UAAS,EACTC,SACEC,MAAOC,EAAe,GACtBC,MAAOC,EAAe,GACtBC,IAAKC,EAAa,IAChB,CAAC,GAWH,CAAA,EACJC,KAWA,MAAQC,MAAMC,QACZA,GAAU,GACR,CAAA,GAAOF,EACP,IAACA,EAAIG,KACD,MAAA,IAAIC,MAAM,wBAEZ,MAAAC,EAAaL,EAChBG,KACAG,QAAQ,eAAe,CAACC,EAAGC,IAAOA,EAAGC,gBAClCC,EAAiBC,OAAOC,YAC5BD,OAAOE,QAAQb,EAAIc,SAAW,CAAA,GAE3BC,QAAO,EAAEC,MAAU,qBAAqBC,K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