@jcoreio/toolchain 4.5.7 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain",
3
- "version": "4.5.7",
3
+ "version": "4.6.0",
4
4
  "description": "base JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,15 +1,16 @@
1
1
  const once = require('../../util/once.cjs')
2
2
  const confirm = require('../../util/confirm.cjs')
3
- const { toolchainConfig } = require('../../util/findUps.cjs')
3
+ const {
4
+ toolchainConfig,
5
+ toolchainConfigDeclared,
6
+ } = require('../../util/findUps.cjs')
4
7
 
5
8
  module.exports = once(async () => {
6
- if (toolchainConfig) {
9
+ if (toolchainConfig && toolchainConfigDeclared) {
7
10
  if (typeof toolchainConfig.outputEsm === 'boolean') {
8
11
  return toolchainConfig.outputEsm
9
12
  }
10
- if (Object.keys(toolchainConfig).length) {
11
- return toolchainConfig.esmBabelEnv != null
12
- }
13
+ return toolchainConfig.esmBabelEnv != null
13
14
  }
14
15
  return await confirm({
15
16
  type: 'confirm',
@@ -5,6 +5,25 @@ module.exports = z.object({
5
5
  esmBabelEnv: z.record(z.unknown()).optional(),
6
6
  esWrapper: z.boolean().optional(),
7
7
  outputEsm: z.boolean().optional(),
8
+ sourceMaps: z
9
+ .union([
10
+ /**
11
+ * Will output source maps as separate .map files on disk
12
+ */
13
+ z.boolean(),
14
+ z.enum([
15
+ /**
16
+ * Will output inline source maps in transpiled code
17
+ * (except for TypeScript declaration maps, which can only be separate files)
18
+ */
19
+ 'inline',
20
+ /**
21
+ * Will output both .map files and inline source maps
22
+ */
23
+ 'both',
24
+ ]),
25
+ ])
26
+ .default(true),
8
27
  scripts: z
9
28
  .record(
10
29
  z.union([
package/util/findUps.cjs CHANGED
@@ -109,6 +109,9 @@ try {
109
109
  // ignore
110
110
  }
111
111
 
112
+ exports.toolchainConfigDeclared =
113
+ toolchainConfigFile != null || name in packageJson
114
+
112
115
  let toolchainConfig
113
116
  try {
114
117
  toolchainConfig = configSchema.parse(