chore(repo): add sync generator for e2e configs (#26427)
This commit is contained in:
parent
ec5461fa85
commit
7495f0664b
@ -24,14 +24,14 @@
|
||||
"nx:build-native",
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs"]
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
},
|
||||
"e2e-ci--src/detox.test.ts": {
|
||||
"dependsOn": [
|
||||
"nx:build-native",
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs"]
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,20 @@
|
||||
},
|
||||
"e2e-macos-ci--src/expo-legacy.test.ts": {
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
},
|
||||
"e2e-ci--src/expo-legacy.test.ts": {
|
||||
"dependsOn": [
|
||||
"nx:build-native",
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
},
|
||||
"e2e-ci--src/expo.test.ts": {
|
||||
"dependsOn": [
|
||||
"nx:build-native",
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,20 @@
|
||||
},
|
||||
"e2e-macos-ci--src/react-native.test.ts": {
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
},
|
||||
"e2e-ci--src/react-native-legacy.test.ts": {
|
||||
"dependsOn": [
|
||||
"nx:build-native",
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
},
|
||||
"e2e-ci--src/react-native.test.ts": {
|
||||
"dependsOn": [
|
||||
"nx:build-native",
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,6 +53,13 @@
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
},
|
||||
"e2e-ci--src/react-package-legacy.test.ts": {
|
||||
"dependsOn": [
|
||||
"nx:build-native",
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
"sourceRoot": "e2e/remix",
|
||||
"projectType": "application",
|
||||
"implicitDependencies": ["remix"],
|
||||
"// targets": "to see all targets run: nx show project e2e-remix --web",
|
||||
"targets": {
|
||||
"e2e-ci--src/nx-remix.test.ts": {
|
||||
"dependsOn": [
|
||||
|
||||
@ -11,6 +11,13 @@
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
},
|
||||
"e2e-ci--src/rollup-legacy.test.ts": {
|
||||
"dependsOn": [
|
||||
"nx:build-native",
|
||||
"@nx/nx-source:populate-local-registry-storage"
|
||||
],
|
||||
"inputs": ["e2eInputs", "^production"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,11 @@
|
||||
"factory": "./src/generators/create-nodes-plugin/generator",
|
||||
"schema": "./src/generators/create-nodes-plugin/schema.json",
|
||||
"description": "Workspace Generator to create a create-nodes-plugin"
|
||||
},
|
||||
"sync-e2e-configs": {
|
||||
"factory": "./src/generators/sync-e2e-config/generator",
|
||||
"schema": "./src/generators/sync-e2e-config/schema.json",
|
||||
"description": "Generator to sync configuration for our e2e targets"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
import {
|
||||
formatFiles,
|
||||
getProjects,
|
||||
globAsync,
|
||||
Tree,
|
||||
updateProjectConfiguration,
|
||||
} from '@nx/devkit';
|
||||
import { relative } from 'node:path';
|
||||
import { join } from 'path';
|
||||
|
||||
export async function syncE2eConfigsGenerator(tree: Tree) {
|
||||
for (const [projName, projectConfig] of getProjects(tree)) {
|
||||
const { root, targets } = projectConfig;
|
||||
if (!root.startsWith('e2e/')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const testFiles = await globAsync(tree, [join(root, `**/*.test.ts`)]);
|
||||
|
||||
for (const testFile of testFiles) {
|
||||
const relativePath = relative(root, testFile);
|
||||
let target = (targets[`e2e-ci--${relativePath}`] ??= {});
|
||||
target.dependsOn = [
|
||||
'nx:build-native',
|
||||
'@nx/nx-source:populate-local-registry-storage',
|
||||
];
|
||||
target.inputs = ['e2eInputs', '^production'];
|
||||
}
|
||||
updateProjectConfiguration(tree, projName, projectConfig);
|
||||
}
|
||||
|
||||
await formatFiles(tree);
|
||||
}
|
||||
|
||||
export default syncE2eConfigsGenerator;
|
||||
@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"$id": "SyncE2eConfigs",
|
||||
"title": "",
|
||||
"description": "Generator to sync configuration for our e2e targets.",
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user