-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sync-schema script to sync generator schema.json to d.ts
- Loading branch information
Showing
29 changed files
with
463 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn verify-yarn-lock | ||
yarn sync-schemas --check | ||
yarn lint-staged |
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 |
---|---|---|
|
@@ -6,3 +6,5 @@ tmp | |
/.yarn | ||
|
||
.nx/cache | ||
# Ignore generated schema files in packages | ||
/packages/*/src/generators/**/*-schema.d.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
11 changes: 8 additions & 3 deletions
11
packages/preset-anchor/src/generators/application/application-anchor-generator.spec.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
26 changes: 20 additions & 6 deletions
26
packages/preset-anchor/src/generators/application/application-anchor-schema.d.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,8 +1,22 @@ | ||
export type ApplicationAnchorTemplate = 'counter' | 'hello-world' | ||
/* eslint-disable */ | ||
/** | ||
* This file was automatically generated by json-schema-to-typescript. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run json-schema-to-typescript to regenerate this file. | ||
*/ | ||
|
||
export interface ApplicationAnchorSchema { | ||
name: string | ||
skipFormat?: boolean | ||
template?: ApplicationAnchorTemplate | ||
/** | ||
* Name of the application | ||
*/ | ||
name: string; | ||
/** | ||
* Skip formatting files | ||
*/ | ||
skipFormat?: boolean; | ||
/** | ||
* The template to use | ||
*/ | ||
template?: "counter" | "hello-world"; | ||
[k: string]: unknown; | ||
} | ||
|
||
export type NormalizedApplicationAnchorSchema = Required<ApplicationAnchorSchema> |
4 changes: 2 additions & 2 deletions
4
packages/preset-anchor/src/generators/application/application-anchor-schema.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
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,2 +1,3 @@ | ||
export * from './application-anchor-ignore-files' | ||
export * from './application-anchor-dependencies' | ||
export * from './normalize-application-anchor-schema' |
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
51 changes: 39 additions & 12 deletions
51
packages/preset-next/src/generators/application/application-next-schema.d.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,15 +1,42 @@ | ||
import { ApplicationAnchorTemplate } from '@solana-developers/preset-anchor' | ||
import { ApplicationReactUiLibrary } from '@solana-developers/preset-react' | ||
/* eslint-disable */ | ||
/** | ||
* This file was automatically generated by json-schema-to-typescript. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run json-schema-to-typescript to regenerate this file. | ||
*/ | ||
|
||
export interface ApplicationNextSchema { | ||
appName?: string | ||
name: string | ||
port?: number | ||
skipFormat?: boolean | ||
uiLibrary?: ApplicationReactUiLibrary | ||
withAnchor?: boolean | ||
anchorName?: string | ||
anchorTemplate?: ApplicationAnchorTemplate | ||
/** | ||
* Name of the application | ||
*/ | ||
name: string; | ||
/** | ||
* Name of the application (overrides name) | ||
*/ | ||
appName?: string; | ||
/** | ||
* Port to run the application on | ||
*/ | ||
port?: number; | ||
/** | ||
* Skip formatting files | ||
*/ | ||
skipFormat?: boolean; | ||
/** | ||
* The UI library to use | ||
*/ | ||
uiLibrary?: "none" | "tailwind"; | ||
/** | ||
* Create an anchor program | ||
*/ | ||
withAnchor?: boolean; | ||
/** | ||
* Anchor project name | ||
*/ | ||
anchorName?: string; | ||
/** | ||
* The template to use | ||
*/ | ||
anchorTemplate?: "counter" | "hello-world"; | ||
[k: string]: unknown; | ||
} | ||
|
||
export type NormalizedApplicationNextSchema = Required<ApplicationNextSchema> |
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
6 changes: 2 additions & 4 deletions
6
packages/preset-next/src/utils/normalize-application-next-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
10 changes: 5 additions & 5 deletions
10
packages/preset-react/src/generators/application/application-react-generator.spec.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
46 changes: 35 additions & 11 deletions
46
packages/preset-react/src/generators/application/application-react-schema.d.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,14 +1,38 @@ | ||
import { ApplicationAnchorTemplate } from '@solana-developers/preset-anchor' | ||
export type ApplicationReactUiLibrary = 'none' | 'tailwind' | ||
/* eslint-disable */ | ||
/** | ||
* This file was automatically generated by json-schema-to-typescript. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run json-schema-to-typescript to regenerate this file. | ||
*/ | ||
|
||
export interface ApplicationReactSchema { | ||
anchorName?: string | ||
anchorTemplate?: ApplicationAnchorTemplate | ||
appName?: string | ||
name: string | ||
skipFormat?: boolean | ||
uiLibrary?: ApplicationReactUiLibrary | ||
withAnchor?: boolean | ||
/** | ||
* Name of the application | ||
*/ | ||
name: string; | ||
/** | ||
* Name of the application (overrides name) | ||
*/ | ||
appName?: string; | ||
/** | ||
* Skip formatting files | ||
*/ | ||
skipFormat?: boolean; | ||
/** | ||
* The UI library to use | ||
*/ | ||
uiLibrary?: "none" | "tailwind"; | ||
/** | ||
* Create an anchor program | ||
*/ | ||
withAnchor?: boolean; | ||
/** | ||
* Anchor project name | ||
*/ | ||
anchorName?: string; | ||
/** | ||
* The template to use | ||
*/ | ||
anchorTemplate?: "counter" | "hello-world"; | ||
[k: string]: unknown; | ||
} | ||
|
||
export type NormalizedApplicationReactSchema = Required<ApplicationReactSchema> |
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
2 changes: 1 addition & 1 deletion
2
packages/preset-react/src/utils/application-react-dependencies.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
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
9 changes: 5 additions & 4 deletions
9
packages/preset-react/src/utils/normalize-application-react-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
Oops, something went wrong.