-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #926 from CruGlobal/commit-gql-generated-files
[no-Jira] Run `yarn gql:w` alongside the Next.js dev server
- Loading branch information
Showing
19 changed files
with
223 additions
and
30 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,3 @@ node_modules | |
|
||
# Storybook | ||
build-storybook.log | ||
|
||
# GraphQL | ||
graphql-digest.txt |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,23 @@ | ||
import { execSync } from 'node:child_process'; | ||
import { unlinkSync } from 'node:fs'; | ||
import { relative } from 'node:path'; | ||
|
||
const normalize = (filename) => relative(process.cwd(), filename); | ||
|
||
// This script receives the list of generated files, each in a separate argument. | ||
// Some of them are relative to the project root, and some of them are absolute. | ||
// Skip the first argument (node) and the second argument (the script filename) | ||
// and convert to a newline-separated list of paths relative to the project root. | ||
const filesToKeep = new Set(process.argv.slice(2).map(normalize)); | ||
|
||
const allFiles = execSync('find . -type f -name "*.generated.ts"') | ||
.toString() | ||
.trim() | ||
.split('\n') | ||
.map(normalize); | ||
|
||
allFiles.forEach((filename) => { | ||
if (!filesToKeep.has(filename)) { | ||
unlinkSync(filename); | ||
} | ||
}); |
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
Oops, something went wrong.