From bcddafadd1d71752f7a606e8ccff95649af7a24d Mon Sep 17 00:00:00 2001
From: Jason Dreyzehner
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 | 16 +++++++++++-----
README.md | 5 ++---
package.json | 1 +
src/editor/dialogs/guide-dialog/GuideDialog.tsx | 2 +-
6 files changed, 23 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..9fec7af 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,17 +15,23 @@ 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
+ # The "preinstall" script runs "git submodule update --init --recursive"
+ # to avoid requiring users to understand this project's submodules
+ # configuration. Since the files are owned by a different user than the
+ # GitHub Action runner (a quirk of GitHub Actions), updating the
+ # submodules again would error: `fatal: detected dubious ownership in repository at '/__w/bitauth-ide/bitauth-ide'`
+ # We can safely disable this check for CI.
+ - run: git config --global --add safe.directory '*'
- run: yarn install --immutable --immutable-cache
- run: yarn build
- run: yarn test:e2e:prod
@@ -38,17 +44,17 @@ 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
+ - run: git config --global --add safe.directory '*'
- run: yarn install --immutable --immutable-cache
- run: yarn test:e2e
- uses: actions/upload-artifact@v4
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 = ({
Scripts
- 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: