mirror of
https://github.com/hestiacp/hestiacp.git
synced 2025-02-06 09:45:30 +00:00
Switch from Yarn v3 to npm (#3675)
* Switch from Yarn v3 to npm * Downgrade ESBuild to fix 3rd party bundles
This commit is contained in:
parent
5f9850709f
commit
f07b858961
15
.drone.yml
15
.drone.yml
@ -25,9 +25,8 @@ steps:
|
||||
- git submodule update --init --recursive
|
||||
- name: Build Hestia package and install
|
||||
commands:
|
||||
- yarn set version stable
|
||||
- yarn install
|
||||
- yarn build
|
||||
- npm ci
|
||||
- npm run build
|
||||
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
|
||||
- name: Run system / user tests
|
||||
commands:
|
||||
@ -75,9 +74,8 @@ steps:
|
||||
- git submodule update --init --recursive
|
||||
- name: Build Hestia package install
|
||||
commands:
|
||||
- yarn set version stable
|
||||
- yarn install
|
||||
- yarn build
|
||||
- npm ci
|
||||
- npm run build
|
||||
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
|
||||
- name: Run system / user tests
|
||||
commands:
|
||||
@ -115,9 +113,8 @@ steps:
|
||||
- name: Build JS/CSS
|
||||
image: node:current-slim
|
||||
commands:
|
||||
- yarn set version stable
|
||||
- yarn install
|
||||
- yarn build
|
||||
- npm ci
|
||||
- npm run build
|
||||
- name: Build
|
||||
image: debian:bullseye
|
||||
commands:
|
||||
|
@ -2,8 +2,6 @@
|
||||
*.min.js
|
||||
|
||||
# Vendor/packages
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
**/node_modules/
|
||||
**/vendor/
|
||||
|
||||
|
21
.github/workflows/lint.yml
vendored
21
.github/workflows/lint.yml
vendored
@ -45,14 +45,11 @@ jobs:
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Yarn v3
|
||||
run: corepack enable && corepack prepare yarn@stable --activate
|
||||
|
||||
- name: Install Node packages
|
||||
run: yarn install --immutable
|
||||
run: npm ci
|
||||
|
||||
- name: Run Prettier
|
||||
run: yarn prettier --check .
|
||||
run: npx prettier --check .
|
||||
|
||||
eslint:
|
||||
name: ESLint
|
||||
@ -66,14 +63,11 @@ jobs:
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Yarn v3
|
||||
run: corepack enable && corepack prepare yarn@stable --activate
|
||||
|
||||
- name: Install Node packages
|
||||
run: yarn install --immutable
|
||||
run: npm ci
|
||||
|
||||
- name: Run ESLint
|
||||
run: yarn eslint .
|
||||
run: npx eslint .
|
||||
|
||||
stylelint:
|
||||
name: Stylelint
|
||||
@ -87,11 +81,8 @@ jobs:
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Yarn v3
|
||||
run: corepack enable && corepack prepare yarn@stable --activate
|
||||
|
||||
- name: Install Node packages
|
||||
run: yarn install --immutable
|
||||
run: npm ci
|
||||
|
||||
- name: Run Stylelint
|
||||
run: yarn stylelint web/css/src/**/*.css
|
||||
run: npx stylelint web/css/src/**/*.css
|
||||
|
12
.gitignore
vendored
12
.gitignore
vendored
@ -49,15 +49,3 @@ npm-debug.log
|
||||
|
||||
# optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# yarn v2+
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
.pnp.*
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
yarn lint-staged
|
||||
npx lint-staged
|
||||
|
@ -31,8 +31,6 @@ web/templates/
|
||||
/install/common/templates/email/
|
||||
|
||||
# Vendor/packages
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
**/node_modules/
|
||||
**/vendor/
|
||||
**/composer.phar
|
||||
@ -47,12 +45,7 @@ web/templates/
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
# npm lock file
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
|
@ -3,8 +3,6 @@ web/css/src/dependencies
|
||||
*.min.css
|
||||
|
||||
# Vendor/packages
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
**/node_modules/
|
||||
**/vendor/
|
||||
|
||||
|
@ -22,7 +22,7 @@ Additional information on how to contribute to Hestia Control Panel can be found
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
### Workflow and process
|
||||
|
||||
|
@ -24,8 +24,8 @@ source_conf "$HESTIA/conf/hestia.conf"
|
||||
# Perform verification if read-only mode is enabled
|
||||
check_hestia_demo_mode
|
||||
|
||||
if [ -z $(which "yarn") ]; then
|
||||
echo "Unable to locate Yarn and NodeJS See https://hestiacp.com/docs/contributing/development.html"
|
||||
if [ -z $(which "node") ]; then
|
||||
echo "Unable to locate Node.js See https://hestiacp.com/docs/contributing/development.html"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -300,9 +300,8 @@ mkdir -p $BUILD_DIR_HESTIA/usr/local/hestia
|
||||
# Move needed directories
|
||||
cd $BUILD_DIR/hestiacp-$branch_dash
|
||||
|
||||
yarn set version stable
|
||||
yarn install
|
||||
yarn build
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
cp -rf bin func install web $BUILD_DIR_HESTIA/usr/local/hestia/
|
||||
|
||||
|
@ -12,8 +12,6 @@ The following is useful for testing a Pull Request or a branch on a fork.
|
||||
|
||||
1. Install Node.js [Download](https://nodejs.org/en/download) or use [Node Source APT](https://github.com/nodesource/distributions)
|
||||
|
||||
1. Install [Yarn](https://yarnpkg.com/getting-started/install) via `corepack enable`
|
||||
|
||||
```bash
|
||||
# Replace with https://github.com/username/hestiacp.git if you want to test a branch that you created yourself
|
||||
git clone https://github.com/hestiacp/hestiacp.git
|
||||
@ -22,12 +20,10 @@ cd ./hestiacp/
|
||||
# Replace main with the branch you want to test
|
||||
git checkout main
|
||||
|
||||
# Enable Yarn 3.x
|
||||
yarn set version stable
|
||||
# Install Dependencies
|
||||
yarn install
|
||||
npm install
|
||||
# Build
|
||||
yarn build
|
||||
npm run build
|
||||
|
||||
cd ./src/
|
||||
|
||||
@ -79,8 +75,6 @@ The following method only supports building the `hestia` package. If you need to
|
||||
|
||||
1. Install Node.js [Download](https://nodejs.org/en/download) or use [Node Source APT](https://github.com/nodesource/distributions)
|
||||
|
||||
1. Install [Yarn](https://yarnpkg.com/getting-started/install) via `corepack enable`
|
||||
|
||||
```bash
|
||||
v-update-sys-hestia-git [USERNAME] [BRANCH]
|
||||
```
|
||||
|
@ -51,14 +51,13 @@ multipass mount $HOME/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
|
||||
sudo apt update && sudo apt install -y jq libjq1
|
||||
```
|
||||
|
||||
1. Install [Node JS](https://nodejs.org/en) and Yarn via `corepack enable`
|
||||
1. Install [Node JS](https://nodejs.org/)
|
||||
|
||||
1. Build the theme files with
|
||||
|
||||
```bash
|
||||
yarn set version stable
|
||||
yarn install
|
||||
yarn build
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
1. Navigate to `/src` and build Hestia packages
|
||||
@ -105,14 +104,10 @@ After setting up Hestia in a VM you can now make changes to the source code in `
|
||||
|
||||
The following are example instructions for making a change to Hestia's UI and testing it locally.
|
||||
|
||||
::: info
|
||||
Please ensure you have [Yarn](https://yarnpkg.com) v3 installed and are using [Node.js](https://nodejs.org/en/) v16 or higher.
|
||||
:::
|
||||
|
||||
1. At the root of the project on your local machine, install Node dependencies
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
npm install
|
||||
```
|
||||
|
||||
1. Make a change to a file that we can later test, then build the UI assets
|
||||
@ -120,7 +115,7 @@ Please ensure you have [Yarn](https://yarnpkg.com) v3 installed and are using [N
|
||||
_e.g. change the body background color to red in `web/css/src/base.css` then run:_
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
npm run build
|
||||
```
|
||||
|
||||
1. SSH into the VM as root and navigate to `/src`
|
||||
|
@ -5,12 +5,11 @@ The documentation is built using [VitePress](https://vitepress.vuejs.org). There
|
||||
## Requirements
|
||||
|
||||
- Node.js 16 or higher
|
||||
- [Yarn](https://yarnpkg.com/getting-started/install) package manager
|
||||
- A code editor with Vue and Markdown support. We suggest [Visual Studio Code](https://code.visualstudio.com).
|
||||
|
||||
## Viewing your changes locally
|
||||
|
||||
1. Open the project folder in your terminal.
|
||||
2. If the dependencies are not installed yet, install them by running `yarn install`.
|
||||
3. Run `yarn docs:dev`.
|
||||
2. If the dependencies are not installed yet, install them by running `npm install`.
|
||||
3. Run `npm run docs:dev`.
|
||||
4. Navigate to `http://localhost:5173` in your browser.
|
||||
|
8990
package-lock.json
generated
Normal file
8990
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -14,10 +14,9 @@
|
||||
"lint": "prettier --cache --check . && eslint --cache . && stylelint web/css/src/**/*.css && markdownlint-cli2 *.md docs/**/*.md",
|
||||
"lint-staged": "lint-staged",
|
||||
"format": "prettier --cache --write .",
|
||||
"preinstall": "npx only-allow yarn",
|
||||
"postinstall": "husky install"
|
||||
"preinstall": "npx only-allow npm",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"packageManager": "yarn@3.5.1",
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^6.4.0",
|
||||
"alpinejs": "^3.12.2",
|
||||
@ -31,7 +30,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
||||
"@typescript-eslint/parser": "^5.59.9",
|
||||
"cssnano": "^6.0.1",
|
||||
"esbuild": "^0.18.1",
|
||||
"esbuild": "^0.17.19",
|
||||
"eslint": "^8.42.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-editorconfig": "^4.0.3",
|
||||
|
Loading…
x
Reference in New Issue
Block a user