@jcoreio/toolchain 3.6.2 → 3.6.3

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": "3.6.2",
3
+ "version": "3.6.3",
4
4
  "description": "base JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
package/scripts/init.cjs CHANGED
@@ -54,6 +54,14 @@ async function init(args = []) {
54
54
  })),
55
55
  }))
56
56
  }
57
+ if (
58
+ ['flow', 'typescript', 'react'].some((value) =>
59
+ selectedToolchains.includes(`${name}-${value}`)
60
+ ) &&
61
+ !selectedToolchains.includes(`${name}-esnext`)
62
+ ) {
63
+ selectedToolchains.push(`${name}-esnext`)
64
+ }
57
65
 
58
66
  const isTest = Boolean(process.env.JCOREIO_TOOLCHAIN_TEST)
59
67
 
@@ -1,4 +1,5 @@
1
1
  const { toolchainManaged } = require('../../util/findUps.cjs')
2
+ const { name } = require('../../package.json')
2
3
  const getPluginsAsyncFunction = require('../../util/getPluginsAsyncFunction.cjs')
3
4
  const fs = require('../../util/projectFs.cjs')
4
5
  const sortDeps = require('../../util/sortDeps.cjs')
@@ -6,7 +7,6 @@ const semver = require('semver')
6
7
  const isEmpty = require('lodash/isEmpty')
7
8
  const pick = require('lodash/pick')
8
9
  const Path = require('path')
9
- const { toolchainConfig } = require('../../util/findUps.cjs')
10
10
  const confirmOutputEsm = require('./confirmOutputEsm.cjs')
11
11
  const confirm = require('../../util/confirm.cjs')
12
12
 
@@ -107,9 +107,7 @@ async function migrateProjectPackageJson() {
107
107
  ? {
108
108
  './*': {
109
109
  types: './*.d.ts',
110
- ...(toolchainConfig.outputEsm !== false
111
- ? { import: './*.mjs' }
112
- : {}),
110
+ ...(outputEsm !== false ? { import: './*.mjs' } : {}),
113
111
  default: './*.js',
114
112
  },
115
113
  }
@@ -135,6 +133,8 @@ async function migrateProjectPackageJson() {
135
133
  )
136
134
  if (isEmpty(packageJson.config)) delete packageJson.config
137
135
 
136
+ const isTest = Boolean(process.env.JCOREIO_TOOLCHAIN_TEST)
137
+
138
138
  for (const section in toolchainManaged) {
139
139
  if (!section.endsWith('ependencies')) continue
140
140
  const managedSection = toolchainManaged[section]
@@ -147,7 +147,9 @@ async function migrateProjectPackageJson() {
147
147
  for (const dep in managedSection) {
148
148
  if (/^optional/.test(section) && !pkgSection[dep]) continue
149
149
  const versionRange = managedSection[dep]
150
- if (
150
+ if (isTest && dep.startsWith(`${name}-`)) {
151
+ pkgSection[dep] = `link:${dep.replace(`${name}-`, '../packages/')}`
152
+ } else if (
151
153
  !pkgSection[dep] ||
152
154
  !semver.satisfies(semver.minVersion(pkgSection[dep]), versionRange)
153
155
  ) {