未验证 提交 8552a462 编写于 作者: P Paweł Kuna 提交者: GitHub

Switch from `npm` to `pnpm` for faster package installation (#1559)

上级 289dd3bd
---
"@tabler/core": patch
---
Switch from `npm` to `pnpm` for faster package installation
......@@ -23,7 +23,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
- name: Install PNPM
run: npm i -g pnpm
- name: Set up Bundler
uses: ruby/setup-ruby@v1
......@@ -31,14 +33,14 @@ jobs:
ruby-version: 2.6
bundler-cache: true
- name: Install npm dependencies
run: npm install
- name: Install pnpm dependencies
run: pnpm install
- name: Run build
run: npm run build
run: pnpm run build
- name: Run bundlewatch
run: npm run bundlewatch
run: pnpm run bundlewatch
env:
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"
CI_BRANCH_BASE: dev
......@@ -22,5 +22,5 @@ jobs:
uses: xalvarez/prevent-file-change-action@v1
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
pattern: Gemfile.lock|package-lock.json
pattern: Gemfile.lock|pnpm-lock.json
trustedAuthors: codecalm, dependabot
......@@ -21,7 +21,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
cache: pnpm
- name: Set up Ruby
uses: ruby/setup-ruby@v1
......@@ -32,8 +32,8 @@ jobs:
- run: ruby --version
- run: node --version
- name: Install npm dependencies
run: npm install
- name: Install pnpm dependencies
run: pnpm install
- name: Build
run: npm run build
run: pnpm run build
......@@ -30,3 +30,4 @@ node_modules/
.yarn
.next
.vercel
package-lock.json
\ No newline at end of file
tasks:
- init: npm install && npm run build
command: npm run start
- init: pnpm install && pnpm run build
command: pnpm run start
FROM ruby:2.7-alpine
RUN apk add --no-cache nodejs npm && \
apk add --no-cache --virtual build-dependencies build-base
WORKDIR /app
ADD package.json /app/
ADD package-lock.json /app/
ADD package.json /app/
ADD Gemfile /app/
ADD Gemfile.lock /app/
ADD _config.yml /app/
ADD gulpfile.js /app/
# RUN apk update && apk add --virtual build-dependencies build-base
RUN npm install
RUN bundle config --global silence_root_warning 1 && bundler install --verbose
# website
EXPOSE 3000
# website management (browser auto reload)
EXPOSE 3001
# run tabler
ENTRYPOINT [ "npm", "run", "start-plugins" ]
\ No newline at end of file
FROM ruby:2.7-alpine
RUN apk add --no-cache nodejs pnpm && \
apk add --no-cache --virtual build-dependencies build-base
WORKDIR /app
ADD package.json /app/
ADD package-lock.json /app/
ADD package.json /app/
ADD Gemfile /app/
ADD Gemfile.lock /app/
ADD _config.yml /app/
ADD gulpfile.js /app/
# RUN apk update && apk add --virtual build-dependencies build-base
RUN pnpm install
RUN bundle config --global silence_root_warning 1 && bundler install --verbose
# website
EXPOSE 3000
# website management (browser auto reload)
EXPOSE 3001
# run tabler
ENTRYPOINT [ "pnpm", "run", "start-plugins" ]
\ No newline at end of file
......@@ -75,13 +75,13 @@ Support this project by becoming a sponsor. Your logo will show up in this READM
To use our build system and run our documentation locally, you'll need a copy of Tabler's source files. Follow the steps below:
1. [Install Node.js](https://nodejs.org/download/), which we use to manage our dependencies.
2. Navigate to the root `/tabler` directory and run `npm install` to install our local dependencies listed in `package.json`.
2. Navigate to the root `/tabler` directory and run `pnpm install` to install our local dependencies listed in `package.json`.
3. [Install Ruby](https://www.ruby-lang.org/en/documentation/installation/) - the recommended version is [2.7.6](https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.6.tar.gz).
4. [Install Bundler](https://bundler.io) with `gem install bundler` and finally run `bundle install`. It will install all Ruby dependencies, such as [Jekyll and plugins](https://jekyllrb.com).
**OSX users**:
1. NPM ```npm install```
1. NPM ```pnpm install```
2. install Ruby (2.5.* recommended)
```brew install ruby @2.5```
3. install bundler
......@@ -108,17 +108,17 @@ Once you complete the setup, you'll be able to run the various commands provided
## Build locally
You need to have `npm` and `bundler` installed.
You need to have `pnpm` and `bundler` installed.
1. From the root `/tabler` directory, run installation in the command line:
- `npm install`
- `pnpm install`
- `bundler install`
2. Then execute `npm run start-plugins` to start up the application stack.
2. Then execute `pnpm run start-plugins` to start up the application stack.
3. Open [http://localhost:3000](http://localhost:3000) in your browser, and voilà.
4. Any change in the `/src` directory will build the application and refresh the page.
**Note**:
Run `npm run build` for reforms a one off build application without refresh.
Run `pnpm run build` for reforms a one off build application without refresh.
Open [http://localhost:3001](http://localhost:3001) to configure the Web server.
## Installation
......
此差异已折叠。
......@@ -18,7 +18,7 @@
"chromatic": "chromatic --project-token=CHROMATIC_PROJECT_TOKEN",
"storybook": "start-storybook -p 6006",
"changelog": "gulp changelog",
"icons": "ncu -u @tabler/icons && npm install && gulp svg-icons && git add . && git commit -am \"update icons to v`npm info @tabler/icons version`\" && git push",
"icons": "ncu -u @tabler/icons && pnpm install && gulp svg-icons && git add . && git commit -am \"update icons to v`pnpm info @tabler/icons version`\" && git push",
"download-images": "node build/download-images.js",
"optimize-images": "for i in ./src/static/photos/*.jpg; do convert \"$i\" -quality 80% \"${i%.jpg}.jpg\"; done",
"format:check": "prettier --check src/**/*.{js,scss} --cache",
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册