From 35bcb9ef5635f42c455db5a3876e6c2d6e154e01 Mon Sep 17 00:00:00 2001
From: Jason Dreyzehner <jason@dreyzehner.com>
Date: Thu, 18 Jan 2024 03:27:37 -0500
Subject: [PATCH] Build and use local libauth

---
 .cspell.json                                    | 1 +
 .eslintrc.cjs                                   | 8 +++++++-
 .github/workflows/ci.yml                        | 8 +++-----
 README.md                                       | 5 ++---
 package.json                                    | 1 +
 src/editor/dialogs/guide-dialog/GuideDialog.tsx | 2 +-
 6 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/.cspell.json b/.cspell.json
index d4993e3..1f1f880 100644
--- a/.cspell.json
+++ b/.cspell.json
@@ -19,6 +19,7 @@
     "CHECKSIG",
     "CHECKSIGVERIFY",
     "Codecov",
+    "corepack",
     "Dreyzehner",
     "EQUALVERIFY",
     "filechooser",
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index a2a2dbc..1b1d7ba 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -21,7 +21,13 @@ module.exports = {
     'plugin:react/jsx-runtime',
     'plugin:react-hooks/recommended',
   ],
-  ignorePatterns: ['coverage', 'dist', 'libauth', '.eslintrc.cjs'],
+  ignorePatterns: [
+    'coverage',
+    'dist',
+    'libauth',
+    'playwright-report',
+    '.eslintrc.cjs',
+  ],
   parser: '@typescript-eslint/parser',
   plugins: ['@typescript-eslint', 'import', 'react-refresh'],
   settings: {
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a91eb2e..a2fb753 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,7 +7,7 @@ jobs:
     steps:
       - uses: actions/checkout@v4
         with:
-          submodules: 'true'
+          submodules: 'recursive'
       - uses: actions/setup-node@v4
         with:
           node-version: 20
@@ -15,14 +15,13 @@ jobs:
       - run: yarn test:lint
 
   prod-e2e:
-    timeout-minutes: 5
     runs-on: ubuntu-latest
     container:
       image: mcr.microsoft.com/playwright:v1.41.0-jammy
     steps:
       - uses: actions/checkout@v4
         with:
-          submodules: 'true'
+          submodules: 'recursive'
       - uses: actions/setup-node@v4
         with:
           node-version: 20
@@ -38,14 +37,13 @@ jobs:
       - uses: codecov/codecov-action@v3
 
   dev-e2e-and-coverage:
-    timeout-minutes: 5
     runs-on: ubuntu-latest
     container:
       image: mcr.microsoft.com/playwright:v1.41.0-jammy
     steps:
       - uses: actions/checkout@v4
         with:
-          submodules: 'true'
+          submodules: 'recursive'
       - uses: actions/setup-node@v4
         with:
           node-version: 20
diff --git a/README.md b/README.md
index 452f267..021e88b 100644
--- a/README.md
+++ b/README.md
@@ -38,11 +38,10 @@ Read more about it in [the blog post](https://blog.bitjson.com/bitauth-ide-write
 
 Pull Requests are welcome!
 
-This application requires [Yarn](https://yarnpkg.com/) for development. If you don't have Yarn, make sure you have `Node.js` installed, then run `npm install -g yarn`. Once Yarn is installed, recursive-clone `bitauth-ide` and run the `start` package script:
+This application requires [Yarn](https://yarnpkg.com/) for development. With `Node.js` installed, the `yarn` package manager can be installed by running `corepack enable`. Once `yarn` is installed:
 
 ```sh
-# note the use of --recursive to clone submodules
-git clone --recursive https://github.com/bitauth/bitauth-ide.git
+git clone https://github.com/bitauth/bitauth-ide.git
 cd bitauth-ide
 yarn
 yarn start
diff --git a/package.json b/package.json
index ab0dbd7..f7bdd24 100644
--- a/package.json
+++ b/package.json
@@ -48,6 +48,7 @@
     "workbox-window": "^7.0.0"
   },
   "scripts": {
+    "preinstall": "git submodule update --init --recursive && cd libauth && yarn && yarn build",
     "start": "vite",
     "build": "tsc && vite build",
     "preview": "vite preview",
diff --git a/src/editor/dialogs/guide-dialog/GuideDialog.tsx b/src/editor/dialogs/guide-dialog/GuideDialog.tsx
index 3c7e9e3..1f5feee 100644
--- a/src/editor/dialogs/guide-dialog/GuideDialog.tsx
+++ b/src/editor/dialogs/guide-dialog/GuideDialog.tsx
@@ -66,7 +66,7 @@ export const GuideDialog = ({
         </p>
         <h3>Scripts</h3>
         <p>
-          All Bitauth templates define a set of scripts which are used by its
+          Every Bitauth templates define a set of scripts which are used by its
           entities. There are 4 types of scripts:
         </p>
         <ul>