Skip to content

Commit

Permalink
chore: 🧶 migrate to yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudAV committed Jan 3, 2022
1 parent b3d5270 commit 243cd79
Show file tree
Hide file tree
Showing 13 changed files with 23,174 additions and 32,480 deletions.
47 changes: 28 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ orbs:
secrethub: secrethub/cli@1.1.0
gh: circleci/github-cli@2.0.0

commands:
yarn-install:
description: Runs Yarn install
steps:
- restore_cache:
name: Restore Yarn cache
keys:
- gio-ui-components-yarn-cache-v1-{{ checksum "yarn.lock" }}
- run:
name: 'Install Yarn dependencies'
command: yarn install
- save_cache:
paths:
- .yarn/cache
key: gio-ui-components-yarn-cache-v1-{{ checksum "yarn.lock" }}

executors:
node-lts:
parameters:
Expand All @@ -23,18 +39,7 @@ jobs:
name: node-lts
steps:
- checkout
- restore_cache:
name: Restore NPM cache
keys:
- npm-cache-v1-{{ checksum "package-lock.json" }}
- run:
name: Install dependencies
command: npm install
- save_cache:
name: Save NPM cache
key: npm-cache-v1-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- yarn-install
- persist_to_workspace:
root: .
paths:
Expand All @@ -50,16 +55,16 @@ jobs:
at: .
- run:
name: Run CommitLint
command: npm run lint:commit
command: yarn lint:commit
- run:
name: Run License Checker
command: npm run lint:license
command: yarn lint:license
- run:
name: Run Prettier and ESLint
command: npm run lint
command: yarn lint
- run:
name: Run unit tests
command: npm run test:coverage -- --ci --runInBand
command: yarn test:coverage --ci --runInBand

dangerjs:
executor:
Expand All @@ -71,7 +76,7 @@ jobs:
at: .
- run:
name: Run Danger JS
command: npm run danger
command: yarn danger

build:
executor:
Expand All @@ -83,7 +88,7 @@ jobs:
at: .
- run:
name: Build
command: NODE_OPTIONS=--max_old_space_size=3072 npm run build
command: NODE_OPTIONS=--max_old_space_size=3072 yarn build
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -156,7 +161,7 @@ jobs:
command: ssh-add -D && ssh-add ~/.ssh/id_rsa_ac88238fc60f7df0fcdf73203456026c
- run:
name: 🚀 Release the Kraken
command: npm run release
command: yarn release

prerelease:
executor:
Expand Down Expand Up @@ -191,6 +196,10 @@ jobs:
\`\`\`shell
npm install @gravitee/ui-components@${versionTag}
\`\`\`
or
\`\`\`shell
yarn add @gravitee/ui-components@${versionTag}
\`\`\`
"
workflows:
Expand Down
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,14 @@ Thumbs.db

.docs
storybook-static

# yarn
/.yarn/*
!/.yarn/patches
!/.yarn/plugins
!/.yarn/releases
!/.yarn/sdks
# Swap the comments on the following lines if you don't wish to use zero-installs
# Documentation here: https://yarnpkg.com/features/zero-installs
# !/.yarn/cache
/.pnp.*
363 changes: 363 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.1.cjs

Large diffs are not rendered by default.

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

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.1.1.cjs
36 changes: 19 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,51 @@ Before submitting your issue, search in the [archive issues](https://github.com/

Providing the following information will help us to deal quickly with your issue :

* **Overview of the issue** : describe the issue and why this is a bug for you.
* **You have stack trace, screenshots, logs?** add these to the issue's description.
- **Overview of the issue** : describe the issue and why this is a bug for you.
- **You have stack trace, screenshots, logs?** add these to the issue's description.

## Submitting changes

You've submitted an issue to the project and know how to fix it? You can contribute to the project by [forking the repository](https://guides.github.com/activities/forking) and [submitting your pull requests](https://guides.github.com/activities/forking/#making-a-pull-request).

Before submitting your pull request consider the following guidelines:

* Make your changes in a new git branch:
- Make your changes in a new git branch:

```shell
git checkout -b issue-<issue-id>-my-fix-branch master
```
Note : issue-id reference the id generated by GitHub (#issue-id).

* Create your patch, **including appropriate test cases**.
* Update the documentation if you create new features or think the documentation needs to be updated/completed.
* Build your changes locally to **ensure all the linters rules and test pass**
Note : issue-id reference the id generated by GitHub (#issue-id).

- Create your patch, **including appropriate test cases**.
- Update the documentation if you create new features or think the documentation needs to be updated/completed.
- Build your changes locally to **ensure all the linters rules and test pass**

```shell
npm run lint
npm run test
yarn lint
yarn test
```
* Commit your changes using a descriptive commit message.

- Commit your changes using a descriptive commit message.

```shell
git commit -a
```

* Push your branch to GitHub:
- Push your branch to GitHub:

```shell
git push origin issue-<issue-id>-my-fix-branch
```

* In GitHub, send a pull request to `<gravitee-io/gravitee-ui-components>:master`.
- In GitHub, send a pull request to `<gravitee-io/gravitee-ui-components>:master`.

* If we suggest changes then:
** Make the required updates.
** Re-run the test suite to ensure tests are still passing.
** Commit your changes to your branch (e.g. `issue/<issue-id>-my-fix-branch`).
** Push the changes to your GitHub repository (this will update your Pull Request).
- If we suggest changes then:
** Make the required updates.
** Re-run the test suite to ensure tests are still passing.
** Commit your changes to your branch (e.g. `issue/<issue-id>-my-fix-branch`).
** Push the changes to your GitHub repository (this will update your Pull Request).

If the PR gets too outdated we may ask you to rebase and force push to update the PR:

Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,47 +136,47 @@ _TIP_: You can clean the **package-lock.json** and remove duplicate dependencies

- Install [nvm](https://github.com/nvm-sh/nvm)
- Use with `nvm use` or install with `nvm install` the node version declared in `.nvmrc`
- Then install node modules with: `npm install`
- Then install node modules with: `yarn install`

### Tasks

The available NPM scripts are:
The available scripts are:

- `npm run serve`: start Storybook in dev mode
- `npm run lint`: run eslint and prettier
- `npm run lint:fix`: run eslint with autofix and prettier in write mode
- `npm run test`: run the unit tests
- `npm run test -- --collect-coverage`: run the unit tests with coverage
- `npm run docs`: generate the documentation
- `npm run build`: build storybook
- `npm run serve:prod`: start Storybook in prod mode
- `npm run generate:dist`: build components to use them in your project
- `npm run generate:icons`: build icons files from svg files
- `npm run generate:theme`: generate theme file based on css custom properties defined in each component file
- `yarn serve`: start Storybook in dev mode
- `yarn lint`: run eslint and prettier
- `yarn lint:fix`: run eslint with autofix and prettier in write mode
- `yarn test`: run the unit tests
- `yarn test --collect-coverage`: run the unit tests with coverage
- `yarn docs`: generate the documentation
- `yarn build`: build storybook
- `yarn serve:prod`: start Storybook in prod mode
- `yarn generate:dist`: build components to use them in your project
- `yarn generate:icons`: build icons files from svg files
- `yarn generate:theme`: generate theme file based on css custom properties defined in each component file

If you want link for use in other local project as dependency:

```bash
npm link
yarn link
cd ../my-project
npm link @gravitee/ui-components
yarn link @gravitee/ui-components
```

If you want link the prod version in other local project:

```bash
npm run build
yarn build
cd dist
npm link
yarn link
cd ../my-project
npm link @gravitee/ui-components
yarn link @gravitee/ui-components
```

## Renovate

Some components are based on third party libraries, for integration into a web component, we extract the css from its libraries as assets.

WARNING: When `highlight.js` or `github-markdown-css` are updated, we must run `npm run build` task to update the css.
WARNING: When `highlight.js` or `github-markdown-css` are updated, we must run `yarn build` task to update the css.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ I just want to tell you that \`package.json\` has been updated in this PR.
Some components are based on third party libraries, for integration into a web component, we extract the css from its libraries as assets.
WARNING: When \`highlight.js\` or \`github-markdown-css\` are updated, we must run \`npm run build\` task to update the css.
WARNING: When \`highlight.js\` or \`github-markdown-css\` are updated, we must run \`yarn build\` task to update the css.
`);
}
2 changes: 1 addition & 1 deletion docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Each components can use `var() - CSS` for customisation.
the CSS variable. Be careful with the {Type} and use the naming convention.
2. Use the custom property in own css code.
3. **ONLY** if you want that's the component to be customizable on the portal, you **MUST** add `@theme facet` in "details" section of component documentation.
4. Run `npm run generate:theme` to check the variable syntax and rebuild `definition.json` defining the default portal's theme.
4. Run `yarn generate:theme` to check the variable syntax and rebuild `definition.json` defining the default portal's theme.

### Types

Expand Down
2 changes: 1 addition & 1 deletion docs/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import '@gravitee/ui-components/wc/gv-icon';
## How to add a new icon ?

1. Add your SVG icon file into `.files/icons/{category}`
2. run `npm run generate:icons`
2. run `yarn generate:icons`
3. Check the `gv-icons` story
4. Commit all changes

Loading

0 comments on commit 243cd79

Please sign in to comment.