Skip to content

Commit f07b858

Browse files
authored
Switch from Yarn v3 to npm (hestiacp#3675)
* Switch from Yarn v3 to npm * Downgrade ESBuild to fix 3rd party bundles
1 parent 5f98507 commit f07b858

File tree

15 files changed

+9021
-7326
lines changed

15 files changed

+9021
-7326
lines changed

.drone.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ steps:
2525
- git submodule update --init --recursive
2626
- name: Build Hestia package and install
2727
commands:
28-
- yarn set version stable
29-
- yarn install
30-
- yarn build
28+
- npm ci
29+
- npm run build
3130
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
3231
- name: Run system / user tests
3332
commands:
@@ -75,9 +74,8 @@ steps:
7574
- git submodule update --init --recursive
7675
- name: Build Hestia package install
7776
commands:
78-
- yarn set version stable
79-
- yarn install
80-
- yarn build
77+
- npm ci
78+
- npm run build
8179
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
8280
- name: Run system / user tests
8381
commands:
@@ -115,9 +113,8 @@ steps:
115113
- name: Build JS/CSS
116114
image: node:current-slim
117115
commands:
118-
- yarn set version stable
119-
- yarn install
120-
- yarn build
116+
- npm ci
117+
- npm run build
121118
- name: Build
122119
image: debian:bullseye
123120
commands:

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
*.min.js
33

44
# Vendor/packages
5-
.pnp.*
6-
.yarn/*
75
**/node_modules/
86
**/vendor/
97

.github/workflows/lint.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,11 @@ jobs:
4545
with:
4646
node-version: 16
4747

48-
- name: Install Yarn v3
49-
run: corepack enable && corepack prepare yarn@stable --activate
50-
5148
- name: Install Node packages
52-
run: yarn install --immutable
49+
run: npm ci
5350

5451
- name: Run Prettier
55-
run: yarn prettier --check .
52+
run: npx prettier --check .
5653

5754
eslint:
5855
name: ESLint
@@ -66,14 +63,11 @@ jobs:
6663
with:
6764
node-version: 16
6865

69-
- name: Install Yarn v3
70-
run: corepack enable && corepack prepare yarn@stable --activate
71-
7266
- name: Install Node packages
73-
run: yarn install --immutable
67+
run: npm ci
7468

7569
- name: Run ESLint
76-
run: yarn eslint .
70+
run: npx eslint .
7771

7872
stylelint:
7973
name: Stylelint
@@ -87,11 +81,8 @@ jobs:
8781
with:
8882
node-version: 16
8983

90-
- name: Install Yarn v3
91-
run: corepack enable && corepack prepare yarn@stable --activate
92-
9384
- name: Install Node packages
94-
run: yarn install --immutable
85+
run: npm ci
9586

9687
- name: Run Stylelint
97-
run: yarn stylelint web/css/src/**/*.css
88+
run: npx stylelint web/css/src/**/*.css

.gitignore

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,3 @@ npm-debug.log
4949

5050
# optional eslint cache
5151
.eslintcache
52-
53-
# Yarn Integrity file
54-
.yarn-integrity
55-
56-
# yarn v2+
57-
.yarn/*
58-
!.yarn/patches
59-
!.yarn/plugins
60-
!.yarn/releases
61-
!.yarn/sdks
62-
!.yarn/versions
63-
.pnp.*

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint-staged
4+
npx lint-staged

.prettierignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ web/templates/
3131
/install/common/templates/email/
3232

3333
# Vendor/packages
34-
.pnp.*
35-
.yarn/*
3634
**/node_modules/
3735
**/vendor/
3836
**/composer.phar
@@ -47,12 +45,7 @@ web/templates/
4745
logs
4846
*.log
4947
npm-debug.log*
50-
yarn-debug.log*
51-
yarn-error.log*
52-
pnpm-debug.log*
5348
lerna-debug.log*
5449

55-
# PNPM, NPM and YARN
56-
pnpm-lock.yaml
50+
# npm lock file
5751
package-lock.json
58-
yarn.lock

.stylelintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ web/css/src/dependencies
33
*.min.css
44

55
# Vendor/packages
6-
.pnp.*
7-
.yarn/*
86
**/node_modules/
97
**/vendor/
108

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Additional information on how to contribute to Hestia Control Panel can be found
2222

2323
We ask that you follow existing naming schemes and coding conventions where possible, and that you add comments in your source code where appropriate to aid other developers in debugging and understanding your code in the future.
2424

25-
To ensure your changes meet our formatting requirements, please run `yarn install` from the root of the repository before committing your changes. This will set up pre-commit hooks for automatic formatting, which will help to get your changes merged as quickly as possible.
25+
To ensure your changes meet our formatting requirements, please run `npm install` from the root of the repository before committing your changes. This will set up pre-commit hooks for automatic formatting, which will help to get your changes merged as quickly as possible.
2626

2727
### Workflow and process
2828

bin/v-update-sys-hestia-git

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ source_conf "$HESTIA/conf/hestia.conf"
2424
# Perform verification if read-only mode is enabled
2525
check_hestia_demo_mode
2626

27-
if [ -z $(which "yarn") ]; then
28-
echo "Unable to locate Yarn and NodeJS See https://hestiacp.com/docs/contributing/development.html"
27+
if [ -z $(which "node") ]; then
28+
echo "Unable to locate Node.js See https://hestiacp.com/docs/contributing/development.html"
2929
exit 0
3030
fi
3131

@@ -300,9 +300,8 @@ mkdir -p $BUILD_DIR_HESTIA/usr/local/hestia
300300
# Move needed directories
301301
cd $BUILD_DIR/hestiacp-$branch_dash
302302

303-
yarn set version stable
304-
yarn install
305-
yarn build
303+
npm install
304+
npm run build
306305

307306
cp -rf bin func install web $BUILD_DIR_HESTIA/usr/local/hestia/
308307

docs/docs/contributing/building.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ The following is useful for testing a Pull Request or a branch on a fork.
1212

1313
1. Install Node.js [Download](https://nodejs.org/en/download) or use [Node Source APT](https://github.com/nodesource/distributions)
1414

15-
1. Install [Yarn](https://yarnpkg.com/getting-started/install) via `corepack enable`
16-
1715
```bash
1816
# Replace with https://github.com/username/hestiacp.git if you want to test a branch that you created yourself
1917
git clone https://github.com/hestiacp/hestiacp.git
@@ -22,12 +20,10 @@ cd ./hestiacp/
2220
# Replace main with the branch you want to test
2321
git checkout main
2422

25-
# Enable Yarn 3.x
26-
yarn set version stable
2723
# Install Dependencies
28-
yarn install
24+
npm install
2925
# Build
30-
yarn build
26+
npm run build
3127

3228
cd ./src/
3329

@@ -79,8 +75,6 @@ The following method only supports building the `hestia` package. If you need to
7975

8076
1. Install Node.js [Download](https://nodejs.org/en/download) or use [Node Source APT](https://github.com/nodesource/distributions)
8177

82-
1. Install [Yarn](https://yarnpkg.com/getting-started/install) via `corepack enable`
83-
8478
```bash
8579
v-update-sys-hestia-git [USERNAME] [BRANCH]
8680
```

0 commit comments

Comments
 (0)