-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: wip add script to install, build, and typecheck examples
Signed-off-by: Logan McAnsh <[email protected]>
- Loading branch information
Showing
17 changed files
with
311 additions
and
49 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Typecheck changed examples | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
typecheck: | ||
if: github.repository == 'remix-run/examples' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "yarn" | ||
|
||
- name: 📥 Install deps | ||
run: yarn --frozen-lockfile | ||
|
||
- name: install, build, typecheck | ||
run: node ./scripts/test.mjs |
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,4 +1,4 @@ | ||
interface User { | ||
export interface User { | ||
id: string; | ||
email: string; | ||
name: string; | ||
|
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
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
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 |
---|---|---|
|
@@ -125,8 +125,15 @@ export const action = async ({ request }: ActionArgs) => { | |
}; | ||
|
||
export default function Register() { | ||
const actionData = useActionData<typeof action>() || {}; | ||
const { fieldErrors, fields, formError } = actionData; | ||
const actionData = useActionData<typeof action>(); | ||
let fieldErrors = | ||
actionData && "fieldErrors" in actionData | ||
? actionData.fieldErrors | ||
: undefined; | ||
let formError = | ||
actionData && "formError" in actionData ? actionData.formError : undefined; | ||
let fields = | ||
actionData && "fields" in actionData ? actionData.fields : undefined; | ||
const [searchParams] = useSearchParams(); | ||
|
||
React.useEffect(() => { | ||
|
@@ -169,7 +176,7 @@ export default function Register() { | |
id="form-error-text" | ||
role="alert" | ||
> | ||
{actionData.formError} | ||
{formError} | ||
</span> | ||
</div> | ||
) : null} | ||
|
@@ -194,7 +201,7 @@ export default function Register() { | |
error={fieldErrors?.nameFirst} | ||
> | ||
<Label>First Name</Label> | ||
<Field defaultValue={fields?.nameFirst} /> | ||
<Field defaultValue={fields?.nameFirst || undefined} /> | ||
<FieldError /> | ||
</FieldProvider> | ||
<FieldProvider | ||
|
@@ -203,7 +210,7 @@ export default function Register() { | |
error={fieldErrors?.nameLast} | ||
> | ||
<Label>Last Name</Label> | ||
<Field defaultValue={fields?.nameLast} /> | ||
<Field defaultValue={fields?.nameLast || undefined} /> | ||
<FieldError /> | ||
</FieldProvider> | ||
<FieldProvider | ||
|
@@ -216,7 +223,7 @@ export default function Register() { | |
<Field | ||
type="email" | ||
placeholder="[email protected]" | ||
defaultValue={fields?.email} | ||
defaultValue={fields?.email || undefined} | ||
/> | ||
<FieldError /> | ||
</FieldProvider> | ||
|
@@ -227,7 +234,10 @@ export default function Register() { | |
error={fieldErrors?.password} | ||
> | ||
<Label>Password</Label> | ||
<Field type="password" defaultValue={fields?.password} /> | ||
<Field | ||
type="password" | ||
defaultValue={fields?.password || undefined} | ||
/> | ||
<FieldError /> | ||
</FieldProvider> | ||
<Button className="register__email-submit-button">Sign Up</Button> | ||
|
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
Oops, something went wrong.