Skip to content

Commit

Permalink
chore(package): replace npm with yarn (#2081)
Browse files Browse the repository at this point in the history
* chore(circleci): upgrade to 2.0

* chore(npm): remove package-lock.json

* chore(yarn): replace npm with yarn

* chore(package): run yarn 😎

* chore(ci): disabled cache momentarily

* chore(yarn): update yarn.lock

* chore(ci): restore cache

* chore(ci): try node 8 and apt-get update

* chore(ci): try updating all pupeteer deps

* refcator(ci): cleanup cruft

* chore(package): update yarn.lock

* fix(tsd:lint): add tsx patterns

* fix(package): run tsd lint fix

* chore(package): target js files in eslint glob

* test(tsd): cleanup typings.js artifcact
  • Loading branch information
levithomason authored Sep 24, 2017
1 parent d9747ab commit 4c16c7f
Show file tree
Hide file tree
Showing 15 changed files with 7,814 additions and 12,551 deletions.
65 changes: 65 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: 2
jobs:
build:
filters:
branches:
ignore: gh-pages
docker:
- image: circleci/node:8
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
steps:
# Chrome HeadlessBrowser is missing deps on Debian, see:
# https://github.com/GoogleChrome/puppeteer/issues/290
- run:
name: Update Pupeteer Dependencies
command: |
sudo apt-get update
sudo apt-get install --yes --quiet gconf-service libasound2 libatk1.0-0 libc6 \
libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 \
libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 \
libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \
libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation \
libappindicator1 libnss3 lsb-release xdg-utils wget
- run:
name: Update yarn
command: |
# remove default yarn
sudo rm -rf $(dirname $(which yarn))/yarn*
# download latest
rm -rf ~/.yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
echo 'export PATH="${PATH}:${HOME}/.yarn/bin"' >> $BASH_ENV
- checkout
# because we don't invoke npm (we use yarn) we need to add npm bin to PATH manually
- run:
name: Add npm bin to PATH
command: echo 'export PATH="${PATH}:$(npm bin)"' >> $BASH_ENV
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies
- run:
name: Install Dependencies
command: yarn
- save_cache:
key: v1-dependencies-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- .yarn-cache
- node_modules
- run:
name: Lint TypeScript
command: yarn tsd:lint
- run:
name: Test TypeScript
command: yarn tsd:test
- run:
name: Lint JavaScript
command: yarn lint
- run:
name: Test JavaScript
command: yarn test
- run:
name: Report coverage
command: bash <(curl -s https://codecov.io/bash)
36 changes: 19 additions & 17 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ v6.2.1

### Fork, Clone & Install

Start by [forking stardust][12] to your GitHub account. Then clone your fork and install dependencies:
Start by [forking Semantic UI React][12] to your GitHub account. Then clone your fork and install dependencies:

```sh
git clone git@github.com:<your-user>/Semantic-UI-React.git
cd Semantic-UI-React
npm install
yarn
```

>Note, we use `yarn` because `npm` has unfortunately become unreliable. Get it [here][16].
Add our repo as a git remote so you can pull/rebase your fork with our latest updates:

```
Expand All @@ -72,25 +74,24 @@ Please follow the [Angular Git Commit Guidelines][8] format.

### Commands

>This list is not updated, you should run `npm run` to see all scripts.
>This list is not updated, you should run `yarn run` to see all scripts.
```sh
npm start // run doc site
npm run start:local-modules // run offline (slower builds)
yarn start // run doc site

npm test // test once
npm run test:watch // test on file change
yarn test // test once
yarn test:watch // test on file change

npm run build // build everything
npm run build:dist // build dist
npm run build:docs // build docs
npm run build:docs-toc // build toc for markdown files
yarn build // build everything
yarn build:dist // build dist
yarn build:docs // build docs
yarn build:docs-toc // build toc for markdown files

npm run deploy:docs // deploy gh-pages doc site
yarn deploy:docs // deploy gh-pages doc site

npm run lint // lint once
npm run lint:fix // lint and attempt to fix
npm run lint:watch // lint on file change
yarn lint // lint once
yarn lint:fix // lint and attempt to fix
yarn lint:watch // lint on file change
```

## Workflow
Expand Down Expand Up @@ -371,7 +372,7 @@ See [`src/factories`][13] for special methods to convert props values into React
## Testing
Run tests during development with `npm run test:watch` to re-run tests on file changes.
Run tests during development with `yarn test:watch` to re-run tests on file changes.
### Coverage
Expand Down Expand Up @@ -494,7 +495,7 @@ Our docs are generated from doc block comments, `propTypes`, and hand written ex
Developing against the doc site is a good way to try your component as you build it. Run the doc site with:

```sh
npm start
yarn start
```

### Components
Expand Down Expand Up @@ -571,3 +572,4 @@ Adding documentation for new components is a bit tedious. The best way to do th
[13]: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/factories
[14]: https://github.com/Semantic-Org/Semantic-UI-React/pull/335#issuecomment-238960895
[15]: https://github.com/Semantic-Org/Semantic-UI-React/issues/607
[16]: https://yarnpkg.com/en/docs/getting-started
18 changes: 9 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
npm-debug.log*
node_modules/
bower_components/
coverage/
dist/
docs/build/
docs/app/docgenInfo.json
dll/
*.log*
*.iml

.DS_Store
.idea/
.yarn-cache/

*.iml
coverage/
dist/
docs/app/docgenInfo.json
docs/build/
dll/
node_modules/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ Any other issue labeled [`help wanted`][4] is ready for a PR.
On the latest clean `master`:

```sh
npm run release:major
npm run release:minor
npm run release:patch
yarn release:major
yarn release:minor
yarn release:patch
```

Deploy the docs:

```sh
npm run deploy:docs
yarn deploy:docs
```

Update the changelog (requires [github_changelog_generator][15]):
Expand Down
16 changes: 0 additions & 16 deletions circle.yml

This file was deleted.

6 changes: 3 additions & 3 deletions docs/app/Views/Usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const Usage = () => (
The Semantic UI React package can be installed via NPM:
</p>
<Segment>
<pre>$ yarn add {pkg.name}</pre>
<pre>$ npm install {pkg.name} --save</pre>
</Segment>
<p>
Expand Down Expand Up @@ -131,9 +132,8 @@ const Usage = () => (
provided <a href={`${semanticUIDocsURL}usage/theming.html`}>here</a>.
</p>
<Segment>
<pre>
$ npm install semantic-ui --save-dev
</pre>
<pre>$ yarn add semantic-ui --dev</pre>
<pre>$ npm install semantic-ui --save-dev</pre>
</Segment>
<p>
After building the project with Gulp, you'll need to include the minified CSS file
Expand Down
1 change: 1 addition & 0 deletions examples/webpack1/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.yarn-cache/
node_modules/
6 changes: 3 additions & 3 deletions examples/webpack1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "Get started with Semantic UI React and Webpack 1",
"main": "index.js",
"scripts": {
"analyze": "cross-env ANALYZE_ENV=true npm run build",
"analyze:production": "cross-env ANALYZE_ENV=true npm run build:production",
"analyze": "cross-env ANALYZE_ENV=true yarn build",
"analyze:production": "cross-env ANALYZE_ENV=true yarn build:production",
"build": "webpack",
"build:production": "cross-env NODE_ENV=production npm run build"
"build:production": "cross-env NODE_ENV=production yarn build"
},
"author": "Alexander Fedyashov <a@fedyashov.com>",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions examples/webpack2/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.yarn-cache/
node_modules/
6 changes: 3 additions & 3 deletions examples/webpack2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "Get started with Semantic UI React and Webpack 2",
"main": "index.js",
"scripts": {
"analyze": "cross-env ANALYZE_ENV=true npm run build",
"analyze:production": "cross-env ANALYZE_ENV=true npm run build:production",
"analyze": "cross-env ANALYZE_ENV=true yarn build",
"analyze:production": "cross-env ANALYZE_ENV=true yarn build:production",
"build": "webpack",
"build:production": "cross-env NODE_ENV=production npm run build"
"build:production": "cross-env NODE_ENV=production yarn build"
},
"author": "Alexander Fedyashov <a@fedyashov.com>",
"license": "MIT",
Expand Down
9 changes: 9 additions & 0 deletions karma.conf.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ export default (karmaConfig) => {
],
includeAllSources: true,
},
customLaunchers: {
puppeteer: {
base: 'ChromeHeadless',
flags: [
// Avoid "Maximum call stack size exceeded" errors on CircleCI
'--stack-trace-limit 50000',
],
},
},
files: [
'./test/tests.bundle.js',
],
Expand Down
Loading

0 comments on commit 4c16c7f

Please sign in to comment.