build: Switch to Yarn (#3057)

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
Lipis 2021-02-20 14:47:17 +02:00 committed by GitHub
parent 74e82d0d7c
commit 4bfcf105a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 15299 additions and 23668 deletions

View File

@ -8,7 +8,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: docker build -t excalidraw .

View File

@ -12,22 +12,18 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Setup Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: |
npm ci
npm ci --prefix src/packages/excalidraw
npm ci --prefix src/packages/utils
yarn --frozen-lockfile
yarn --cwd src/packages/excalidraw
yarn --cwd src/packages/utils
- name: Build @excalidraw/excalidraw
run: |
npm run pack --prefix src/packages/excalidraw
yarn --cwd src/packages/excalidraw run pack
- name: Build @excalidraw/utils
run: |
npm run pack --prefix src/packages/utils
yarn --cwd src/packages/utils run pack

View File

@ -9,7 +9,6 @@ on:
jobs:
cancel:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/cancel-workflow-action@0.6.0

View File

@ -16,7 +16,7 @@ jobs:
- name: Install and lint
run: |
npm ci
npm run test:other
npm run test:code
npm run test:typecheck
yarn --frozen-lockfile
yarn test:other
yarn test:code
yarn test:typecheck

View File

@ -3,7 +3,7 @@ name: Build locales coverage
on:
push:
branches:
- "l10n_master"
- l10n_master
jobs:
locales:
@ -21,7 +21,7 @@ jobs:
- name: Create report file
run: |
npm run locales-coverage
yarn locales-coverage
FILE_CHANGED=$(git diff src/locales/percentages.json)
if [ ! -z "${FILE_CHANGED}" ]; then
git config --global user.name 'Excalidraw Bot'
@ -33,7 +33,7 @@ jobs:
- name: Construct comment body
id: getCommentBody
run: |
body=$(npm run locales-coverage:description | grep '^[^>]')
body=$(yarn locales-coverage:description | grep '^[^>]')
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"

View File

@ -1,4 +1,4 @@
name: "Semantic PR title"
name: Semantic PR title
on:
pull_request_target:
@ -10,7 +10,6 @@ on:
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v3.0.0
env:

View File

@ -1,4 +1,4 @@
name: New Sentry Production Release
name: New Sentry production release
on:
push:
@ -8,26 +8,21 @@ on:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
- name: Setup Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install and build
run: |
npm ci
npm run build:app
yarn --frozen-lockfile
yarn build:app
env:
CI: true
- name: Install Sentry
run: |
curl -sL https://sentry.io/get-cli/ | bash
- name: Create new Sentry release
run: |
export SENTRY_RELEASE=$(sentry-cli releases propose-version)

View File

@ -5,16 +5,13 @@ on: pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install and test
run: |
npm ci
npm run test:app
yarn --frozen-lockfile
yarn test:app

2
.gitignore vendored
View File

@ -16,7 +16,7 @@ firebase
logs
node_modules
npm-debug.log*
package-lock.json
static
yarn-debug.log*
yarn-error.log*
yarn.lock

View File

@ -2,13 +2,13 @@ FROM node:14-alpine AS build
WORKDIR /opt/node_app
COPY package.json package-lock.json ./
RUN npm i --no-optional
COPY package.json yarn.lock ./
RUN yarn --ignore-optional
ARG NODE_ENV=production
COPY . .
RUN npm run build:app:docker
RUN yarn build:app:docker
FROM nginx:1.17-alpine

View File

@ -86,6 +86,12 @@ Try out [`@excalidraw/excalidraw`](https://www.npmjs.com/package/@excalidraw/exc
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
#### Requirements
- [Node.js](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/getting-started/install)
- [Git](https://git-scm.com/downloads)
#### Clone the repo
```bash
@ -94,14 +100,14 @@ git clone https://github.com/excalidraw/excalidraw.git
#### Commands
| Command | Description |
| --------------------- | --------------------------------- |
| `npm install` | Install the dependencies |
| `npm start` | Run the project |
| `npm run fix` | Reformat all files with Prettier |
| `npm test` | Run tests |
| `npm run test:update` | Update test snapshots |
| `npm run test:code` | Test for formatting with Prettier |
| Command | Description |
| ------------------ | --------------------------------- |
| `yarn` | Install the dependencies |
| `yarn start` | Run the project |
| `yarn fix` | Reformat all files with Prettier |
| `yarn test` | Run tests |
| `yarn test:update` | Update test snapshots |
| `yarn test:code` | Test for formatting with Prettier |
#### Docker Compose

23611
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@
"rewire": "5.0.0"
},
"engines": {
"node": ">=12.0.0"
"node": ">=14.0.0"
},
"homepage": ".",
"husky": {
@ -84,22 +84,22 @@
"build:app:docker": "REACT_APP_DISABLE_SENTRY=true react-scripts build",
"build:app": "REACT_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA react-scripts build",
"build:version": "node ./scripts/build-version.js",
"build": "npm run build:app && npm run build:version",
"build": "yarn build:app && yarn build:version",
"eject": "react-scripts eject",
"fix:code": "npm run test:code -- --fix",
"fix:other": "npm run prettier -- --write",
"fix": "npm run fix:other && npm run fix:code",
"fix:code": "yarn test:code -- --fix",
"fix:other": "yarn prettier -- --write",
"fix": "yarn fix:other && yarn fix:code",
"locales-coverage": "node scripts/build-locales-coverage.js",
"locales-coverage:description": "node scripts/locales-coverage-description.js",
"prettier": "prettier \"**/*.{css,scss,json,md,html,yml}\" --ignore-path=.eslintignore",
"start": "react-scripts start",
"test:all": "npm run test:typecheck && npm run test:code && npm run test:other && npm run test:app -- --watchAll=false",
"test:all": "yarn test:typecheck && yarn test:code && yarn test:other && yarn test:app -- --watchAll=false",
"test:app": "react-scripts test --passWithNoTests",
"test:code": "eslint --max-warnings=0 --ignore-path .gitignore --ext .js,.ts,.tsx .",
"test:debug": "react-scripts --inspect-brk test --runInBand --no-cache",
"test:other": "npm run prettier -- --list-different",
"test:other": "yarn prettier -- --list-different",
"test:typecheck": "tsc",
"test:update": "npm run test:app -- --updateSnapshot --watchAll=false",
"test": "npm run test:app"
"test:update": "yarn test:app -- --updateSnapshot --watchAll=false",
"test": "yarn test:app"
}
}

View File

@ -5,7 +5,7 @@
// In order to run:
// npm install canvas # please do not check it in
// npm run build-node
// yarn build-node
// node build/static/js/build-node.js
// open test.png

View File

@ -68,6 +68,6 @@
"scripts": {
"build:umd": "cross-env NODE_ENV=production webpack --config webpack.prod.config.js",
"build:umd:withAnalyzer": "cross-env NODE_ENV=production ANALYZER=true webpack --config webpack.prod.config.js",
"pack": "npm run build:umd && npm pack"
"pack": "yarn build:umd && yarn pack"
}
}

View File

@ -55,6 +55,6 @@
"scripts": {
"build:umd": "cross-env NODE_ENV=production webpack --config webpack.prod.config.js",
"build:umd:withAnalyzer": "cross-env NODE_ENV=production ANALYZER=true webpack --config webpack.prod.config.js",
"pack": "npm run build:umd && npm pack"
"pack": "yarn build:umd && npm pack"
}
}

15251
yarn.lock Normal file

File diff suppressed because it is too large Load Diff