-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(foundation): move schema.graphqls to IR package
- Loading branch information
1 parent
48a8a12
commit 3e65603
Showing
9 changed files
with
37 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2023-04-05T09:33:26-07:00 | ||
2023-04-08T19:43:30-07:00 |
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
File renamed without changes.
1 change: 1 addition & 0 deletions
1
packages/@code-like-a-carpenter/foundation-intermediate-representation/src/index.ts
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export * from './field'; | ||
export * from './intermediate-representation'; | ||
export * from './model'; | ||
export * from './schema'; | ||
export * from './table'; | ||
export * from './types'; |
22 changes: 22 additions & 0 deletions
22
packages/@code-like-a-carpenter/foundation-intermediate-representation/src/schema.ts
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,22 @@ | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
|
||
function loadSchema() { | ||
try { | ||
// we're in dist. | ||
return fs.readFileSync( | ||
path.resolve(__dirname, '..', '..', 'schema.graphqls'), | ||
'utf8' | ||
); | ||
} catch (err) { | ||
if (err instanceof Error && 'code' in err && err.code === 'ENOENT') { | ||
// we're in src. | ||
return fs.readFileSync( | ||
path.resolve(__dirname, '..', 'schema.graphqls'), | ||
'utf8' | ||
); | ||
} | ||
throw err; | ||
} | ||
} | ||
export const schema = loadSchema(); |
10 changes: 2 additions & 8 deletions
10
packages/@code-like-a-carpenter/foundation-parser/src/test-helpers.ts
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