-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvement: clean up old config, correctly name scripts
- Loading branch information
Showing
15 changed files
with
352 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
language: node_js | ||
node_js: '12' | ||
node_js: '10.16.3' | ||
sudo: false | ||
before_script: | ||
- export TZ=Europe/Amsterdam | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,6 @@ | |
</p> | ||
|
||
<p align="center"> | ||
<a href="https://lerna.js.org/"> | ||
<img alt="Lerna" src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg" /> | ||
</a> | ||
<a href="https://travis-ci.org/42BV/ui/"> | ||
<img alt="Build status" src="https://travis-ci.org/42BV/ui.svg?branch=master" /> | ||
</a> | ||
|
@@ -39,36 +36,18 @@ npm i @42.nl/ui --save | |
|
||
## Contributing | ||
|
||
This repository makes heavy use of [`Yarn` workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) | ||
functionality, therefore it is mandatory to have `Yarn` installed. If you | ||
do not have `Yarn` installed, consult the [installation guide](https://yarnpkg.com/en/docs/install#mac-stable). | ||
|
||
### Setup | ||
|
||
1. Ensure you have Node.js 10.13+ and Yarn installed. | ||
2. Git clone the repository. | ||
3. From the root of the repository, run `yarn` to install the dependencies required for development. This should automatically build and link the individual packages. | ||
|
||
### Development | ||
|
||
This project uses [lerna](https://lerna.js.org/) to manage independently | ||
versioned packages and enable code sharing. This enables us to run commands | ||
on repository level through `lerna run [script]` or on package level | ||
through `yarn [script]`. | ||
|
||
#### Scenario: new component | ||
|
||
1. Copy an existing package (e.g. `cp -r packages/Avatar packages/Component`) or use [@lerna/create](https://github.com/lerna/lerna/tree/master/commands/create#readme). | ||
2. Update `package.json` to reflect the new component. | ||
3. Ensure the package works by writing a test and verify by running `yarn test`. | ||
4. (Optional) if you're not using an [ESLint plugin](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) for your editor, run `yarn lint`. | ||
3. From the root of the repository, run `yarn` to install the dependencies required for development. | ||
|
||
### Testing | ||
|
||
First follow the build instructions above. Then to run both the linters and tests, use: | ||
|
||
```bash | ||
yarn test | ||
yarn test-all | ||
``` | ||
|
||
Or to run them seperately, use: | ||
|
@@ -78,39 +57,29 @@ yarn lint | |
``` | ||
|
||
```bash | ||
yarn test-only | ||
yarn test | ||
``` | ||
|
||
### Publishing | ||
|
||
#### Development | ||
|
||
To prevent multiple prelease publishes for a single feature, we recommend using | ||
[https://verdaccio.org/](Verdaccio). Verdaccio enables you to spin up | ||
a local NPM registry. This allows us to publish multiple versions for | ||
testing purposes without polluting the version scope. | ||
|
||
> We recommend the Docker approach instead of locally installing | ||
Verdaccio, if you do not want to use Docker, refer to the Verdaccio | ||
documentation. | ||
To prevent multiple prelease publishes for a single feature, we recommend using | ||
[https://verdaccio.org/](Verdaccio). Verdaccio enables you to spin up | ||
a local NPM registry which in turn allows us to publish multiple versions for testing purposes without polluting the version in NPM. | ||
|
||
To publish to the Verdaccio registry run `yarn dev-publish` this | ||
will spin up Verdaccio and publish all packages as a version | ||
based on the current date. To get out the version look for a line | ||
in the output that looks like this: | ||
> We recommend the Docker approach instead of locally installing | ||
> Verdaccio, if you do not want to use Docker, refer to the Verdaccio | ||
> documentation. | ||
`+ @42.nl/[email protected]`. | ||
|
||
In this case the version would be `2019.7.2182427`. | ||
To publish to the Verdaccio registry run `yarn dev:publish` this | ||
will spin up Verdaccio and publish. | ||
|
||
You can view Verdaccio here: `http://localhost:4873/` it should after | ||
a successful dev publish show the packages here. | ||
|
||
Next in the `package.json` of the project you want to test the new | ||
version in change the `@42.nl/ui` version to the version that was | ||
created. | ||
|
||
Then install with the registry Verdaccio registry via: | ||
To verify the release, install `@42.nl/ui` from the Verdaccio registry in a project of your choice | ||
by running: | ||
|
||
`npm install --registry http://localhost:4873`. | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
read -p "Have you updated the package version (y/n)? " answer | ||
case ${answer:0:1} in | ||
y | Y) ;; | ||
|
||
*) | ||
echo "Please do so according to https://semver.org/" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# Check if docker exists | ||
if [[ "$(docker -v 2>/dev/null)" == "" ]]; then | ||
printf -- 'You dont seem to have Docker installed.\n' | ||
printf -- 'Get it: https://www.docker.com/community-edition\n' | ||
printf -- 'Exiting with code 127...\n' | ||
exit 127 | ||
fi | ||
|
||
printf -- 'Docker found.\n' | ||
|
||
if [ "$(docker ps -q -f name=verdaccio)" ]; then | ||
printf -- '\033[37m Verdaccio already running, pulling down... \033[0m\n' | ||
docker stop verdaccio >/dev/null 2>&1 | ||
printf -- '\033[32m SUCCESS: Pulled down Verdaccio instance \033[0m\n' | ||
fi | ||
|
||
printf -- '\033[37m Starting verdaccio... \033[0m\n' | ||
docker run -d -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio:4.2.1 >/dev/null 2>&1 | ||
docker start verdaccio 2>&1 | ||
until $(curl --output /dev/null --silent --head --fail http://localhost:4873); do | ||
printf '.' | ||
sleep 1 | ||
done | ||
printf -- '\033[32m SUCCESS: Verdaccio is now running \033[0m\n' | ||
|
||
printf -- '\033[37m Creating verdaccio user... \033[0m\n' | ||
/usr/bin/expect <<EOD | ||
spawn npm adduser --registry http://localhost:4873 | ||
expect { | ||
"Username:" {send "test\r"; exp_continue} | ||
"Password:" {send "test\r"; exp_continue} | ||
"Email: (this IS public)" {send "test@[email protected]\r"; exp_continue} | ||
} | ||
EOD | ||
|
||
printf -- '\033[32m SUCCESS: verdaccio user created \033[0m\n' | ||
|
||
# Publish packages | ||
printf -- '\033[37m Attempting to publish to verdaccio... \033[0m\n' | ||
npm publish --registry http://localhost:4873 | ||
printf -- '\033[32m SUCCESS: Succesfully published packages \033[0m\n' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.