-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: move pre-commit checks to CI #893
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b980629
ci: try changelog and schema checks in CI
manzt ffe4ec2
chore: remove auto git add
manzt 14ab46b
ci: update workflow name
manzt 24dcfe8
refactor: create schema generation script
manzt 838efe1
chore: add CLI comment
manzt c02189b
ci: force color and cancel early if possible
manzt 8287a4f
fix: temp disable cache?
manzt de37658
ci: re-enable caching
manzt adae6bc
ci: remove concurrency group
manzt 1394cbf
chore: set fetch depth of 0
manzt 497942a
chore: tmp disable cache
manzt 9326848
ci: set fetch-depth 0 for release action
manzt f8eb000
ci: remove changelog from CI workflow
manzt 2f31efe
ci: check schemas in linting
manzt 233c64b
chore: run changelog in versioning
manzt 77dc984
chore: remove unused changelog script
manzt cbe5048
chore: remove commitlint and husky
manzt 282ac52
ci: fix git typo
manzt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// @ts-check | ||
import * as fs from "node:fs"; | ||
import * as path from "node:path"; | ||
import * as url from "node:url"; | ||
import * as tsj from "ts-json-schema-generator"; | ||
|
||
// Copied from `ts-json-schema-generator` to create | ||
// identical schemas to the one previously generated by CLI. | ||
// @ref: https://github.com/vega/ts-json-schema-generator/blob/aec8a25f366fa32ba9539adc5a91f4ff3b14d1e9/ts-json-schema-generator.ts#LL67C1-L68C1 | ||
import stableStringify from "safe-stable-stringify"; | ||
|
||
const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); | ||
|
||
const SCHEMAS = [ | ||
["GoslingSpec", "gosling.schema.json"], | ||
["HiGlassSpec", "higlass.schema.json"], | ||
["Theme", "theme.schema.json"], | ||
["TemplateTrackDef", "template.schema.json"], | ||
]; | ||
|
||
const generator = tsj.createGenerator({ | ||
path: path.resolve(__dirname, "../src/index.ts"), | ||
tsconfig: path.resolve(__dirname, "../tsconfig.json"), | ||
skipTypeCheck: true, | ||
encodeRefs: false, | ||
}); | ||
Comment on lines
+21
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running |
||
|
||
for (const [type, filename] of SCHEMAS) { | ||
const schema = generator.createSchema(type); | ||
fs.promises.writeFile( | ||
path.resolve(__dirname, `../schema/${filename}`), | ||
stableStringify(schema, null, 2) + "\n", | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this action was added in #881. This action also won't work unless you set
fetch-depth: 0
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got it! Thanks for finding this