Skip to content

Commit 4c16c7f

Browse files
authored
chore(package): replace npm with yarn (Semantic-Org#2081)
* 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
1 parent d9747ab commit 4c16c7f

File tree

15 files changed

+7814
-12551
lines changed

15 files changed

+7814
-12551
lines changed

.circleci/config.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: 2
2+
jobs:
3+
build:
4+
filters:
5+
branches:
6+
ignore: gh-pages
7+
docker:
8+
- image: circleci/node:8
9+
environment:
10+
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
11+
steps:
12+
# Chrome HeadlessBrowser is missing deps on Debian, see:
13+
# https://github.com/GoogleChrome/puppeteer/issues/290
14+
- run:
15+
name: Update Pupeteer Dependencies
16+
command: |
17+
sudo apt-get update
18+
sudo apt-get install --yes --quiet gconf-service libasound2 libatk1.0-0 libc6 \
19+
libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 \
20+
libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 \
21+
libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \
22+
libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation \
23+
libappindicator1 libnss3 lsb-release xdg-utils wget
24+
- run:
25+
name: Update yarn
26+
command: |
27+
# remove default yarn
28+
sudo rm -rf $(dirname $(which yarn))/yarn*
29+
# download latest
30+
rm -rf ~/.yarn
31+
curl -o- -L https://yarnpkg.com/install.sh | bash
32+
echo 'export PATH="${PATH}:${HOME}/.yarn/bin"' >> $BASH_ENV
33+
- checkout
34+
# because we don't invoke npm (we use yarn) we need to add npm bin to PATH manually
35+
- run:
36+
name: Add npm bin to PATH
37+
command: echo 'export PATH="${PATH}:$(npm bin)"' >> $BASH_ENV
38+
- restore_cache:
39+
keys:
40+
- v1-dependencies-{{ checksum "yarn.lock" }}
41+
- v1-dependencies
42+
- run:
43+
name: Install Dependencies
44+
command: yarn
45+
- save_cache:
46+
key: v1-dependencies-{{ checksum "yarn.lock" }}
47+
paths:
48+
- ~/.cache/yarn
49+
- .yarn-cache
50+
- node_modules
51+
- run:
52+
name: Lint TypeScript
53+
command: yarn tsd:lint
54+
- run:
55+
name: Test TypeScript
56+
command: yarn tsd:test
57+
- run:
58+
name: Lint JavaScript
59+
command: yarn lint
60+
- run:
61+
name: Test JavaScript
62+
command: yarn test
63+
- run:
64+
name: Report coverage
65+
command: bash <(curl -s https://codecov.io/bash)

.github/CONTRIBUTING.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ v6.2.1
5252

5353
### Fork, Clone & Install
5454

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

5757
```sh
5858
git clone git@github.com:<your-user>/Semantic-UI-React.git
5959
cd Semantic-UI-React
60-
npm install
60+
yarn
6161
```
6262

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

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

7375
### Commands
7476

75-
>This list is not updated, you should run `npm run` to see all scripts.
77+
>This list is not updated, you should run `yarn run` to see all scripts.
7678
7779
```sh
78-
npm start // run doc site
79-
npm run start:local-modules // run offline (slower builds)
80+
yarn start // run doc site
8081

81-
npm test // test once
82-
npm run test:watch // test on file change
82+
yarn test // test once
83+
yarn test:watch // test on file change
8384

84-
npm run build // build everything
85-
npm run build:dist // build dist
86-
npm run build:docs // build docs
87-
npm run build:docs-toc // build toc for markdown files
85+
yarn build // build everything
86+
yarn build:dist // build dist
87+
yarn build:docs // build docs
88+
yarn build:docs-toc // build toc for markdown files
8889

89-
npm run deploy:docs // deploy gh-pages doc site
90+
yarn deploy:docs // deploy gh-pages doc site
9091

91-
npm run lint // lint once
92-
npm run lint:fix // lint and attempt to fix
93-
npm run lint:watch // lint on file change
92+
yarn lint // lint once
93+
yarn lint:fix // lint and attempt to fix
94+
yarn lint:watch // lint on file change
9495
```
9596

9697
## Workflow
@@ -371,7 +372,7 @@ See [`src/factories`][13] for special methods to convert props values into React
371372

372373
## Testing
373374

374-
Run tests during development with `npm run test:watch` to re-run tests on file changes.
375+
Run tests during development with `yarn test:watch` to re-run tests on file changes.
375376

376377
### Coverage
377378

@@ -494,7 +495,7 @@ Our docs are generated from doc block comments, `propTypes`, and hand written ex
494495
Developing against the doc site is a good way to try your component as you build it. Run the doc site with:
495496

496497
```sh
497-
npm start
498+
yarn start
498499
```
499500

500501
### Components
@@ -571,3 +572,4 @@ Adding documentation for new components is a bit tedious. The best way to do th
571572
[13]: https://github.com/Semantic-Org/Semantic-UI-React/blob/master/src/factories
572573
[14]: https://github.com/Semantic-Org/Semantic-UI-React/pull/335#issuecomment-238960895
573574
[15]: https://github.com/Semantic-Org/Semantic-UI-React/issues/607
575+
[16]: https://yarnpkg.com/en/docs/getting-started

.gitignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
npm-debug.log*
2-
node_modules/
3-
bower_components/
4-
coverage/
5-
dist/
6-
docs/build/
7-
docs/app/docgenInfo.json
8-
dll/
1+
*.log*
2+
*.iml
93

104
.DS_Store
115
.idea/
6+
.yarn-cache/
127

13-
*.iml
8+
coverage/
9+
dist/
10+
docs/app/docgenInfo.json
11+
docs/build/
12+
dll/
13+
node_modules/

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ Any other issue labeled [`help wanted`][4] is ready for a PR.
143143
On the latest clean `master`:
144144

145145
```sh
146-
npm run release:major
147-
npm run release:minor
148-
npm run release:patch
146+
yarn release:major
147+
yarn release:minor
148+
yarn release:patch
149149
```
150150

151151
Deploy the docs:
152152

153153
```sh
154-
npm run deploy:docs
154+
yarn deploy:docs
155155
```
156156

157157
Update the changelog (requires [github_changelog_generator][15]):

circle.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/app/Views/Usage.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const Usage = () => (
3333
The Semantic UI React package can be installed via NPM:
3434
</p>
3535
<Segment>
36+
<pre>$ yarn add {pkg.name}</pre>
3637
<pre>$ npm install {pkg.name} --save</pre>
3738
</Segment>
3839
<p>
@@ -131,9 +132,8 @@ const Usage = () => (
131132
provided <a href={`${semanticUIDocsURL}usage/theming.html`}>here</a>.
132133
</p>
133134
<Segment>
134-
<pre>
135-
$ npm install semantic-ui --save-dev
136-
</pre>
135+
<pre>$ yarn add semantic-ui --dev</pre>
136+
<pre>$ npm install semantic-ui --save-dev</pre>
137137
</Segment>
138138
<p>
139139
After building the project with Gulp, you'll need to include the minified CSS file

examples/webpack1/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
.yarn-cache/
12
node_modules/

examples/webpack1/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"description": "Get started with Semantic UI React and Webpack 1",
55
"main": "index.js",
66
"scripts": {
7-
"analyze": "cross-env ANALYZE_ENV=true npm run build",
8-
"analyze:production": "cross-env ANALYZE_ENV=true npm run build:production",
7+
"analyze": "cross-env ANALYZE_ENV=true yarn build",
8+
"analyze:production": "cross-env ANALYZE_ENV=true yarn build:production",
99
"build": "webpack",
10-
"build:production": "cross-env NODE_ENV=production npm run build"
10+
"build:production": "cross-env NODE_ENV=production yarn build"
1111
},
1212
"author": "Alexander Fedyashov <a@fedyashov.com>",
1313
"license": "MIT",

examples/webpack2/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
.yarn-cache/
12
node_modules/

examples/webpack2/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"description": "Get started with Semantic UI React and Webpack 2",
55
"main": "index.js",
66
"scripts": {
7-
"analyze": "cross-env ANALYZE_ENV=true npm run build",
8-
"analyze:production": "cross-env ANALYZE_ENV=true npm run build:production",
7+
"analyze": "cross-env ANALYZE_ENV=true yarn build",
8+
"analyze:production": "cross-env ANALYZE_ENV=true yarn build:production",
99
"build": "webpack",
10-
"build:production": "cross-env NODE_ENV=production npm run build"
10+
"build:production": "cross-env NODE_ENV=production yarn build"
1111
},
1212
"author": "Alexander Fedyashov <a@fedyashov.com>",
1313
"license": "MIT",

0 commit comments

Comments
 (0)