Skip to content

Commit f146f45

Browse files
authored
feat: Publish Veda UI to npm and workflow proposal (#1391)
**Related Ticket:** closes [#1369](#1369) ### Description of Changes - Changed the registry in .npmrc from the private Verdaccio registry to the public NPM registry under the scope `teamimpact` - [Published the library](https://www.npmjs.com/~teamimpact?activeTab=packages) under the `teamimpact` scope and updated the docs on how to set the necessary npm credentials - Experimented with a new `README-lib.md`: - Added an experimental workflow to copy this file to the lib dist during the library build - This allows us to have a unique `README.md` for the library when its published on NPM, separate from the veda-ui submodule documentation - I noticed the lib bundle size increased, largely due to the USWDS images and fonts being copied in the library build. There’s room for optimization, including removing unused assets or modules from the existing veda-ui (e.g. `air-quality-and-covid-19--story-cover.png` etc), and I made a tracking issue for that: #1392 ### Notes & Questions About Changes Proposed workflow for developing, testing and publishing the NPM registry: - Workflow proposal for veda-ui NPM publishing and development / testing with consuming apps (Next.JS) is [documented here](https://docs.google.com/document/d/1JRvZybU08mSdZTTXPkJr5pqYgoB_5EYYNWixXlgUIlA/edit?usp=sharing). The proposal aligns and extends our current veda-ui publishing workflow with the bi-weekly automated releases ### Validation / Testing 1. Set the necessary npm auth credentials mentioned in the set up docs 2. dry-run publish a version to make sure everything you're correctly authenticated 3. Review the [Google doc](https://docs.google.com/document/d/1JRvZybU08mSdZTTXPkJr5pqYgoB_5EYYNWixXlgUIlA/edit?usp=sharing) proposal and share feedback
2 parents ac99317 + dc629cf commit f146f45

File tree

5 files changed

+61
-10
lines changed

5 files changed

+61
-10
lines changed

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
registry=http://verdaccio.ds.io:4873
1+
registry=https://registry.npmjs.org

README-lib.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# VEDA Dashboard
2+
3+
![VEDA logo](./docs/media/nasa-veda-logo-pos.svg)
4+
5+
VEDA is a dashboard to explore data.
6+
7+
This repository contains the UI component of Veda where development of new features happens.
8+
If you're looking to add content check the [veda-config](https://github.com/NASA-IMPACT/veda-config) repository.
9+
10+
## Content documentation
11+
12+
**⚠️ The content configuration should not happen on this repository, but on your instance of [veda-config](https://github.com/NASA-IMPACT/veda-config).**
13+
14+
The following documentation will guide you through the process of configuring the content.
15+
16+
- Check [CONFIGURATION](./docs/content/CONFIGURATION.md) to see a list of configuration options for VEDA.
17+
- Check [CONTENT](./docs/content/CONTENT.md) for how to structure the content pieces.
18+
- Check [PAGE_OVERRIDES](./docs/content/PAGE_OVERRIDES.md) for all the layout overrides available to you and how they work.
19+
20+
21+
## Development documentation
22+
23+
Check the documentation below for how to setup and develop features for `veda-ui`.
24+
25+
- **Start here**: Check [SETUP.md](./docs/development/SETUP.md) for instructions on how to set up your local development environment.
26+
- Check [ARCHITECTURE](./docs/development/ARCHITECTURE.md) docs to read about architecture.
27+
- Check [PAGE_OVERRIDES](./docs/development/PAGE_OVERRIDES.md) for information about the component/content overriding feature.
28+
29+
## License
30+
This project is licensed under **Apache 2**, see the [LICENSE](./LICENSE) file for more details.

docs/development/REGISTRY.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ yarn buildlib
1212
After successfully building the library, link the project to your local environment with the following command, executed inside the VEDA-UI directory:
1313

1414
```
15-
yarn link
15+
yarn link
1616
```
17-
Then change your directory to the project that is using veda-ui, which has `@developmentseed/veda-ui` as a dependency. Create a local alias for VEDA-UI by running:
17+
Then change your directory to the project that is using veda-ui, which has `@teamimpact/veda-ui` as a dependency. Create a local alias for VEDA-UI by running:
1818
```
19-
yarn link @developmentseed/veda-ui
19+
yarn link @teamimpact/veda-ui
2020
```
2121

2222
Your project should now use the local version of the VEDA-UI library.
@@ -29,7 +29,28 @@ Note: Package publishing is not yet part of the CI system since the library is s
2929

3030
### Publish
3131

32-
As of September 2024, VEDA-UI is being published to Development Seed's Verdaccio instance.To publish the package, authenticate using Development Seed's NPM credentials. Run the following command to test the publishing process before pushing live:
32+
As of January 2025, VEDA-UI is published to NASA IMPACT's npm registry.
33+
34+
## Authentication
35+
36+
To publish the package, make sure you are authenticated with teamimpact's NPM registry. Use the following steps to set up authentication and scope:
37+
38+
1. Set the scoped registry for @teamimpact:
39+
40+
```
41+
npm config set @teamimpact:registry=https://registry.npmjs.org/
42+
```
43+
44+
2. Add your authentication token for the registry:
45+
46+
```
47+
npm config set //registry.npmjs.org/:_authToken=<your-token>
48+
```
49+
Replace <your-token> with the actual token provided to you.
50+
51+
> **Important:** Avoid using `npm logout` while working with the registry locally. Logging out invalidates the authentication token globally, which will disrupt publishing and other registry-related actions.
52+
53+
Before publishing live, test the process with:
3354

3455
```
3556
npm publish --dry-run
@@ -49,7 +70,7 @@ For example, if the current version is v5.7.0 and further changes are necessary
4970
To check the latest version in the registry and ensure proper versioning, run:
5071

5172
```
52-
npm view @developmentseed/veda-ui version
73+
npm view @teamimpact/veda-ui version
5374
```
5475

5576
Currently, developers manually update the version number in the package.json file to publish with pre-release tags (instead of using npm tag) because a formal release cycle for the library has not yet been established.

docs/development/THEMING_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The order of importing styles is important so that proper styles cascading can b
5959
// Note: For custom styles that override VEDA UI and/or USWDS,
6060
// create a separate custom.scss file and import it last in your application
6161
// Import order in your app:
62-
// 1. import '@developmentseed/veda-ui/lib/main.css';
62+
// 1. import '@teamimpact/veda-ui/lib/main.css';
6363
// 2. import './styles/index.scss';
6464
// 3. import './styles/custom.scss';
6565
```
@@ -123,7 +123,7 @@ module.exports = {
123123

124124
```typescript
125125
import './styles/index.scss';
126-
import '@developmentseed/veda-ui/lib/main.css';
126+
import '@teamimpact/veda-ui/lib/main.css';
127127
// Any other custom styles
128128
import './styles/custom.scss';
129129
```

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@developmentseed/veda-ui",
2+
"name": "@teamimpact/veda-ui",
33
"description": "Dashboard",
44
"version": "5.12.1",
55
"author": {
@@ -22,7 +22,7 @@
2222
"scripts": {
2323
"serve": "NODE_ENV=development gulp serve",
2424
"build": "NODE_ENV=production gulp",
25-
"buildlib": "gulp buildlib",
25+
"buildlib": "gulp buildlib && cp README-lib.md lib/README.md",
2626
"stage": "yarn buildlib && NODE_ENV=staging gulp",
2727
"clean": "gulp clean",
2828
"lint": "yarn lint:scripts && yarn lint:css",

0 commit comments

Comments
 (0)