From fece75cfe711d6e47a04d5c79c11f11c1bdef34b Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Wed, 24 Apr 2024 19:48:01 +0200 Subject: [PATCH] automatically install typescript into ./node_modules if missing during build simplifies process. --- .github/workflows/build-test.yml | 1 - Makefile | 6 ++++-- develop.txt | 7 +++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 01e1d6c..79f8d2d 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -17,7 +17,6 @@ jobs: with: node-version: 16 cache: 'npm' - - run: npm ci - run: 'touch */*.ts' - uses: actions/setup-go@v4 diff --git a/Makefile b/Makefile index 8d451d0..09cff30 100644 --- a/Makefile +++ b/Makefile @@ -110,10 +110,12 @@ fmt: tswatch: bash -c 'while true; do inotifywait -q -e close_write *.ts webadmin/*.ts webaccount/*.ts webmail/*.ts; make frontend; done' -install-js: +node_modules/.bin/tsc: -mkdir -p node_modules/.bin npm ci +install-js: node_modules/.bin/tsc + install-js0: -mkdir -p node_modules/.bin npm install --save-dev --save-exact typescript@5.1.6 @@ -133,7 +135,7 @@ webadmin/admin.js: lib.ts webadmin/api.ts webadmin/admin.ts webaccount/account.js: lib.ts webaccount/api.ts webaccount/account.ts ./tsc.sh $@ $^ -frontend: webadmin/admin.js webaccount/account.js webmail/webmail.js webmail/msg.js webmail/text.js +frontend: node_modules/.bin/tsc webadmin/admin.js webaccount/account.js webmail/webmail.js webmail/msg.js webmail/text.js install-apidiff: go install golang.org/x/exp/cmd/apidiff@v0.0.0-20231206192017-f3f8817b8deb diff --git a/develop.txt b/develop.txt index 09ea215..cbe7c63 100644 --- a/develop.txt +++ b/develop.txt @@ -3,10 +3,9 @@ This file has notes useful for mox developers. # Building & testing For a full build, you'll need a recent Go compiler/toolchain and nodejs/npm for -the frontend. First install frontend dependencies (typescript) with "make -install-js". Then run "make build" to do a full build. Run "make test" to run -the test suite. With docker installed, you can run "make test-integration" to -start up a few mox instances, a dns server, a postfix instance, and send email +the frontend. Run "make build" to do a full build. Run "make test" to run the +test suite. With docker installed, you can run "make test-integration" to start +up a few mox instances, a dns server, a postfix instance, and send email between them. The mox localserve command is a convenient way to test locally. Most of the