microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
eng/common/config/area.ts
67lines · modecode
| 1 | import type { AreaLabels } from "./labels.js"; |
| 2 | |
| 3 | /** |
| 4 | * Set the paths that each area applies to. |
| 5 | */ |
| 6 | export const AreaPaths: Record<keyof typeof AreaLabels, string[]> = { |
| 7 | "compiler:core": ["packages/compiler/"], |
| 8 | "compiler:emitter-framework": [], |
| 9 | ide: ["packages/typespec-vscode/", "packages/typespec-vs/"], |
| 10 | "lib:http": ["packages/http/"], |
| 11 | "lib:openapi": ["packages/openapi/"], |
| 12 | "lib:rest": ["packages/rest/"], |
| 13 | "lib:versioning": ["packages/versioning/"], |
| 14 | "lib:http-specs": ["packages/http-specs/"], |
| 15 | "meta:blog": ["blog/"], |
| 16 | "meta:website": ["website/"], |
| 17 | tspd: ["packages/tspd/"], |
| 18 | "emitter:client:all": [], |
| 19 | "emitter:client:js": ["packages/http-client-js/"], |
| 20 | "emitter:client:csharp": ["packages/http-client-csharp/"], |
| 21 | "emitter:client:java": ["packages/http-client-java/"], |
| 22 | "emitter:client:python": ["packages/http-client-python/"], |
| 23 | "emitter:graphql": ["packages/graphql/"], |
| 24 | "emitter:json-schema": ["packages/json-schema/"], |
| 25 | "emitter:protobuf": ["packages/protobuf/"], |
| 26 | "emitter:openapi3": ["packages/openapi3/"], |
| 27 | "openapi3:converter": ["packages/openapi3/src/cli/actions/convert/"], |
| 28 | "emitter:service:csharp": ["packages/http-server-csharp"], |
| 29 | "emitter:service:js": ["packages/http-server-js"], |
| 30 | "emitter:service:java": [], |
| 31 | eng: ["eng/", ".github/"], |
| 32 | "ui:playground": ["packages/playground/"], |
| 33 | "ui:type-graph-viewer": ["packages/html-program-viewer/"], |
| 34 | spector: ["packages/spector/", "packages/http-specs"], |
| 35 | }; |
| 36 | |
| 37 | /** |
| 38 | * Path that should trigger every CI build. |
| 39 | */ |
| 40 | const all = ["eng/common/", "vitest.config.ts", "tsconfig.base.json"]; |
| 41 | |
| 42 | /** |
| 43 | * Path that should trigger all isolated emitter builds |
| 44 | */ |
| 45 | const isolatedEmitters = ["eng/emitters/"]; |
| 46 | |
| 47 | export const CIRules = { |
| 48 | CSharp: [...all, ...isolatedEmitters, ...AreaPaths["emitter:client:csharp"], ".editorconfig"], |
| 49 | Java: [...all, ...isolatedEmitters, ...AreaPaths["emitter:client:java"], ".editorconfig"], |
| 50 | Python: [...all, ...isolatedEmitters, ...AreaPaths["emitter:client:python"], ".editorconfig"], |
| 51 | |
| 52 | Core: [ |
| 53 | "**/*", |
| 54 | "!.prettierignore", // Prettier is already run as its dedicated CI(via github action) |
| 55 | "!.prettierrc.json", |
| 56 | "!cspell.yaml", // CSpell is already run as its dedicated CI(via github action) |
| 57 | "!eslint.config.json", // Eslint is already run as its dedicated CI(via github action) |
| 58 | ...ignore(isolatedEmitters), |
| 59 | ...ignore(AreaPaths["emitter:client:csharp"]), |
| 60 | ...ignore(AreaPaths["emitter:client:java"]), |
| 61 | ...ignore(AreaPaths["emitter:client:python"]), |
| 62 | ], |
| 63 | }; |
| 64 | |
| 65 | function ignore(paths: string[]) { |
| 66 | return paths.map((x) => `!${x}`); |
| 67 | } |
| 68 | |