@vzn/vx-migrate 0.0.635 → 0.0.637
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/README.md +294 -42
- package/package.json +3 -3
- package/src/adopt.ts +23 -8
- package/src/manifest-graph.ts +65 -0
- package/src/manifests.ts +52 -0
- package/src/mapping-cache.ts +2 -8
- package/src/migrate-nx.ts +17 -16
- package/src/migrate-scripts.ts +1261 -0
- package/src/migrate-turbo.ts +6 -7
- package/src/migrate-vite-task.ts +5 -4
- package/src/migrate.ts +376 -139
- package/src/nx/index.ts +77 -20
- package/src/nx/nx-boundaries.ts +191 -0
- package/src/nx/nx-deps.ts +3 -3
- package/src/nx/nx-map.ts +37 -41
- package/src/nx/nx-upstream.ts +3 -2
- package/src/nx-cache/index.ts +5 -11
- package/src/package-fs.ts +152 -0
- package/src/packages.ts +806 -0
- package/src/paths.ts +2 -2
- package/src/remote-cache.ts +118 -0
- package/src/shared-outputs.ts +63 -19
- package/src/tracked-outputs.ts +54 -35
- package/src/turbo/index.ts +32 -20
- package/src/turbo/turbo-map.ts +96 -56
- package/src/turbo-cache/index.ts +14 -20
- package/src/vite-task/vite-task-map.ts +13 -12
- package/src/workspace-notes.ts +12 -6
- package/src/workspace-plugins.ts +41 -11
package/src/migrate-turbo.ts
CHANGED
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
type MigrationFormat,
|
|
10
10
|
type MigrationPlan,
|
|
11
11
|
PERSISTENT_TODO,
|
|
12
|
-
type ProjectMeta,
|
|
13
12
|
quoteTsLiteral as quote,
|
|
14
13
|
} from '@vzn/vx'
|
|
14
|
+
import type { PackageMeta } from './packages.js'
|
|
15
15
|
import {
|
|
16
16
|
mapTurboWorkspace,
|
|
17
17
|
rootTaskProject,
|
|
@@ -42,7 +42,7 @@ const PRESET_NAMES: Record<TurboGlobal, string> = {
|
|
|
42
42
|
|
|
43
43
|
export async function migrateTurbo(
|
|
44
44
|
root: string,
|
|
45
|
-
metas: readonly
|
|
45
|
+
metas: readonly PackageMeta[],
|
|
46
46
|
format: MigrationFormat = 'ts',
|
|
47
47
|
): Promise<MigrationPlan> {
|
|
48
48
|
const tracked = await trackedFiles(root)
|
|
@@ -56,9 +56,8 @@ export async function migrateTurbo(
|
|
|
56
56
|
sourceNames: (dirs) => spelledNames(root, dirs, tracked),
|
|
57
57
|
ignored: (rels) => gitIgnored(root, rels),
|
|
58
58
|
})
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
// first run. turbo() takes such files back each run; the configs must.
|
|
59
|
+
// A reader whose `!` hides a committed file under another task's output
|
|
60
|
+
// runs uncached, as under turbo().
|
|
62
61
|
if (tracked !== null)
|
|
63
62
|
for (const [id, todo] of spareTrackedOutputs(root, mapping.projects, tracked)) {
|
|
64
63
|
const at = id.lastIndexOf('#')
|
|
@@ -128,8 +127,8 @@ export async function migrateTurbo(
|
|
|
128
127
|
*/
|
|
129
128
|
async function withRootProject(
|
|
130
129
|
root: string,
|
|
131
|
-
metas: readonly
|
|
132
|
-
): Promise<readonly
|
|
130
|
+
metas: readonly PackageMeta[],
|
|
131
|
+
): Promise<readonly PackageMeta[]> {
|
|
133
132
|
const named = await rootTaskProject(root)
|
|
134
133
|
// A root the globs list already is a project of this name; a package
|
|
135
134
|
// that took the name leaves the root none to take.
|
package/src/migrate-vite-task.ts
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// `run` block (vite-plus's `vp run`) and its package.json scripts, as a
|
|
3
3
|
// migration plan.
|
|
4
4
|
|
|
5
|
-
import { type MigrationFormat, type MigrationPlan
|
|
5
|
+
import { type MigrationFormat, type MigrationPlan } from '@vzn/vx'
|
|
6
|
+
import type { PackageMeta } from './packages.js'
|
|
6
7
|
import { spelledNames } from './spelled-env.js'
|
|
7
8
|
import { spareTrackedOutputs, trackedFiles, trackedKinds } from './tracked-outputs.js'
|
|
8
9
|
import { mapViteTaskWorkspace, viteTaskProjects } from './vite-task/vite-task-map.js'
|
|
9
10
|
|
|
10
11
|
export async function migrateViteTask(
|
|
11
12
|
root: string,
|
|
12
|
-
metas: readonly
|
|
13
|
+
metas: readonly PackageMeta[],
|
|
13
14
|
format: MigrationFormat = 'ts',
|
|
14
15
|
): Promise<MigrationPlan> {
|
|
15
16
|
const withRoot = await viteTaskProjects(root, metas)
|
|
@@ -19,8 +20,8 @@ export async function migrateViteTask(
|
|
|
19
20
|
ownConfig: () => `vx.config.${format}`,
|
|
20
21
|
sourceNames: (dirs) => spelledNames(root, dirs, tracked),
|
|
21
22
|
})
|
|
22
|
-
// A
|
|
23
|
-
//
|
|
23
|
+
// A reader whose `!` hides a committed file under another task's output
|
|
24
|
+
// runs uncached.
|
|
24
25
|
if (tracked !== null)
|
|
25
26
|
for (const [id, todo] of spareTrackedOutputs(root, mapped.projects, tracked)) {
|
|
26
27
|
const at = id.lastIndexOf('#')
|