-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Consolidate arcgis rest js #1497
Conversation
move all arcgis-rest-js references to common.
consolidating arcgis-rest-js imports into a single file. Changed reference from files to the file.
updated test files
lint clean up
fix test script errors
…into pw-user-session
remove interface prefix on test
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1497 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 150 151 +1
Lines 8082 8109 +27
Branches 1797 1854 +57
=========================================
+ Hits 8082 8109 +27 ☔ View full report in Codecov by Sentry. |
@previnWong & @jmhauck, I added three commits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Previn!
A next step is to remove arcgis-rest-* from the rest of the test code so that when we change from 3.x to 4.x, the tests should continue to work.
The automatic formatting is a pain the first time, but will eliminate false change flags in the future.
Mike, what other tests needs to be updated? |
Here's what I found searching for "@esri/arcgis-rest" File solution.js\packages\common\test\create-hub-request-options.test.ts
18 32:import * as portalModule from "@esri/arcgis-rest-portal";
File solution.js\packages\common\test\deleteHelpers\removeItems.test.ts
23 26:import * as portal from "@esri/arcgis-rest-portal";
File solution.js\packages\common\test\deleteSolution.test.ts
31 26:import * as portal from "@esri/arcgis-rest-portal";
File solution.js\packages\common\test\featureServiceHelpers.test.ts
85 38:import * as rest_feature_layer from "@esri/arcgis-rest-feature-layer";
File solution.js\packages\common\test\generalHelpers.test.ts
25 32:import * as serviceAdmin from "@esri/arcgis-rest-service-admin";
File solution.js\packages\common\test\resourceHelpers.test.ts
23 26:import * as portal from "@esri/arcgis-rest-portal";
File solution.js\packages\common\test\resources\copyAssociatedFiles.test.ts
38 26:import * as portal from "@esri/arcgis-rest-portal";
File solution.js\packages\common\test\restHelpers.test.ts
22 25:import * as admin from "@esri/arcgis-rest-service-admin";
37 26:import * as portal from "@esri/arcgis-rest-portal";
38 27:import * as request from "@esri/arcgis-rest-request";
46 32:import { IPagingParams } from "@esri/arcgis-rest-portal";
File solution.js\packages\common\test\restHelpersGet.test.ts
24 26:import * as portal from "@esri/arcgis-rest-portal";
25 27:import * as request from "@esri/arcgis-rest-request";
File solution.js\packages\common\test\sharing\share-item-to-groups.test.ts
18 26:import * as portal from "@esri/arcgis-rest-portal";
File solution.js\packages\common\test\workflowHelpers.test.ts
22 27:import * as request from "@esri/arcgis-rest-request";
File solution.js\packages\form\test\helpers\create-item-from-hub-template.test.ts
18 30:import * as restPortal from "@esri/arcgis-rest-portal";
File solution.js\packages\hub-types\test\helpers\replace-item-ids.test.ts
19 24:import { IItem } from "@esri/arcgis-rest-portal";
File solution.js\packages\hub-types\test\helpers\_post-process-page.test.ts
20 38:import { IUpdateItemResponse } from "@esri/arcgis-rest-portal";
File solution.js\packages\hub-types\test\helpers\_post-process-site.test.ts
20 38:import { IUpdateItemResponse } from "@esri/arcgis-rest-portal";
File solution.js\packages\storymap\test\helpers\get-storymap-dependencies.test.ts
19 24:import { IItem } from "@esri/arcgis-rest-portal";
File solution.js\packages\web-experience\test\helpers\get-web-experience-dependecies.test.ts
19 24:import { IItem } from "@esri/arcgis-rest-portal"; |
geez, I thought I did a wildcard search and caught them all. Sheesh. I'll start on those ones. Good to merge this PR first though? |
If your review of my three commits is OK, then, yes, please, let's merge this PR. Makes the future work easier to review. |
This PR consolidates all the interfaces, classes, and functions exports from ArcGIS Rest JS in various files into a single file arcgisRestJS.ts in packages/common.
All references in various files have been updated from direct arcgis-rest-js import/exports into point to this file.
All arcgis rest js exports from common/interfaces has also been moved to arcgisRestJS
For function that have custom exports in restHelpers that has the same name as an export in arcgis-rest-js, the export from arcgis-rest-js has "rest" added to the export name. Example image below
