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

CED-1724: new folder structure and publish process for v3 #1467

Merged
merged 15 commits into from
Aug 15, 2024
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
61 changes: 46 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Run local v3 docs site with hot reloading hooked up to es-bs-base and es-ds-components

.PHONY: dev
dev:
cd es-bs-base; npm link
cd es-ds-components; npm link
cd es-ds-docs; npm link @energysage/es-bs-base @energysage/es-ds-components
dev: symlink
nathanielwarner marked this conversation as resolved.
Show resolved Hide resolved
cd es-ds-docs; npm run dev

# Run the old v2 docs site with slow rebuilds of es-bs-base and es-vue-base
Expand All @@ -13,6 +10,12 @@ dev:
legacy-dev:
overmind s

.PHONY: symlink
symlink:
cd es-bs-base; npm link
cd es-ds-components; npm link
cd es-ds-docs; npm link @energysage/es-bs-base @energysage/es-ds-components

# Unlink local v3 docs site from local es-bs-base and es-ds-components; restore to NPM versions

.PHONY: unlink
Expand All @@ -25,34 +28,58 @@ unlink:

.PHONY: lint
lint:
npm --prefix es-bs-base run lint
# TODO: set up linting for es-ds-components and es-ds-docs
lgeggleston marked this conversation as resolved.
Show resolved Hide resolved
# npm --prefix es-ds-components run lint
# npm --prefix es-ds-docs run lint

.PHONY: legacy-lint
legacy-lint:
nathanielwarner marked this conversation as resolved.
Show resolved Hide resolved
npx lerna run lint

.PHONY: test
test:
tomleo marked this conversation as resolved.
Show resolved Hide resolved
npm --prefix es-bs-base run test
# TODO: set up testing for es-ds-components and es-ds-docs
# npm --prefix es-ds-components run test
# npm --prefix es-ds-docs run test

.PHONY: legacy-test
legacy-test:
npx lerna run test

.PHONY: build
build:
npm --prefix es-bs-base run build
npm --prefix es-ds-docs run build
# es-ds-components does not have a build step

.PHONY: legacy-build
legacy-build:
npx lerna run build

.PHONY: publish
publish:
nathanielwarner marked this conversation as resolved.
Show resolved Hide resolved
cd es-bs-base; npm publish --tag alpha
nathanielwarner marked this conversation as resolved.
Show resolved Hide resolved
cd es-ds-components; npm publish

.PHONY: legacy-publish
legacy-publish:
npx lerna publish

.PHONY: symlink
symlink:
.PHONY: legacy-symlink
legacy-symlink:
npx lerna bootstrap

.PHONE: reload
reload:
.PHONE: legacy-reload
legacy-reload:
npm --prefix es-vue-base run build
npx lerna bootstrap

# Sometimes Called

.PHONY: install
install:
npm install
npm --prefix es-bs-base install
npm --prefix es-ds-components install
npm --prefix es-ds-docs install
Expand All @@ -64,15 +91,19 @@ legacy-install:

# Bootstraping Commands (not reguarly called)

.PHONY: build-scss-pkg
build-scss-pkg:
.PHONY: update-docs-deps
update-docs-deps:
cd es-ds-docs; npm uninstall @energysage/es-bs-base && npm install @energysage/es-bs-base@alpha && npm uninstall @energysage/es-ds-components && npm install @energysage/es-ds-components

.PHONY: legacy-build-scss-pkg
legacy-build-scss-pkg:
npm run --prefix es-bs-base build

.PHONY: build-vue-pkg
build-vue-pkg:
.PHONY: legacy-build-vue-pkg
legacy-build-vue-pkg:
npm run --prefix es-vue-base build

.PHONY: update-peer-deps
update-peer-deps:
.PHONY: legacy-update-peer-deps
legacy-update-peer-deps:
npm --prefix es-vue-base install bootstrap-vue@2 \
vue@2
43 changes: 31 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ origin [email protected]:EnergySage/es-ds.git (push)
**v2.x and earlier**

1. `make legacy-install` - installs all packages from npm
2. `make update-peer-deps` - installs necessary peer deps for `es-vue-base` used
2. `make legacy-update-peer-deps` - installs necessary peer deps for `es-vue-base` used
in `es-design-system`
3. `make build-scss-pkg` - build `es-bs-base/dist` locally; we do this first
3. `make legacy-build-scss-pkg` - build `es-bs-base/dist` locally; we do this first
since `es-vue-base` imports it `@import '~@energysage/es-bs-base/scss/includes'`
4. `make symlink` - [symlink or bootstrap](https://lerna.js.org/docs/features/bootstrap) `es-bs-base/dist`
5. `make build-vue-pkg` - build `es-vue-base/dist` locally
6. `make symlink` - [symlink or bootstrap](https://lerna.js.org/docs/features/bootstrap)
4. `make legacy-symlink` - [symlink or bootstrap](https://lerna.js.org/docs/features/bootstrap) `es-bs-base/dist`
5. `make legacy-build-vue-pkg` - build `es-vue-base/dist` locally
6. `make legacy-symlink` - [symlink or bootstrap](https://lerna.js.org/docs/features/bootstrap)
`es-bs-base/dist` and `es-vue-base/dist` for use in `es-design-system`

### Development workflow
Expand Down Expand Up @@ -262,29 +262,48 @@ in the changelog when publishing a new release.
For simplicity of deployment, versioning of packages are fixed and updated
together.

#### Publishing a new version of a package
#### Publishing a new version of a package (3.0 and later)
nathanielwarner marked this conversation as resolved.
Show resolved Hide resolved

Assuming changes are approved, the process of publishing a new version is...
0. Ensure your local environment is
[setup](./README.md#installing-dependencies-and-linking-packages) and you are on
the `main` branch
1. Make sure the package.json versions in `es-bs-base` and `es-ds-components` is updated to a new version
that hasn't been published before on NPM.
2. `npm login` - Logs you into the npm.js registry. You'll need access to our `es-ds` package there in order for things to work.
3. `make install && make symlink` - Install and symlink dependencies locally
4. `make build` - Build all packages to `*/dist` folders locally
5. `make lint && make test` - Run tests and linting to ensure they pass
6. `make publish` - Publish updated packages to
[npmjs.com](https://www.npmjs.com/org/energysage)
7. Update [CHANGELOG.md](./CHANGELOG.md) with our newly published changes
8. `make update-docs-deps` - Install the new published versions locally
9. `git commit -m "docs: :memo: add version X.X.X to the changelog" && git push` -
Commit and push the changelog and `package-lock.json` updates

#### (LEGACY VERSION PRE-3.0) Publishing a new version of a package

Assuming changes are approved, the process of publishing a new version is...

0. Ensure your local environment is
[setup](./README.md#installing-dependencies-and-linking-packages) and you are on
the `main` branch
1. `npm login` - Logs you into the npm.js registry. You'll need access to our `es-ds` package there in order for things to work.
2. `make install && make symlink` - Install the new published versions locally
2. `make legacy-install && make legacy-symlink` - Install the new published versions locally
and symlink them
3. `make build` - Build all packages to `*/dist` folders locally
4. `make lint && make test` - Run tests and linting to ensure they pass
5. `make publish` - Publish updated packages to
3. `make legacy-build` - Build all packages to `*/dist` folders locally
4. `make legacy-lint && make legacy-test` - Run tests and linting to ensure they pass
5. `make legacy-publish` - Publish updated packages to
[npmjs.com](https://www.npmjs.com/org/energysage)
6. Update [CHANGELOG.md](./CHANGELOG.md) with our newly published changes
7. `make install && make symlink` - Install the new published versions locally
7. `make legacy-install && make legacy-symlink` - Install the new published versions locally
and symlink them
8. `git commit -m "docs: :memo: add version X.X.X to the changelog" && git push` -
Commit and push the changelog and `package-lock.json` updates
9. For updating the design-system website see
[Deploy Design System](https://energysage.atlassian.net/wiki/spaces/DSE/pages/208568321/Deploy+Design+System+Documentation)

Running `make publish` will trigger the following prompt:
Running `make legacy-publish` will trigger the following prompt:

```shell
lerna info Looking for changed packages since v0.1.9
Expand Down
4 changes: 2 additions & 2 deletions es-bs-base/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion es-bs-base/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@energysage/es-bs-base",
"description": "Base CSS for EnergySage design system based on Bootstrap",
"version": "2.0.4",
"version": "3.0.0-alpha.2",
"config": {
"version_short": "0.1"
},
Expand Down
4 changes: 2 additions & 2 deletions es-ds-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion es-ds-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@energysage/es-ds-components",
"version": "0.0.1",
"version": "3.0.0-alpha.2",
"private": false,
"description": "An EnergySage Vue component library",
"main": "./nuxt.config.ts",
Expand Down
16 changes: 8 additions & 8 deletions es-ds-docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions es-ds-docs/package.json
nathanielwarner marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"@energysage/es-bs-base": "^2.0.4",
"@energysage/es-ds-components": "^0.0.1",
"@energysage/es-bs-base": "^3.0.0-alpha.2",
nathanielwarner marked this conversation as resolved.
Show resolved Hide resolved
"@energysage/es-ds-components": "^3.0.0-alpha.2",
"@nuxtjs/google-fonts": "^3.2.0",
"clipboard": "^2.0.11",
"nuxt": "^3.12.4",
Expand Down