Skip to content

Commit 584ff46

Browse files
authored
Merge pull request #11 from HydrologicEngineeringCenter/bugfix/10-custom-readme
Use custom README for generated package
2 parents 34986a3 + 66e2d19 commit 584ff46

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ _CWMS Data API (CDA) client library created with OpenAPI generator in TypeScript
55
## Getting Started
66

77
- Install CWMSjs to your react project with:
8-
`npm install cwmsjs --save`
8+
`npm install cwmsjs`
99
(This will grab the latest)
1010

1111
- Import the API endpoint you wish to use:
1212
- Avaiable endpoints are here (Classes ending in API): [Endpoints](https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/modules.html)
1313
- At the top of your js/jsx/file type:
1414
```javascript
15-
import { TimeseriesAPI } from "cwmsjs";
15+
import { TimeSeriesAPI } from "cwmsjs";
1616
```
17-
- Then initialize the TimeseriesAPI with:
17+
- Then initialize the TimeSeriesAPI with:
1818
```javascript
19-
const tsa = new TimeseriesAPI();
19+
const ts_api = new TimeSeriesAPI();
2020
```
21-
- Fetch timeseries data with:
21+
- Fetch time series data with:
2222
```javascript
2323
await ts_api
24-
.getTimeseries({
24+
.getTimeSeries({
2525
office: "SWT",
2626
name: "KEYS.Elev.Inst.1Hour.0.Ccp-Rev",
2727
})
@@ -38,15 +38,23 @@ Documentation is available for both developers and new users:
3838
- New Users : [Examples](https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/examples/)
3939
- Advanced users : [Type Documentation / Developer Docs](https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/)
4040

41-
## Building CWMSjs from source
41+
## Developers
42+
### Versioning
43+
In order to accommodate changes both to the generator and to CDA itself, cwmsjs is versioned in the following format:
44+
`[generator SemVer]-[generation date]`
4245

43-
- Install openapi-generator-cli with:
44-
`npm install -g @openapitools/openapi-generator-cli`
45-
(This will grab the latest)
46+
CDA is expected to at some point expose a CalVer for the latest update. When this is available, the generation date will be replaced with the current CDA CalVer.
47+
48+
### Publishing
49+
Contributors with authorization can publish a new version of cwmsjs by manually running the "Build, Test, and Publish" GitHub Action.
4650

47-
### Run the following commands to build the project:
51+
The workflow will build an updated cwmsjs library using the current generator and national CDA instance OpenAPI spec. If all tests pass, the library will be published to npm and updated documentation will be deployed to GitHub Pages.
4852

53+
## Building CWMSjs from source
54+
55+
- Clone this repository
56+
- Install dependencies with: `npm install`
4957
- Run the generator with:
50-
`npm run openapi`
51-
- Transpile the typescript
5258
`npm run build`
59+
60+
All generated files (source, library, and docs) will be in `[repo]/cwmsjs`

scripts/package-updates/modPackage.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ npx node-jq 'del(.publishConfig)' |
1919

2020
# Write to file
2121
cat > temp.json
22-
mv temp.json cwmsjs/package.json
22+
mv temp.json cwmsjs/package.json
23+
24+
# Copy custom README.md to generated package
25+
cp README.md cwmsjs/README.md

0 commit comments

Comments
 (0)