@particle/tooling 0.1.1 → 0.1.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.
- package/lib/migrate.js +4 -4
- package/package.json +1 -1
package/lib/migrate.js
CHANGED
|
@@ -4,6 +4,7 @@ import { readdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { promisify, styleText } from 'node:util';
|
|
6
6
|
|
|
7
|
+
import toolingPackage from '../package.json' with { type: 'json' };
|
|
7
8
|
import { parseJsonc } from './jsonc.js';
|
|
8
9
|
|
|
9
10
|
const execFile = promisify(execFileCallback);
|
|
@@ -534,9 +535,8 @@ export async function createPlan(dir, style, options = {}) {
|
|
|
534
535
|
if (!Object.hasOwn(STYLES, style)) {
|
|
535
536
|
throw new Error(`Unknown style "${style}". Expected one of: ${Object.keys(STYLES).join(', ')}`);
|
|
536
537
|
}
|
|
537
|
-
const
|
|
538
|
-
const
|
|
539
|
-
const typescriptSpec = own.peerDependencies.typescript;
|
|
538
|
+
const toolingSpec = options.toolingSpec ?? `^${toolingPackage.version}`;
|
|
539
|
+
const typescriptSpec = toolingPackage.peerDependencies.typescript;
|
|
540
540
|
const packageSource = await readFile(path.join(dir, 'package.json'), 'utf8');
|
|
541
541
|
const pkg = JSON.parse(packageSource);
|
|
542
542
|
const original = structuredClone(pkg);
|
|
@@ -579,7 +579,7 @@ export async function createPlan(dir, style, options = {}) {
|
|
|
579
579
|
plan.dependencies.push(`add typescript ${typescriptSpec}`);
|
|
580
580
|
}
|
|
581
581
|
if (style !== 'js' && pkg.devDependencies?.[TYPE_AWARE_LINTER] === undefined) {
|
|
582
|
-
const spec =
|
|
582
|
+
const spec = toolingPackage.peerDependencies[TYPE_AWARE_LINTER];
|
|
583
583
|
pkg.devDependencies = { ...pkg.devDependencies, [TYPE_AWARE_LINTER]: spec };
|
|
584
584
|
plan.dependencies.push(
|
|
585
585
|
`add ${TYPE_AWARE_LINTER} ${spec} (runs the type-aware lint rules, such as no-floating-promises)`
|
package/package.json
CHANGED