@sanity/pkg-utils 7.8.0 → 7.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,17 +61,49 @@ function resolveRolldownConfig(ctx, buildTask) {
61
61
  rolldownPluginDts.dts({
62
62
  emitDtsOnly: !0,
63
63
  tsconfig: ctx.ts.configPath || "tsconfig.json",
64
- tsgo: typeof pkg.devDependencies == "object" && "@typescript/native-preview" in pkg.devDependencies
64
+ tsgo: typeof pkg.devDependencies == "object" && "@typescript/native-preview" in pkg.devDependencies,
65
+ resolve: ctx.bundledPackages
65
66
  })
66
67
  ],
67
68
  treeshake: !0
68
69
  }, outputOptions = {
69
70
  dir: outDir,
70
71
  entryFileNames,
72
+ chunkFileNames: buildTask.type === "rolldown:dts" ? `_chunks-dts/[name]${outputExt}` : void 0,
71
73
  esModule: !0,
72
74
  format: buildTask.type === "rolldown:dts" ? "es" : format,
73
75
  sourcemap: buildTask.type === "rolldown:dts" ? !1 : config?.sourcemap ?? !0,
74
76
  hoistTransitiveImports: !1
77
+ /**
78
+ * rolldown doesn't permit disabling chunks, we can only choose between automatic chunking (the default)
79
+ * and manual chunking (using advancedChunks).
80
+ * This matters for how we generate dts files.
81
+ * While we use rolldown for dts generation, and rollup for the rest, we want to reduce the amount of dts files emitted as chunks,
82
+ * and to make them predictable in how they're generated.
83
+ */
84
+ // @TODO the following breaks the dts generation, report bug to rolldown
85
+ // advancedChunks:
86
+ // buildTask.type === 'rolldown:dts'
87
+ // ? {
88
+ // groups: [
89
+ // {
90
+ // /**
91
+ // * Groups all inlined typings specified by bundledPackages in extract.bundledPackages to its own chunk.
92
+ // */
93
+ // name: 'bundled-packages',
94
+ // test: (id) => ctx.bundledPackages.includes(id),
95
+ // priority: 1,
96
+ // },
97
+ // {
98
+ // /**
99
+ // * Put all other shared chunks into a single chunk.
100
+ // */
101
+ // name: 'shared',
102
+ // minShareCount: 1,
103
+ // },
104
+ // ],
105
+ // }
106
+ // : {},
75
107
  };
76
108
  return { inputOptions, outputOptions };
77
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolveRolldownConfig.cjs","sources":["../../src/node/tasks/rolldown/resolveRolldownConfig.ts"],"sourcesContent":["import path from 'node:path'\nimport type {InputOptions, OutputOptions} from 'rolldown'\nimport {dts as dtsPlugin} from 'rolldown-plugin-dts'\nimport type {BuildContext} from '../../core/contexts/buildContext'\nimport {pkgExtMap as extMap} from '../../core/pkg/pkgExt'\nimport type {RolldownDtsTask} from '../types'\n\nexport interface RolldownConfig {\n inputOptions: InputOptions\n outputOptions: OutputOptions\n}\n\nexport function resolveRolldownConfig(\n ctx: BuildContext,\n buildTask: RolldownDtsTask,\n): RolldownConfig {\n const {format, runtime, target} = buildTask\n const {config, cwd, exports: _exports, external, distPath, logger, pkg, ts} = ctx\n const outputExt = extMap[pkg.type || 'commonjs'][format]\n const outDir = path.relative(cwd, distPath)\n\n const pathAliases = Object.fromEntries(\n Object.entries(ts.config?.options.paths || {}).map(([key, val]) => {\n return [key, path.resolve(cwd, ts.config?.options.baseUrl || '.', val[0]!)]\n }),\n )\n\n const entries = buildTask.entries.map((entry) => {\n return {\n ...entry,\n name: path.relative(outDir, entry.output).replace(/\\.[^/.]+$/, ''),\n }\n }, {})\n\n const exportIds =\n _exports && Object.keys(_exports).map((exportPath) => path.join(pkg.name, exportPath))\n\n const sourcePaths = _exports && Object.values(_exports).map((e) => path.resolve(cwd, e.source))\n\n const replacements = Object.fromEntries(\n Object.entries(config?.define || {}).map(([key, val]) => [key, JSON.stringify(val)]),\n )\n\n const entryFileNames = `[name]${outputExt}`\n\n const inputOptions = {\n cwd,\n jsx: {\n mode:\n config?.jsx === 'automatic'\n ? 'automatic'\n : config?.jsx === 'preserve'\n ? 'preserve'\n : config?.jsx === 'transform'\n ? 'classic'\n : 'automatic',\n factory: config?.jsxFactory,\n fragment: config?.jsxFragment,\n importSource: config?.jsxImportSource,\n },\n define:\n pkg.name === '@sanity/pkg-utils'\n ? {...replacements}\n : {\n 'process.env.PKG_FORMAT': JSON.stringify(format),\n 'process.env.PKG_RUNTIME': JSON.stringify(runtime),\n 'process.env.PKG_VERSION': JSON.stringify(process.env['PKG_VERSION'] || pkg.version),\n ...replacements,\n },\n\n platform:\n buildTask.type === 'rolldown:dts'\n ? 'node'\n : runtime === 'node'\n ? 'node'\n : runtime === 'browser'\n ? 'browser'\n : 'neutral',\n\n resolve: {\n alias: pathAliases,\n tsconfigFilename: ctx.ts.configPath || 'tsconfig.json',\n },\n transform: {\n target,\n },\n experimental: {\n attachDebugInfo: 'none',\n },\n\n external: (id, importer) => {\n // Check if the id is a self-referencing import\n if (exportIds?.includes(id)) {\n return true\n }\n\n // Check if the id is a file path that points to an exported source file\n if (importer && (id.startsWith('.') || id.startsWith('/'))) {\n const idPath = path.resolve(path.dirname(importer), id)\n\n if (sourcePaths?.includes(idPath)) {\n logger.warn(\n `detected self-referencing import – treating as external: ${path.relative(\n cwd,\n idPath,\n )}`,\n )\n\n return true\n }\n }\n\n const idParts = id.split('/')\n\n const name = idParts[0]!.startsWith('@') ? `${idParts[0]}/${idParts[1]}` : idParts[0]\n\n if (name && external.includes(name)) {\n return true\n }\n\n return false\n },\n\n input: entries.reduce<{[entryAlias: string]: string}>(\n (acc, entry) => Object.assign(acc, {[entry.name]: entry.source}),\n {},\n ),\n\n plugins: [\n dtsPlugin({\n emitDtsOnly: true,\n tsconfig: ctx.ts.configPath || 'tsconfig.json',\n tsgo:\n typeof pkg.devDependencies === 'object' &&\n '@typescript/native-preview' in pkg.devDependencies,\n }),\n ],\n\n treeshake: true,\n } satisfies InputOptions\n const outputOptions = {\n dir: outDir,\n entryFileNames,\n esModule: true,\n format: buildTask.type === 'rolldown:dts' ? 'es' : format,\n sourcemap: buildTask.type === 'rolldown:dts' ? false : (config?.sourcemap ?? true),\n hoistTransitiveImports: false,\n } satisfies OutputOptions\n\n return {inputOptions, outputOptions}\n}\n"],"names":["extMap","path","dtsPlugin"],"mappings":";;;;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MAAM,QAAO;AAAA,MAC/D,CAAA;AAAA,IAAC;AAAA,IAGH,SAAS;AAAA,MACPC,sBAAU;AAAA,QACR,aAAa;AAAA,QACb,UAAU,IAAI,GAAG,cAAc;AAAA,QAC/B,MACE,OAAO,IAAI,mBAAoB,YAC/B,gCAAgC,IAAI;AAAA,MAAA,CACvC;AAAA,IAAA;AAAA,IAGH,WAAW;AAAA,EAAA,GAEP,gBAAgB;AAAA,IACpB,KAAK;AAAA,IACL;AAAA,IACA,UAAU;AAAA,IACV,QAAQ,UAAU,SAAS,iBAAiB,OAAO;AAAA,IACnD,WAAW,UAAU,SAAS,iBAAiB,KAAS,QAAQ,aAAa;AAAA,IAC7E,wBAAwB;AAAA,EAAA;AAG1B,SAAO,EAAC,cAAc,cAAA;AACxB;;"}
1
+ {"version":3,"file":"resolveRolldownConfig.cjs","sources":["../../src/node/tasks/rolldown/resolveRolldownConfig.ts"],"sourcesContent":["import path from 'node:path'\nimport type {InputOptions, OutputOptions} from 'rolldown'\nimport {dts as dtsPlugin} from 'rolldown-plugin-dts'\nimport type {BuildContext} from '../../core/contexts/buildContext'\nimport {pkgExtMap as extMap} from '../../core/pkg/pkgExt'\nimport type {RolldownDtsTask} from '../types'\n\nexport interface RolldownConfig {\n inputOptions: InputOptions\n outputOptions: OutputOptions\n}\n\nexport function resolveRolldownConfig(\n ctx: BuildContext,\n buildTask: RolldownDtsTask,\n): RolldownConfig {\n const {format, runtime, target} = buildTask\n const {config, cwd, exports: _exports, external, distPath, logger, pkg, ts} = ctx\n const outputExt = extMap[pkg.type || 'commonjs'][format]\n const outDir = path.relative(cwd, distPath)\n\n const pathAliases = Object.fromEntries(\n Object.entries(ts.config?.options.paths || {}).map(([key, val]) => {\n return [key, path.resolve(cwd, ts.config?.options.baseUrl || '.', val[0]!)]\n }),\n )\n\n const entries = buildTask.entries.map((entry) => {\n return {\n ...entry,\n name: path.relative(outDir, entry.output).replace(/\\.[^/.]+$/, ''),\n }\n }, {})\n\n const exportIds =\n _exports && Object.keys(_exports).map((exportPath) => path.join(pkg.name, exportPath))\n\n const sourcePaths = _exports && Object.values(_exports).map((e) => path.resolve(cwd, e.source))\n\n const replacements = Object.fromEntries(\n Object.entries(config?.define || {}).map(([key, val]) => [key, JSON.stringify(val)]),\n )\n\n const entryFileNames = `[name]${outputExt}`\n\n const inputOptions = {\n cwd,\n jsx: {\n mode:\n config?.jsx === 'automatic'\n ? 'automatic'\n : config?.jsx === 'preserve'\n ? 'preserve'\n : config?.jsx === 'transform'\n ? 'classic'\n : 'automatic',\n factory: config?.jsxFactory,\n fragment: config?.jsxFragment,\n importSource: config?.jsxImportSource,\n },\n define:\n pkg.name === '@sanity/pkg-utils'\n ? {...replacements}\n : {\n 'process.env.PKG_FORMAT': JSON.stringify(format),\n 'process.env.PKG_RUNTIME': JSON.stringify(runtime),\n 'process.env.PKG_VERSION': JSON.stringify(process.env['PKG_VERSION'] || pkg.version),\n ...replacements,\n },\n\n platform:\n buildTask.type === 'rolldown:dts'\n ? 'node'\n : runtime === 'node'\n ? 'node'\n : runtime === 'browser'\n ? 'browser'\n : 'neutral',\n\n resolve: {\n alias: pathAliases,\n tsconfigFilename: ctx.ts.configPath || 'tsconfig.json',\n },\n transform: {\n target,\n },\n experimental: {\n attachDebugInfo: 'none',\n },\n\n external: (id, importer) => {\n // Check if the id is a self-referencing import\n if (exportIds?.includes(id)) {\n return true\n }\n\n // Check if the id is a file path that points to an exported source file\n if (importer && (id.startsWith('.') || id.startsWith('/'))) {\n const idPath = path.resolve(path.dirname(importer), id)\n\n if (sourcePaths?.includes(idPath)) {\n logger.warn(\n `detected self-referencing import – treating as external: ${path.relative(\n cwd,\n idPath,\n )}`,\n )\n\n return true\n }\n }\n\n const idParts = id.split('/')\n\n const name = idParts[0]!.startsWith('@') ? `${idParts[0]}/${idParts[1]}` : idParts[0]\n\n if (name && external.includes(name)) {\n return true\n }\n\n return false\n },\n\n input: entries.reduce<{[entryAlias: string]: string}>(\n (acc, entry) => Object.assign(acc, {[entry.name]: entry.source}),\n {},\n ),\n\n plugins: [\n dtsPlugin({\n emitDtsOnly: true,\n tsconfig: ctx.ts.configPath || 'tsconfig.json',\n tsgo:\n typeof pkg.devDependencies === 'object' &&\n '@typescript/native-preview' in pkg.devDependencies,\n resolve: ctx.bundledPackages,\n }),\n ],\n\n treeshake: true,\n } satisfies InputOptions\n const outputOptions = {\n dir: outDir,\n entryFileNames,\n chunkFileNames:\n buildTask.type === 'rolldown:dts' ? `_chunks-dts/[name]${outputExt}` : undefined,\n esModule: true,\n format: buildTask.type === 'rolldown:dts' ? 'es' : format,\n sourcemap: buildTask.type === 'rolldown:dts' ? false : (config?.sourcemap ?? true),\n hoistTransitiveImports: false,\n /**\n * rolldown doesn't permit disabling chunks, we can only choose between automatic chunking (the default)\n * and manual chunking (using advancedChunks).\n * This matters for how we generate dts files.\n * While we use rolldown for dts generation, and rollup for the rest, we want to reduce the amount of dts files emitted as chunks,\n * and to make them predictable in how they're generated.\n */\n // @TODO the following breaks the dts generation, report bug to rolldown\n // advancedChunks:\n // buildTask.type === 'rolldown:dts'\n // ? {\n // groups: [\n // {\n // /**\n // * Groups all inlined typings specified by bundledPackages in extract.bundledPackages to its own chunk.\n // */\n // name: 'bundled-packages',\n // test: (id) => ctx.bundledPackages.includes(id),\n // priority: 1,\n // },\n // {\n // /**\n // * Put all other shared chunks into a single chunk.\n // */\n // name: 'shared',\n // minShareCount: 1,\n // },\n // ],\n // }\n // : {},\n } satisfies OutputOptions\n\n return {inputOptions, outputOptions}\n}\n"],"names":["extMap","path","dtsPlugin"],"mappings":";;;;;;AAYO,SAAS,sBACd,KACA,WACgB;AAChB,QAAM,EAAC,QAAQ,SAAS,OAAA,IAAU,WAC5B,EAAC,QAAQ,KAAK,SAAS,UAAU,UAAU,UAAU,QAAQ,KAAK,GAAA,IAAM,KACxE,YAAYA,MAAAA,UAAO,IAAI,QAAQ,UAAU,EAAE,MAAM,GACjD,SAASC,cAAAA,QAAK,SAAS,KAAK,QAAQ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IAGH,WAAW;AAAA,EAAA,GAEP,gBAAgB;AAAA,IACpB,KAAK;AAAA,IACL;AAAA,IACA,gBACE,UAAU,SAAS,iBAAiB,qBAAqB,SAAS,KAAK;AAAA,IACzE,UAAU;AAAA,IACV,QAAQ,UAAU,SAAS,iBAAiB,OAAO;AAAA,IACnD,WAAW,UAAU,SAAS,iBAAiB,KAAS,QAAQ,aAAa;AAAA,IAC7E,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAiC1B,SAAO,EAAC,cAAc,cAAA;AACxB;;"}
@@ -58,17 +58,49 @@ function resolveRolldownConfig(ctx, buildTask) {
58
58
  dts({
59
59
  emitDtsOnly: !0,
60
60
  tsconfig: ctx.ts.configPath || "tsconfig.json",
61
- tsgo: typeof pkg.devDependencies == "object" && "@typescript/native-preview" in pkg.devDependencies
61
+ tsgo: typeof pkg.devDependencies == "object" && "@typescript/native-preview" in pkg.devDependencies,
62
+ resolve: ctx.bundledPackages
62
63
  })
63
64
  ],
64
65
  treeshake: !0
65
66
  }, outputOptions = {
66
67
  dir: outDir,
67
68
  entryFileNames,
69
+ chunkFileNames: buildTask.type === "rolldown:dts" ? `_chunks-dts/[name]${outputExt}` : void 0,
68
70
  esModule: !0,
69
71
  format: buildTask.type === "rolldown:dts" ? "es" : format,
70
72
  sourcemap: buildTask.type === "rolldown:dts" ? !1 : config?.sourcemap ?? !0,
71
73
  hoistTransitiveImports: !1
74
+ /**
75
+ * rolldown doesn't permit disabling chunks, we can only choose between automatic chunking (the default)
76
+ * and manual chunking (using advancedChunks).
77
+ * This matters for how we generate dts files.
78
+ * While we use rolldown for dts generation, and rollup for the rest, we want to reduce the amount of dts files emitted as chunks,
79
+ * and to make them predictable in how they're generated.
80
+ */
81
+ // @TODO the following breaks the dts generation, report bug to rolldown
82
+ // advancedChunks:
83
+ // buildTask.type === 'rolldown:dts'
84
+ // ? {
85
+ // groups: [
86
+ // {
87
+ // /**
88
+ // * Groups all inlined typings specified by bundledPackages in extract.bundledPackages to its own chunk.
89
+ // */
90
+ // name: 'bundled-packages',
91
+ // test: (id) => ctx.bundledPackages.includes(id),
92
+ // priority: 1,
93
+ // },
94
+ // {
95
+ // /**
96
+ // * Put all other shared chunks into a single chunk.
97
+ // */
98
+ // name: 'shared',
99
+ // minShareCount: 1,
100
+ // },
101
+ // ],
102
+ // }
103
+ // : {},
72
104
  };
73
105
  return { inputOptions, outputOptions };
74
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolveRolldownConfig.js","sources":["../../src/node/tasks/rolldown/resolveRolldownConfig.ts"],"sourcesContent":["import path from 'node:path'\nimport type {InputOptions, OutputOptions} from 'rolldown'\nimport {dts as dtsPlugin} from 'rolldown-plugin-dts'\nimport type {BuildContext} from '../../core/contexts/buildContext'\nimport {pkgExtMap as extMap} from '../../core/pkg/pkgExt'\nimport type {RolldownDtsTask} from '../types'\n\nexport interface RolldownConfig {\n inputOptions: InputOptions\n outputOptions: OutputOptions\n}\n\nexport function resolveRolldownConfig(\n ctx: BuildContext,\n buildTask: RolldownDtsTask,\n): RolldownConfig {\n const {format, runtime, target} = buildTask\n const {config, cwd, exports: _exports, external, distPath, logger, pkg, ts} = ctx\n const outputExt = extMap[pkg.type || 'commonjs'][format]\n const outDir = path.relative(cwd, distPath)\n\n const pathAliases = Object.fromEntries(\n Object.entries(ts.config?.options.paths || {}).map(([key, val]) => {\n return [key, path.resolve(cwd, ts.config?.options.baseUrl || '.', val[0]!)]\n }),\n )\n\n const entries = buildTask.entries.map((entry) => {\n return {\n ...entry,\n name: path.relative(outDir, entry.output).replace(/\\.[^/.]+$/, ''),\n }\n }, {})\n\n const exportIds =\n _exports && Object.keys(_exports).map((exportPath) => path.join(pkg.name, exportPath))\n\n const sourcePaths = _exports && Object.values(_exports).map((e) => path.resolve(cwd, e.source))\n\n const replacements = Object.fromEntries(\n Object.entries(config?.define || {}).map(([key, val]) => [key, JSON.stringify(val)]),\n )\n\n const entryFileNames = `[name]${outputExt}`\n\n const inputOptions = {\n cwd,\n jsx: {\n mode:\n config?.jsx === 'automatic'\n ? 'automatic'\n : config?.jsx === 'preserve'\n ? 'preserve'\n : config?.jsx === 'transform'\n ? 'classic'\n : 'automatic',\n factory: config?.jsxFactory,\n fragment: config?.jsxFragment,\n importSource: config?.jsxImportSource,\n },\n define:\n pkg.name === '@sanity/pkg-utils'\n ? {...replacements}\n : {\n 'process.env.PKG_FORMAT': JSON.stringify(format),\n 'process.env.PKG_RUNTIME': JSON.stringify(runtime),\n 'process.env.PKG_VERSION': JSON.stringify(process.env['PKG_VERSION'] || pkg.version),\n ...replacements,\n },\n\n platform:\n buildTask.type === 'rolldown:dts'\n ? 'node'\n : runtime === 'node'\n ? 'node'\n : runtime === 'browser'\n ? 'browser'\n : 'neutral',\n\n resolve: {\n alias: pathAliases,\n tsconfigFilename: ctx.ts.configPath || 'tsconfig.json',\n },\n transform: {\n target,\n },\n experimental: {\n attachDebugInfo: 'none',\n },\n\n external: (id, importer) => {\n // Check if the id is a self-referencing import\n if (exportIds?.includes(id)) {\n return true\n }\n\n // Check if the id is a file path that points to an exported source file\n if (importer && (id.startsWith('.') || id.startsWith('/'))) {\n const idPath = path.resolve(path.dirname(importer), id)\n\n if (sourcePaths?.includes(idPath)) {\n logger.warn(\n `detected self-referencing import – treating as external: ${path.relative(\n cwd,\n idPath,\n )}`,\n )\n\n return true\n }\n }\n\n const idParts = id.split('/')\n\n const name = idParts[0]!.startsWith('@') ? `${idParts[0]}/${idParts[1]}` : idParts[0]\n\n if (name && external.includes(name)) {\n return true\n }\n\n return false\n },\n\n input: entries.reduce<{[entryAlias: string]: string}>(\n (acc, entry) => Object.assign(acc, {[entry.name]: entry.source}),\n {},\n ),\n\n plugins: [\n dtsPlugin({\n emitDtsOnly: true,\n tsconfig: ctx.ts.configPath || 'tsconfig.json',\n tsgo:\n typeof pkg.devDependencies === 'object' &&\n '@typescript/native-preview' in pkg.devDependencies,\n }),\n ],\n\n treeshake: true,\n } satisfies InputOptions\n const outputOptions = {\n dir: outDir,\n entryFileNames,\n esModule: true,\n format: buildTask.type === 'rolldown:dts' ? 'es' : format,\n sourcemap: buildTask.type === 'rolldown:dts' ? false : (config?.sourcemap ?? true),\n hoistTransitiveImports: false,\n } satisfies OutputOptions\n\n return {inputOptions, outputOptions}\n}\n"],"names":["extMap","dtsPlugin"],"mappings":";;;AAYO,SAAS,sBACd,KACA,WACgB;AAChB,QAAM,EAAC,QAAQ,SAAS,OAAA,IAAU,WAC5B,EAAC,QAAQ,KAAK,SAAS,UAAU,UAAU,UAAU,QAAQ,KAAK,GAAA,IAAM,KACxE,YAAYA,UAAO,IAAI,QAAQ,UAAU,EAAE,MAAM,GACjD,SAAS,KAAK,SAAS,KAAK,QAAQ,GAEpC,cAAc,OAAO;AAAA,IACzB,OAAO,QAAQ,GAAG,QAAQ,QAAQ,SAAS,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,KAAK,GAAG,MACpD,CAAC,KAAK,KAAK,QAAQ,KAAK,GAAG,QAAQ,QAAQ,WAAW,KAAK,IAAI,CAAC,CAAE,CAAC,CAC3E;AAAA,EAAA,GAGG,UAAU,UAAU,QAAQ,IAAI,CAAC,WAC9B;AAAA,IACL,GAAG;AAAA,IACH,MAAM,KAAK,SAAS,QAAQ,MAAM,MAAM,EAAE,QAAQ,aAAa,EAAE;AAAA,EAAA,IAElE,CAAA,CAAE,GAEC,YACJ,YAAY,OAAO,KAAK,QAAQ,EAAE,IAAI,CAAC,eAAe,KAAK,KAAK,IAAI,MAAM,UAAU,CAAC,GAEjF,cAAc,YAAY,OAAO,OAAO,QAAQ,EAAE,IAAI,CAAC,MAAM,KAAK,QAAQ,KAAK,EAAE,MAAM,CAAC,GAExF,eAAe,OAAO;AAAA,IAC1B,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AAG,MAAM,GAAG,GAEtB,OAAO,QAAQ,CAAC,EAAG,WAAW,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,KAAK,QAAQ,CAAC;AAEpF,aAAI,CAAA,EAAA,QAAQ,SAAS,SAAS,IAAI;AAAA,IAAA;AAAA,IAOpC,OAAO,QAAQ;AAAA,MACb,CAAC,KAAK,UAAU,OAAO,OAAO,KAAK,EAAC,CAAC,MAAM,IAAI,GAAG,MAAM,QAAO;AAAA,MAC/D,CAAA;AAAA,IAAC;AAAA,IAGH,SAAS;AAAA,MACPC,IAAU;AAAA,QACR,aAAa;AAAA,QACb,UAAU,IAAI,GAAG,cAAc;AAAA,QAC/B,MACE,OAAO,IAAI,mBAAoB,YAC/B,gCAAgC,IAAI;AAAA,MAAA,CACvC;AAAA,IAAA;AAAA,IAGH,WAAW;AAAA,EAAA,GAEP,gBAAgB;AAAA,IACpB,KAAK;AAAA,IACL;AAAA,IACA,UAAU;AAAA,IACV,QAAQ,UAAU,SAAS,iBAAiB,OAAO;AAAA,IACnD,WAAW,UAAU,SAAS,iBAAiB,KAAS,QAAQ,aAAa;AAAA,IAC7E,wBAAwB;AAAA,EAAA;AAG1B,SAAO,EAAC,cAAc,cAAA;AACxB;"}
1
+ {"version":3,"file":"resolveRolldownConfig.js","sources":["../../src/node/tasks/rolldown/resolveRolldownConfig.ts"],"sourcesContent":["import path from 'node:path'\nimport type {InputOptions, OutputOptions} from 'rolldown'\nimport {dts as dtsPlugin} from 'rolldown-plugin-dts'\nimport type {BuildContext} from '../../core/contexts/buildContext'\nimport {pkgExtMap as extMap} from '../../core/pkg/pkgExt'\nimport type {RolldownDtsTask} from '../types'\n\nexport interface RolldownConfig {\n inputOptions: InputOptions\n outputOptions: OutputOptions\n}\n\nexport function resolveRolldownConfig(\n ctx: BuildContext,\n buildTask: RolldownDtsTask,\n): RolldownConfig {\n const {format, runtime, target} = buildTask\n const {config, cwd, exports: _exports, external, distPath, logger, pkg, ts} = ctx\n const outputExt = extMap[pkg.type || 'commonjs'][format]\n const outDir = path.relative(cwd, distPath)\n\n const pathAliases = Object.fromEntries(\n Object.entries(ts.config?.options.paths || {}).map(([key, val]) => {\n return [key, path.resolve(cwd, ts.config?.options.baseUrl || '.', val[0]!)]\n }),\n )\n\n const entries = buildTask.entries.map((entry) => {\n return {\n ...entry,\n name: path.relative(outDir, entry.output).replace(/\\.[^/.]+$/, ''),\n }\n }, {})\n\n const exportIds =\n _exports && Object.keys(_exports).map((exportPath) => path.join(pkg.name, exportPath))\n\n const sourcePaths = _exports && Object.values(_exports).map((e) => path.resolve(cwd, e.source))\n\n const replacements = Object.fromEntries(\n Object.entries(config?.define || {}).map(([key, val]) => [key, JSON.stringify(val)]),\n )\n\n const entryFileNames = `[name]${outputExt}`\n\n const inputOptions = {\n cwd,\n jsx: {\n mode:\n config?.jsx === 'automatic'\n ? 'automatic'\n : config?.jsx === 'preserve'\n ? 'preserve'\n : config?.jsx === 'transform'\n ? 'classic'\n : 'automatic',\n factory: config?.jsxFactory,\n fragment: config?.jsxFragment,\n importSource: config?.jsxImportSource,\n },\n define:\n pkg.name === '@sanity/pkg-utils'\n ? {...replacements}\n : {\n 'process.env.PKG_FORMAT': JSON.stringify(format),\n 'process.env.PKG_RUNTIME': JSON.stringify(runtime),\n 'process.env.PKG_VERSION': JSON.stringify(process.env['PKG_VERSION'] || pkg.version),\n ...replacements,\n },\n\n platform:\n buildTask.type === 'rolldown:dts'\n ? 'node'\n : runtime === 'node'\n ? 'node'\n : runtime === 'browser'\n ? 'browser'\n : 'neutral',\n\n resolve: {\n alias: pathAliases,\n tsconfigFilename: ctx.ts.configPath || 'tsconfig.json',\n },\n transform: {\n target,\n },\n experimental: {\n attachDebugInfo: 'none',\n },\n\n external: (id, importer) => {\n // Check if the id is a self-referencing import\n if (exportIds?.includes(id)) {\n return true\n }\n\n // Check if the id is a file path that points to an exported source file\n if (importer && (id.startsWith('.') || id.startsWith('/'))) {\n const idPath = path.resolve(path.dirname(importer), id)\n\n if (sourcePaths?.includes(idPath)) {\n logger.warn(\n `detected self-referencing import – treating as external: ${path.relative(\n cwd,\n idPath,\n )}`,\n )\n\n return true\n }\n }\n\n const idParts = id.split('/')\n\n const name = idParts[0]!.startsWith('@') ? `${idParts[0]}/${idParts[1]}` : idParts[0]\n\n if (name && external.includes(name)) {\n return true\n }\n\n return false\n },\n\n input: entries.reduce<{[entryAlias: string]: string}>(\n (acc, entry) => Object.assign(acc, {[entry.name]: entry.source}),\n {},\n ),\n\n plugins: [\n dtsPlugin({\n emitDtsOnly: true,\n tsconfig: ctx.ts.configPath || 'tsconfig.json',\n tsgo:\n typeof pkg.devDependencies === 'object' &&\n '@typescript/native-preview' in pkg.devDependencies,\n resolve: ctx.bundledPackages,\n }),\n ],\n\n treeshake: true,\n } satisfies InputOptions\n const outputOptions = {\n dir: outDir,\n entryFileNames,\n chunkFileNames:\n buildTask.type === 'rolldown:dts' ? `_chunks-dts/[name]${outputExt}` : undefined,\n esModule: true,\n format: buildTask.type === 'rolldown:dts' ? 'es' : format,\n sourcemap: buildTask.type === 'rolldown:dts' ? false : (config?.sourcemap ?? true),\n hoistTransitiveImports: false,\n /**\n * rolldown doesn't permit disabling chunks, we can only choose between automatic chunking (the default)\n * and manual chunking (using advancedChunks).\n * This matters for how we generate dts files.\n * While we use rolldown for dts generation, and rollup for the rest, we want to reduce the amount of dts files emitted as chunks,\n * and to make them predictable in how they're generated.\n */\n // @TODO the following breaks the dts generation, report bug to rolldown\n // advancedChunks:\n // buildTask.type === 'rolldown:dts'\n // ? {\n // groups: [\n // {\n // /**\n // * Groups all inlined typings specified by bundledPackages in extract.bundledPackages to its own chunk.\n // */\n // name: 'bundled-packages',\n // test: (id) => ctx.bundledPackages.includes(id),\n // priority: 1,\n // },\n // {\n // /**\n // * Put all other shared chunks into a single chunk.\n // */\n // name: 'shared',\n // minShareCount: 1,\n // },\n // ],\n // }\n // : {},\n } satisfies OutputOptions\n\n return {inputOptions, output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,CAAA;AAAA,IAAC;AAAA,IAGH,SAAS;AAAA,MACPC,IAAU;AAAA,QACR,aAAa;AAAA,QACb,UAAU,IAAI,GAAG,cAAc;AAAA,QAC/B,MACE,OAAO,IAAI,mBAAoB,YAC/B,gCAAgC,IAAI;AAAA,QACtC,SAAS,IAAI;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,IAGH,WAAW;AAAA,EAAA,GAEP,gBAAgB;AAAA,IACpB,KAAK;AAAA,IACL;AAAA,IACA,gBACE,UAAU,SAAS,iBAAiB,qBAAqB,SAAS,KAAK;AAAA,IACzE,UAAU;AAAA,IACV,QAAQ,UAAU,SAAS,iBAAiB,OAAO;AAAA,IACnD,WAAW,UAAU,SAAS,iBAAiB,KAAS,QAAQ,aAAa;AAAA,IAC7E,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAiC1B,SAAO,EAAC,cAAc,cAAA;AACxB;"}
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { cac } from "cac";
2
- var version = "7.8.0";
2
+ var version = "7.8.2";
3
3
  const cli = cac();
4
4
  cli.command("", "Check").alias("check").option("--strict", "Strict mode").option("--tsconfig [tsconfig]", "[string] tsconfig.json").action(async (options) => {
5
5
  const { checkAction } = await import("./_chunks-es/checkAction.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/pkg-utils",
3
- "version": "7.8.0",
3
+ "version": "7.8.2",
4
4
  "description": "Simple utilities for modern npm packages.",
5
5
  "keywords": [
6
6
  "sanity-io",
@@ -124,7 +124,7 @@
124
124
  "@types/semver": "^7.5.8",
125
125
  "@types/treeify": "^1.0.3",
126
126
  "@types/uuid": "^10.0.0",
127
- "@typescript/native-preview": "7.0.0-dev.20250619.1",
127
+ "@typescript/native-preview": "7.0.0-dev.20250620.1",
128
128
  "browserslist-to-esbuild": "2.1.1",
129
129
  "commitizen": "^4.3.1",
130
130
  "cz-conventional-changelog": "^3.3.0",
@@ -140,7 +140,7 @@
140
140
  "tsx": "^4.20.3",
141
141
  "typescript": "5.8.3",
142
142
  "vitest": "^3.2.4",
143
- "@sanity/pkg-utils": "7.8.0"
143
+ "@sanity/pkg-utils": "7.8.2"
144
144
  },
145
145
  "peerDependencies": {
146
146
  "babel-plugin-react-compiler": "*",