Skip to content

Commit

Permalink
Feature/CI-CD (jaredpalmer#1246)
Browse files Browse the repository at this point in the history
* chore: update lerna

* chore: fix example pacakge name

* chore: add test command

* chore: update monorepo configs

* chore: update scripts

* chore: update deps
  • Loading branch information
nimaa77 authored Apr 16, 2020
1 parent dd9a3db commit 79c5ae0
Show file tree
Hide file tree
Showing 8 changed files with 433 additions and 6,542 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defaults: &defaults

- run:
name: Run tests
command: yarn e2e --runInBand --coverage
command: yarn test --runInBand --coverage

- save_cache:
paths:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: yarn install --frozen-lockfile --ignore-engines

- name: Run tests
run: yarn e2e --runInBand --coverage
run: yarn test --runInBand --coverage
env:
CI: true

47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
name: Build, test, Publish
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: yarn install --frozen-lockfile
- run: yarn test
env:
CI: true
- name: Potentially save npm token
run: |
([[ ! -z ${{ secrets.NPM_TOKEN }} ]] && echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc) || echo "Did not write npm token"
- name: Potentially publish canary to npm
run: |
if \
ls ~/.npmrc >/dev/null 2>&1 && \
[[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; \
then
yarn run lerna publish from-git --npm-tag canary --yes
else
echo "Did not publish canary"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Potentially publish stable to npm
run: |
if \
ls ~/.npmrc >/dev/null 2>&1 && \
[[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; \
then
yarn run lerna publish from-git --yes
else
echo "Did not publish"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 14 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ Hi there! Thanks for your interest in Razzle. This guide will help you get start
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Project Structure](#project-structure)
- [Developing locally](#developing-locally)
- [Commands](#commands)
- [Updating your fork](#updating-your-fork)
- [Adding examples](#adding-examples)
- [Use `examples/basic` as template](#use-examplesbasic-as-template)
- [Naming examples](#naming-examples)
- [How to get your example merged](#how-to-get-your-example-merged)
- [Why wasn't my PR merged?](#why-wasnt-my-pr-merged)
- [Getting help](#getting-help)
- [Contributing to Razzle](#contributing-to-razzle)
- [Project Structure](#project-structure)
- [Developing locally](#developing-locally)
- [Commands](#commands)
- [Updating your fork](#updating-your-fork)
- [Adding examples](#adding-examples)
- [Use `examples/basic` as template](#use-examplesbasic-as-template)
- [Naming examples](#naming-examples)
- [How to get your example merged](#how-to-get-your-example-merged)
- [Why wasn't my PR merged?](#why-wasnt-my-pr-merged)
- [Getting help](#getting-help)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -52,7 +53,9 @@ immediately in all the examples.

- `yarn run clean`: Clean up all `node_modules` and remove all symlinks from packages and examples.
- `yarn run bootstrap`: Run `yarn` on all examples and packages. Automatically symlinks inter-dependent modules.
- `yarn run e2e`: Runs end-to-end tests
- `yarn run test`: Runs all tests
- `yarn run test:packages`: Runs tests for packages
- `yarn run test:e2e`: Runs end-to-end tests

### Updating your fork

Expand Down
2 changes: 1 addition & 1 deletion examples/with-redux-observable/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "with-redux-observable",
"name": "razzle-examples-with-observable",
"version": "2.4.1",
"license": "MIT",
"scripts": {
Expand Down
13 changes: 8 additions & 5 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
{
"lerna": "2.10.1",
"lerna": "3.20.2",
"packages": [
"packages/razzle",
"packages/babel-preset-razzle",
"packages/create-razzle-app",
"packages/razzle-dev-utils",
"packages/razzle-plugin-*",
"examples/*"
"packages/razzle-plugin-*"
],
"useWorkspaces": true,
"npmClient": "yarn",
"commands": {
"command": {
"bootstrap": {
"hoist": true,
"nohoist": "express"
},
"publish": {
"npmClient": "npm",
"allowBranch": ["master", "canary"],
"registry": "https://registry.npmjs.org/"
}
},
"changelog": {
Expand Down
25 changes: 15 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,35 @@
"eslint": "^6.8.0",
"husky": "^4.2.3",
"jest": "^25.1.0",
"lerna": "3.20.2",
"lerna": "^3.20.2",
"lerna-changelog": "^1.0.1",
"lint-staged": "^10.0.8",
"prettier": "^1.19.1",
"ps-tree": "1.2.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"semver": "7.1.3",
"shelljs": "^0.8.3",
"serve": "^11.3.0"
"serve": "^11.3.0",
"shelljs": "^0.8.3"
},
"scripts": {
"e2e": "jest --config ./test/jest.config.json --verbose --no-cache ",
"clean": "lerna clean --yes && node ./scripts/clean.js",
"changelog": "lerna-changelog",
"test": "yarn test:e2e",
"test:packages": "lerna run test --stream --scope razzle-* --ignore razzle-examples-* -- --passWithNoTests --verbose --no-cache",
"test:e2e": "jest --config ./test/jest.config.json --verbose --no-cache ",
"clean": "lerna clean --yes",
"format": "prettier --trailing-comma es5 --single-quote --write 'packages/*/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|mdx)' 'packages/*/!(node_modules)/**/*.js'",
"precommit": "lint-staged"
"publish-canary": "lerna version prerelease --preid canary --force-publish && release --pre",
"publish-stable": "lerna version --force-publish && release && node ./scripts/release-notes.js",
"git-reset": "git reset --hard HEAD",
"git-clean": "git clean -d -x -e node_modules -e packages -f"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"*.{js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|mdx}": [
"prettier --trailing-comma es5 --single-quote --write",
"git add"
]
Expand All @@ -61,7 +67,6 @@
"packages/babel-preset-razzle",
"packages/create-razzle-app",
"packages/razzle-dev-utils",
"packages/razzle-plugin-*",
"examples/*"
"packages/razzle-plugin-*"
]
}
Loading

0 comments on commit 79c5ae0

Please sign in to comment.