зеркало из https://github.com/mozilla/fxa.git
chore(ci): update modules-to-test.js to use the workspace:* dependencies to make it easier to keep up to date
This commit is contained in:
Родитель
efd4a5601b
Коммит
fbd4a4bed9
|
@ -1,6 +1,5 @@
|
|||
const parseDiff = require('diffparser');
|
||||
const fetch = require('node-fetch');
|
||||
const { moduleDependencies } = require('../package.json').fxa;
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
|
@ -16,6 +15,23 @@ const testable = fs
|
|||
.filter((de) => de.isDirectory())
|
||||
.map((de) => de.name);
|
||||
|
||||
function packageJsonPath(name) {
|
||||
return path.resolve(__dirname, '../packages', name, 'package.json');
|
||||
}
|
||||
|
||||
const moduleDependencies = Object.fromEntries(
|
||||
testable
|
||||
.filter((name) => fs.existsSync(packageJsonPath(name)))
|
||||
.map((name) => {
|
||||
const pkg = require(packageJsonPath(name));
|
||||
const deps = Object.entries(pkg.dependencies || {})
|
||||
.concat(Object.entries(pkg.devDependencies || {}))
|
||||
.filter(([_, v]) => v.startsWith('workspace:'))
|
||||
.map(([dep]) => dep);
|
||||
return [name, deps];
|
||||
})
|
||||
);
|
||||
|
||||
const IS_BUILD_SCRIPT = /^\.circleci\//;
|
||||
|
||||
function moduleName(path) {
|
||||
|
@ -109,11 +125,9 @@ async function main() {
|
|||
for (const mod of toRun) {
|
||||
console.log(mod);
|
||||
}
|
||||
}
|
||||
else if (branch === 'main') {
|
||||
} else if (branch === 'main') {
|
||||
console.log('all');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
//TODO diff main..branch
|
||||
console.log('all');
|
||||
}
|
||||
|
|
38
package.json
38
package.json
|
@ -42,44 +42,6 @@
|
|||
"engines": {
|
||||
"node": "^16.12.0"
|
||||
},
|
||||
"fxa": {
|
||||
"moduleDependencies": {
|
||||
"fxa-content-server": [
|
||||
"123done",
|
||||
"fortress",
|
||||
"fxa-auth-server",
|
||||
"fxa-auth-client",
|
||||
"fxa-shared",
|
||||
"fxa-profile-server",
|
||||
"fxa-payments-server",
|
||||
"fxa-settings"
|
||||
],
|
||||
"fxa-auth-server": [
|
||||
"fxa-auth-db-mysql",
|
||||
"fxa-shared"
|
||||
],
|
||||
"fxa-auth-client": [
|
||||
"fxa-auth-server"
|
||||
],
|
||||
"fxa-event-broker": [
|
||||
"fxa-shared"
|
||||
],
|
||||
"fxa-profile-server": [
|
||||
"fxa-auth-server",
|
||||
"fxa-shared"
|
||||
],
|
||||
"fxa-payments-server": [
|
||||
"fxa-shared",
|
||||
"fxa-react"
|
||||
],
|
||||
"fxa-settings": [
|
||||
"fxa-shared",
|
||||
"fxa-react",
|
||||
"fxa-content-server",
|
||||
"fxa-graphql-api"
|
||||
]
|
||||
}
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged",
|
||||
|
|
Загрузка…
Ссылка в новой задаче