8000 4.0 build system (#911) · Esri/arcgis-rest-js@e8d1be1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e8d1be1

Browse files
4.0 build system (#911)
* 4.0 build system WIP * working build system * wip * co * add fetch package * wip * remove typedoc * more cleanup * remove package locks * restore typedoc * continue cleanup * remove old ts-helper for node tests * remove old ts-helper for node tests * update engine * delete lerna.json * continue cleanup * Use node-fetch 3.0, fix rollup * updates to webpack and rollup, add files * Update demos/node-common-js/package.json Co-authored-by: Noah Mulfinger <nmulfinger@esri.com> * Update package-lock.json * rollup support * more rollup fixing * clean up * revert linting * rollup specific builds * add wrapper around node-fetch * More WIP * chrome debugging * cleanup skypack check, fix intermittantly failing test * migrate @esri/arcgis-rest-auth, fix browser auth test * auth demo * migrate portal, service admin and routing * migrate all packages * cleanup package.jsons * attachments demo * more demo work * fix spelling of Vernonia * wrap up demos * more demos * use import/export type, ultra runner, better rollup * format package.jsons * update actions * fix build script * fix tests, add file attachment node demo, remove data for file/text in tests * use npm 7 in GitHub actions * fix build * upgrade npm in actions * fix tests * don't fail fast on tests * don't fail fast on tests * sass * fix tests * deno demo, cleanup * final cleanup * fix tests in windows, cleanup test deprecations Co-authored-by: Noah Mulfinger <nmulfinger@esri.com>
1 parent 2a6e355 commit e8d1be1

File tree

385 files changed

+58089
-80116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+58089
-80116
lines changed

.eslintrc.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

.eslintrc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 2018,
6+
"sourceType": "module"
7+
},
8+
"env": {
9+
"browser": true,
10+
"node": true,
11+
"es2017": true
12+
},
13+
"plugins": ["@typescript-eslint", "import"],
14+
"extends": [
15+
"eslint:recommended",
16+
"plugin:@typescript-eslint/recommended",
17+
"prettier",
18+
"prettier/@typescript-eslint",
19+
"plugin:import/recommended",
20+
"plugin:import/typescript"
21+
],
22+
"rules": {
23+
"@typescript-eslint/no-explicit-any": "off",
24+
"@typescript-eslint/no-unused-vars": "off",
25+
"@typescript-eslint/ban-types": "off",
26+
"@typescript-eslint/explicit-module-boundary-types": "off",
27+
"import/extensions": ["error", "ignorePackages"],
28+
29+
// remove import/no-unresolved once https://github.com/import-js/eslint-plugin-import/issues/2111 is resolved
30+
"import/no-unresolved": "off"
31+
},
32+
"settings": {
33+
"import/parsers": {
34+
"@typescript-eslint/parser": [".ts", ".tsx"]
35+
}
36+
}
37+
}

.github/workflows/pre-release-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616

1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
os: [ubuntu-latest, macos-latest, windows-latest]
20-
node: [12, 14]
21+
node: [12, 14, 16]
2122

2223
steps:
2324
- uses: actions/checkout@v2
2425
- uses: actions/setup-node@v2
2526
with:
2627
node-version: ${{ matrix.node }}
2728

29+
- name: Upgrade npm
30+
run: npm i -g npm@7
31+
2832
- name: Install Dependencies
2933
run: npm install
3034

.github/workflows/pull-request-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616

1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
os: [ubuntu-latest]
20-
node: [14]
21+
node: [12, 14, 16]
2122

2223
steps:
2324
- uses: actions/checkout@v2
2425
- uses: actions/setup-node@v2
2526
with:
2627
node-version: ${{ matrix.node }}
2728

29+
- name: Update to NPM 7 for workspace support
30+
run: npm install -g npm@7
31+
2832
- name: Install Dependencies
2933
run: npm install
3034< 10000 code class="diff-text syntax-highlighted-line">

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,13 @@ packages/**/test/mocks/**/*.js
9898
packages/**/test/mocks/**/*.map
9999

100100
# Ignore built TypeDoc files
101-
typedoc
101+
typedoc
102+
103+
# Ignore srihash output
104+
srihashes.json
105+
106+
# Prevent caches from ultra runner
107+
**/.ultra.cache.json
108+
109+
# Prevent package locks from npm installs in demos
110+
demos/*/package-lock.json

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"semi": true,
1414
"singleQuote": false,
1515
"tabWidth": 2,
16-
"trailingComma": "es5",
16+
"trailingComma": "none",
1717
"useTabs": false,
1818
"vueIndentScriptAndStyle": false
1919
}

.vscode/launch.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8+
"name": "Attach to `npm run test:node:debug`",
89
"type": "node",
9-
"request": "launch",
10-
"name": "Debug Node Tests",
11-
"program": "${workspaceRoot}/node_modules/.bin/jasmine",
12-
"args": [
13-
"--config=jasmine.json"
14-
]
10+
"request": "attach",
11+
"port": 9229
1512
},
1613
{
17-
"type": "node",
18-
"request": "launch",
19-
"name": "Debug Changelog Script",
20-
"program": "${workspaceRoot}/support/changelog.js",
21-
"args": ["--config=jasmine.json"]
14+
"type": "pwa-msedge",
15+
"request": "attach",
16+
"name": "Attach to `npm run test:chrome:debug`",
17+
"address": "localhost",
18+
"port": 9333,
19+
"pathMapping": {
20+
"/": "${workspaceRoot}/",
21+
"/base/": "${workspaceRoot}/"
22+
}
2223
}
2324
]
2425
}

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"editor.tabSize": 2
2+
"editor.tabSize": 2,
3+
"javascript.preferences.importModuleSpecifierEnding": "js",
4+
"typescript.preferences.importModuleSpecifierEnding": "js"
35
}

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,34 @@ The documentation is published at http://esri.github.io/arcgis-rest-js/ (source
4848

4949
### Instructions
5050

51-
You can install dependencies (and bootstrap lerna) by cloning the repository and running:
51+
You can install dependencies by cloning the repository and running:
5252

5353
```bash
5454
npm install
5555
```
5656

5757
Afterward, for a list of all available commands run `npm run`.
5858

59-
Some useful commands include:
59+
For all packages
6060

61-
- `npm test` runs _all_ the tests and confirms the API is functioning as expected.
62-
- There is also a `Debug Node Tests` configuration in the `.vscode/launch.json` which will run the Node tests in the VS Code debugger.
63-
- `npm run docs:serve` will run the documentation site locally at http://localhost:3000/arcgis-rest-js/
64-
- `npm run build` will created UMD bundles for _all_ the packages
65-
- `npm run dev -- <esm|node|umd> <glob>` will re-run the specified build type anytime the source code changes. Example: `npm run dev -- umd @esri/*`
61+
- `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.
62+
- `npm run build:esm`, `npm run build:cjs`, `npm run build:bundled` - as as the above but only one of our target distributions.
63+
- `npm run dev:esm`, `npm run dev:cjs`, `npm run dev:bundled` - runs the appropriate watch command in all packages.
64+
65+
For a specific package
66+
67+
- `npm run build -w @esri/arcgis-rest-request` - run all builds in a specific workspace
68+
- `npm run dev -w @esri/arcgis-rest-request` - run all dev commands in a specific workspace
69+
- `npm run build:esm -w @esri/arcgis-rest-request` - run the esm build in a specific workspace
70+
- `npm run dev:esm -w @esri/arcgis-rest-request` - run the esm dev command in a specific workspace
71+
- `npm run build:cjs -w @esri/arcgis-rest-request` - run the common js build in a specific workspace
72+
- `npm run dev:cjs -w @esri/arcgis-rest-request` - run the common js dev command in a specific workspace
73+
- `npm run build:bundled -w @esri/arcgis-rest-request` - run the rollup build in a specific workspace
74+
- `npm run dev:bundled -w @esri/arcgis-rest-request` - run the rollup dev command in a specific workspace
6675

6776
### Packages
6877

6978
- [`@esri/arcgis-rest-request`](./packages/arcgis-rest-request/) - Underpins other packages and supports making low-level requests.
70-
- [`@esri/arcgis-rest-auth`](./packages/arcgis-rest-auth) - Provides methods for authenticating named users and applications.
7179
- [`@esri/arcgis-rest-portal`](./packages/arcgis-rest-portal) - Methods for working with ArcGIS Online/Enterprise content and users.
7280
- [`@esri/arcgis-rest-feature-layer`](./packages/arcgis-rest-feature-layer) - Functions for querying and editing features inside of hosted feature layers.
7381
- [`@esri/arcgis-rest-service-admin`](./packages/arcgis-rest-service-admin) - Functions for administering hosted feature services.

demos/ago-node-cli/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ This project uses the `commander` module, which streamlines the creation of node
88

99
### Installing
1010

11-
Like all the other demo apps, run `npm run bootstrap` from the root.
11+
Like all the other demo apps, run `npm run build` from the root.
1212

1313
### Running
14+
1415
If you use this demo as a starting point for your own command line package, you would publish it to npm, then on the target systems run `npm install <your-cli-package>`, and it would be available as a command.
1516

1617
But, this is demo code, and thus the package is not "installed" via `npm install ...`, before we can call it as `ago <command> <query>` we need to run `npm link` in the `/demos/ago-node-cli` folder. After you do that, the command should work.
@@ -19,9 +20,9 @@ Here is a post with information on creating node command line tools: [A Guide to
1920

2021
### Commands
2122

22-
| command | description | example |
23-
| --- | --- | --- |
24-
| `ago search <query>` | search for items | `ago search water` |
23+
| command | description | example |
24+
| ------------------------ | ----------------------------- | ----------------------------------------------------- |
25+
| `ago search <query>` | search for items | `ago search water` |
2526
| `ago export <id> <file>` | export an item to a json file | `ago export a62cb9d894f145cc89531c096d0012b1 pa.json` |
2627

2728
## Building your own tooling

0 commit comments

Comments
 (0)
0