jiek 0.4.7-alpha.3 → 0.4.7-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/jiek.js +9 -6
- package/dist/{cli.mjs → cli.cjs} +92 -65
- package/dist/cli.js +71 -86
- package/dist/cli.min.cjs +1 -0
- package/dist/cli.min.js +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.js +1 -3
- package/dist/index.min.cjs +1 -0
- package/dist/index.min.js +1 -1
- package/dist/rollup/{index.mjs → index.cjs} +69 -63
- package/dist/rollup/index.js +67 -65
- package/dist/rollup/index.min.cjs +1 -0
- package/dist/rollup/index.min.js +1 -1
- package/package.json +11 -10
- package/dist/cli.d.mts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cli.min.js.map +0 -1
- package/dist/cli.min.mjs +0 -1
- package/dist/cli.min.mjs.map +0 -1
- package/dist/cli.mjs.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.min.js.map +0 -1
- package/dist/index.min.mjs +0 -1
- package/dist/index.min.mjs.map +0 -1
- package/dist/index.mjs +0 -3
- package/dist/index.mjs.map +0 -1
- package/dist/rollup/index.d.mts.map +0 -1
- package/dist/rollup/index.d.ts.map +0 -1
- package/dist/rollup/index.js.map +0 -1
- package/dist/rollup/index.min.js.map +0 -1
- package/dist/rollup/index.min.mjs +0 -1
- package/dist/rollup/index.min.mjs.map +0 -1
- package/dist/rollup/index.mjs.map +0 -1
- /package/dist/{cli.d.mts → cli.d.cts} +0 -0
- /package/dist/{index.d.mts → index.d.cts} +0 -0
- /package/dist/rollup/{index.d.mts → index.d.cts} +0 -0
package/dist/rollup/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/getRoot.ts","../../src/utils/filterSupport.ts","../../src/utils/getWD.ts","../../src/utils/tsRegister.ts","../../src/utils/loadConfig.ts","../../src/rollup/plugins/progress.ts","../../src/rollup/plugins/skip.ts","../../src/rollup/utils/externalResolver.ts","../../src/rollup/index.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 : undefined\n return root\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\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,\n 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,\n root,\n value: {\n [wd]: JSON.parse(fs.readFileSync(path.resolve(wd, 'package.json'), 'utf-8'))\n }\n }\n}\n","import { getWorkspaceDir, isWorkspaceDir } 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 if (root !== undefined) {\n const isWorkspace = isWorkspaceDir(root, type)\n notWorkspace = !isWorkspace\n wd = root\n return { wd, notWorkspace }\n }\n try {\n wd = getWorkspaceDir(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","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 fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\nimport type { Config } from 'jiek'\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(process.cwd(), `${configName}.${ext}`),\n path.resolve(process.cwd(), `.${configName}.${ext}`),\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(): Config {\n const { wd: root, notWorkspace } = getWD()\n if (notWorkspace) {\n throw new Error('not in workspace')\n }\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 }\n if (!path.isAbsolute(configPath)) {\n configPath = path.resolve(root, configPath)\n }\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')) as Config\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 type { PluginImpl } from 'rollup'\n\ninterface Options {\n onEvent?: (event: string, message?: string) => void\n}\n\nexport default ((options = {}) => {\n const { onEvent } = options\n return {\n name: 'progress',\n buildStart: () => onEvent?.('start', 'Start building...'),\n buildEnd: () => onEvent?.('end', 'Build completed!'),\n resolveId: {\n order: 'post',\n handler: source => onEvent?.('resolve', `Resolving ${source}...`)\n },\n load: {\n order: 'post',\n handler: id => onEvent?.('load', `Loading ${id}...`)\n },\n transform: {\n order: 'post',\n handler: (_, id) => onEvent?.('transform', `Transforming ${id}...`)\n }\n }\n}) as PluginImpl<Options>\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 fs from 'node:fs'\n\nexport default function(json: Record<string, unknown>): (string | RegExp)[]\nexport default function(path?: string): (string | RegExp)[]\nexport default function(jsonOrPath: string | Record<string, unknown> = process.cwd()): (string | RegExp)[] {\n const pkg = typeof jsonOrPath === 'string'\n ? fs.existsSync(`${jsonOrPath}/package.json`)\n ? JSON.parse(fs.readFileSync(`${jsonOrPath}/package.json`, 'utf-8'))\n : {}\n : jsonOrPath\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","import '../rollup/base'\n\nimport fs from 'node:fs'\nimport { dirname, resolve } from 'node:path'\n\nimport type { Entrypoints2ExportsOptions, RecursiveRecord } from '@jiek/pkger/entrypoints'\nimport {\n DEFAULT_SKIP_VALUES,\n entrypoints2Exports,\n filterLeafs,\n getAllLeafs,\n resolveEntrypoints\n} from '@jiek/pkger/entrypoints'\nimport { dts } from '@jiek/rollup-plugin-dts'\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport { nodeResolve } from '@rollup/plugin-node-resolve'\nimport terser from '@rollup/plugin-terser'\nimport { sendMessage } from 'execa'\nimport { parse } from 'jsonc-parser'\nimport { isMatch } from 'micromatch'\nimport type { OutputOptions, OutputPlugin, RollupOptions } from 'rollup'\nimport esbuild from 'rollup-plugin-esbuild'\nimport ts from 'typescript'\n\nimport { loadConfig } from '../utils/loadConfig'\nimport type { RollupProgressEvent, TemplateOptions } from './base'\nimport progress from './plugins/progress'\nimport skip from './plugins/skip'\nimport externalResolver from './utils/externalResolver'\n\ninterface PackageJSON {\n name?: string\n type?: string\n exports?: Record<string, unknown> | string | string[]\n}\n\nconst {\n JIEK_ROOT,\n JIEK_ENTRIES\n} = process.env\nconst WORKSPACE_ROOT = JIEK_ROOT ?? getWorkspaceDir()\nconst COMMON_OPTIONS = {} satisfies RollupOptions\nconst COMMON_PLUGINS = [\n json()\n]\n\nconst { build } = loadConfig()\nconst jsOutdir = resolve(\n (\n typeof build?.output?.dir === 'object'\n // the outdir only effect js output in this function\n ? build.output.dir.js\n : build?.output?.dir\n ) ?? 'dist'\n)\n\nconst STYLE_REGEXP = /\\.(css|s[ac]ss|less|styl)$/\n\n// eslint-disable-next-line unused-imports/no-unused-vars\nconst debug = (...args: unknown[]) => sendMessage({ type: 'debug', data: args } satisfies RollupProgressEvent)\n\nconst resolveWorkspacePath = (p: string) => resolve(WORKSPACE_ROOT, p)\n\nconst intersection = <T>(a: Set<T>, b: Set<T>) => new Set([...a].filter(i => b.has(i)))\n\nconst pascalCase = (str: string) =>\n str\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n .replace(/(?:^|-)(\\w)/g, (_, $1) => $1.toUpperCase())\n\nconst reveal = (obj: string | Record<string, unknown>, keys: string[]) =>\n keys.reduce((acc, key) => {\n if (typeof acc === 'string') throw new Error('key not found in exports')\n if (!(key in acc)) throw new Error(`key ${key} not found in exports`)\n return acc[key] as string | Record<string, unknown>\n }, obj)\n\nconst withMinify = (\n output: OutputOptions & {\n plugins?: OutputPlugin[]\n },\n minify = build?.output?.minify\n) =>\n minify === false\n ? [output]\n : minify === 'only-minify'\n ? [{\n ...output,\n // TODO replace suffix when pubish to npm and the `build.output.minify` is 'only-minify'\n // TODO resolve dts output file name\n file: output.file?.replace(/(\\.[cm]?js)$/, '.min$1'),\n plugins: [\n ...(output.plugins ?? []),\n terser()\n ]\n }]\n : [\n output,\n {\n ...output,\n file: output.file?.replace(/(\\.[cm]?js)$/, '.min$1'),\n plugins: [\n ...(output.plugins ?? []),\n terser()\n ]\n }\n ]\n\ntype TSConfig = {\n extends?: string | string[]\n compilerOptions?: Record<string, unknown>\n references?: { path: string }[]\n files?: string[]\n include?: string[]\n exclude?: string[]\n}\n\nconst getTSConfig = (p: string): TSConfig =>\n !fs.existsSync(p) || !fs.statSync(p).isFile()\n ? {}\n : parse(fs.readFileSync(p, 'utf-8'), [], { allowTrailingComma: true, allowEmptyContent: true })\n\nconst getExtendTSConfig = (tsconfigPath: string): TSConfig => {\n tsconfigPath = resolve(tsconfigPath)\n const tsconfigPathDirname = dirname(tsconfigPath)\n const { extends: exts, ...tsconfig } = getTSConfig(tsconfigPath)\n const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []\n\n const extendsPaths = resolvePaths(\n exts ? Array.isArray(exts) ? exts : [exts] : []\n )\n if (extendsPaths.length === 0) return tsconfig\n return extendsPaths\n .map(getExtendTSConfig)\n // https://www.typescriptlang.org/tsconfig/#files:~:text=Currently%2C%20the%20only%20top%2Dlevel%20property%20that%20is%20excluded%20from%20inheritance%20is%20references.\n // Currently, the only top-level property that is excluded from inheritance is references.\n .reduce((acc, { compilerOptions = {}, references: _, ...curr }) => ({\n ...acc,\n ...curr,\n compilerOptions: {\n ...acc.compilerOptions,\n ...compilerOptions\n }\n }), tsconfig)\n}\n\nconst getCompilerOptionsByFilePath = (tsconfigPath: string, filePath: string): Record<string, unknown> | undefined => {\n tsconfigPath = resolve(tsconfigPath)\n filePath = resolve(filePath)\n const tsconfigPathDirname = dirname(tsconfigPath)\n // https://www.typescriptlang.org/tsconfig/#files:~:text=It%E2%80%99s%20worth%20noting%20that%20files%2C%20include%2C%20and%20exclude%20from%20the%20inheriting%20config%20file%20overwrite%20those%20from%20the%20base%20config%20file%2C%20and%20that%20circularity%20between%20configuration%20files%20is%20not%20allowed.\n // It’s worth noting that files, include, and exclude from the inheriting config file overwrite\n // those from the base config file, and that circularity between configuration files is not allowed.\n const tsconfig = getExtendTSConfig(tsconfigPath)\n\n const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []\n\n const [\n references,\n files,\n include,\n exclude\n ] = [\n tsconfig.references?.map(({ path }) => path),\n tsconfig.files,\n tsconfig.include,\n tsconfig.exclude\n ].map(resolvePaths)\n if (exclude.length > 0 && exclude.some(i => isMatch(filePath, i))) return\n\n // when files or include is not empty, the tsconfig should be ignored\n if (tsconfig.files?.length === 0 && tsconfig.include?.length === 0) return\n let isInclude = false\n isInclude ||= files.length > 0 && files.includes(filePath)\n isInclude ||= include.length > 0 && include.some(i => isMatch(filePath, i))\n if (isInclude) {\n return tsconfig.compilerOptions ?? {}\n } else {\n // when files or include is not empty, but the file is not matched, the tsconfig should be ignored\n if (\n (tsconfig.files && tsconfig.files.length > 0)\n || (tsconfig.include && tsconfig.include.length > 0)\n ) return\n }\n\n references.reverse()\n for (const ref of references) {\n const compilerOptions = getCompilerOptionsByFilePath(ref, filePath)\n if (compilerOptions) return compilerOptions\n }\n return tsconfig.compilerOptions\n}\n\nconst generateConfigs = ({\n path,\n name,\n input,\n output,\n external,\n pkgIsModule,\n conditionals\n}: {\n path: string\n name: string\n input: string\n output: string\n external: (string | RegExp)[]\n pkgIsModule: boolean\n conditionals: string[]\n}, options: TemplateOptions = {}): RollupOptions[] => {\n const isModule = conditionals.includes('import')\n const isCommonJS = conditionals.includes('require')\n const isBrowser = conditionals.includes('browser')\n const dtsTSConfigPaths = [\n resolveWorkspacePath('tsconfig.json'),\n resolveWorkspacePath('tsconfig.dts.json')\n ]\n let dtsTSConfigPath: string | undefined\n dtsTSConfigPaths.forEach(p => {\n if (fs.existsSync(p) && fs.statSync(p).isFile()) {\n dtsTSConfigPath = p\n }\n })\n let compilerOptions: ts.CompilerOptions = {}\n if (dtsTSConfigPath) {\n const jsonCompilerOptions = getCompilerOptionsByFilePath(dtsTSConfigPath, resolve(input))\n const { options, errors } = ts.convertCompilerOptionsFromJson(\n jsonCompilerOptions,\n dirname(dtsTSConfigPath)\n )\n if (errors.length > 0) {\n throw new Error(errors.map(e => e.messageText).join('\\n'))\n }\n compilerOptions = options\n }\n const exportConditions = [...conditionals, ...(compilerOptions.customConditions ?? [])]\n const throughEventProps: RollupProgressEvent & { type: 'progress' } = {\n type: 'progress',\n data: { name, path, exportConditions, input }\n }\n const outdir = options?.output?.dir\n return [\n {\n input,\n external,\n output: [\n ...withMinify({\n file: output,\n name,\n sourcemap: typeof options?.output?.sourcemap === 'object'\n ? options.output.sourcemap.js\n : options?.output?.sourcemap ?? true,\n format: isModule ? 'esm' : (\n isCommonJS ? 'cjs' : (\n isBrowser ? 'umd' : (\n pkgIsModule ? 'esm' : 'cjs'\n )\n )\n ),\n strict: typeof options?.output?.strict === 'object'\n ? options.output.strict.js\n : options?.output?.strict\n })\n ],\n plugins: [\n nodeResolve({ exportConditions }),\n import('rollup-plugin-postcss')\n .then(({ default: postcss }) =>\n postcss({\n extract: resolve(output.replace(/\\.[cm]?js$/, '.css')),\n minimize: true\n })\n )\n .catch(() => void 0),\n esbuild(),\n progress({\n onEvent: (event, message) =>\n sendMessage(\n {\n ...throughEventProps,\n data: { ...throughEventProps.data, event, message, tags: ['js'] }\n } satisfies RollupProgressEvent\n )\n })\n ]\n },\n {\n input,\n external,\n output: [\n {\n dir: resolve((typeof outdir === 'object' ? outdir.dts : outdir) ?? 'dist'),\n sourcemap: typeof options?.output?.sourcemap === 'object'\n ? options.output.sourcemap.dts\n : options?.output?.sourcemap ?? true,\n entryFileNames: () =>\n output\n .replace(`${jsOutdir}/`, '')\n .replace(/(\\.[cm]?)js$/, '.d$1ts'),\n strict: typeof options?.output?.strict === 'object'\n ? options.output.strict.dts\n : options?.output?.strict\n }\n ],\n plugins: [\n nodeResolve({ exportConditions }),\n skip({ patterns: [STYLE_REGEXP] }),\n dts({\n respectExternal: true,\n compilerOptions\n }),\n progress({\n onEvent: (event, message) =>\n sendMessage(\n {\n ...throughEventProps,\n data: { ...throughEventProps.data, event, message, tags: ['dts'] }\n } satisfies RollupProgressEvent\n )\n })\n ]\n }\n ]\n}\n\nexport function template(packageJSON: PackageJSON): RollupOptions[] {\n const { name, type, exports: entrypoints } = packageJSON\n const pkgIsModule = type === 'module'\n if (!name) throw new Error('package.json name is required')\n if (!entrypoints) throw new Error('package.json exports is required')\n\n const entries = JIEK_ENTRIES\n ?.split(',')\n .map(e => e.trim())\n .map(e => ({\n 'index': '.'\n }[e] ?? e))\n\n const {\n crossModuleConvertor = true\n } = build ?? {}\n\n const packageName = pascalCase(name)\n\n const external = externalResolver(packageJSON as Record<string, unknown>)\n\n const [, resolvedEntrypoints] = resolveEntrypoints(entrypoints)\n if (entries) {\n Object\n .entries(resolvedEntrypoints)\n .forEach(([key]) => {\n if (!entries.some(e => isMatch(key, e, { matchBase: true }))) {\n delete resolvedEntrypoints[key]\n }\n })\n }\n const filteredResolvedEntrypoints = filterLeafs(\n resolvedEntrypoints as RecursiveRecord<string>,\n {\n skipValue: [\n // ignore values that filename starts with `.jk-noentry`\n /(^|\\/)\\.jk-noentry/,\n ...DEFAULT_SKIP_VALUES\n ]\n }\n )\n const crossModuleWithConditional: Entrypoints2ExportsOptions['withConditional'] = crossModuleConvertor\n ? {\n import: opts =>\n !pkgIsModule && intersection(\n new Set(opts.conditionals),\n new Set(['import', 'module'])\n ).size === 0\n ? opts.dist.replace(/\\.js$/, '.mjs')\n : false,\n require: opts => {\n return pkgIsModule && intersection(\n new Set(opts.conditionals),\n new Set(['require', 'node'])\n ).size === 0\n ? opts.dist.replace(/\\.js$/, '.cjs')\n : false\n }\n }\n : {}\n const exports = entrypoints2Exports(filteredResolvedEntrypoints, {\n outdir: jsOutdir,\n withConditional: {\n ...crossModuleWithConditional\n }\n })\n\n const leafMap = new Map<string, string[][]>()\n getAllLeafs(filteredResolvedEntrypoints as RecursiveRecord<string>, ({ keys, value }) => {\n if (typeof value === 'string') {\n const keysArr = leafMap.get(value) ?? []\n leafMap.set(value, keysArr)\n keysArr.push(keys)\n }\n return false\n })\n\n const configs: RollupOptions[] = []\n leafMap.forEach((keysArr, input) =>\n keysArr.forEach((keys) => {\n const [path, ...conditionals] = keys\n\n const name = packageName + (path === '.' ? '' : pascalCase(path))\n const keyExports = reveal(exports, keys)\n const commonOptions = {\n path,\n name,\n input,\n external,\n pkgIsModule\n }\n\n switch (typeof keyExports) {\n case 'string': {\n configs.push(...generateConfigs({\n ...commonOptions,\n output: keyExports,\n conditionals\n }, build))\n break\n }\n case 'object': {\n getAllLeafs(keyExports as RecursiveRecord<string>, ({ keys: nextKeys, value }) => {\n const allConditionals = [...new Set([...conditionals, ...nextKeys])]\n if (typeof value === 'string') {\n configs.push(...generateConfigs({\n ...commonOptions,\n output: value,\n conditionals: allConditionals\n }, build))\n }\n return false\n })\n break\n }\n }\n })\n )\n sendMessage(\n {\n type: 'init',\n data: {\n leafMap,\n targetsLength: configs.length\n }\n } satisfies RollupProgressEvent\n )\n return configs.map(c => ({\n ...COMMON_OPTIONS,\n ...c,\n plugins: [\n ...COMMON_PLUGINS,\n c.plugins\n ]\n }))\n}\n"],"names":["program","isWorkspaceDir","getWorkspaceDir","load","resolve","parse","dirname","isMatch","path","options","nodeResolve","sendMessage","dts","entrypoints","resolveEntrypoints","filterLeafs","DEFAULT_SKIP_VALUES","entrypoints2Exports","getAllLeafs","name"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA,IAAI,IAAA,CAAA;AACG,SAAS,OAAU,GAAA;AACxB,EAAI,IAAA,IAAA;AAAM,IAAO,OAAA,IAAA,CAAA;AAEjB,EAAM,MAAA,UAAA,GAAaA,iBAAQ,CAAA,cAAA,CAAe,MAAM,CAAA,CAAA;AAChD,EAAA,IAAA,GAAO,UACH,GAAA,IAAA,CAAK,UAAW,CAAA,UAAU,CACxB,GAAA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,YAAA;AAAA,WACF,EAAG,KAAK,CAAC,CAAA,CAAA;AACT,UAAA,MAAA;AAAA,SACF;AAAA,QACA,KAAK,QAAU,EAAA;AACb,UAAAD,uBAAA,CAAY,YAAuC,CAAC,EAAE,IAAM,EAAA,QAAA,EAAU,OAAY,KAAA;AAChF,YAAM,MAAA,eAAA,GAAkB,CAAC,mBAAO,IAAA,GAAA,CAAI,CAAC,GAAG,YAAc,EAAA,GAAG,QAAQ,CAAC,CAAC,CAAA,CAAA;AACnE,YAAI,IAAA,OAAO,UAAU,QAAU,EAAA;AAC7B,cAAQ,OAAA,CAAA,IAAA,CAAK,GAAG,eAAgB,CAAA;AAAA,gBAC9B,GAAG,aAAA;AAAA,gBACH,MAAQ,EAAA,KAAA;AAAA,gBACR,YAAc,EAAA,eAAA;AAAA,eAChB,EAAG,KAAK,CAAC,CAAA,CAAA;AAAA,aACX;AACA,YAAO,OAAA,KAAA,CAAA;AAAA,WACR,CAAA,CAAA;AACD,UAAA,MAAA;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH,CAAA;AACA,EAAAP,iBAAA;AAAA,IACE;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,IAAM,EAAA;AAAA,QACJ,OAAA;AAAA,QACA,eAAe,OAAQ,CAAA,MAAA;AAAA,OACzB;AAAA,KACF;AAAA,GACF,CAAA;AACA,EAAO,OAAA,OAAA,CAAQ,IAAI,CAAM,CAAA,MAAA;AAAA,IACvB,GAAG,cAAA;AAAA,IACH,GAAG,CAAA;AAAA,IACH,OAAS,EAAA;AAAA,MACP,GAAG,cAAA;AAAA,MACH,CAAE,CAAA,OAAA;AAAA,KACJ;AAAA,GACA,CAAA,CAAA,CAAA;AACJ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.min.js","sources":["../../src/utils/getRoot.ts","../../src/utils/filterSupport.ts","../../src/utils/getWD.ts","../../src/utils/tsRegister.ts","../../src/utils/loadConfig.ts","../../src/rollup/plugins/progress.ts","../../src/rollup/plugins/skip.ts","../../src/rollup/index.ts","../../src/rollup/utils/externalResolver.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 : undefined\n return root\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\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,\n 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,\n root,\n value: {\n [wd]: JSON.parse(fs.readFileSync(path.resolve(wd, 'package.json'), 'utf-8'))\n }\n }\n}\n","import { getWorkspaceDir, isWorkspaceDir } 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 if (root !== undefined) {\n const isWorkspace = isWorkspaceDir(root, type)\n notWorkspace = !isWorkspace\n wd = root\n return { wd, notWorkspace }\n }\n try {\n wd = getWorkspaceDir(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","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 fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\nimport type { Config } from 'jiek'\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(process.cwd(), `${configName}.${ext}`),\n path.resolve(process.cwd(), `.${configName}.${ext}`),\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(): Config {\n const { wd: root, notWorkspace } = getWD()\n if (notWorkspace) {\n throw new Error('not in workspace')\n }\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 }\n if (!path.isAbsolute(configPath)) {\n configPath = path.resolve(root, configPath)\n }\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')) as Config\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 type { PluginImpl } from 'rollup'\n\ninterface Options {\n onEvent?: (event: string, message?: string) => void\n}\n\nexport default ((options = {}) => {\n const { onEvent } = options\n return {\n name: 'progress',\n buildStart: () => onEvent?.('start', 'Start building...'),\n buildEnd: () => onEvent?.('end', 'Build completed!'),\n resolveId: {\n order: 'post',\n handler: source => onEvent?.('resolve', `Resolving ${source}...`)\n },\n load: {\n order: 'post',\n handler: id => onEvent?.('load', `Loading ${id}...`)\n },\n transform: {\n order: 'post',\n handler: (_, id) => onEvent?.('transform', `Transforming ${id}...`)\n }\n }\n}) as PluginImpl<Options>\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 '../rollup/base'\n\nimport fs from 'node:fs'\nimport { dirname, resolve } from 'node:path'\n\nimport type { Entrypoints2ExportsOptions, RecursiveRecord } from '@jiek/pkger/entrypoints'\nimport {\n DEFAULT_SKIP_VALUES,\n entrypoints2Exports,\n filterLeafs,\n getAllLeafs,\n resolveEntrypoints\n} from '@jiek/pkger/entrypoints'\nimport { dts } from '@jiek/rollup-plugin-dts'\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport { nodeResolve } from '@rollup/plugin-node-resolve'\nimport terser from '@rollup/plugin-terser'\nimport { sendMessage } from 'execa'\nimport { parse } from 'jsonc-parser'\nimport { isMatch } from 'micromatch'\nimport type { OutputOptions, OutputPlugin, RollupOptions } from 'rollup'\nimport esbuild from 'rollup-plugin-esbuild'\nimport ts from 'typescript'\n\nimport { loadConfig } from '../utils/loadConfig'\nimport type { RollupProgressEvent, TemplateOptions } from './base'\nimport progress from './plugins/progress'\nimport skip from './plugins/skip'\nimport externalResolver from './utils/externalResolver'\n\ninterface PackageJSON {\n name?: string\n type?: string\n exports?: Record<string, unknown> | string | string[]\n}\n\nconst {\n JIEK_ROOT,\n JIEK_ENTRIES\n} = process.env\nconst WORKSPACE_ROOT = JIEK_ROOT ?? getWorkspaceDir()\nconst COMMON_OPTIONS = {} satisfies RollupOptions\nconst COMMON_PLUGINS = [\n json()\n]\n\nconst { build } = loadConfig()\nconst jsOutdir = resolve(\n (\n typeof build?.output?.dir === 'object'\n // the outdir only effect js output in this function\n ? build.output.dir.js\n : build?.output?.dir\n ) ?? 'dist'\n)\n\nconst STYLE_REGEXP = /\\.(css|s[ac]ss|less|styl)$/\n\n// eslint-disable-next-line unused-imports/no-unused-vars\nconst debug = (...args: unknown[]) => sendMessage({ type: 'debug', data: args } satisfies RollupProgressEvent)\n\nconst resolveWorkspacePath = (p: string) => resolve(WORKSPACE_ROOT, p)\n\nconst intersection = <T>(a: Set<T>, b: Set<T>) => new Set([...a].filter(i => b.has(i)))\n\nconst pascalCase = (str: string) =>\n str\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n .replace(/(?:^|-)(\\w)/g, (_, $1) => $1.toUpperCase())\n\nconst reveal = (obj: string | Record<string, unknown>, keys: string[]) =>\n keys.reduce((acc, key) => {\n if (typeof acc === 'string') throw new Error('key not found in exports')\n if (!(key in acc)) throw new Error(`key ${key} not found in exports`)\n return acc[key] as string | Record<string, unknown>\n }, obj)\n\nconst withMinify = (\n output: OutputOptions & {\n plugins?: OutputPlugin[]\n },\n minify = build?.output?.minify\n) =>\n minify === false\n ? [output]\n : minify === 'only-minify'\n ? [{\n ...output,\n // TODO replace suffix when pubish to npm and the `build.output.minify` is 'only-minify'\n // TODO resolve dts output file name\n file: output.file?.replace(/(\\.[cm]?js)$/, '.min$1'),\n plugins: [\n ...(output.plugins ?? []),\n terser()\n ]\n }]\n : [\n output,\n {\n ...output,\n file: output.file?.replace(/(\\.[cm]?js)$/, '.min$1'),\n plugins: [\n ...(output.plugins ?? []),\n terser()\n ]\n }\n ]\n\ntype TSConfig = {\n extends?: string | string[]\n compilerOptions?: Record<string, unknown>\n references?: { path: string }[]\n files?: string[]\n include?: string[]\n exclude?: string[]\n}\n\nconst getTSConfig = (p: string): TSConfig =>\n !fs.existsSync(p) || !fs.statSync(p).isFile()\n ? {}\n : parse(fs.readFileSync(p, 'utf-8'), [], { allowTrailingComma: true, allowEmptyContent: true })\n\nconst getExtendTSConfig = (tsconfigPath: string): TSConfig => {\n tsconfigPath = resolve(tsconfigPath)\n const tsconfigPathDirname = dirname(tsconfigPath)\n const { extends: exts, ...tsconfig } = getTSConfig(tsconfigPath)\n const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []\n\n const extendsPaths = resolvePaths(\n exts ? Array.isArray(exts) ? exts : [exts] : []\n )\n if (extendsPaths.length === 0) return tsconfig\n return extendsPaths\n .map(getExtendTSConfig)\n // https://www.typescriptlang.org/tsconfig/#files:~:text=Currently%2C%20the%20only%20top%2Dlevel%20property%20that%20is%20excluded%20from%20inheritance%20is%20references.\n // Currently, the only top-level property that is excluded from inheritance is references.\n .reduce((acc, { compilerOptions = {}, references: _, ...curr }) => ({\n ...acc,\n ...curr,\n compilerOptions: {\n ...acc.compilerOptions,\n ...compilerOptions\n }\n }), tsconfig)\n}\n\nconst getCompilerOptionsByFilePath = (tsconfigPath: string, filePath: string): Record<string, unknown> | undefined => {\n tsconfigPath = resolve(tsconfigPath)\n filePath = resolve(filePath)\n const tsconfigPathDirname = dirname(tsconfigPath)\n // https://www.typescriptlang.org/tsconfig/#files:~:text=It%E2%80%99s%20worth%20noting%20that%20files%2C%20include%2C%20and%20exclude%20from%20the%20inheriting%20config%20file%20overwrite%20those%20from%20the%20base%20config%20file%2C%20and%20that%20circularity%20between%20configuration%20files%20is%20not%20allowed.\n // It’s worth noting that files, include, and exclude from the inheriting config file overwrite\n // those from the base config file, and that circularity between configuration files is not allowed.\n const tsconfig = getExtendTSConfig(tsconfigPath)\n\n const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []\n\n const [\n references,\n files,\n include,\n exclude\n ] = [\n tsconfig.references?.map(({ path }) => path),\n tsconfig.files,\n tsconfig.include,\n tsconfig.exclude\n ].map(resolvePaths)\n if (exclude.length > 0 && exclude.some(i => isMatch(filePath, i))) return\n\n // when files or include is not empty, the tsconfig should be ignored\n if (tsconfig.files?.length === 0 && tsconfig.include?.length === 0) return\n let isInclude = false\n isInclude ||= files.length > 0 && files.includes(filePath)\n isInclude ||= include.length > 0 && include.some(i => isMatch(filePath, i))\n if (isInclude) {\n return tsconfig.compilerOptions ?? {}\n } else {\n // when files or include is not empty, but the file is not matched, the tsconfig should be ignored\n if (\n (tsconfig.files && tsconfig.files.length > 0)\n || (tsconfig.include && tsconfig.include.length > 0)\n ) return\n }\n\n references.reverse()\n for (const ref of references) {\n const compilerOptions = getCompilerOptionsByFilePath(ref, filePath)\n if (compilerOptions) return compilerOptions\n }\n return tsconfig.compilerOptions\n}\n\nconst generateConfigs = ({\n path,\n name,\n input,\n output,\n external,\n pkgIsModule,\n conditionals\n}: {\n path: string\n name: string\n input: string\n output: string\n external: (string | RegExp)[]\n pkgIsModule: boolean\n conditionals: string[]\n}, options: TemplateOptions = {}): RollupOptions[] => {\n const isModule = conditionals.includes('import')\n const isCommonJS = conditionals.includes('require')\n const isBrowser = conditionals.includes('browser')\n const dtsTSConfigPaths = [\n resolveWorkspacePath('tsconfig.json'),\n resolveWorkspacePath('tsconfig.dts.json')\n ]\n let dtsTSConfigPath: string | undefined\n dtsTSConfigPaths.forEach(p => {\n if (fs.existsSync(p) && fs.statSync(p).isFile()) {\n dtsTSConfigPath = p\n }\n })\n let compilerOptions: ts.CompilerOptions = {}\n if (dtsTSConfigPath) {\n const jsonCompilerOptions = getCompilerOptionsByFilePath(dtsTSConfigPath, resolve(input))\n const { options, errors } = ts.convertCompilerOptionsFromJson(\n jsonCompilerOptions,\n dirname(dtsTSConfigPath)\n )\n if (errors.length > 0) {\n throw new Error(errors.map(e => e.messageText).join('\\n'))\n }\n compilerOptions = options\n }\n const exportConditions = [...conditionals, ...(compilerOptions.customConditions ?? [])]\n const throughEventProps: RollupProgressEvent & { type: 'progress' } = {\n type: 'progress',\n data: { name, path, exportConditions, input }\n }\n const outdir = options?.output?.dir\n return [\n {\n input,\n external,\n output: [\n ...withMinify({\n file: output,\n name,\n sourcemap: typeof options?.output?.sourcemap === 'object'\n ? options.output.sourcemap.js\n : options?.output?.sourcemap ?? true,\n format: isModule ? 'esm' : (\n isCommonJS ? 'cjs' : (\n isBrowser ? 'umd' : (\n pkgIsModule ? 'esm' : 'cjs'\n )\n )\n ),\n strict: typeof options?.output?.strict === 'object'\n ? options.output.strict.js\n : options?.output?.strict\n })\n ],\n plugins: [\n nodeResolve({ exportConditions }),\n import('rollup-plugin-postcss')\n .then(({ default: postcss }) =>\n postcss({\n extract: resolve(output.replace(/\\.[cm]?js$/, '.css')),\n minimize: true\n })\n )\n .catch(() => void 0),\n esbuild(),\n progress({\n onEvent: (event, message) =>\n sendMessage(\n {\n ...throughEventProps,\n data: { ...throughEventProps.data, event, message, tags: ['js'] }\n } satisfies RollupProgressEvent\n )\n })\n ]\n },\n {\n input,\n external,\n output: [\n {\n dir: resolve((typeof outdir === 'object' ? outdir.dts : outdir) ?? 'dist'),\n sourcemap: typeof options?.output?.sourcemap === 'object'\n ? options.output.sourcemap.dts\n : options?.output?.sourcemap ?? true,\n entryFileNames: () =>\n output\n .replace(`${jsOutdir}/`, '')\n .replace(/(\\.[cm]?)js$/, '.d$1ts'),\n strict: typeof options?.output?.strict === 'object'\n ? options.output.strict.dts\n : options?.output?.strict\n }\n ],\n plugins: [\n nodeResolve({ exportConditions }),\n skip({ patterns: [STYLE_REGEXP] }),\n dts({\n respectExternal: true,\n compilerOptions\n }),\n progress({\n onEvent: (event, message) =>\n sendMessage(\n {\n ...throughEventProps,\n data: { ...throughEventProps.data, event, message, tags: ['dts'] }\n } satisfies RollupProgressEvent\n )\n })\n ]\n }\n ]\n}\n\nexport function template(packageJSON: PackageJSON): RollupOptions[] {\n const { name, type, exports: entrypoints } = packageJSON\n const pkgIsModule = type === 'module'\n if (!name) throw new Error('package.json name is required')\n if (!entrypoints) throw new Error('package.json exports is required')\n\n const entries = JIEK_ENTRIES\n ?.split(',')\n .map(e => e.trim())\n .map(e => ({\n 'index': '.'\n }[e] ?? e))\n\n const {\n crossModuleConvertor = true\n } = build ?? {}\n\n const packageName = pascalCase(name)\n\n const external = externalResolver(packageJSON as Record<string, unknown>)\n\n const [, resolvedEntrypoints] = resolveEntrypoints(entrypoints)\n if (entries) {\n Object\n .entries(resolvedEntrypoints)\n .forEach(([key]) => {\n if (!entries.some(e => isMatch(key, e, { matchBase: true }))) {\n delete resolvedEntrypoints[key]\n }\n })\n }\n const filteredResolvedEntrypoints = filterLeafs(\n resolvedEntrypoints as RecursiveRecord<string>,\n {\n skipValue: [\n // ignore values that filename starts with `.jk-noentry`\n /(^|\\/)\\.jk-noentry/,\n ...DEFAULT_SKIP_VALUES\n ]\n }\n )\n const crossModuleWithConditional: Entrypoints2ExportsOptions['withConditional'] = crossModuleConvertor\n ? {\n import: opts =>\n !pkgIsModule && intersection(\n new Set(opts.conditionals),\n new Set(['import', 'module'])\n ).size === 0\n ? opts.dist.replace(/\\.js$/, '.mjs')\n : false,\n require: opts => {\n return pkgIsModule && intersection(\n new Set(opts.conditionals),\n new Set(['require', 'node'])\n ).size === 0\n ? opts.dist.replace(/\\.js$/, '.cjs')\n : false\n }\n }\n : {}\n const exports = entrypoints2Exports(filteredResolvedEntrypoints, {\n outdir: jsOutdir,\n withConditional: {\n ...crossModuleWithConditional\n }\n })\n\n const leafMap = new Map<string, string[][]>()\n getAllLeafs(filteredResolvedEntrypoints as RecursiveRecord<string>, ({ keys, value }) => {\n if (typeof value === 'string') {\n const keysArr = leafMap.get(value) ?? []\n leafMap.set(value, keysArr)\n keysArr.push(keys)\n }\n return false\n })\n\n const configs: RollupOptions[] = []\n leafMap.forEach((keysArr, input) =>\n keysArr.forEach((keys) => {\n const [path, ...conditionals] = keys\n\n const name = packageName + (path === '.' ? '' : pascalCase(path))\n const keyExports = reveal(exports, keys)\n const commonOptions = {\n path,\n name,\n input,\n external,\n pkgIsModule\n }\n\n switch (typeof keyExports) {\n case 'string': {\n configs.push(...generateConfigs({\n ...commonOptions,\n output: keyExports,\n conditionals\n }, build))\n break\n }\n case 'object': {\n getAllLeafs(keyExports as RecursiveRecord<string>, ({ keys: nextKeys, value }) => {\n const allConditionals = [...new Set([...conditionals, ...nextKeys])]\n if (typeof value === 'string') {\n configs.push(...generateConfigs({\n ...commonOptions,\n output: value,\n conditionals: allConditionals\n }, build))\n }\n return false\n })\n break\n }\n }\n })\n )\n sendMessage(\n {\n type: 'init',\n data: {\n leafMap,\n targetsLength: configs.length\n }\n } satisfies RollupProgressEvent\n )\n return configs.map(c => ({\n ...COMMON_OPTIONS,\n ...c,\n plugins: [\n ...COMMON_PLUGINS,\n c.plugins\n ]\n }))\n}\n","import fs from 'node:fs'\n\nexport default function(json: Record<string, unknown>): (string | RegExp)[]\nexport default function(path?: string): (string | RegExp)[]\nexport default function(jsonOrPath: string | Record<string, unknown> = process.cwd()): (string | RegExp)[] {\n const pkg = typeof jsonOrPath === 'string'\n ? fs.existsSync(`${jsonOrPath}/package.json`)\n ? JSON.parse(fs.readFileSync(`${jsonOrPath}/package.json`, 'utf-8'))\n : {}\n : jsonOrPath\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":["root","getRoot","rootOption","program","getOptionValue","path","isAbsolute","resolve","process","cwd","wd","type","require","option","tsRegisterName","notWorkspace","getWD","isWorkspace","isWorkspaceDir","getWorkspaceDir","e","message","packageIsExist","name","registers","env","JIEK_TS_REGISTER","filter","Boolean","register","configName","progress","options","onEvent","buildStart","buildEnd","resolveId","order","handler","source","load","id","transform","_","skip","patterns","some","pattern","includes","test","JIEK_ROOT","JIEK_ENTRIES","WORKSPACE_ROOT","COMMON_OPTIONS","COMMON_PLUGINS","json","build","Error","configPath","fs","existsSync","isSupportTsLoader","configWithExtIsExist","ext","filenames","filename","lstatSync","isFile","getConfigPath","extname","module","readFileSync","default","loadConfig","jsOutdir","output","dir","js","STYLE_REGEXP","resolveWorkspacePath","p","intersection","a","b","Set","i","has","pascalCase","str","replace","$1","toUpperCase","withMinify","minify","file","plugins","terser","getExtendTSConfig","tsconfigPath","tsconfigPathDirname","dirname","extends","exts","tsconfig","statSync","parse","allowTrailingComma","allowEmptyContent","extendsPaths","paths","Array","isArray","map","length","reduce","acc","compilerOptions","references","curr","getCompilerOptionsByFilePath","filePath","files","include","exclude","isMatch","isInclude","reverse","ref","generateConfigs","input","external","pkgIsModule","conditionals","isModule","isCommonJS","isBrowser","dtsTSConfigPath","forEach","jsonCompilerOptions","errors","ts","convertCompilerOptionsFromJson","messageText","join","exportConditions","customConditions","throughEventProps","data","outdir","sourcemap","format","strict","nodeResolve","import","then","postcss","extract","minimize","catch","esbuild","event","sendMessage","tags","dts","entryFileNames","respectExternal","packageJSON","exports","entrypoints","entries","split","trim","index","crossModuleConvertor","packageName","jsonOrPath","pkg","JSON","dependencies","peerDependencies","optionalDependencies","Object","keys","concat","dep","RegExp","externalResolver","resolvedEntrypoints","resolveEntrypoints","key","matchBase","filteredResolvedEntrypoints","filterLeafs","skipValue","DEFAULT_SKIP_VALUES","crossModuleWithConditional","opts","size","dist","entrypoints2Exports","withConditional","leafMap","Map","getAllLeafs","value","keysArr","get","set","push","configs","keyExports","obj","reveal","commonOptions","nextKeys","allConditionals","targetsLength","c"],"mappings":"ycAIA,IAAIA,EACG,SAASC,IACV,GAAAD,EAAa,OAAAA,EAEX,MAAAE,EAAaC,EAAAA,QAAQC,eAAe,QAMnC,OALPJ,EAAOE,EACHG,EAAKC,WAAWJ,GACdA,EACAG,EAAKE,QAAQC,QAAQC,MAAOP,QAC9B,EACGF,CACT,4CCLO,ICLHU,EDKOC,EAAO,GAElB,IACEC,QAAQL,QAAQ,mCACTI,EAAA,MACT,CAAQ,MAAc,CACT,KAATA,GAECR,EAAAA,QAAAU,OAAO,wBAAyB,mBCZrC,ICGWC,EDHPC,GAAe,EAEZ,SAASC,IACV,GAAAN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oints as n,filterLeafs as i,DEFAULT_SKIP_VALUES as p,entrypoints2Exports as c,getAllLeafs as u}from"@jiek/pkger/entrypoints";import{dts as l}from"@jiek/rollup-plugin-dts";import{isWorkspaceDir as a,getWorkspaceDir as f}from"@jiek/utils/getWorkspaceDir";import d from"@rollup/plugin-json";import{nodeResolve as m}from"@rollup/plugin-node-resolve";import g from"@rollup/plugin-terser";import{sendMessage as y}from"execa";import{parse as w}from"jsonc-parser";import{isMatch as h}from"micromatch";import j from"rollup-plugin-esbuild";import k from"typescript";import{program as $}from"commander";import{load as v}from"js-yaml";import"@pnpm/filter-workspace-packages";const E=(e,t)=>new Set([...e].filter((e=>t.has(e))));let b;function x(){if(b)return b;const e=$.getOptionValue("root");return b=e?t.isAbsolute(e)?e:t.resolve(process.cwd(),e):void 0,b}let S,O="";try{require.resolve("@pnpm/filter-workspace-packages"),O="pnpm"}catch{}""!==O&&$.option("-f, --filter <filter>","filter packages");let I,q=!1;function C(e){try{return require.resolve(e),!0}catch(e){return!1}}const F=[process.env.JIEK_TS_REGISTER,"esbuild-register","@swc-node/register","ts-node/register"].filter(Boolean);for(const e of F)if(C(e)){I=e;break}let T="jiek.config";var R=(e={})=>{const{onEvent:t}=e;return{name:"progress",buildStart:()=>t?.("start","Start building..."),buildEnd:()=>t?.("end","Build completed!"),resolveId:{order:"post",handler:e=>t?.("resolve",`Resolving ${e}...`)},load:{order:"post",handler:e=>t?.("load",`Loading ${e}...`)},transform:{order:"post",handler:(e,r)=>t?.("transform",`Transforming ${r}...`)}}},M=(e={})=>({name:"skip",load(t){if(e.patterns?.some((e=>"string"==typeof e?t.includes(e):e.test(t))))return""}});const{JIEK_ROOT:J,JIEK_ENTRIES:_}=process.env,A=J??f(),K={},W=[d()],z=function(r){const{wd:o}=function(){if(S)return{wd:S,notWorkspace:q};const e=x();if(void 0!==e){const t=a(e,O);return q=!t,S=e,{wd:S,notWorkspace:q}}try{S=f(O)}catch(t){if(!("message"in t)||"workspace root not found"!==t.message)throw t;S=e,q=!0}return{wd:S,notWorkspace:q}}();let s=$.getOptionValue("configPath");if(s){if(!e.existsSync(s))throw new Error(`config file not found: ${s}`);t.isAbsolute(s)||(s=t.resolve(o,s))}else s=function(r,o){const s=!!I;function n(s){const n=[t.resolve(process.cwd(),`${T}.${s}`),t.resolve(process.cwd(),`.${T}.${s}`),t.resolve(r,`${T}.${s}`),t.resolve(r,`.${T}.${s}`)];o&&n.unshift(t.resolve(o,`${T}.${s}`),t.resolve(o,`.${T}.${s}`));for(const t of n)if(e.existsSync(t)&&e.lstatSync(t).isFile())return t}return T=n("js")??T,T=n("json")??T,T=n("yaml")??T,s&&(T=n("ts")??T),t.resolve(r,T)}(o,r);const n=t.extname(s);let i;switch(n){case".js":i=require(s);break;case".json":return require(s);case".yaml":return v(e.readFileSync(s,"utf-8"));case".ts":if(I){require(I),i=require(s);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: ${n}`)}if(!i)throw new Error("config file is empty");return i.default??i}()??{},{build:B={}}=z,D=`./${o(process.cwd(),r(("object"==typeof B?.output?.dir?B.output.dir.js:B?.output?.dir)??"dist"))}`,N=/\.(css|s[ac]ss|less|styl)$/,V=e=>r(A,e),G=e=>e.replace(/[@|/-](\w)/g,((e,t)=>t.toUpperCase())).replace(/(?:^|-)(\w)/g,((e,t)=>t.toUpperCase())),L=(e,t=B?.output?.minify)=>!1===t?[e]:"only-minify"===t?[{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],g()]}]:[e,{...e,file:e.file?.replace(/(\.[cm]?js)$/,".min$1"),plugins:[...e.plugins??[],g()]}],U=t=>{t=r(t);const o=s(t),{extends:n,...i}=(p=t,e.existsSync(p)&&e.statSync(p).isFile()?w(e.readFileSync(p,"utf-8"),[],{allowTrailingComma:!0,allowEmptyContent:!0}):{});var p;const c=(u=n?Array.isArray(n)?n:[n]:[],u?.map((e=>r(o,e)))??[]);var u;return 0===c.length?i:c.map(U).reduce(((e,{compilerOptions:t={},references:r,...o})=>({...e,...o,compilerOptions:{...e.compilerOptions,...t}})),i)},P=(e,t)=>{e=r(e),t=r(t);const o=s(e),n=U(e),[i,p,c,u]=[n.references?.map((({path:e})=>e)),n.files,n.include,n.exclude].map((e=>e?.map((e=>r(o,e)))??[]));if(u.length>0&&u.some((e=>h(t,e))))return;if(0===n.files?.length&&0===n.include?.length)return;let l=!1;if(l||(l=p.length>0&&p.includes(t)),l||(l=c.length>0&&c.some((e=>h(t,e)))),l)return n.compilerOptions??{};if(!(n.files&&n.files.length>0||n.include&&n.include.length>0)){i.reverse();for(const e of i){const r=P(e,t);if(r)return r}return n.compilerOptions}},H=({path:t,name:o,input:n,output:i,external:p,pkgIsModule:c,conditionals:u},a={})=>{const f=u.includes("import"),d=u.includes("require"),g=u.includes("browser");let w;[V("tsconfig.json"),V("tsconfig.dts.json")].forEach((t=>{e.existsSync(t)&&e.statSync(t).isFile()&&(w=t)}));let h={};if(w){const e=P(w,r(n)),{options:t,errors:o}=k.convertCompilerOptionsFromJson(e,s(w));if(o.length>0)throw new Error(o.map((e=>e.messageText)).join("\n"));h=t}const $=[...u,...h.customConditions??[]],v={type:"progress",data:{name:o,path:t,exportConditions:$,input:n}},E=a?.output?.dir;return[{input:n,external:p,output:[...L({file:i,name:o,sourcemap:"object"==typeof a?.output?.sourcemap?a.output.sourcemap.js:a?.output?.sourcemap,format:f?"esm":d?"cjs":g?"umd":c?"esm":"cjs",strict:"object"==typeof a?.output?.strict?a.output.strict.js:a?.output?.strict})],plugins:[m({exportConditions:$}),import("rollup-plugin-postcss").then((({default:e})=>e({extract:r(i.replace(/\.[cm]?js$/,".css")),minimize:!0}))).catch((()=>{})),j(),R({onEvent:(e,t)=>y({...v,data:{...v.data,event:e,message:t,tags:["js"]}})})]},{input:n,external:p,output:[{dir:r(("object"==typeof E?E.dts:E)??"dist"),sourcemap:"object"==typeof a?.output?.sourcemap?a.output.sourcemap.dts:a?.output?.sourcemap,entryFileNames:()=>i.replace(`${D}/`,"").replace(/(\.[cm]?)js$/,".d$1ts"),strict:"object"==typeof a?.output?.strict?a.output.strict.dts:a?.output?.strict}],plugins:[m({exportConditions:$}),M({patterns:[N]}),l({respectExternal:!0,compilerOptions:h}),R({onEvent:(e,t)=>y({...v,data:{...v.data,event:e,message:t,tags:["dts"]}})})]}]};function Q(t){const{name:s,type:l,exports:a}=t,f="module"===l;if(!s)throw new Error("package.json name is required");if(!a)throw new Error("package.json exports is required");const d=_?.split(",").map((e=>e.trim())).map((e=>({index:"."}[e]??e))),m=G(s),g=function(t=process.cwd()){const r="string"==typeof t?e.existsSync(`${t}/package.json`)?JSON.parse(e.readFileSync(`${t}/package.json`,"utf-8")):{}:t,{dependencies:o={},peerDependencies:s={},optionalDependencies:n={}}=r;return Object.keys(o).concat(Object.keys(s)).concat(Object.keys(n)).map((e=>new RegExp(`^${e}(/.*)?$`))).concat([/^node:/])}(t),[w,j]=function({entrypoints:e,pkgIsModule:t,entries:s,config:u,dir:l,noFilter:a}){const{build:f={}}=u??{},{crossModuleConvertor:d=!0}=f,m=`./${(e=>o(l??process.cwd(),e))(((...e)=>r(l??process.cwd(),...e))(("object"==typeof f?.output?.dir?f.output.dir.js:f?.output?.dir)??"dist"))}`,[,g]=n(e);s&&Object.entries(g).forEach((([e])=>{s.some((t=>h(e,t,{matchBase:!0})))||delete g[e]}));const y=a?g:i(g,{skipValue:[/(^|\/)\.jk-noentry/,...p]});return[y,c(y,{outdir:m,withConditional:{...d?{import:e=>!t&&0===E(new Set(e.conditionals),new Set(["import","module"])).size&&e.dist.replace(/\.js$/,".mjs"),require:e=>!(!t||0!==E(new Set(e.conditionals),new Set(["require","node"])).size)&&e.dist.replace(/\.js$/,".cjs")}:{}}})]}({entrypoints:a,pkgIsModule:f,entries:d,config:z}),k=new Map;u(w,(({keys:e,value:t})=>{if("string"==typeof t){const r=k.get(t)??[];k.set(t,r),r.push(e)}return!1}));const $=[];return k.forEach(((e,t)=>e.forEach((e=>{const[r,...o]=e,s=m+("."===r?"":G(r)),n=((e,t)=>t.reduce(((e,t)=>{if("string"==typeof e)throw new Error("key not found in exports");if(!(t in e))throw new Error(`key ${t} not found in exports`);return e[t]}),e))(j,e),i={path:r,name:s,input:t,external:g,pkgIsModule:f};switch(typeof n){case"string":$.push(...H({...i,output:n,conditionals:o},B));break;case"object":u(n,(({keys:e,value:t})=>{const r=[...new Set([...o,...e])];return"string"==typeof t&&$.push(...H({...i,output:t,conditionals:r},B)),!1}))}})))),y({type:"init",data:{leafMap:k,targetsLength:$.length}}),$.map((e=>({...K,...e,plugins:[...W,e.plugins]})))}export{Q as template};
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.min.mjs","sources":["../../src/utils/getRoot.ts","../../src/utils/filterSupport.ts","../../src/utils/getWD.ts","../../src/utils/tsRegister.ts","../../src/utils/loadConfig.ts","../../src/rollup/plugins/progress.ts","../../src/rollup/plugins/skip.ts","../../src/rollup/index.ts","../../src/rollup/utils/externalResolver.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 : undefined\n return root\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\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,\n 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,\n root,\n value: {\n [wd]: JSON.parse(fs.readFileSync(path.resolve(wd, 'package.json'), 'utf-8'))\n }\n }\n}\n","import { getWorkspaceDir, isWorkspaceDir } 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 if (root !== undefined) {\n const isWorkspace = isWorkspaceDir(root, type)\n notWorkspace = !isWorkspace\n wd = root\n return { wd, notWorkspace }\n }\n try {\n wd = getWorkspaceDir(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","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 fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\nimport type { Config } from 'jiek'\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(process.cwd(), `${configName}.${ext}`),\n path.resolve(process.cwd(), `.${configName}.${ext}`),\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(): Config {\n const { wd: root, notWorkspace } = getWD()\n if (notWorkspace) {\n throw new Error('not in workspace')\n }\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 }\n if (!path.isAbsolute(configPath)) {\n configPath = path.resolve(root, configPath)\n }\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')) as Config\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 type { PluginImpl } from 'rollup'\n\ninterface Options {\n onEvent?: (event: string, message?: string) => void\n}\n\nexport default ((options = {}) => {\n const { onEvent } = options\n return {\n name: 'progress',\n buildStart: () => onEvent?.('start', 'Start building...'),\n buildEnd: () => onEvent?.('end', 'Build completed!'),\n resolveId: {\n order: 'post',\n handler: source => onEvent?.('resolve', `Resolving ${source}...`)\n },\n load: {\n order: 'post',\n handler: id => onEvent?.('load', `Loading ${id}...`)\n },\n transform: {\n order: 'post',\n handler: (_, id) => onEvent?.('transform', `Transforming ${id}...`)\n }\n }\n}) as PluginImpl<Options>\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 '../rollup/base'\n\nimport fs from 'node:fs'\nimport { dirname, resolve } from 'node:path'\n\nimport type { Entrypoints2ExportsOptions, RecursiveRecord } from '@jiek/pkger/entrypoints'\nimport {\n DEFAULT_SKIP_VALUES,\n entrypoints2Exports,\n filterLeafs,\n getAllLeafs,\n resolveEntrypoints\n} from '@jiek/pkger/entrypoints'\nimport { dts } from '@jiek/rollup-plugin-dts'\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport { nodeResolve } from '@rollup/plugin-node-resolve'\nimport terser from '@rollup/plugin-terser'\nimport { sendMessage } from 'execa'\nimport { parse } from 'jsonc-parser'\nimport { isMatch } from 'micromatch'\nimport type { OutputOptions, OutputPlugin, RollupOptions } from 'rollup'\nimport esbuild from 'rollup-plugin-esbuild'\nimport ts from 'typescript'\n\nimport { loadConfig } from '../utils/loadConfig'\nimport type { RollupProgressEvent, TemplateOptions } from './base'\nimport progress from './plugins/progress'\nimport skip from './plugins/skip'\nimport externalResolver from './utils/externalResolver'\n\ninterface PackageJSON {\n name?: string\n type?: string\n exports?: Record<string, unknown> | string | string[]\n}\n\nconst {\n JIEK_ROOT,\n JIEK_ENTRIES\n} = process.env\nconst WORKSPACE_ROOT = JIEK_ROOT ?? getWorkspaceDir()\nconst COMMON_OPTIONS = {} satisfies RollupOptions\nconst COMMON_PLUGINS = [\n json()\n]\n\nconst { build } = loadConfig()\nconst jsOutdir = resolve(\n (\n typeof build?.output?.dir === 'object'\n // the outdir only effect js output in this function\n ? build.output.dir.js\n : build?.output?.dir\n ) ?? 'dist'\n)\n\nconst STYLE_REGEXP = /\\.(css|s[ac]ss|less|styl)$/\n\n// eslint-disable-next-line unused-imports/no-unused-vars\nconst debug = (...args: unknown[]) => sendMessage({ type: 'debug', data: args } satisfies RollupProgressEvent)\n\nconst resolveWorkspacePath = (p: string) => resolve(WORKSPACE_ROOT, p)\n\nconst intersection = <T>(a: Set<T>, b: Set<T>) => new Set([...a].filter(i => b.has(i)))\n\nconst pascalCase = (str: string) =>\n str\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n .replace(/(?:^|-)(\\w)/g, (_, $1) => $1.toUpperCase())\n\nconst reveal = (obj: string | Record<string, unknown>, keys: string[]) =>\n keys.reduce((acc, key) => {\n if (typeof acc === 'string') throw new Error('key not found in exports')\n if (!(key in acc)) throw new Error(`key ${key} not found in exports`)\n return acc[key] as string | Record<string, unknown>\n }, obj)\n\nconst withMinify = (\n output: OutputOptions & {\n plugins?: OutputPlugin[]\n },\n minify = build?.output?.minify\n) =>\n minify === false\n ? [output]\n : minify === 'only-minify'\n ? [{\n ...output,\n // TODO replace suffix when pubish to npm and the `build.output.minify` is 'only-minify'\n // TODO resolve dts output file name\n file: output.file?.replace(/(\\.[cm]?js)$/, '.min$1'),\n plugins: [\n ...(output.plugins ?? []),\n terser()\n ]\n }]\n : [\n output,\n {\n ...output,\n file: output.file?.replace(/(\\.[cm]?js)$/, '.min$1'),\n plugins: [\n ...(output.plugins ?? []),\n terser()\n ]\n }\n ]\n\ntype TSConfig = {\n extends?: string | string[]\n compilerOptions?: Record<string, unknown>\n references?: { path: string }[]\n files?: string[]\n include?: string[]\n exclude?: string[]\n}\n\nconst getTSConfig = (p: string): TSConfig =>\n !fs.existsSync(p) || !fs.statSync(p).isFile()\n ? {}\n : parse(fs.readFileSync(p, 'utf-8'), [], { allowTrailingComma: true, allowEmptyContent: true })\n\nconst getExtendTSConfig = (tsconfigPath: string): TSConfig => {\n tsconfigPath = resolve(tsconfigPath)\n const tsconfigPathDirname = dirname(tsconfigPath)\n const { extends: exts, ...tsconfig } = getTSConfig(tsconfigPath)\n const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []\n\n const extendsPaths = resolvePaths(\n exts ? Array.isArray(exts) ? exts : [exts] : []\n )\n if (extendsPaths.length === 0) return tsconfig\n return extendsPaths\n .map(getExtendTSConfig)\n // https://www.typescriptlang.org/tsconfig/#files:~:text=Currently%2C%20the%20only%20top%2Dlevel%20property%20that%20is%20excluded%20from%20inheritance%20is%20references.\n // Currently, the only top-level property that is excluded from inheritance is references.\n .reduce((acc, { compilerOptions = {}, references: _, ...curr }) => ({\n ...acc,\n ...curr,\n compilerOptions: {\n ...acc.compilerOptions,\n ...compilerOptions\n }\n }), tsconfig)\n}\n\nconst getCompilerOptionsByFilePath = (tsconfigPath: string, filePath: string): Record<string, unknown> | undefined => {\n tsconfigPath = resolve(tsconfigPath)\n filePath = resolve(filePath)\n const tsconfigPathDirname = dirname(tsconfigPath)\n // https://www.typescriptlang.org/tsconfig/#files:~:text=It%E2%80%99s%20worth%20noting%20that%20files%2C%20include%2C%20and%20exclude%20from%20the%20inheriting%20config%20file%20overwrite%20those%20from%20the%20base%20config%20file%2C%20and%20that%20circularity%20between%20configuration%20files%20is%20not%20allowed.\n // It’s worth noting that files, include, and exclude from the inheriting config file overwrite\n // those from the base config file, and that circularity between configuration files is not allowed.\n const tsconfig = getExtendTSConfig(tsconfigPath)\n\n const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []\n\n const [\n references,\n files,\n include,\n exclude\n ] = [\n tsconfig.references?.map(({ path }) => path),\n tsconfig.files,\n tsconfig.include,\n tsconfig.exclude\n ].map(resolvePaths)\n if (exclude.length > 0 && exclude.some(i => isMatch(filePath, i))) return\n\n // when files or include is not empty, the tsconfig should be ignored\n if (tsconfig.files?.length === 0 && tsconfig.include?.length === 0) return\n let isInclude = false\n isInclude ||= files.length > 0 && files.includes(filePath)\n isInclude ||= include.length > 0 && include.some(i => isMatch(filePath, i))\n if (isInclude) {\n return tsconfig.compilerOptions ?? {}\n } else {\n // when files or include is not empty, but the file is not matched, the tsconfig should be ignored\n if (\n (tsconfig.files && tsconfig.files.length > 0)\n || (tsconfig.include && tsconfig.include.length > 0)\n ) return\n }\n\n references.reverse()\n for (const ref of references) {\n const compilerOptions = getCompilerOptionsByFilePath(ref, filePath)\n if (compilerOptions) return compilerOptions\n }\n return tsconfig.compilerOptions\n}\n\nconst generateConfigs = ({\n path,\n name,\n input,\n output,\n external,\n pkgIsModule,\n conditionals\n}: {\n path: string\n name: string\n input: string\n output: string\n external: (string | RegExp)[]\n pkgIsModule: boolean\n conditionals: string[]\n}, options: TemplateOptions = {}): RollupOptions[] => {\n const isModule = conditionals.includes('import')\n const isCommonJS = conditionals.includes('require')\n const isBrowser = conditionals.includes('browser')\n const dtsTSConfigPaths = [\n resolveWorkspacePath('tsconfig.json'),\n resolveWorkspacePath('tsconfig.dts.json')\n ]\n let dtsTSConfigPath: string | undefined\n dtsTSConfigPaths.forEach(p => {\n if (fs.existsSync(p) && fs.statSync(p).isFile()) {\n dtsTSConfigPath = p\n }\n })\n let compilerOptions: ts.CompilerOptions = {}\n if (dtsTSConfigPath) {\n const jsonCompilerOptions = getCompilerOptionsByFilePath(dtsTSConfigPath, resolve(input))\n const { options, errors } = ts.convertCompilerOptionsFromJson(\n jsonCompilerOptions,\n dirname(dtsTSConfigPath)\n )\n if (errors.length > 0) {\n throw new Error(errors.map(e => e.messageText).join('\\n'))\n }\n compilerOptions = options\n }\n const exportConditions = [...conditionals, ...(compilerOptions.customConditions ?? [])]\n const throughEventProps: RollupProgressEvent & { type: 'progress' } = {\n type: 'progress',\n data: { name, path, exportConditions, input }\n }\n const outdir = options?.output?.dir\n return [\n {\n input,\n external,\n output: [\n ...withMinify({\n file: output,\n name,\n sourcemap: typeof options?.output?.sourcemap === 'object'\n ? options.output.sourcemap.js\n : options?.output?.sourcemap ?? true,\n format: isModule ? 'esm' : (\n isCommonJS ? 'cjs' : (\n isBrowser ? 'umd' : (\n pkgIsModule ? 'esm' : 'cjs'\n )\n )\n ),\n strict: typeof options?.output?.strict === 'object'\n ? options.output.strict.js\n : options?.output?.strict\n })\n ],\n plugins: [\n nodeResolve({ exportConditions }),\n import('rollup-plugin-postcss')\n .then(({ default: postcss }) =>\n postcss({\n extract: resolve(output.replace(/\\.[cm]?js$/, '.css')),\n minimize: true\n })\n )\n .catch(() => void 0),\n esbuild(),\n progress({\n onEvent: (event, message) =>\n sendMessage(\n {\n ...throughEventProps,\n data: { ...throughEventProps.data, event, message, tags: ['js'] }\n } satisfies RollupProgressEvent\n )\n })\n ]\n },\n {\n input,\n external,\n output: [\n {\n dir: resolve((typeof outdir === 'object' ? outdir.dts : outdir) ?? 'dist'),\n sourcemap: typeof options?.output?.sourcemap === 'object'\n ? options.output.sourcemap.dts\n : options?.output?.sourcemap ?? true,\n entryFileNames: () =>\n output\n .replace(`${jsOutdir}/`, '')\n .replace(/(\\.[cm]?)js$/, '.d$1ts'),\n strict: typeof options?.output?.strict === 'object'\n ? options.output.strict.dts\n : options?.output?.strict\n }\n ],\n plugins: [\n nodeResolve({ exportConditions }),\n skip({ patterns: [STYLE_REGEXP] }),\n dts({\n respectExternal: true,\n compilerOptions\n }),\n progress({\n onEvent: (event, message) =>\n sendMessage(\n {\n ...throughEventProps,\n data: { ...throughEventProps.data, event, message, tags: ['dts'] }\n } satisfies RollupProgressEvent\n )\n })\n ]\n }\n ]\n}\n\nexport function template(packageJSON: PackageJSON): RollupOptions[] {\n const { name, type, exports: entrypoints } = packageJSON\n const pkgIsModule = type === 'module'\n if (!name) throw new Error('package.json name is required')\n if (!entrypoints) throw new Error('package.json exports is required')\n\n const entries = JIEK_ENTRIES\n ?.split(',')\n .map(e => e.trim())\n .map(e => ({\n 'index': '.'\n }[e] ?? e))\n\n const {\n crossModuleConvertor = true\n } = build ?? {}\n\n const packageName = pascalCase(name)\n\n const external = externalResolver(packageJSON as Record<string, unknown>)\n\n const [, resolvedEntrypoints] = resolveEntrypoints(entrypoints)\n if (entries) {\n Object\n .entries(resolvedEntrypoints)\n .forEach(([key]) => {\n if (!entries.some(e => isMatch(key, e, { matchBase: true }))) {\n delete resolvedEntrypoints[key]\n }\n })\n }\n const filteredResolvedEntrypoints = filterLeafs(\n resolvedEntrypoints as RecursiveRecord<string>,\n {\n skipValue: [\n // ignore values that filename starts with `.jk-noentry`\n /(^|\\/)\\.jk-noentry/,\n ...DEFAULT_SKIP_VALUES\n ]\n }\n )\n const crossModuleWithConditional: Entrypoints2ExportsOptions['withConditional'] = crossModuleConvertor\n ? {\n import: opts =>\n !pkgIsModule && intersection(\n new Set(opts.conditionals),\n new Set(['import', 'module'])\n ).size === 0\n ? opts.dist.replace(/\\.js$/, '.mjs')\n : false,\n require: opts => {\n return pkgIsModule && intersection(\n new Set(opts.conditionals),\n new Set(['require', 'node'])\n ).size === 0\n ? opts.dist.replace(/\\.js$/, '.cjs')\n : false\n }\n }\n : {}\n const exports = entrypoints2Exports(filteredResolvedEntrypoints, {\n outdir: jsOutdir,\n withConditional: {\n ...crossModuleWithConditional\n }\n })\n\n const leafMap = new Map<string, string[][]>()\n getAllLeafs(filteredResolvedEntrypoints as RecursiveRecord<string>, ({ keys, value }) => {\n if (typeof value === 'string') {\n const keysArr = leafMap.get(value) ?? []\n leafMap.set(value, keysArr)\n keysArr.push(keys)\n }\n return false\n })\n\n const configs: RollupOptions[] = []\n leafMap.forEach((keysArr, input) =>\n keysArr.forEach((keys) => {\n const [path, ...conditionals] = keys\n\n const name = packageName + (path === '.' ? '' : pascalCase(path))\n const keyExports = reveal(exports, keys)\n const commonOptions = {\n path,\n name,\n input,\n external,\n pkgIsModule\n }\n\n switch (typeof keyExports) {\n case 'string': {\n configs.push(...generateConfigs({\n ...commonOptions,\n output: keyExports,\n conditionals\n }, build))\n break\n }\n case 'object': {\n getAllLeafs(keyExports as RecursiveRecord<string>, ({ keys: nextKeys, value }) => {\n const allConditionals = [...new Set([...conditionals, ...nextKeys])]\n if (typeof value === 'string') {\n configs.push(...generateConfigs({\n ...commonOptions,\n output: value,\n conditionals: allConditionals\n }, build))\n }\n return false\n })\n break\n }\n }\n })\n )\n sendMessage(\n {\n type: 'init',\n data: {\n leafMap,\n targetsLength: configs.length\n }\n } satisfies RollupProgressEvent\n )\n return configs.map(c => ({\n ...COMMON_OPTIONS,\n ...c,\n plugins: [\n ...COMMON_PLUGINS,\n c.plugins\n ]\n }))\n}\n","import fs from 'node:fs'\n\nexport default function(json: Record<string, unknown>): (string | RegExp)[]\nexport default function(path?: string): (string | RegExp)[]\nexport default function(jsonOrPath: string | Record<string, unknown> = process.cwd()): (string | RegExp)[] {\n const pkg = typeof jsonOrPath === 'string'\n ? fs.existsSync(`${jsonOrPath}/package.json`)\n ? JSON.parse(fs.readFileSync(`${jsonOrPath}/package.json`, 'utf-8'))\n : {}\n : jsonOrPath\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":["root","getRoot","rootOption","program","getOptionValue","path","isAbsolute","resolve","process","cwd","wd","type","require","option","tsRegisterName","notWorkspace","getWD","isWorkspace","isWorkspaceDir","getWorkspaceDir","e","message","packageIsExist","name","registers","env","JIEK_TS_REGISTER","filter","Boolean","register","configName","progress","options","onEvent","buildStart","buildEnd","resolveId","order","handler","source","load","id","transform","_","skip","patterns","some","pattern","includes","test","JIEK_ROOT","JIEK_ENTRIES","WORKSPACE_ROOT","COMMON_OPTIONS","COMMON_PLUGINS","json","build","Error","configPath","fs","existsSync","isSupportTsLoader","configWithExtIsExist","ext","filenames","filename","lstatSync","isFile","getConfigPath","extname","module","readFileSync","default","loadConfig","jsOutdir","output","dir","js","STYLE_REGEXP","resolveWorkspacePath","p","intersection","a","b","Set","i","has","pascalCase","str","replace","$1","toUpperCase","withMinify","minify","file","plugins","terser","getExtendTSConfig","tsconfigPath","tsconfigPathDirname","dirname","extends","exts","tsconfig","statSync","parse","allowTrailingComma","allowEmptyContent","extendsPaths","paths","Array","isArray","map","length","reduce","acc","compilerOptions","references","curr","getCompilerOptionsByFilePath","filePath","files","include","exclude","isMatch","isInclude","reverse","ref","generateConfigs","input","external","pkgIsModule","conditionals","isModule","isCommonJS","isBrowser","dtsTSConfigPath","forEach","jsonCompilerOptions","errors","ts","convertCompilerOptionsFromJson","messageText","join","exportConditions","customConditions","throughEventProps","data","outdir","sourcemap","format","strict","nodeResolve","import","then","postcss","extract","minimize","catch","esbuild","event","sendMessage","tags","dts","entryFileNames","respectExternal","template","packageJSON","exports","entrypoints","entries","split","trim","index","crossModuleConvertor","packageName","jsonOrPath","pkg","JSON","dependencies","peerDependencies","optionalDependencies","Object","keys","concat","dep","RegExp","externalResolver","resolvedEntrypoints","resolveEntrypoints","key","matchBase","filteredResolvedEntrypoints","filterLeafs","skipValue","DEFAULT_SKIP_VALUES","entrypoints2Exports","withConditional","opts","size","dist","leafMap","Map","getAllLeafs","value","keysArr","get","set","push","configs","keyExports","obj","reveal","commonOptions","nextKeys","allConditionals","targetsLength","c"],"mappings":"svBAIA,IAAIA,EACG,SAASC,IACV,GAAAD,EAAa,OAAAA,EAEX,MAAAE,EAAaC,EAAQC,eAAe,QAMnC,OALPJ,EAAOE,EACHG,EAAKC,WAAWJ,GACdA,EACAG,EAAKE,QAAQC,QAAQC,MAAOP,QAC9B,EACGF,CACT,CCLO,ICLHU,EDKOC,EAAO,GAElB,IACEC,QAAQL,QAAQ,mCACTI,EAAA,MACT,CAAQ,MAAc,CACT,KAATA,GAECR,EAAAU,OAAO,wBAAyB,mBCZrC,ICGWC,EDHPC,GAAe,EAEZ,SAASC,IACV,GAAAN,EAAW,MAAA,CAAEA,KAAIK,gBAErB,MAAMf,EAAOC,IACb,QAAa,IAATD,EAAoB,CAChB,MAAAiB,EAAcC,EAAelB,EAAMW,GAGlC,OAFPI,GAAgBE,EACXP,EAAAV,EACE,CAAEU,KAAIK,eACf,CACI,IACFL,EAAKS,EAAgBR,SACdS,GAEP,KAAI,YAAaA,IAAmB,6BAAdA,EAAEC,QAIhB,MAAAD,EAHDV,EAAAV,EACUe,GAAA,CAInB,CACO,MAAA,CAAEL,KAAIK,eACf,CC9BA,SAASO,EAAeC,GAClB,IAEK,OADPX,QAAQL,QAAQgB,IACT,QACAH,GACA,OAAA,CACT,CACF,CAGA,MAAMI,EAAY,CAChBhB,QAAQiB,IAAIC,iBACZ,mBACA,qBACA,oBACAC,OAAOC,SACT,IAAA,MAAWC,KAAYL,EACjB,GAAAF,EAAeO,GAAW,CACXf,EAAAe,EACjB,KACF,CCVF,IAAIC,EAAa,cCJjB,IAAAC,EAAgB,CAACC,EAAU,CAAA,KACnB,MAAAC,QAAEA,GAAYD,EACb,MAAA,CACLT,KAAM,WACNW,W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,EAAgB,IAC3BqF,EACH1I,OAAQiI,EACRxE,aAAcmF,GACb/J,KAEE,CAAA,IAIb,MAGJyG,EACE,CACEtJ,KAAM,OACNwI,KAAM,CACJsD,UACAe,cAAeP,EAAQhG,UAItBgG,EAAQjG,KAAUyG,IAAA,IACpBpK,KACAoK,EACH1H,QAAS,IACJzC,EACHmK,EAAE1H,YAGR"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/utils/getRoot.ts","../../src/utils/filterSupport.ts","../../src/utils/getWD.ts","../../src/utils/tsRegister.ts","../../src/utils/loadConfig.ts","../../src/rollup/plugins/progress.ts","../../src/rollup/plugins/skip.ts","../../src/rollup/utils/externalResolver.ts","../../src/rollup/index.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 : undefined\n return root\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\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,\n 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,\n root,\n value: {\n [wd]: JSON.parse(fs.readFileSync(path.resolve(wd, 'package.json'), 'utf-8'))\n }\n }\n}\n","import { getWorkspaceDir, isWorkspaceDir } 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 if (root !== undefined) {\n const isWorkspace = isWorkspaceDir(root, type)\n notWorkspace = !isWorkspace\n wd = root\n return { wd, notWorkspace }\n }\n try {\n wd = getWorkspaceDir(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","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 fs from 'node:fs'\nimport path from 'node:path'\n\nimport { program } from 'commander'\nimport type { Config } from 'jiek'\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(process.cwd(), `${configName}.${ext}`),\n path.resolve(process.cwd(), `.${configName}.${ext}`),\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(): Config {\n const { wd: root, notWorkspace } = getWD()\n if (notWorkspace) {\n throw new Error('not in workspace')\n }\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 }\n if (!path.isAbsolute(configPath)) {\n configPath = path.resolve(root, configPath)\n }\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')) as Config\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 type { PluginImpl } from 'rollup'\n\ninterface Options {\n onEvent?: (event: string, message?: string) => void\n}\n\nexport default ((options = {}) => {\n const { onEvent } = options\n return {\n name: 'progress',\n buildStart: () => onEvent?.('start', 'Start building...'),\n buildEnd: () => onEvent?.('end', 'Build completed!'),\n resolveId: {\n order: 'post',\n handler: source => onEvent?.('resolve', `Resolving ${source}...`)\n },\n load: {\n order: 'post',\n handler: id => onEvent?.('load', `Loading ${id}...`)\n },\n transform: {\n order: 'post',\n handler: (_, id) => onEvent?.('transform', `Transforming ${id}...`)\n }\n }\n}) as PluginImpl<Options>\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 fs from 'node:fs'\n\nexport default function(json: Record<string, unknown>): (string | RegExp)[]\nexport default function(path?: string): (string | RegExp)[]\nexport default function(jsonOrPath: string | Record<string, unknown> = process.cwd()): (string | RegExp)[] {\n const pkg = typeof jsonOrPath === 'string'\n ? fs.existsSync(`${jsonOrPath}/package.json`)\n ? JSON.parse(fs.readFileSync(`${jsonOrPath}/package.json`, 'utf-8'))\n : {}\n : jsonOrPath\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","import '../rollup/base'\n\nimport fs from 'node:fs'\nimport { dirname, resolve } from 'node:path'\n\nimport type { Entrypoints2ExportsOptions, RecursiveRecord } from '@jiek/pkger/entrypoints'\nimport {\n DEFAULT_SKIP_VALUES,\n entrypoints2Exports,\n filterLeafs,\n getAllLeafs,\n resolveEntrypoints\n} from '@jiek/pkger/entrypoints'\nimport { dts } from '@jiek/rollup-plugin-dts'\nimport { getWorkspaceDir } from '@jiek/utils/getWorkspaceDir'\nimport json from '@rollup/plugin-json'\nimport { nodeResolve } from '@rollup/plugin-node-resolve'\nimport terser from '@rollup/plugin-terser'\nimport { sendMessage } from 'execa'\nimport { parse } from 'jsonc-parser'\nimport { isMatch } from 'micromatch'\nimport type { OutputOptions, OutputPlugin, RollupOptions } from 'rollup'\nimport esbuild from 'rollup-plugin-esbuild'\nimport ts from 'typescript'\n\nimport { loadConfig } from '../utils/loadConfig'\nimport type { RollupProgressEvent, TemplateOptions } from './base'\nimport progress from './plugins/progress'\nimport skip from './plugins/skip'\nimport externalResolver from './utils/externalResolver'\n\ninterface PackageJSON {\n name?: string\n type?: string\n exports?: Record<string, unknown> | string | string[]\n}\n\nconst {\n JIEK_ROOT,\n JIEK_ENTRIES\n} = process.env\nconst WORKSPACE_ROOT = JIEK_ROOT ?? getWorkspaceDir()\nconst COMMON_OPTIONS = {} satisfies RollupOptions\nconst COMMON_PLUGINS = [\n json()\n]\n\nconst { build } = loadConfig()\nconst jsOutdir = resolve(\n (\n typeof build?.output?.dir === 'object'\n // the outdir only effect js output in this function\n ? build.output.dir.js\n : build?.output?.dir\n ) ?? 'dist'\n)\n\nconst STYLE_REGEXP = /\\.(css|s[ac]ss|less|styl)$/\n\n// eslint-disable-next-line unused-imports/no-unused-vars\nconst debug = (...args: unknown[]) => sendMessage({ type: 'debug', data: args } satisfies RollupProgressEvent)\n\nconst resolveWorkspacePath = (p: string) => resolve(WORKSPACE_ROOT, p)\n\nconst intersection = <T>(a: Set<T>, b: Set<T>) => new Set([...a].filter(i => b.has(i)))\n\nconst pascalCase = (str: string) =>\n str\n .replace(/[@|/-](\\w)/g, (_, $1) => $1.toUpperCase())\n .replace(/(?:^|-)(\\w)/g, (_, $1) => $1.toUpperCase())\n\nconst reveal = (obj: string | Record<string, unknown>, keys: string[]) =>\n keys.reduce((acc, key) => {\n if (typeof acc === 'string') throw new Error('key not found in exports')\n if (!(key in acc)) throw new Error(`key ${key} not found in exports`)\n return acc[key] as string | Record<string, unknown>\n }, obj)\n\nconst withMinify = (\n output: OutputOptions & {\n plugins?: OutputPlugin[]\n },\n minify = build?.output?.minify\n) =>\n minify === false\n ? [output]\n : minify === 'only-minify'\n ? [{\n ...output,\n // TODO replace suffix when pubish to npm and the `build.output.minify` is 'only-minify'\n // TODO resolve dts output file name\n file: output.file?.replace(/(\\.[cm]?js)$/, '.min$1'),\n plugins: [\n ...(output.plugins ?? []),\n terser()\n ]\n }]\n : [\n output,\n {\n ...output,\n file: output.file?.replace(/(\\.[cm]?js)$/, '.min$1'),\n plugins: [\n ...(output.plugins ?? []),\n terser()\n ]\n }\n ]\n\ntype TSConfig = {\n extends?: string | string[]\n compilerOptions?: Record<string, unknown>\n references?: { path: string }[]\n files?: string[]\n include?: string[]\n exclude?: string[]\n}\n\nconst getTSConfig = (p: string): TSConfig =>\n !fs.existsSync(p) || !fs.statSync(p).isFile()\n ? {}\n : parse(fs.readFileSync(p, 'utf-8'), [], { allowTrailingComma: true, allowEmptyContent: true })\n\nconst getExtendTSConfig = (tsconfigPath: string): TSConfig => {\n tsconfigPath = resolve(tsconfigPath)\n const tsconfigPathDirname = dirname(tsconfigPath)\n const { extends: exts, ...tsconfig } = getTSConfig(tsconfigPath)\n const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []\n\n const extendsPaths = resolvePaths(\n exts ? Array.isArray(exts) ? exts : [exts] : []\n )\n if (extendsPaths.length === 0) return tsconfig\n return extendsPaths\n .map(getExtendTSConfig)\n // https://www.typescriptlang.org/tsconfig/#files:~:text=Currently%2C%20the%20only%20top%2Dlevel%20property%20that%20is%20excluded%20from%20inheritance%20is%20references.\n // Currently, the only top-level property that is excluded from inheritance is references.\n .reduce((acc, { compilerOptions = {}, references: _, ...curr }) => ({\n ...acc,\n ...curr,\n compilerOptions: {\n ...acc.compilerOptions,\n ...compilerOptions\n }\n }), tsconfig)\n}\n\nconst getCompilerOptionsByFilePath = (tsconfigPath: string, filePath: string): Record<string, unknown> | undefined => {\n tsconfigPath = resolve(tsconfigPath)\n filePath = resolve(filePath)\n const tsconfigPathDirname = dirname(tsconfigPath)\n // https://www.typescriptlang.org/tsconfig/#files:~:text=It%E2%80%99s%20worth%20noting%20that%20files%2C%20include%2C%20and%20exclude%20from%20the%20inheriting%20config%20file%20overwrite%20those%20from%20the%20base%20config%20file%2C%20and%20that%20circularity%20between%20configuration%20files%20is%20not%20allowed.\n // It’s worth noting that files, include, and exclude from the inheriting config file overwrite\n // those from the base config file, and that circularity between configuration files is not allowed.\n const tsconfig = getExtendTSConfig(tsconfigPath)\n\n const resolvePaths = (paths: string[] | undefined) => paths?.map(p => resolve(tsconfigPathDirname, p)) ?? []\n\n const [\n references,\n files,\n include,\n exclude\n ] = [\n tsconfig.references?.map(({ path }) => path),\n tsconfig.files,\n tsconfig.include,\n tsconfig.exclude\n ].map(resolvePaths)\n if (exclude.length > 0 && exclude.some(i => isMatch(filePath, i))) return\n\n // when files or include is not empty, the tsconfig should be ignored\n if (tsconfig.files?.length === 0 && tsconfig.include?.length === 0) return\n let isInclude = false\n isInclude ||= files.length > 0 && files.includes(filePath)\n isInclude ||= include.length > 0 && include.some(i => isMatch(filePath, i))\n if (isInclude) {\n return tsconfig.compilerOptions ?? {}\n } else {\n // when files or include is not empty, but the file is not matched, the tsconfig should be ignored\n if (\n (tsconfig.files && tsconfig.files.length > 0)\n || (tsconfig.include && tsconfig.include.length > 0)\n ) return\n }\n\n references.reverse()\n for (const ref of references) {\n const compilerOptions = getCompilerOptionsByFilePath(ref, filePath)\n if (compilerOptions) return compilerOptions\n }\n return tsconfig.compilerOptions\n}\n\nconst generateConfigs = ({\n path,\n name,\n input,\n output,\n external,\n pkgIsModule,\n conditionals\n}: {\n path: string\n name: string\n input: string\n output: string\n external: (string | RegExp)[]\n pkgIsModule: boolean\n conditionals: string[]\n}, options: TemplateOptions = {}): RollupOptions[] => {\n const isModule = conditionals.includes('import')\n const isCommonJS = conditionals.includes('require')\n const isBrowser = conditionals.includes('browser')\n const dtsTSConfigPaths = [\n resolveWorkspacePath('tsconfig.json'),\n resolveWorkspacePath('tsconfig.dts.json')\n ]\n let dtsTSConfigPath: string | undefined\n dtsTSConfigPaths.forEach(p => {\n if (fs.existsSync(p) && fs.statSync(p).isFile()) {\n dtsTSConfigPath = p\n }\n })\n let compilerOptions: ts.CompilerOptions = {}\n if (dtsTSConfigPath) {\n const jsonCompilerOptions = getCompilerOptionsByFilePath(dtsTSConfigPath, resolve(input))\n const { options, errors } = ts.convertCompilerOptionsFromJson(\n jsonCompilerOptions,\n dirname(dtsTSConfigPath)\n )\n if (errors.length > 0) {\n throw new Error(errors.map(e => e.messageText).join('\\n'))\n }\n compilerOptions = options\n }\n const exportConditions = [...conditionals, ...(compilerOptions.customConditions ?? [])]\n const throughEventProps: RollupProgressEvent & { type: 'progress' } = {\n type: 'progress',\n data: { name, path, exportConditions, input }\n }\n const outdir = options?.output?.dir\n return [\n {\n input,\n external,\n output: [\n ...withMinify({\n file: output,\n name,\n sourcemap: typeof options?.output?.sourcemap === 'object'\n ? options.output.sourcemap.js\n : options?.output?.sourcemap ?? true,\n format: isModule ? 'esm' : (\n isCommonJS ? 'cjs' : (\n isBrowser ? 'umd' : (\n pkgIsModule ? 'esm' : 'cjs'\n )\n )\n ),\n strict: typeof options?.output?.strict === 'object'\n ? options.output.strict.js\n : options?.output?.strict\n })\n ],\n plugins: [\n nodeResolve({ exportConditions }),\n import('rollup-plugin-postcss')\n .then(({ default: postcss }) =>\n postcss({\n extract: resolve(output.replace(/\\.[cm]?js$/, '.css')),\n minimize: true\n })\n )\n .catch(() => void 0),\n esbuild(),\n progress({\n onEvent: (event, message) =>\n sendMessage(\n {\n ...throughEventProps,\n data: { ...throughEventProps.data, event, message, tags: ['js'] }\n } satisfies RollupProgressEvent\n )\n })\n ]\n },\n {\n input,\n external,\n output: [\n {\n dir: resolve((typeof outdir === 'object' ? outdir.dts : outdir) ?? 'dist'),\n sourcemap: typeof options?.output?.sourcemap === 'object'\n ? options.output.sourcemap.dts\n : options?.output?.sourcemap ?? true,\n entryFileNames: () =>\n output\n .replace(`${jsOutdir}/`, '')\n .replace(/(\\.[cm]?)js$/, '.d$1ts'),\n strict: typeof options?.output?.strict === 'object'\n ? options.output.strict.dts\n : options?.output?.strict\n }\n ],\n plugins: [\n nodeResolve({ exportConditions }),\n skip({ patterns: [STYLE_REGEXP] }),\n dts({\n respectExternal: true,\n compilerOptions\n }),\n progress({\n onEvent: (event, message) =>\n sendMessage(\n {\n ...throughEventProps,\n data: { ...throughEventProps.data, event, message, tags: ['dts'] }\n } satisfies RollupProgressEvent\n )\n })\n ]\n }\n ]\n}\n\nexport function template(packageJSON: PackageJSON): RollupOptions[] {\n const { name, type, exports: entrypoints } = packageJSON\n const pkgIsModule = type === 'module'\n if (!name) throw new Error('package.json name is required')\n if (!entrypoints) throw new Error('package.json exports is required')\n\n const entries = JIEK_ENTRIES\n ?.split(',')\n .map(e => e.trim())\n .map(e => ({\n 'index': '.'\n }[e] ?? e))\n\n const {\n crossModuleConvertor = true\n } = build ?? {}\n\n const packageName = pascalCase(name)\n\n const external = externalResolver(packageJSON as Record<string, unknown>)\n\n const [, resolvedEntrypoints] = resolveEntrypoints(entrypoints)\n if (entries) {\n Object\n .entries(resolvedEntrypoints)\n .forEach(([key]) => {\n if (!entries.some(e => isMatch(key, e, { matchBase: true }))) {\n delete resolvedEntrypoints[key]\n }\n })\n }\n const filteredResolvedEntrypoints = filterLeafs(\n resolvedEntrypoints as RecursiveRecord<string>,\n {\n skipValue: [\n // ignore values that filename starts with `.jk-noentry`\n /(^|\\/)\\.jk-noentry/,\n ...DEFAULT_SKIP_VALUES\n ]\n }\n )\n const crossModuleWithConditional: Entrypoints2ExportsOptions['withConditional'] = crossModuleConvertor\n ? {\n import: opts =>\n !pkgIsModule && intersection(\n new Set(opts.conditionals),\n new Set(['import', 'module'])\n ).size === 0\n ? opts.dist.replace(/\\.js$/, '.mjs')\n : false,\n require: opts => {\n return pkgIsModule && intersection(\n new Set(opts.conditionals),\n new Set(['require', 'node'])\n ).size === 0\n ? opts.dist.replace(/\\.js$/, '.cjs')\n : false\n }\n }\n : {}\n const exports = entrypoints2Exports(filteredResolvedEntrypoints, {\n outdir: jsOutdir,\n withConditional: {\n ...crossModuleWithConditional\n }\n })\n\n const leafMap = new Map<string, string[][]>()\n getAllLeafs(filteredResolvedEntrypoints as RecursiveRecord<string>, ({ keys, value }) => {\n if (typeof value === 'string') {\n const keysArr = leafMap.get(value) ?? []\n leafMap.set(value, keysArr)\n keysArr.push(keys)\n }\n return false\n })\n\n const configs: RollupOptions[] = []\n leafMap.forEach((keysArr, input) =>\n keysArr.forEach((keys) => {\n const [path, ...conditionals] = keys\n\n const name = packageName + (path === '.' ? '' : pascalCase(path))\n const keyExports = reveal(exports, keys)\n const commonOptions = {\n path,\n name,\n input,\n external,\n pkgIsModule\n }\n\n switch (typeof keyExports) {\n case 'string': {\n configs.push(...generateConfigs({\n ...commonOptions,\n output: keyExports,\n conditionals\n }, build))\n break\n }\n case 'object': {\n getAllLeafs(keyExports as RecursiveRecord<string>, ({ keys: nextKeys, value }) => {\n const allConditionals = [...new Set([...conditionals, ...nextKeys])]\n if (typeof value === 'string') {\n configs.push(...generateConfigs({\n ...commonOptions,\n output: value,\n conditionals: allConditionals\n }, build))\n }\n return false\n })\n break\n }\n }\n })\n )\n sendMessage(\n {\n type: 'init',\n data: {\n leafMap,\n targetsLength: configs.length\n }\n } satisfies RollupProgressEvent\n )\n return configs.map(c => ({\n ...COMMON_OPTIONS,\n ...c,\n plugins: [\n ...COMMON_PLUGINS,\n c.plugins\n ]\n }))\n}\n"],"names":["options","name"],"mappings":";;;;;;;;;;;;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