-
Notifications
You must be signed in to change notification settings - Fork 171
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 #372 from Shopify/typescript
Typescript π
- Loading branch information
Showing
19 changed files
with
152 additions
and
71 deletions.
There are no files selected for viewing
File renamed without changes.
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,80 @@ | ||
name: Create Javascript conversion PR | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
convert-ts-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Create lock file | ||
run: touch yarn.lock | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn add -W --dev @shopify/prettier-config @shopify/eslint-plugin | ||
|
||
- name: Transpile to Javascript | ||
run: | | ||
find app \( -name "*.ts" -o -name "*.tsx" \) -exec yarn tsc \ | ||
--strict \ | ||
--removeComments false \ | ||
--skipLibCheck \ | ||
--isolatedModules \ | ||
--noEmitOnError \ | ||
--jsx "preserve" \ | ||
--module "ES2022" \ | ||
--moduleResolution "bundler" \ | ||
--target "ES2022" \ | ||
--types "@shopify/app-bridge-types" \ | ||
{} + | ||
- name: Remove Typescript files | ||
run: find app \( -name "*.ts" -o -name "*.tsx" \) -delete | ||
|
||
- name: Run prettier | ||
run: yarn prettier -w "app/**/*.{js,jsx}" --plugin @shopify/prettier-config | ||
|
||
- name: Run ESLint | ||
run: | | ||
yarn lint "app/**/*.{js,jsx}" --fix --no-cache --plugin @shopify/eslint-plugin --rule '{ | ||
"import/order": "error", | ||
"import/newline-after-import": "error", | ||
"padding-line-between-statements": ["error", | ||
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"}, | ||
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]} | ||
{ "blankLine": "always", "prev": "*", "next": "return" }, | ||
{ "blankLine": "always", "prev": "*", "next": "export" }, | ||
{ "blankLine": "never", "prev": "export", "next": "export" }, | ||
{ "blankLine": "always", "prev": "*", "next": "block-like" }, | ||
{ "blankLine": "always", "prev": "block-like", "next": "*" } | ||
]}' | ||
- name: Stage changes to files | ||
run: | | ||
git fetch | ||
git checkout javascript_updates || git checkout -b javascript_updates | ||
git config user.name GitHub | ||
git config user.email [email protected] | ||
git add app | ||
git commit -m "Convert template to Javascript" | ||
git push --force origin javascript_updates | ||
- name: Create Javascript PR | ||
run: | | ||
gh pr view --json mergedAt -q ".mergedAt" javascript_updates | grep -E "^$" || \ | ||
gh pr create -B javascript -H javascript_updates --title 'Convert template to Javascript' --body 'This is an automated PR that converts the latest changes from Typescript to Javascript' | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module "*.css"; |
File renamed without changes.
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 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { LoaderFunctionArgs } from "@remix-run/node"; | ||
import { authenticate } from "../shopify.server"; | ||
|
||
export const loader = async ({ request }: LoaderFunctionArgs) => { | ||
await authenticate.admin(request); | ||
|
||
return null; | ||
}; |
7 changes: 6 additions & 1 deletion
7
app/routes/auth.login/error.server.jsx β app/routes/auth.login/error.server.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
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.