From 4c564689703c49c3309306369d4c7b012deadd3d Mon Sep 17 00:00:00 2001 From: vcoppe Date: Tue, 24 Sep 2024 13:45:30 +0200 Subject: [PATCH] rely on gpx postinstall script to build the library --- .github/workflows/deploy.yml | 6 ------ README.md | 12 ++---------- gpx/package.json | 2 +- website/package-lock.json | 11 ++++++++--- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f05cc40d..f15883f3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,12 +18,6 @@ jobs: cache-dependency-path: | gpx/package-lock.json website/package-lock.json - - - name: Install dependencies for gpx - run: npm install --prefix gpx - - - name: Build gpx - run: npm run build --prefix gpx - name: Install dependencies for website run: npm install --prefix website diff --git a/README.md b/README.md index b6a51cf8..7f05e339 100644 --- a/README.md +++ b/README.md @@ -29,17 +29,9 @@ The code is split into two parts: - `gpx`: a Typescript library for parsing and manipulating GPX files, - `website`: the website itself, which is a [SvelteKit](https://kit.svelte.dev/) application. -You will need [Node.js](https://nodejs.org/) to build and run these two parts. +You will need [Node.js](https://nodejs.org/) to build and run the website. -### Building the `gpx` library - -```bash -cd gpx -npm install -npm run build -``` - -### Running the website +### Running the website in development mode To be able to load the map, you will need to create your own Mapbox access token and store it in a `.env` file in the `website` directory. diff --git a/gpx/package.json b/gpx/package.json index 809e2536..3d35f22b 100644 --- a/gpx/package.json +++ b/gpx/package.json @@ -22,6 +22,6 @@ }, "scripts": { "build": "tsc", - "postinstall": "npm run build" + "postinstall": "npm install && npm run build" } } \ No newline at end of file diff --git a/website/package-lock.json b/website/package-lock.json index 6c8f5d89..c7cd46bd 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -73,6 +73,7 @@ }, "../gpx": { "version": "1.0.0", + "hasInstallScript": true, "dependencies": { "fast-xml-parser": "^4.4.0", "immer": "^10.1.1", @@ -2163,14 +2164,18 @@ } }, "node_modules/@sveltejs/enhanced-img": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@sveltejs/enhanced-img/-/enhanced-img-0.3.0.tgz", - "integrity": "sha512-o8FdEUyJR/+LjUUl4sgB9QeM9rSGpOzTO6/CH0AmO/FgwWkcJdj/MwVNtr2F/AtaPgNfzvRpnExjklmuuDOtPA==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@sveltejs/enhanced-img/-/enhanced-img-0.3.8.tgz", + "integrity": "sha512-n66u46ZeqHltiTm0BEjWptYmCrCY0EltEEvakmC7d5o5ZejDbOvOWm914mebbRKaP2Bezv65TNCod/wqvw/0KA==", "dev": true, "dependencies": { "magic-string": "^0.30.5", "svelte-parse-markup": "^0.1.2", "vite-imagetools": "^7.0.1" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "vite": ">= 5.0.0" } }, "node_modules/@sveltejs/kit": {