Skip to content

Commit

Permalink
docs: update contributor docs (#1104)
Browse files Browse the repository at this point in the history
* docs: update contributor docs

* Update README.md

Co-authored-by: John Foster <jfoster@esri.com>

* Update README.md

Co-authored-by: Gavin Rehkemper <gavinr@users.noreply.github.com>

* Update README.md

Co-authored-by: Gavin Rehkemper <gavinr@users.noreply.github.com>

* Update README.md

Co-authored-by: Gavin Rehkemper <gavinr@users.noreply.github.com>

---------

Co-authored-by: John Foster <jfoster@esri.com>
Co-authored-by: Gavin Rehkemper <gavinr@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 22, 2023
1 parent eca1c03 commit 649f7e7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 33 deletions.
37 changes: 30 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ If something isn't working the way you expected, please take a look at [previous
If you're looking for help you can also post issues on [GIS Stackexchange](http://gis.stackexchange.com/questions/ask?tags=esri-oss).

**Please include the following information in your issue:**

* Browser (or Node.js) version
* a snippet of code
* an explanation of
Expand All @@ -27,25 +28,47 @@ You don't _have to_ but we recommend installing TypeScript, Prettier and EditorC

### Running the tests

@esri/arcgis-rest-js has a comprehensive test suite built with [Karma](http://karma-runner.github.io/0.12/index.html) and [Jasmine](https://jasmine.github.io/) The tests can be found in `/packages/*/test/`.
`@esri/arcgis-rest-js` has a comprehensive test suite built with [Karma](http://karma-runner.github.io/0.12/index.html) and [Jasmine](https://jasmine.github.io/) The tests can be found in `/packages/*/test/`.

The tests also make heavy use of [`fetch-mock`](http://www.wheresrhys.co.uk/fetch-mock/) to mock the underlying `fetch()` implementation for testing.

You can run _all_ the tests with `npm test`.

* `npm run test:chrome:debug` runs the Karma tests in Chrome and watches for changes. In the opened Chrome window you can click "Debug" and refresh the page to enter the debugger for tests.
* `npm run test:node:debug` run the node tests, automatically opening the Chrome (60+) debugger. This is great for debugging the tests while you are working.

### Formatting commit messsages
Using [`npm run c`](https://github.com/Esri/arcgis-rest-js/blob/fd9005fef74c33c684273fd283aa6bd9990e8630/package.json#L110) (instead of `git commit`) create messages our handy [script](https://github.com/Esri/arcgis-rest-js/blob/master/support/changelog.js) can parse to categorize your bug fix, new feature or breaking change and associate it with relevant packages in our [CHANGELOG](CHANGELOG.md) automatically.
### Formatting commit messages

We require all commit messages be formatted according to [the Conventional Commits standard.](https://www.conventionalcommits.org/en/v1.0.0/). The automated build and release process uses these commits to determine changes and automatically publish changed packages and update the changelog in each package.

Please refer to [the summary of the Conventional Commits standard](https://www.conventionalcommits.org/en/v1.0.0/#summary) for how to format your commit messages. We also use [`commitlint`](https://commitlint.js.org/#/) to validate commit messages so providing a commit message in an incorrect format will result in a precommit failure.

### Documentation site

The documentation is published at https://developers.arcgis.com/arcgis-rest-js/ and is maintained ina private repository and managed by the ArcGIS Developer Experience team. The [API reference](https://developers.arcgis.com/arcgis-rest-js/api-reference/) is generated automatically by [TypeDoc](https://typedoc.org/) via the `npm run typedoc` command and the [`typedoc.json` configuration file](./typedoc.json).

This isn't mandatory, but it is pretty cool. :sparkles:
If you see any issue with any page on the API Reference, you can fix that by updating the inline documentation comments in this repository. If you have an issue with one of the samples or other guide pages, please [log a documentation issue](https://github.com/Esri/arcgis-rest-js/issues/new?assignees=&labels=Documentation&template=documentation.yml).

### Documentation Site
#### How to add a new package

We use TypeDoc to turn the inline documentation into the [API Reference section of the documentation website](https://developers.arcgis.com/arcgis-rest-js/api-reference/). If you see any issue with any page on the API Reference, you can fix that by updating the inline documentation comments in this repository. If you have an issue with one of the samples or other guide pages, please [log a documentation issue](https://github.com/Esri/arcgis-rest-js/issues/new?assignees=&labels=Documentation&template=documentation.yml).
- In `/packages`, create a new folder with your desired new package name.
- Each package will have it’s own `package.json` and `tsconfig.json`. These can be copied from other packages to maintain the correct configuration. Set the version of your new package at `1.0.0`.
- Create a folder in your new package called `src` in which your code will be defined. Create an `index.ts` file with a simple `console.log("hello world")` to serve as the entry point of your package.
- After creating your package, go to the root `package.json`, under the property `workspaces`, add the path to your new package.
- Run `npm install` to update the dependencies of your project and then run `npm build:esm` to build your project.
- Check in the root `/node_modules/@esri` and `/packages/{YOUR PACKAGE}/dist` that your new package and it has been built properly.
- Go into `/demos`, create a new folder and title what you want to call your demo. You can also copy one of the existing demos depending on what kind of demo you are building. Generally [the `node-typescript-es-modules`](./demos/node-typescript-es-modules) demo is a good places to start.
- Add a `package.json` in your new demo folder. Add your package as a dependency and be sure to have at least these properties in your `package.json`, `dependencies`, `name`, `version`, `description`, `license`, `type`, `main`, `scripts`, and `author`. Ensure that the `private` flag is set to `true`.
- Add a `.gitignore` in the root level of your demo folder that ignore `node_modules`. Be sure to ignore an `.env` file as well if your demo is using any personal keys or tokens with [dot-env](https://github.com/motdotla/dotenv)
- Run `npm install` within the `./demos` directory and make sure your demo folder has it's own local node_modules.
- In your demo import your package.
- To run your demo be sure to have script that has a property `start` in your demo directory and your script is pointing to the correct entry point.
- Run `npm run start` while being in your `/demos/custom-demo` directory.
- Add a readme describing your demo.

### Watching local source for changes

you can run the command below in the root of the repo to automatically recompile a package when the raw TypeScript source changes
you can run the command below in the root of the repo to automatically recompile a package when the raw TypeScript source changes. You can use this in conjunction with [the demos](./demos/).

```
# watch 'request' and rebuild a UMD for the browser
Expand Down
42 changes: 16 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,31 @@ request(url).then((response) => {
});
```

### API Reference
### Get Started

The documentation is published at http://esri.github.io/arcgis-rest-js/ (source code [here](/docs/src)).
To get started, go to [ArcGIS REST JS on the ArcGIS Developers website](https://developers.arcgis.com/arcgis-rest-js/).

### Documentation

The documentation is published at https://developers.arcgis.com/arcgis-rest-js/ and is maintained in a private repository and managed by the ArcGIS Developer Experience team. The [API reference](https://developers.arcgis.com/arcgis-rest-js/api-reference/) is generated automatically by [TypeDoc](https://typedoc.org/) via the `npm run typedoc` command and the [`typedoc.json` configuration file](./typedoc.json).

### Instructions

You can install dependencies by cloning the repository and running:

```bash
npm install
npm install && npm run build
```

Afterward, for a list of all available commands run `npm run`.
This will install all dependencies and do an initial build. Afterward, you can run any of the [demo apps](./demos/) by `cd`'ing by following the README for the specific demo. For a list of all available commands run `npm run`.

For all packages
For all packages:

- `npm run build` - builds all distributions of every package with `ultra`, inside each package builds are done in parallel with `npm-run-all`. Output is errors only.
- `npm run build:esm`, `npm run build:cjs`, `npm run build:bundled` - as as the above but only one of our target distributions.
- `npm run dev:esm`, `npm run dev:cjs`, `npm run dev:bundled` - runs the appropriate watch command in all packages.

For a specific package
For a specific package:

- `npm run build -w @esri/arcgis-rest-request` - run all builds in a specific workspace
- `npm run dev -w @esri/arcgis-rest-request` - run all dev commands in a specific workspace
Expand All @@ -73,29 +77,15 @@ For a specific package
- `npm run build:bundled -w @esri/arcgis-rest-request` - run the rollup build in a specific workspace
- `npm run dev:bundled -w @esri/arcgis-rest-request` - run the rollup dev command in a specific workspace

#### How to add a new package
- In `/packages`, create a new folder with your desired new package name
- Each package will have it’s own local `package.json` and tsconfig.json if using typescript
- Create a folder in your new package called `src` in which your code will be defined
- After creating your custom package, go to the root `package.json`, under the property `workspaces`, add the title of your custom package
- Run `npm build:esm`
- Check in the root `node_modules/@esri` that your new custom package has been added
- Go into `/demos`, create a new folder and title what you want to call your demo
- Add a local `package.json` in your new demo folder. Add your custom package name as a dependency and be sure to have at least these properties in your `package.json`, `dependency, name, version, - description, license, type, main, scripts, and author`.
- Add a `.gitignore` in the root level of your demo folder that ignore `node_modules`. Be sure to ignore an `env` file as well if your demo is using any personal keys or tokens.
- Run `mpm install` within the `/demos` directory and make sure your demo folder has it's own local node_modules.
- In your `demo/index`, import your custom package.
- To run your demo be sure to have script that has a property `start` in your demo directory and your script is pointing to the correct index file.
- Run `npm run start` while being in your `/demos/custom-demo` directory.
- Add a readme describing your demo.

### Packages

- [`@esri/arcgis-rest-request`](./packages/arcgis-rest-request/) - Core module implementing basic request code, shared TypeScript types and common utilities.
- [`@esri/arcgis-rest-portal`](./packages/arcgis-rest-portal) - Methods for working with ArcGIS Online/Enterprise content and users.
- [`@esri/arcgis-rest-feature-service`](./packages/arcgis-rest-feature-service) - Functions for querying, editing, and administering hosted feature layers and feature services.
- [`@esri/arcgis-rest-geocoding`](./packages/arcgis-rest-geocoding) - Geocoding wrapper for `@esri/arcgis-rest-js`
- [`@esri/arcgis-rest-routing`](./packages/arcgis-rest-routing) - Routing and directions wrapper for `@esri/arcgis-rest-js`.
- [`@esri/arcgis-rest-geocoding`](./packages/arcgis-rest-geocoding) - Wrapper around geocoding services.
- [`@esri/arcgis-rest-routing`](./packages/arcgis-rest-routing) - Wrapper around routing and directions services.
- [`@esri/arcgis-rest-demographics`](./packages/arcgis-rest-demographics) - Wrapper around demographic data services.
- [`@esri/arcgis-rest-places`](./packages/arcgis-rest-places) - Wrapper around place finding and place data services.

### Issues

Expand All @@ -105,7 +95,7 @@ If you're looking for help you can also post issues on [Stack Overflow](https://

### Versioning

For transparency into the release cycle and in striving to maintain backward compatibility, @esri/arcgis-rest-js is maintained under Semantic Versioning guidelines and will adhere to these rules whenever possible.
For transparency into the release cycle and in striving to maintain backward compatibility, `@esri/arcgis-rest-js` is maintained under [Semantic Versioning guidelines](https://semver.org/) and will adhere to these rules whenever possible.

For more information on SemVer, please visit <http://semver.org/>.

Expand All @@ -115,7 +105,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines

### License

Copyright &copy; 2017-2022 Esri
Copyright &copy; 2017-2023 Esri

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ As of v4, the ArcGIS REST JS packages are released automatically via Semantic Re
2. Find the most recent failed [`Build, Test, Release` GitHub action workflow run](https://github.com/Esri/arcgis-rest-js/actions/workflows/release.yml), and re-run it.
3. After the release is complete, re-enable the branch protection rules from step 1.

**Note:** Any new packages added are published at v1.0.0 instead of 4.0.0.

## v3

The release process has been entirely automated, but it is not perfect, so it requires some attentive human oversight.
Expand Down

0 comments on commit 649f7e7

Please sign in to comment.