Skip to content

Commit

Permalink
chore: add fail fast to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamiell committed Sep 27, 2024
1 parent 1f90777 commit 339e286
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
strategy:
matrix:
package-name: ${{ fromJson(needs.get-build-packages.outputs.package-names) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/setup
Expand Down Expand Up @@ -49,6 +50,7 @@ jobs:
strategy:
matrix:
package-name: ${{ fromJson(needs.get-lint-packages.outputs.package-names) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/setup
Expand All @@ -72,6 +74,7 @@ jobs:
strategy:
matrix:
package-name: ${{ fromJson(needs.get-test-packages.outputs.package-names) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./.github/workflows/setup
Expand Down
12 changes: 9 additions & 3 deletions packages/docs/typedoc.config.base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function getTypeDocConfig(packageDirectoryPath) {
// We want one entry point for each export source file, which will correspond to one Markdown file
// for each source file.
const indexTSPath = path.join(packageDirectoryPath, "src", "index.ts");
const typeScriptFileExports = getTypeScriptFileExports(indexTSPath);
const typeScriptFileExports = getIndexTSExports(indexTSPath);
const exportsWithSrcPrefix = typeScriptFileExports.map((entryPoint) =>
entryPoint.replaceAll("./", "./src/"),
);
Expand All @@ -61,15 +61,21 @@ export function getTypeDocConfig(packageDirectoryPath) {
}

/**
* By default, TypeDoc will create a page for each individual function (even if the
* "entryPointStrategy" is set to "expand"). Instead, we want to create a page per function
* category.
*
* This function parses the "index.ts" file to find all of the individual pages.
*
* @param {string} typeScriptFilePath The path to the ".ts" file.
* @returns {readonly string[]} An array of exported file paths.
*/
function getTypeScriptFileExports(typeScriptFilePath) {
function getIndexTSExports(typeScriptFilePath) {
const typeScriptFile = fs.readFileSync(typeScriptFilePath, "utf8");
const lines = typeScriptFile.split("\n");
const exportLines = lines.filter((line) => line.startsWith("export"));
return exportLines.map((line) => {
const match = line.match(/"(.+)"/);
const match = line.match(/export \* from "(.+)";/);
if (match === null) {
throw new Error(`Failed to parse line: ${line}`);
}
Expand Down
12 changes: 10 additions & 2 deletions packages/isaacscript-common/src/types/AddSubtract.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
/** From: https://gist.github.com/ryandabler/8b4ff4f36aed47bc09acc03174638468 */
/**
* Helper type to add two other types.
*
* From: https://gist.github.com/ryandabler/8b4ff4f36aed47bc09acc03174638468
*/
export type Add<A extends number, B extends number> = Length<
[...BuildTuple<A>, ...BuildTuple<B>]
>;

/** From: https://gist.github.com/ryandabler/8b4ff4f36aed47bc09acc03174638468 */
/**
* Helper type to subtract two other types.
*
* From: https://gist.github.com/ryandabler/8b4ff4f36aed47bc09acc03174638468
*/
export type Subtract<A extends number, B extends number> = A extends A
? BuildTuple<A> extends [...infer U, ...BuildTuple<B>]
? Length<U>
Expand Down
2 changes: 0 additions & 2 deletions todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
- release new version with flat config
- GET RID OF ALL: "./**/.*.mjs",

- release tsconfig in dev after this and everything else is sorted out

- use `sort-keys` eslint plugin to sort object alphabetically in base-typescript-eslint
https://eslint.org/docs/latest/rules/sort-keys

Expand Down

0 comments on commit 339e286

Please sign in to comment.