Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add packages publisher #241

Merged
merged 5 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry "https://registry.npmjs.org/"
63 changes: 63 additions & 0 deletions development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Development

## Workflow

To run all the packages locally at once, simply clone this repository and run:

```sh
yarn;
yarn build; #only needs to be run the first time
yarn dev;
```

A hot reloading server should come up on localhost:3000, it's the exact same as what's at react-celo-c-labs.vercel.app.
aaronmgdr marked this conversation as resolved.
Show resolved Hide resolved
aaronmgdr marked this conversation as resolved.
Show resolved Hide resolved

Alternatively, you can individually run `react-celo` and the `example` app in parallel.

For that, you still need to have run `yarn` in the root.

Then, you can run `react-celo` in one tab:

```sh
cd packages/react-celo
yarn dev
```

and run the `example` app in another:

```sh
cd packages/example
yarn dev
```

## Bumping the packages

All packages under `/packages` are meant to published with the same version.

To bump the version of all the packages at once, use the `bump-versions` script.
You'll need to specify which semver increase you want to use.

For example, to bump to a prerelease:

```sh
yarn bump-versions prerelease --preId alpha
```

or for bumping a `major` version (same for `minor` or `patch`):

```sh
yarn bump-versions major
```

## Publishing the packages

Once the packages are ready to be published, ensure you've checked master and it is updated. Then, you can run the npm following npm script:

```sh
yarn publish-packages
```

Hint:

- You can use the `--dry-run` flag to check everything would run properly
- If you need to run the script multiple times without changing the code, using the `--skip-build` flag can be useful to reduce the time.
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"workspaces": [
"packages/*"
],
"pkgs": {
"path": "./packages"
},
"scripts": {
"dev": "lerna run dev --stream --parallel",
"build": "lerna link && lerna run clean && lerna run build --scope 'example' --include-dependencies",
Expand All @@ -13,10 +16,13 @@
"test": "lerna link && COVERAGE=ON lerna run --stream --no-bail test",
"prepare": "husky install",
"reset-modules": "rm -rf node_modules/ packages/*/node_modules",
"publish-packages": "ts-node ./scripts/publish-packages.ts",
"deprecate-version": "ts-node ./scripts/deprecate-version.ts"
"publish-packages-script": "ts-node ./scripts/publish-packages.ts",
aaronmgdr marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the old script right? why not remove?

"deprecate-version": "ts-node ./scripts/deprecate-version.ts",
"publish-packages": "pkgs publish",
"bump-versions": "pkgs bump-versions"
},
"devDependencies": {
"@clabs/packages-publisher": "^0.0.1-alpha.2",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@types/jest": "^27.5.1",
Expand Down
30 changes: 0 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,36 +365,6 @@ interface Theme {
}
```

## Development

To run all the packages locally at once, simply clone this repository and run:

```sh
yarn;
yarn build; #only needs to be run the first time
yarn dev;
```

A hot reloading server should come up on localhost:3000, it's the exact same as what's at react-celo-c-labs.vercel.app.

Alternatively, you can individually run `react-celo` and the `example` app in parallel.

For that, you still need to have run `yarn` in the root.

Then, you can run `react-celo` in one tab:

```sh
cd packages/react-celo
yarn dev
```

and run the `example` app in another:

```sh
cd packages/example
yarn dev
```

## Support

Struggling with anything react-celo related? Jump into the [GitHub Discussions](https://github.com/celo-org/react-celo/discussions) or [celo-org discord channel](https://chat.celo.org) and ask for help any time.
Expand Down
40 changes: 38 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,17 @@
eth-lib "^0.2.8"
ethereumjs-util "^5.2.0"

"@clabs/packages-publisher@^0.0.1-alpha.2":
version "0.0.1-alpha.2"
resolved "https://registry.npmjs.org/@clabs/packages-publisher/-/packages-publisher-0.0.1-alpha.2.tgz#e1a8b3958d8a87397e7f2b0bbf6ed177a561bd95"
integrity sha512-ynm7U6Y8Cu63mHQKdGODlX51oPBxSCnkQBDNcpNVFNEbjLD5KJkvGCtWjG+ESBZU7oK4BGnHkYjDqHkZG5wDIQ==
dependencies:
execa "5.1.1"
kleur "^4.1.4"
prompts "^2.4.2"
semver "^7.3.6"
yargs "^17.4.1"

"@eslint/eslintrc@^1.0.5":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318"
Expand Down Expand Up @@ -5850,7 +5861,7 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3:
md5.js "^1.3.4"
safe-buffer "^5.1.1"

execa@^5.0.0, execa@^5.1.1:
execa@5.1.1, execa@^5.0.0, execa@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"
integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==
Expand Down Expand Up @@ -7834,6 +7845,11 @@ kleur@^3.0.3:
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==

kleur@^4.1.4:
version "4.1.4"
resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d"
integrity sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==

lerna@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/lerna/-/lerna-4.0.0.tgz#b139d685d50ea0ca1be87713a7c2f44a5b678e9e"
Expand Down Expand Up @@ -9517,7 +9533,7 @@ prompt@^1.2.1:
revalidator "0.1.x"
winston "2.x"

prompts@^2.0.1:
prompts@^2.0.1, prompts@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069"
integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==
Expand Down Expand Up @@ -10198,6 +10214,13 @@ semver@^6.0.0, semver@^6.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==

semver@^7.3.6:
version "7.3.7"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
dependencies:
lru-cache "^6.0.0"

send@0.17.1:
version "0.17.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
Expand Down Expand Up @@ -12318,3 +12341,16 @@ yargs@^17.3.1:
string-width "^4.2.3"
y18n "^5.0.5"
yargs-parser "^21.0.0"

yargs@^17.4.1:
version "17.5.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.5.1.tgz#e109900cab6fcb7fd44b1d8249166feb0b36e58e"
integrity sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==
dependencies:
cliui "^7.0.2"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.3"
y18n "^5.0.5"
yargs-parser "^21.0.0"