Introduce yarn

This commit is contained in:
Cutls 2019-09-17 01:20:52 +09:00
parent fd365c52cc
commit dd59cc1468
5 changed files with 2817 additions and 6 deletions

1
.gitignore vendored
View File

@ -12,7 +12,6 @@ enq.md
app/.tkn app/.tkn
app/node_modules app/node_modules
app/js/login/tkn.js app/js/login/tkn.js
app/package-lock.json
app/view/en app/view/en
app/view/ja app/view/ja
app/view/de app/view/de

View File

@ -5,13 +5,15 @@ os:
language: node_js language: node_js
node_js: node_js:
- '10.15.2' - '10.15.2'
cache:
yarn: true
script: node -v script: node -v
before_deploy: before_deploy:
- npm install electron-builder -g - yarn install electron-builder -g
- cd app - cd app
- VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') - VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')
- npm install - yarn install
- npm run construct - yarn construct
- if [ "$TRAVIS_OS_NAME" = "osx" ];then electron-builder --mac -p never;else :;fi - if [ "$TRAVIS_OS_NAME" = "osx" ];then electron-builder --mac -p never;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then electron-builder --linux --x64 -p never;else :;fi - if [ "$TRAVIS_OS_NAME" = "linux" ];then electron-builder --linux --x64 -p never;else :;fi
- if [ "$TRAVIS_OS_NAME" = "linux" ];then cd ../build;else :;fi - if [ "$TRAVIS_OS_NAME" = "linux" ];then cd ../build;else :;fi

View File

@ -80,6 +80,10 @@ Fellow coder
## Build ## Build
You have to use either **npm** or **yarn**. Whichever you use, it works well.
### npm
```sh ```sh
git clone https://github.com/cutls/TheDesk git clone https://github.com/cutls/TheDesk
cd TheDesk/app cd TheDesk/app
@ -88,8 +92,21 @@ npm install --only=dev
npm run construct npm run construct
``` ```
### yarn
```sh
git clone https://github.com/cutls/TheDesk
cd TheDesk/app
yarn install
yarn construct
```
run `npm run dev` or `yarn dev` to launch developer version with console(click `view`)
### electron-builder(Recommended) ### electron-builder(Recommended)
Use npm scripts. Use scripts(they can work well with npm, **yarn**).
#### npm
```sh ```sh
# Build for current platform # Build for current platform
@ -103,6 +120,21 @@ npm run build:win
npm run build:all npm run build:all
``` ```
#### yarn
```sh
# Build for current platform
yarn build
# Select build target
## Windows
yarn build:win
## Windows and Linux (The macOS target should run on macOS. So, this option hasn't include the build for macOS)
yarn build:all
```
Config is all on package.json Config is all on package.json
### electron-packager ### electron-packager

View File

@ -79,6 +79,9 @@ Linuxビルダー
## ビルド ## ビルド
npmでもyarnでも好きな方を選んでください。
### npm
```sh ```sh
git clone https://github.com/cutls/TheDesk git clone https://github.com/cutls/TheDesk
@ -88,8 +91,20 @@ npm install --only=dev
npm run construct npm run construct
``` ```
### yarn
```sh
git clone https://github.com/cutls/TheDesk
cd TheDesk/app
yarn install
yarn construct
```
### electron-builder(推奨) ### electron-builder(推奨)
npm scriptsを利用します
scriptsを利用します
#### npm
```sh ```sh
# 実行している環境向けにビルド # 実行している環境向けにビルド
@ -103,6 +118,20 @@ npm run build:win
npm run build:all npm run build:all
``` ```
#### yarn
```sh
# 実行している環境向けにビルド
yarn build
# ターゲットを指定してビルド
## Windows
yarn build:win
## macOS向けのビルドにはmacOSで実行する必要があるためこのコマンドではビルドされません
yarn build:all
```
ビルド設定はすべてpackage.jsonに記載しています。 ビルド設定はすべてpackage.jsonに記載しています。
### electron-packager(非推奨) ### electron-packager(非推奨)

2749
app/yarn.lock Normal file

File diff suppressed because it is too large Load Diff