Skip to content

Commit

Permalink
docs: moved demos folder to separate repo
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinr-maps committed Jan 13, 2025
1 parent 39ce5f3 commit 1d07ba0
Show file tree
Hide file tree
Showing 154 changed files with 18 additions and 46,349 deletions.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ packages/*/debug/
test.html
test.js

#
demos/test/*

# Temporary build products
packages/**/src/**/*.d.ts
packages/**/src/**/*.js
Expand All @@ -108,7 +105,4 @@ typedoc
srihashes.json

# Prevent caches from ultra runner
**/.ultra.cache.json

# Prevent package locks from npm installs in demos
demos/*/package-lock.json
**/.ultra.cache.json
23 changes: 11 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Esri welcomes contributions from anyone and everyone. Please see our [guidelines

### Before filing an issue

If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/arcgis-rest-js/issues) first. Have you found a new bug? Want to request a new feature? We'd [love](https://github.com/Esri/arcgis-rest-js/issues/new) to hear from you.
If something isn't working the way you expected, please take a look at [previously logged issues](https://github.com/Esri/arcgis-rest-js/issues) first. Have you found a new bug? Want to request a new feature? We'd [love](https://github.com/Esri/arcgis-rest-js/issues/new) to hear from you.

If you're looking for help you can also post issues on [GIS Stackexchange](http://gis.stackexchange.com/questions/ask?tags=esri-oss).

Expand Down Expand Up @@ -51,24 +51,23 @@ If you see any issue with any page on the API Reference, you can fix that by upd

#### How to add a new package

- In `/packages`, create a new folder with your desired new package name.
- 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.
- Clone the [samples repository](https://github.com/Esri/arcgis-rest-js-samples) and create a new folder and title what you want to call your demo. You can also copy one of the existing samples depending on what kind of demo you are building. Generally [the `node-typescript-es-modules`](https://github.com/Esri/arcgis-rest-js-samples/tree/main/samples/node-typescript-es-modules) sample is a good places to start.
- Add a `package.json` in your new sample 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 sample 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)
- In your sample import your package, following the instructions on how to point to your local version of ArcGIS REST JS.
- To run your sample be sure to have script that has a property `start` in your sample directory and your script is pointing to the correct entry point.
- Run `npm run start` in your sample directory.
- Add a readme describing your sample.

### 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 use this in conjunction with [the demos](./demos/).
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 samples](https://github.com/Esri/arcgis-rest-js-samples?tab=readme-ov-file#local-arcgis-rest-js).

```
# watch 'request' and rebuild a UMD for the browser
Expand All @@ -82,4 +81,4 @@ npm run dev -- node @esri/arcgis-rest-request
# watch all the packages
npm run dev -- umd @esri/*
```
```
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ You can install dependencies by cloning the repository and running:
npm install && npm run build
```

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`.
This will install all dependencies and do an initial build. Afterward, you can run any of the [samples](https://github.com/Esri/arcgis-rest-js-samples). See that repository's readme for instructions on how to run the samples while using a local version of ArcGIS REST JS.

NPM run commands include:

For all packages:

Expand All @@ -79,6 +81,8 @@ 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

For a list of all available commands run `npm run`.

### Packages

- [`@esri/arcgis-rest-request`](./packages/arcgis-rest-request/) - Core module implementing basic request code, shared TypeScript types and common utilities.
Expand Down
Empty file removed demos/ago-node-cli/.gitignore
Empty file.
30 changes: 0 additions & 30 deletions demos/ago-node-cli/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions demos/ago-node-cli/ago.js

This file was deleted.

11 changes: 0 additions & 11 deletions demos/ago-node-cli/index.js

This file was deleted.

48 changes: 0 additions & 48 deletions demos/ago-node-cli/lib/item-export-command.js

This file was deleted.

32 changes: 0 additions & 32 deletions demos/ago-node-cli/lib/item-search-command.js

This file was deleted.

29 changes: 0 additions & 29 deletions demos/ago-node-cli/package.json

This file was deleted.

7 changes: 0 additions & 7 deletions demos/attachments-browser/README.md

This file was deleted.

Loading

0 comments on commit 1d07ba0

Please sign in to comment.