Skip to content

Commit 5cec386

Browse files
committed
Convert web app to npm
1 parent a1c7f68 commit 5cec386

36 files changed

Lines changed: 11251 additions & 6124 deletions

File tree

‎.github/actions/deploy-web-app/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ runs:
2121
- name: Build ${{ inputs.app }}
2222
shell: bash
2323
working-directory: web
24-
run: yarn build:${{ inputs.app }}
24+
run: npm run build:${{ inputs.app }}
2525

2626
- name: Publish ${{ inputs.app }}
2727
uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0

‎.github/workflows/ensu-build.yml‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,8 @@ jobs:
130130
uses: actions/setup-node@v6
131131
with:
132132
node-version: 24
133-
cache: "yarn"
134-
cache-dependency-path: "web/yarn.lock"
135-
136-
- name: Activate Yarn 1.22.22
137-
run: |
138-
corepack enable
139-
corepack prepare [email protected] --activate
133+
cache: "npm"
134+
cache-dependency-path: "web/package-lock.json"
140135

141136
- name: Install dependencies (Ubuntu only)
142137
if: matrix.platform.os == 'ubuntu-22.04'
@@ -150,11 +145,11 @@ jobs:
150145

151146
- name: Install web dependencies
152147
working-directory: web
153-
run: yarn install --frozen-lockfile
148+
run: npm ci
154149

155150
- name: Build WASM
156151
working-directory: web
157-
run: yarn build:wasm
152+
run: npm run build:wasm
158153

159154
- name: Install Tauri dependencies
160155
run: npm ci --prefix rust/apps/ensu

‎.github/workflows/web-deploy-2of3.yml‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,21 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v6
2121

22-
- name: Setup node and enable yarn caching
22+
- name: Setup node
2323
uses: actions/setup-node@v6
2424
with:
2525
node-version: 24
26-
cache: "yarn"
27-
cache-dependency-path: "web/yarn.lock"
28-
29-
- name: Activate Yarn 1.22.22
30-
run: |
31-
corepack enable
32-
corepack prepare [email protected] --activate
26+
cache: "npm"
27+
cache-dependency-path: "web/package-lock.json"
3328

3429
- name: Install dependencies
35-
run: yarn install --frozen-lockfile
30+
run: npm ci
3631

3732
- name: Audit dependencies
38-
run: |
39-
yarn audit --level critical || exit_code=$?
40-
if [[ $exit_code -ge 16 ]]; then
41-
echo "::error::Yarn audit found critical issues"
42-
exit 1
43-
fi
33+
run: npm audit --audit-level critical
4434

4535
- name: Build 2of3
46-
run: yarn build:twoof3
36+
run: npm run build:twoof3
4737

4838
- name: Publish 2of3
4939
uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0

‎.github/workflows/web-deploy.yml‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,18 @@ jobs:
3535
- name: Checkout
3636
uses: actions/checkout@v6
3737

38-
- name: Setup node and enable yarn caching
38+
- name: Setup node
3939
uses: actions/setup-node@v6
4040
with:
4141
node-version: 24
42-
cache: "yarn"
43-
cache-dependency-path: "web/yarn.lock"
44-
45-
- name: Activate Yarn 1.22.22
46-
run: |
47-
corepack enable
48-
corepack prepare [email protected] --activate
42+
cache: "npm"
43+
cache-dependency-path: "web/package-lock.json"
4944

5045
- name: Install dependencies
51-
run: yarn install --frozen-lockfile
46+
run: npm ci
5247

5348
- name: Audit dependencies
54-
run: |
55-
yarn audit --level critical || exit_code=$?
56-
if [[ $exit_code -ge 16 ]]; then
57-
echo "::error::Yarn audit found critical issues"
58-
exit 1
59-
fi
60-
49+
run: npm audit --audit-level critical
6150
- name: Deploy photos
6251
uses: ./.github/actions/deploy-web-app
6352
with:

‎.github/workflows/web-lint.yml‎

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,19 @@ jobs:
3030
- name: Checkout code
3131
uses: actions/checkout@v6
3232

33-
- name: Setup node and enable yarn caching
33+
- name: Setup node
3434
uses: actions/setup-node@v6
3535
with:
3636
node-version: 24
37-
cache: "yarn"
38-
cache-dependency-path: "web/yarn.lock"
37+
cache: "npm"
38+
cache-dependency-path: "web/package-lock.json"
3939

40-
- name: Activate Yarn 1.22.22
41-
run: |
42-
corepack enable
43-
corepack prepare [email protected] --activate
40+
- run: npm ci
4441

45-
- run: yarn install --frozen-lockfile
42+
- run: npm audit --audit-level critical
4643

47-
- run: yarn build:wasm
44+
- run: npm run build:wasm
4845

49-
- run: yarn lint
46+
- run: npm run lint
5047

51-
- run: yarn test
52-
53-
- name: Audit dependencies
54-
run: |
55-
yarn audit --level critical || exit_code=$?
56-
if [[ $exit_code -ge 16 ]]; then
57-
echo "::error::Yarn audit found critical issues"
58-
exit 1
59-
fi
48+
- run: npm test

‎desktop/docs/README.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ npm run dev
88
```
99

1010
The docs in this directory provide more details that some developers might find useful. You might also find the developer docs for [web](../../web/docs/README.md) useful.
11-
12-
## npm install
13-
14-
Use `npm ci` when installing dependencies since it uses the lockfile. Use plain `npm install` only when you are intentionally updating dependencies and reviewing the resulting `package-lock.json` changes.

‎desktop/docs/dev.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## npm commands
44

5+
### npm install
6+
7+
Use `npm ci` when installing dependencies since it uses the lockfile. Use plain `npm install` only when you are intentionally updating dependencies and reviewing the resulting `package-lock.json` changes.
8+
59
### npm run dev
610

711
Launch the app in development mode:

‎desktop/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
"build": "npm run build-renderer && npm run build-main",
1111
"build-main": "tsc && electron-builder",
1212
"build-main:quick": "tsc && electron-builder --dir --config.compression=store --config.mac.identity=null",
13-
"build-renderer": "cross-env-shell _ENTE_IS_DESKTOP=1 \"cd ../web && yarn install --frozen-lockfile && yarn build:photos && cd ../desktop && shx rm -rf out && shx cp -r ../web/apps/photos/out out\"",
13+
"build-renderer": "cross-env-shell _ENTE_IS_DESKTOP=1 \"cd ../web && npm ci && npm run build:photos && cd ../desktop && shx rm -rf out && shx cp -r ../web/apps/photos/out out\"",
1414
"build:ci": "npm run build-renderer && tsc",
1515
"build:quick": "npm run build-renderer && npm run build-main:quick",
1616
"dev": "concurrently --kill-others --success first --names 'main,rndr' \"npm run dev-main\" \"npm run dev-renderer\"",
1717
"dev-main": "tsc && electron .",
18-
"dev-renderer": "cross-env-shell _ENTE_IS_DESKTOP=1 \"cd ../web && yarn install --frozen-lockfile && yarn workspace photos next dev -p 3008\"",
18+
"dev-renderer": "cross-env-shell _ENTE_IS_DESKTOP=1 \"cd ../web && npm ci && npm exec --workspace photos -- next dev -p 3008\"",
1919
"postinstall": "electron-builder install-app-deps",
2020
"lint": "prettier --check --log-level warn . && eslint && tsc",
2121
"lint:fix": "prettier --write --log-level warn . && eslint && tsc",

‎docs/docs/self-hosting/development/lima.md‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ limactl shell docker /bin/bash -lc '
7070
-e NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080 \
7171
node:24-bookworm \
7272
bash -lc "
73-
corepack enable &&
74-
corepack prepare [email protected] --activate &&
75-
yarn install --frozen-lockfile &&
76-
yarn workspace paste next dev -p 3008
73+
npm ci &&
74+
npm exec --workspace paste -- next dev -p 3008
7775
"
7876
'
7977
```

‎docs/docs/self-hosting/installation/manual.md‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,14 @@ If you wish to run Ente from source without using Docker, follow the steps descr
4444
sudo apt install pkg-config
4545
```
4646

47-
4. **yarn, npm and Node.js:** Needed for building the web application.
47+
4. **npm and Node.js:** Needed for building the web application.
4848

4949
Install npm and Node using your package manager.
5050

5151
```shell
5252
sudo apt install npm nodejs
5353
```
5454

55-
Install yarn by following the [official documentation](https://yarnpkg.com/getting-started/install)
56-
5755
5. **Git:** Needed for cloning the repository and pulling in latest changes
5856

5957
6. **Caddy:** Used for setting reverse proxy and file servers
@@ -158,15 +156,15 @@ Museum should be accessible at `http://localhost:8080`
158156

159157
## Step 4: Configure Web Application
160158

161-
1. Install the dependencies for web application. Enable corepack if prompted.
159+
1. Install the dependencies for web application.
162160

163161
```shell
164162
# Change into web directory, this is where all the applications
165163
# will be managed and built
166164
cd ../web
167165
168166
# Install dependencies
169-
yarn install --frozen-lockfile
167+
npm ci
170168
```
171169

172170
2. Configure the environment variables in your corresponding shell's configuration file (`.bashrc`, `.zshrc`)
@@ -181,28 +179,28 @@ Museum should be accessible at `http://localhost:8080`
181179
```shell
182180
# These commands are executed inside web directory
183181
# Build photos. Build output to be served is present at apps/photos/out
184-
yarn build
182+
npm run build
185183
186184
# Build albums. Build output to be served is present at apps/albums/out
187-
yarn build:albums
185+
npm run build:albums
188186
189187
# Build accounts. Build output to be served is present at apps/accounts/out
190-
yarn build:accounts
188+
npm run build:accounts
191189
192190
# Build auth. Build output to be served is present at apps/auth/out
193-
yarn build:auth
191+
npm run build:auth
194192
195193
# Build cast. Build output to be served is present at apps/cast/out
196-
yarn build:cast
194+
npm run build:cast
197195
198196
# Build public locker. Build output to be served is present at apps/share/out
199-
yarn build:share
197+
npm run build:share
200198
201199
# Build embed. Build output to be served is present at apps/embed/out
202-
yarn build:embed
200+
npm run build:embed
203201
204202
# Build memories. Build output to be served is present at apps/memories/out
205-
yarn build:memories
203+
npm run build:memories
206204
```
207205
208206
4. Copy the output files to `/var/www/ente/apps` for easier management.

0 commit comments

Comments
 (0)