@sprucelabs/spruce-location-utils 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-location-utils",
3
- "description": "Locations",
4
- "version": "2.0.5",
3
+ "description": "Location Utilities",
4
+ "version": "2.0.6",
5
5
  "skill": {
6
6
  "namespace": "locations"
7
7
  },
@@ -16,119 +16,24 @@
16
16
  "files": [
17
17
  "build/index-module.js",
18
18
  "build/index-module.d.ts",
19
- "build/tests/utilities/organizationAssert.js",
20
- "build/tests/utilities/organizationAssert.d.ts",
19
+ "build/tests/utilities/organizationAssert.utility.js",
20
+ "build/tests/utilities/organizationAssert.utility.d.ts",
21
21
  "build/esm/index-module.js",
22
22
  "build/esm/index-module.d.ts",
23
- "build/esm/tests/utilities/organizationAssert.js",
24
- "build/esm/tests/utilities/organizationAssert.d.ts"
23
+ "build/esm/tests/utilities/organizationAssert.utility.js",
24
+ "build/esm/tests/utilities/organizationAssert.utility.d.ts"
25
25
  ],
26
26
  "keywords": [],
27
27
  "scripts": {
28
- "boot": "node build/index",
29
- "boot.local": "node -r ts-node/register -r tsconfig-paths/register ./src/index",
30
- "build.ci": "yarn build.tsc && yarn build.resolve-paths && yarn lint",
31
- "build.copy-files": "mkdir -p build && rsync -avzq --exclude='*.ts' ./src/ ./build/",
32
- "build.dev": "yarn build.tsc --sourceMap ; yarn resolve-paths.lint",
33
- "build.dist": "yarn build.tsc && tsc --project tsconfig.dist.json && yarn build.resolve-paths && yarn build.esm-postbuild",
34
- "build.esm-postbuild": "esm-postbuild --target build/esm --patterns '**/*.js'",
35
- "build.resolve-paths": "resolve-path-aliases --target build --patterns '**/*.js,**/*.d.ts'",
36
- "build.tsc": "yarn build.copy-files && tsc",
37
- "clean": "yarn clean.build",
38
- "clean.all": "yarn clean.dependencies && yarn clean.build",
39
- "clean.build": "rm -rf build/",
40
- "clean.dependencies": "rm -rf node_modules/ package-lock.json yarn.lock",
41
- "fix.lint": "eslint --fix --cache '**/*.ts'",
42
- "health": "yarn boot --health",
43
- "health.local": "yarn boot.local --health",
44
- "heroku-postbuild": "yarn build.dev",
45
- "lint": "eslint --cache '**/*.ts'",
46
- "lint.tsc": "tsc -p . --noEmit",
47
- "post.watch.build": "yarn build.copy-files && yarn build.resolve-paths",
48
- "rebuild": "yarn clean.all && yarn && yarn build.dev",
49
- "release": "semantic-release",
50
- "resolve-paths.lint": "yarn build.resolve-paths ; yarn lint",
51
- "test": "jest",
52
- "update.dependencies": "yarn clean.dependencies && yarn",
53
- "watch.build.dev": "tsc-watch --sourceMap --onCompilationComplete 'yarn post.watch.build'",
54
- "watch.lint": "concurrently 'yarn lint' \"chokidar 'src/**/*' -c 'yarn lint.tsc'\"",
55
- "watch.rebuild": "yarn clean.all && yarn && yarn watch.build.dev",
56
- "watch.tsc": "tsc -w"
28
+ "release": "npm publish"
57
29
  },
58
30
  "dependencies": {
59
- "@sprucelabs/error": "^5.0.310",
60
- "@sprucelabs/heartwood-view-controllers": "^51.5.15",
61
- "@sprucelabs/mercury-client": "^17.2.18",
62
- "@sprucelabs/mercury-core-events": "^1.6.164",
63
- "@sprucelabs/mercury-types": "^26.1.954",
64
- "@sprucelabs/schema": "^25.4.50",
65
- "@sprucelabs/spruce-core-schemas": "^22.6.221",
66
- "@sprucelabs/spruce-event-plugin": "^16.0.0",
67
- "@sprucelabs/spruce-event-utils": "^17.1.228",
68
- "@sprucelabs/spruce-skill-booter": "^16.0.0",
69
- "@sprucelabs/spruce-skill-utils": "^22.1.31",
70
- "@sprucelabs/spruce-view-plugin": "^7.0.272",
71
- "dotenv": "^10.0.0",
72
- "globby": "^11.0.4"
73
- },
74
- "devDependencies": {
75
- "@sprucelabs/esm-postbuild": "^1.0.294",
76
- "@sprucelabs/jest-json-reporter": "^6.0.260",
77
- "@sprucelabs/jest-sheets-reporter": "^1.2.265",
78
- "@sprucelabs/resolve-path-aliases": "^1.0.234",
79
- "@sprucelabs/semantic-release": "^4.0.8",
80
- "@sprucelabs/spruce-test-fixtures": "^16.0.0",
81
- "@sprucelabs/test": "^7.7.243",
82
- "@sprucelabs/test-utils": "^3.0.293",
83
- "@types/node": "^16.11.11",
84
- "chokidar-cli": "^3.0.0",
85
- "concurrently": "^6.4.0",
86
- "eslint": "^8.3.0",
87
- "eslint-config-spruce": "^10.10.16",
88
- "jest": "^27.4.3",
89
- "jest-circus": "^27.4.2",
90
- "prettier": "^2.5.0",
91
- "ts-node": "^10.4.0",
92
- "tsc-watch": "^4.5.0",
93
- "tsconfig-paths": "^3.12.0",
94
- "typescript": "^4.5.2"
31
+ "@sprucelabs/heartwood-view-controllers": "latest",
32
+ "@sprucelabs/spruce-test-fixtures": "latest",
33
+ "@sprucelabs/test": "latest"
95
34
  },
96
35
  "engines": {
97
36
  "node": "16.x",
98
37
  "yarn": "1.x"
99
- },
100
- "jest": {
101
- "testRunner": "jest-circus/runner",
102
- "maxWorkers": 4,
103
- "testTimeout": 120000,
104
- "testEnvironment": "node",
105
- "testPathIgnorePatterns": [
106
- "<rootDir>/tmp/",
107
- "<rootDir>/src/",
108
- "<rootDir>/node_modules/",
109
- "<rootDir>/build/__tests__/testDirsAndFiles/"
110
- ],
111
- "testMatch": [
112
- "**/__tests__/**/*.test.js?(x)"
113
- ],
114
- "moduleNameMapper": {
115
- "^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
116
- },
117
- "reporters": [
118
- "default",
119
- [
120
- "@sprucelabs/jest-sheets-reporter",
121
- {
122
- "sheetId": "1DoWM7mYgGDa-PJXptLomrZmbIBZiuxS1YiAsRXU2Gm0",
123
- "worksheetId": 2023312774,
124
- "testMap": {
125
- "doesNotRenderToolBeltWithNoLocations": "L22",
126
- "redirectsToRootAfterAdding": "L23",
127
- "updatingFormUpdatesLocation": "L24",
128
- "redirectsWhenDeletingCurrentLocation": "L25"
129
- }
130
- }
131
- ]
132
- ]
133
38
  }
134
39
  }
@@ -1,16 +0,0 @@
1
- import { SkillViewController } from '@sprucelabs/heartwood-view-controllers';
2
- import { OrganizationFixture, ViewFixture } from '@sprucelabs/spruce-test-fixtures';
3
- declare const organizationAssert: {
4
- assertRedirectsToAddOrgIfNoOrgExists(options: {
5
- viewFixture: ViewFixture;
6
- organizationFixture: OrganizationFixture;
7
- vc: SkillViewController<any>;
8
- didAddOrgRedirectDestination: string;
9
- }): Promise<void>;
10
- assertDoesNotRedirectToAddAOrgIfOrgExists(options: {
11
- vc: SkillViewController<any>;
12
- viewFixture: ViewFixture;
13
- organizationFixture: OrganizationFixture;
14
- }): Promise<void>;
15
- };
16
- export default organizationAssert;
@@ -1,62 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { vcAssertUtil, } from '@sprucelabs/heartwood-view-controllers';
11
- import { assertOptions } from '@sprucelabs/schema';
12
- import { TestRouter, } from '@sprucelabs/spruce-test-fixtures';
13
- import { assert } from '@sprucelabs/test';
14
- const organizationAssert = {
15
- assertRedirectsToAddOrgIfNoOrgExists(options) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- assertOptions(options, [
18
- 'viewFixture',
19
- 'vc',
20
- 'organizationFixture',
21
- 'didAddOrgRedirectDestination',
22
- ]);
23
- const { viewFixture, vc, organizationFixture, didAddOrgRedirectDestination: redirectDestination, } = options;
24
- yield organizationFixture.deleteAllOrganizations();
25
- TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
26
- const router = viewFixture.getRouter();
27
- yield vcAssertUtil.assertActionRedirects({
28
- router,
29
- action: () => viewFixture.load(vc),
30
- destination: {
31
- id: 'organization.add',
32
- args: {
33
- redirect: {
34
- id: redirectDestination,
35
- },
36
- },
37
- },
38
- });
39
- TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
40
- });
41
- },
42
- assertDoesNotRedirectToAddAOrgIfOrgExists(options) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- assertOptions(options, ['viewFixture', 'vc', 'organizationFixture']);
45
- const { vc, viewFixture, organizationFixture } = options;
46
- yield viewFixture.loginAsDemoPerson();
47
- const latest = yield organizationFixture.getNewestOrganization();
48
- if (!latest) {
49
- yield organizationFixture.seedDemoOrganization();
50
- }
51
- let wasHit = false;
52
- yield viewFixture.getRouter().on('did-redirect', () => {
53
- wasHit = true;
54
- });
55
- TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
56
- yield viewFixture.load(vc);
57
- TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
58
- assert.isFalse(wasHit, `I was redirected and didn't expect to be.`);
59
- });
60
- },
61
- };
62
- export default organizationAssert;
@@ -1,16 +0,0 @@
1
- import { SkillViewController } from '@sprucelabs/heartwood-view-controllers';
2
- import { OrganizationFixture, ViewFixture } from '@sprucelabs/spruce-test-fixtures';
3
- declare const organizationAssert: {
4
- assertRedirectsToAddOrgIfNoOrgExists(options: {
5
- viewFixture: ViewFixture;
6
- organizationFixture: OrganizationFixture;
7
- vc: SkillViewController<any>;
8
- didAddOrgRedirectDestination: string;
9
- }): Promise<void>;
10
- assertDoesNotRedirectToAddAOrgIfOrgExists(options: {
11
- vc: SkillViewController<any>;
12
- viewFixture: ViewFixture;
13
- organizationFixture: OrganizationFixture;
14
- }): Promise<void>;
15
- };
16
- export default organizationAssert;
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
4
- const schema_1 = require("@sprucelabs/schema");
5
- const spruce_test_fixtures_1 = require("@sprucelabs/spruce-test-fixtures");
6
- const test_1 = require("@sprucelabs/test");
7
- const organizationAssert = {
8
- async assertRedirectsToAddOrgIfNoOrgExists(options) {
9
- (0, schema_1.assertOptions)(options, [
10
- 'viewFixture',
11
- 'vc',
12
- 'organizationFixture',
13
- 'didAddOrgRedirectDestination',
14
- ]);
15
- const { viewFixture, vc, organizationFixture, didAddOrgRedirectDestination: redirectDestination, } = options;
16
- await organizationFixture.deleteAllOrganizations();
17
- spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
18
- const router = viewFixture.getRouter();
19
- await heartwood_view_controllers_1.vcAssertUtil.assertActionRedirects({
20
- router,
21
- action: () => viewFixture.load(vc),
22
- destination: {
23
- id: 'organization.add',
24
- args: {
25
- redirect: {
26
- id: redirectDestination,
27
- },
28
- },
29
- },
30
- });
31
- spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
32
- },
33
- async assertDoesNotRedirectToAddAOrgIfOrgExists(options) {
34
- (0, schema_1.assertOptions)(options, ['viewFixture', 'vc', 'organizationFixture']);
35
- const { vc, viewFixture, organizationFixture } = options;
36
- await viewFixture.loginAsDemoPerson();
37
- const latest = await organizationFixture.getNewestOrganization();
38
- if (!latest) {
39
- await organizationFixture.seedDemoOrganization();
40
- }
41
- let wasHit = false;
42
- await viewFixture.getRouter().on('did-redirect', () => {
43
- wasHit = true;
44
- });
45
- spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
46
- await viewFixture.load(vc);
47
- spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
48
- test_1.assert.isFalse(wasHit, `I was redirected and didn't expect to be.`);
49
- },
50
- };
51
- exports.default = organizationAssert;