forked from redwoodjs/redwood
-
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.
Create file watch for type def generation (redwoodjs#2614)
* Add babel deps for parsing ast trees. * Add code to abstract ast parsing. * Find all the cells in a project. * Add function to fetch all the cell files. * Fix TS warning. * Find all directory named imports in a project. * Fix tests for Windows. * Create mirror directory in getPaths. * Partially convert fixture to TypeScript. * Generate mirror types for Cells. * Improve conditional checks for magic-modules. * Clean up comments. * Convert fixture api side to TypeScript. * Generate directory named module mirror files. * Remove whitespace in generated type. * Remove "devtools" concept. Internal is always build time. * Bump lock file. * Fix test. * Improve performance by removing import-time computation. * Fix lint errors. * Export fn to generate types. * Add helpful alias for testing the CLI. * Add command to generate types. * Rename mirror types to generate types. * Generate global types for imported pages. * Replace glob with fast-glob. * Remove pre-build-tasks and replace with generate-types. * Add jsx ast tools. * Clean up generate types. * Bump yarn lock. * Fix tests. * Clean up some code. * Fix lint and tests. * Rename findFiles to files. * Remove type generation from babel-plugins. * Fix build script. * Adjust generated paths. * Prefix type definition templates. * Add side prefix to generated includes. * Remove unused mock from test. * Add helper for creating type def include files. * Generate all types. * Add new ways to find files. * Improve gen-type-def function names. * Export file finders and type-def generators. * Add file watcher stub. * A note about process pages dir. * Add some notes for outstanding things. * Add is DirNamedModule check. * Move file watcher. * Fix some comments. * Delete mirror directory for remove files. * Move code-gen packages. * Move GraphQL operation generation to internal. * Make fixture app work again. * Generate the GraphQL types. * Lint. * Find GraphQL schema files. * Remove test matcher. * Add graphql schema to paths. * Add schema-ast. * Keep todos count. * Add way to generate graphql schema. * Point graphql config to generated schema. * Make generate types command do the work. * Make watcher generate graphql schema and typedefs. * Use rw-gen-watch command in dev. * Clean up output. * Fix windows tests? * Update template tsconfigs. * skipLibCheck already in compiler options config.
- Loading branch information
Showing
74 changed files
with
12,762 additions
and
4,862 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
"name": "api", | ||
"version": "0.0.0", | ||
"dependencies": { | ||
"@redwoodjs/api": "0.7.0" | ||
"@redwoodjs/api": "0.32.2" | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
__fixtures__/example-todo-main/api/src/graphql/currentUser.sdl.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,5 @@ | ||
export const schema = gql` | ||
type Query { | ||
currentUser: JSON | ||
} | ||
` |
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ export const schema = gql` | |
type Query { | ||
todos: [Todo] | ||
todosCount: Int! | ||
} | ||
type Mutation { | ||
|
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,32 @@ | ||
{ | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"allowJs": true, | ||
"esModuleInterop": true, | ||
"target": "esnext", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"baseUrl": "./", | ||
"rootDirs": [ | ||
"./src", | ||
"../.redwood/types/mirror/api/src" | ||
], | ||
"paths": { | ||
"src/*": [ | ||
"./src/*", | ||
"../.redwood/types/mirror/api/src/*" | ||
], | ||
"types/*": ["./types/*"] | ||
}, | ||
"typeRoots": [ | ||
"../node_modules/@types", | ||
"./node_modules/@types" | ||
], | ||
"types": ["jest"], | ||
}, | ||
"include": [ | ||
"src", | ||
"../.redwood/types/includes/all-*", | ||
"../.redwood/types/includes/api-*", | ||
] | ||
} |
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 was deleted.
Oops, something went wrong.
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,17 @@ | ||
import { FatalErrorBoundary } from '@redwoodjs/web' | ||
import { RedwoodApolloProvider } from '@redwoodjs/web/apollo' | ||
|
||
import FatalErrorPage from 'src/pages/FatalErrorPage' | ||
import Routes from './Routes' | ||
|
||
import './index.css' | ||
|
||
const App = () => ( | ||
<FatalErrorBoundary page={FatalErrorPage}> | ||
<RedwoodApolloProvider> | ||
<Routes /> | ||
</RedwoodApolloProvider> | ||
</FatalErrorBoundary> | ||
) | ||
|
||
export default App |
3 changes: 3 additions & 0 deletions
3
__fixtures__/example-todo-main/web/src/components/TableCell/TableCell.js
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,3 @@ | ||
export default () => { | ||
return (<>I am not a cell, I am a component that is named cell.</>) | ||
} |
4 changes: 3 additions & 1 deletion
4
...c/components/TodoListCell/TodoListCell.js → .../components/TodoListCell/TodoListCell.tsx
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 was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...o-main/web/src/pages/HomePage/HomePage.js → ...-main/web/src/pages/HomePage/HomePage.tsx
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"esModuleInterop": true, | ||
"allowJs": true, | ||
"target": "esnext", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"baseUrl": "./", | ||
"paths": { | ||
"src/*": [ | ||
"./src/*", | ||
"../.redwood/types/mirror/web/src/*" | ||
] | ||
}, | ||
"rootDirs": [ | ||
"./src", | ||
"../.redwood/types/mirror/web/src" | ||
], | ||
"typeRoots": [ | ||
"../node_modules/@types", | ||
"./node_modules/@types" | ||
], | ||
"types": [ | ||
"jest" | ||
], | ||
"jsx": "preserve", | ||
}, | ||
"include": [ | ||
"src", | ||
"../.redwood/types/includes/all-*", | ||
"../.redwood/types/includes/web-*", | ||
] | ||
} |
Oops, something went wrong.