Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
More solid way to stick with npm instead of yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Nov 15, 2016
1 parent 7548dc7 commit 1eaf316
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 16 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ environment:
- nodejs_version: '6'

# stick to npm
PHENOMIC_TEST_WITH_YARN: 0
PHENOMIC_TEST_WITH_YARN: false

version: "{build}"
build: off
Expand Down
4 changes: 4 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ machine:
node:
version: 6

environment:
# stick to npm
PHENOMIC_TEST_WITH_YARN: false

dependencies:
override:
- npm prune
Expand Down
51 changes: 37 additions & 14 deletions docs/content/contributing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,56 @@
title: How to contribute to Phenomic
---

## Clone the repository & get dependencies

```
git clone https://github.com/MoOx/phenomic.git
cd phenomic
```

**Note about dependencies:**
We support both [npm](http://npmjs.com/) and [Yarn](http://yarnpkg.com/)
but to make developer experience faster we use yarn by default.
Some scripts use yarn under the hood. To force npm usage, just export this in
your current terminal session:

```console
export PHENOMIC_TEST_WITH_YARN=false
```

## Update the phenomic-theme-base

To work on the phenomic-theme-base, run the following:

```sh
```console
npm run phenomic-theme-base-start
```

_or with `yarn`_
```sh

```console
yarn run phenomic-theme-base-start
```

Then you can edit files in the `phenomic-theme-base` folder.
Then you can edit files in the `themes/phenomic-theme-base` folder, you should
see change immediately.

## Update the docs

To work on the docs, run the following:
```sh

```console
npm run docs-start
```

_or with `yarn`_
```sh

```console
yarn run docs-start
```

Then you can edit files in the `docs` folder.
Then you can edit files in the `docs` folder and you will get changes
immediately.

## Work on the core

Expand All @@ -36,13 +60,11 @@ Then you can edit files in the `docs` folder.
- Integration tests are located at the root of the project (`__tests__/*`).

_After every modification, please run the entire test suite by using
`npm test`._
_or with `yarn`_
`yarn test`._
`npm test` (or with `yarn`, using `yarn test`)._

Note that the full test suite can take a few minutes, as it runs unit tests and
integration tests (with several builds, including docs and a new project from
the phenomic-theme-base).
end to end tests
(with several builds, including docs and a new project from the phenomic-theme-base).

To speed things up, you can limit tests to the specific component you are working on.

Expand All @@ -53,11 +75,12 @@ Tests will be in ``src/PageContainer/__tests__/*``.

To run tests for the ``PageContainer`` component:

```sh
ava src/PageContainer/__tests__/*
```console
jest src/PageContainer/__tests__/*
```

When you think you are done with your update, remember to run either `npm test` or `yarn test`.
When you think you are done with your update, remember to run either `npm test` (or `yarn test`).

Anyway, CI will warn us if something goes wrong.

---
Expand Down
7 changes: 6 additions & 1 deletion scripts/utils/test-folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ export default async function test(
try {
const targetModules = `${ target }/node_modules`

let yarn = process.env.PHENOMIC_TEST_WITH_YARN || true
let yarn = (
typeof process.env.PHENOMIC_TEST_WITH_YARN !== "undefined"
? Boolean(JSON.parse(process.env.PHENOMIC_TEST_WITH_YARN))
: true
)

if (yarn) {
try {
await exec("yarn --version")
Expand Down

0 comments on commit 1eaf316

Please sign in to comment.