Skip to content

Commit

Permalink
chore: switch to yarn 2 (#1825)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>
  • Loading branch information
darkbasic and robertsLando authored Oct 14, 2021
1 parent c087212 commit a8e01ab
Show file tree
Hide file tree
Showing 10 changed files with 16,812 additions and 11,767 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --prefer-offline --frozen-lockfile
run: yarn install --immutable

- name: Lint
if: matrix['node-version'] == '14.x'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install
run: yarn install --immutable

- name: Make the release
env:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@ typings/
*.ntvs*
*.njsproj
*.sln

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
630 changes: 630 additions & 0 deletions .yarn/releases/yarn-3.1.0-rc.8.cjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nodeLinker: node-modules
enableGlobalCache: true

yarnPath: .yarn/releases/yarn-3.1.0-rc.8.cjs
11 changes: 7 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ RUN apk --no-cache add \
alpine-sdk \
python3

COPY package.json yarn.lock ./
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/releases .yarn/releases

RUN yarn config set unsafe-perm true && yarn install --network-timeout=300000
RUN yarn install --ignore-optional
ENV YARN_HTTP_TIMEOUT=300000

RUN yarn install --immutable

COPY . .

Expand All @@ -24,7 +26,8 @@ RUN yarn run build && \
package.sh \
src \
static \
docs
docs \
.yarn

# add plugin support, space separated
ARG plugins
Expand Down
15 changes: 11 additions & 4 deletions docker/Dockerfile.contrib
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ RUN git clone -b ${Z2M_BRANCH} --depth 1 ${Z2M_REPOSITORY}

# Option 2: Copy from local sources
FROM node:16.3.0-buster AS local-copy-src
COPY --chown=node node-zwave-js /home/node/node-zwave-js
COPY --chown=node zwavejs2mqtt /home/node/zwavejs2mqtt
COPY --chown=node --from=git-clone-src /home/node/node-zwave-js /home/node/node-zwave-js
COPY --chown=node --from=git-clone-src /home/node/zwavejs2mqtt /home/node/zwavejs2mqtt

#####################
# Build Environment #
Expand Down Expand Up @@ -63,11 +63,18 @@ RUN yarn
RUN yarn build

# Prune devDependencies
RUN yarn install --production
RUN yarn remove $(cat package.json | jq -r '.devDependencies | keys | join(" ")') && \
rm -rf \
build \
package.sh \
src \
static \
docs \
.yarn

# Copy to distribution folder
RUN mkdir my_dist
RUN cp -Lr .git package.json yarn.lock bin config server dist hass lib store views node_modules my_dist/
RUN cp -Lr .git package.json yarn.lock .yarnrc.yml bin config server dist hass lib store views node_modules my_dist/

#####################
# Setup Final Image #
Expand Down
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"name": "zwavejs2mqtt",
"version": "5.8.0",
"bin": {
"zwavejs2mqtt": "server/bin/www.js"
},
"bin": "server/bin/www.js",
"description": "Zwavejs2Mqtt Gateway",
"author": "Daniel Lando <daniel.sorridi@gmail.com>",
"private": false,
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -48,19 +45,19 @@
"dev:server": "ts-node-dev --inspect -- bin/www.ts",
"dev-https:server": "HTTPS='true' ts-node-dev --inspect -- bin/www.ts",
"start": "node server/bin/www.js",
"lint": "npm-run-all lint:*",
"lint-fix": "npm-run-all lint-fix:*",
"lint": "npm-run-all 'lint:*'",
"lint-fix": "npm-run-all 'lint-fix:*'",
"lint:eslint": "eslint --ext .js,.ts,.vue .",
"lint-fix:eslint": "eslint --fix --ext .js,.ts,.vue .",
"lint:markdownlint": "markdownlint '**/*.md'",
"lint-fix:markdownlint": "markdownlint --fix '**/*.md'",
"test": "npm-run-all test:*",
"test:server": "mocha -r ts-node/register ./test/**/*.test.ts",
"test": "npm-run-all 'test:*'",
"test:server": "mocha -r ts-node/register './test/**/*.test.ts'",
"test:ui": "mocha -r @babel/register src/modules",
"docs": "docsify serve ./docs",
"coverage": "c8 --clean npm run test",
"record-coverage": "c8 report --reporter=text-lcov --all --exclude=test/* --exclude=.git --exclude=.eslintrc.js --exclude=.postcssrc.js --exclude=wallaby.js > ./coverage/lcov.info",
"build": "npm-run-all build:*",
"record-coverage": "c8 report --reporter=text-lcov --all --exclude='test/*' --exclude=.git --exclude=.eslintrc.js --exclude=.postcssrc.js --exclude=wallaby.js > ./coverage/lcov.info",
"build": "npm-run-all 'build:*'",
"build:server": "tsc",
"build:ui": "node build/build.js",
"clean": "tsc --build --clean",
Expand Down Expand Up @@ -261,5 +258,6 @@
"> 1%",
"last 2 versions",
"not ie <= 8"
]
],
"packageManager": "yarn@3.1.0-rc.8"
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"preserveSymlinks": true, /* Necessary to support yarn portals with the node-modules linker, used by yarn link (berry) */
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
Expand Down Expand Up @@ -43,4 +44,4 @@
"lib/*.ts",
"types/*.ts"
],
}
}
Loading

0 comments on commit a8e01ab

Please sign in to comment.