chore: revert back to yarn until npm 7 is stable

This commit is contained in:
jorenbroekema 2020-11-09 14:01:31 +01:00
parent 2e95029b0a
commit 398fe12d64
11 changed files with 13433 additions and 48665 deletions

View file

@ -24,9 +24,6 @@ jobs:
node-version: 14.x node-version: 14.x
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
- name: Install npm 7
run: npm i -g npm@7
- name: Get npm cache directory - name: Get npm cache directory
id: npm-cache-dir id: npm-cache-dir
run: | run: |
@ -40,7 +37,7 @@ jobs:
${{ runner.os }}-npm- ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run:
- name: Create Release Pull Request or Publish to npm - name: Create Release Pull Request or Publish to npm
id: changesets id: changesets

View file

@ -14,9 +14,6 @@ jobs:
with: with:
node-version: 14.x node-version: 14.x
- name: Install npm 7
run: npm i -g npm@7
- name: Get npm cache directory - name: Get npm cache directory
id: npm-cache-dir id: npm-cache-dir
run: | run: |
@ -30,7 +27,7 @@ jobs:
${{ runner.os }}-npm- ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: yarn --frozen-lockfile
- name: Lint - name: Lint
run: npm run lint run: npm run lint
@ -49,9 +46,6 @@ jobs:
with: with:
node-version: 14.x node-version: 14.x
- name: Install npm 7
run: npm i -g npm@7
- name: Get npm cache directory - name: Get npm cache directory
id: npm-cache-dir id: npm-cache-dir
run: | run: |
@ -65,7 +59,7 @@ jobs:
${{ runner.os }}-npm- ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: yarn --frozen-lockfile
- uses: microsoft/playwright-github-action@v1 - uses: microsoft/playwright-github-action@v1
@ -86,9 +80,6 @@ jobs:
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install npm 7
run: npm i -g npm@7
- name: Get npm cache directory - name: Get npm cache directory
id: npm-cache-dir id: npm-cache-dir
run: | run: |
@ -102,7 +93,7 @@ jobs:
${{ runner.os }}-npm- ${{ runner.os }}-npm-
- name: Install Dependencies - name: Install Dependencies
run: npm ci run: yarn --frozen-lockfile
- name: Test - name: Test
run: npm run test:node run: npm run test:node

4
.gitignore vendored
View file

@ -12,8 +12,8 @@ node_modules/
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log
# we prefer package-lock.json # we use yarn.lock for now until npm 7 is stable
/yarn.lock /package-lock.json
## build artifacts ## build artifacts
/lib/ /lib/

View file

@ -7,7 +7,7 @@ module.exports = {
"markdownlint --ignore '{.github/**/*.md,.changeset/*.md,**/CHANGELOG.md}'", "markdownlint --ignore '{.github/**/*.md,.changeset/*.md,**/CHANGELOG.md}'",
'git add', 'git add',
], ],
'package-lock.json': ['node ./scripts/package-lock-scan.js'], 'yarn.lock': ['node ./scripts/yarn-lock-scan.js'],
'*package.json': absolutePaths => { '*package.json': absolutePaths => {
const sortPackages = []; const sortPackages = [];
absolutePaths.forEach(p => { absolutePaths.forEach(p => {

View file

@ -19,19 +19,13 @@ git clone https://github.com/ing-bank/lion.git
cd lion cd lion
# Install dependencies # Install dependencies
npm install yarn
# Create a branch for your changes # Create a branch for your changes
git checkout -b fix/buttonSize git checkout -b fix/buttonSize
``` ```
> Requires NPM v7 at least, since we use workspaces. > Requires to use yarn for now, since we use workspaces, and NPM 7 is still too buggy
To install NPM 7:
```sh
npm i -g npm@7
```
Make sure everything works as expected: Make sure everything works as expected:

View file

@ -17,6 +17,8 @@ For some more details see the [announcement blog post](https://medium.com/ing-bl
We do have a [live Storybook](http://lion-web-components.netlify.com) which shows all our components. We do have a [live Storybook](http://lion-web-components.netlify.com) which shows all our components.
**Please note:** This project uses Yarn [Workspaces](https://classic.yarnpkg.com/en/docs/workspaces). If you want to run all demos locally you need to get [Yarn](https://classic.yarnpkg.com/en/docs/install) and install all dependencies by executing `yarn install`.
The code examples make use of [Javascript tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) which are a key component of the [lit-html engine](https://lit-html.polymer-project.org/) used in Lion. The code examples make use of [Javascript tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) which are a key component of the [lit-html engine](https://lit-html.polymer-project.org/) used in Lion.
Additionally imports like `import '@lion/form/lion-form.js'` need to be transformed somehow, for example by [es-dev-server](https://open-wc.org/developing/es-dev-server.html#node-resolve). Additionally imports like `import '@lion/form/lion-form.js'` need to be transformed somehow, for example by [es-dev-server](https://open-wc.org/developing/es-dev-server.html#node-resolve).
@ -142,6 +144,7 @@ Lion Web Components aims to be future proof and use well-supported proven techno
- [lit-html](https://lit-html.polymer-project.org) and [lit-element](https://lit-element.polymer-project.org) - [lit-html](https://lit-html.polymer-project.org) and [lit-element](https://lit-element.polymer-project.org)
- [npm](http://npmjs.com) - [npm](http://npmjs.com)
- [yarn](https://yarnpkg.com)
- [open-wc](https://open-wc.org) - [open-wc](https://open-wc.org)
- [Karma](https://karma-runner.github.io) - [Karma](https://karma-runner.github.io)
- [Mocha](https://mochajs.org) - [Mocha](https://mochajs.org)

View file

@ -94,13 +94,11 @@ Inside ING, our design system also makes use of this providence tool to create t
```json ```json
"scripts": { "scripts": {
"upgrade:lion": "npx update-by-scope @lion && npm run providence:extend", "upgrade:lion": "yarn upgrade --scope @lion --latest --exact && npm run providence:extend",
"providence:extend": "providence extend-docs -r 'node_modules/@lion/*' --prefix-from lion --prefix-to ing" "providence:extend": "providence extend-docs -r 'node_modules/@lion/*' --prefix-from lion --prefix-to ing"
} }
``` ```
> Note that if you want to fix your lion versions, you have to do this manually or write your own script for updating by scope. `update-by-scope` does not support passing `--save-exact` flag sadly (or any flag for that matter).
### Replacing paths & template tagnames ### Replacing paths & template tagnames
Now that we have a JSON file with all the information we need to know about to replace import paths and tagnames inside templates, we can start transforming the `LionTabs` documentation to `LeaTabs` documentation. Now that we have a JSON file with all the information we need to know about to replace import paths and tagnames inside templates, we can start transforming the `LionTabs` documentation to `LeaTabs` documentation.

48625
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,10 +0,0 @@
const fs = require('fs');
const path = require('path');
const packageLockPath = './package-lock.json';
const data = fs.readFileSync(path.resolve(packageLockPath), 'utf8');
if (data.match(/artifactory/g)) {
throw new Error(
'Artifactory references in your package-lock.json! Please make sure you are using a public npm registry when downloading your dependencies!',
);
}

10
scripts/yarn-lock-scan.js Normal file
View file

@ -0,0 +1,10 @@
const fs = require('fs');
const path = require('path');
const yarnLockPath = './yarn.lock';
const data = fs.readFileSync(path.resolve(yarnLockPath), 'utf8');
if (data.match(/artifactory/g)) {
throw new Error(
'Artifactory references in your yarn.lock! Please make sure you are using a public npm registry when downloading your dependencies!',
);
}

13410
yarn.lock Normal file

File diff suppressed because it is too large Load diff