@sprucelabs/spruce-view-plugin 47.1.14 → 47.1.16

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.
@@ -75,9 +75,15 @@ export class ViewFeature {
75
75
  }
76
76
  const destination = diskUtil.resolvePath(diskUtil.createRandomTempDir(), 'bundle.js');
77
77
  this.exportDestination = destination;
78
+ const defines = Object.keys(process.env).reduce((acc, key) => {
79
+ //@ts-ignore
80
+ acc[`process.env.${key}`] = JSON.stringify(process.env[key]);
81
+ return acc;
82
+ }, {});
78
83
  yield ((_a = this.exporter) === null || _a === void 0 ? void 0 : _a.export({
79
84
  source: this.viewsSource,
80
85
  destination,
86
+ defines,
81
87
  profilerStatsDestination: process.env.VIEW_PROFILER_STATS_DESTINATION_DIR,
82
88
  shouldWatch: this.isWatching,
83
89
  onDidIncrementallyBuild: (err) => {
@@ -4,8 +4,8 @@ export default abstract class AbstractViewPluginTest extends AbstractSpruceFixtu
4
4
  protected static beforeEach(): Promise<void>;
5
5
  protected static Skill(options?: SkillFactoryOptions): Promise<import("@sprucelabs/spruce-skill-utils").Skill>;
6
6
  protected static resolveTestPathSrc(...pathAfterTestDirsAndFiles: string[]): string;
7
- protected static seedAndRegisterCurrentSkill(): Promise<import("@sprucelabs/spruce-test-fixtures").SpruceSchemas.Spruce.v2020_07_22.Skill>;
7
+ protected static seedAndRegisterSkill(): Promise<import("@sprucelabs/spruce-test-fixtures").SpruceSchemas.Spruce.v2020_07_22.Skill>;
8
8
  protected static TestSkillWithViewFilesInPlace(testDir: string): Promise<import("@sprucelabs/spruce-skill-utils").Skill>;
9
9
  protected static GoodSkill(): Promise<import("@sprucelabs/spruce-skill-utils").Skill>;
10
- protected static importEventContractSeedAndRegisterCurrentSkill(): Promise<import("@sprucelabs/spruce-test-fixtures").SpruceSchemas.Spruce.v2020_07_22.Skill>;
10
+ protected static importEventContractSeedAndRegisterSkill(): Promise<import("@sprucelabs/spruce-test-fixtures").SpruceSchemas.Spruce.v2020_07_22.Skill>;
11
11
  }
@@ -31,7 +31,7 @@ export default class AbstractViewPluginTest extends AbstractSpruceFixtureTest {
31
31
  static resolveTestPathSrc(...pathAfterTestDirsAndFiles) {
32
32
  return this.resolvePath(__dirname, '..', '..', 'src', '__tests__', 'testDirsAndFiles', ...pathAfterTestDirsAndFiles);
33
33
  }
34
- static seedAndRegisterCurrentSkill() {
34
+ static seedAndRegisterSkill() {
35
35
  return __awaiter(this, void 0, void 0, function* () {
36
36
  const currentSkill = yield this.Fixture('skill').seedDemoSkill({
37
37
  name: 'my skill with events',
@@ -55,12 +55,12 @@ export default class AbstractViewPluginTest extends AbstractSpruceFixtureTest {
55
55
  return this.TestSkillWithViewFilesInPlace('skill');
56
56
  });
57
57
  }
58
- static importEventContractSeedAndRegisterCurrentSkill() {
58
+ static importEventContractSeedAndRegisterSkill() {
59
59
  return __awaiter(this, void 0, void 0, function* () {
60
60
  const combined = eventContractUtil.unifyContracts(coreEventContracts);
61
61
  assert.isTruthy(combined);
62
62
  MercuryClientFactory.setDefaultContract(combined);
63
- return yield this.seedAndRegisterCurrentSkill();
63
+ return yield this.seedAndRegisterSkill();
64
64
  });
65
65
  }
66
66
  }
@@ -60,9 +60,15 @@ class ViewFeature {
60
60
  }
61
61
  const destination = spruce_skill_utils_1.diskUtil.resolvePath(spruce_skill_utils_1.diskUtil.createRandomTempDir(), 'bundle.js');
62
62
  this.exportDestination = destination;
63
+ const defines = Object.keys(process.env).reduce((acc, key) => {
64
+ //@ts-ignore
65
+ acc[`process.env.${key}`] = JSON.stringify(process.env[key]);
66
+ return acc;
67
+ }, {});
63
68
  await this.exporter?.export({
64
69
  source: this.viewsSource,
65
70
  destination,
71
+ defines,
66
72
  profilerStatsDestination: process.env.VIEW_PROFILER_STATS_DESTINATION_DIR,
67
73
  shouldWatch: this.isWatching,
68
74
  onDidIncrementallyBuild: (err) => {
@@ -4,8 +4,8 @@ export default abstract class AbstractViewPluginTest extends AbstractSpruceFixtu
4
4
  protected static beforeEach(): Promise<void>;
5
5
  protected static Skill(options?: SkillFactoryOptions): Promise<import("@sprucelabs/spruce-skill-utils").Skill>;
6
6
  protected static resolveTestPathSrc(...pathAfterTestDirsAndFiles: string[]): string;
7
- protected static seedAndRegisterCurrentSkill(): Promise<import("@sprucelabs/spruce-test-fixtures").SpruceSchemas.Spruce.v2020_07_22.Skill>;
7
+ protected static seedAndRegisterSkill(): Promise<import("@sprucelabs/spruce-test-fixtures").SpruceSchemas.Spruce.v2020_07_22.Skill>;
8
8
  protected static TestSkillWithViewFilesInPlace(testDir: string): Promise<import("@sprucelabs/spruce-skill-utils").Skill>;
9
9
  protected static GoodSkill(): Promise<import("@sprucelabs/spruce-skill-utils").Skill>;
10
- protected static importEventContractSeedAndRegisterCurrentSkill(): Promise<import("@sprucelabs/spruce-test-fixtures").SpruceSchemas.Spruce.v2020_07_22.Skill>;
10
+ protected static importEventContractSeedAndRegisterSkill(): Promise<import("@sprucelabs/spruce-test-fixtures").SpruceSchemas.Spruce.v2020_07_22.Skill>;
11
11
  }
@@ -25,7 +25,7 @@ class AbstractViewPluginTest extends spruce_test_fixtures_1.AbstractSpruceFixtur
25
25
  static resolveTestPathSrc(...pathAfterTestDirsAndFiles) {
26
26
  return this.resolvePath(__dirname, '..', '..', 'src', '__tests__', 'testDirsAndFiles', ...pathAfterTestDirsAndFiles);
27
27
  }
28
- static async seedAndRegisterCurrentSkill() {
28
+ static async seedAndRegisterSkill() {
29
29
  const currentSkill = await this.Fixture('skill').seedDemoSkill({
30
30
  name: 'my skill with events',
31
31
  });
@@ -43,11 +43,11 @@ class AbstractViewPluginTest extends spruce_test_fixtures_1.AbstractSpruceFixtur
43
43
  static async GoodSkill() {
44
44
  return this.TestSkillWithViewFilesInPlace('skill');
45
45
  }
46
- static async importEventContractSeedAndRegisterCurrentSkill() {
46
+ static async importEventContractSeedAndRegisterSkill() {
47
47
  const combined = spruce_event_utils_1.eventContractUtil.unifyContracts(events_contract_1.default);
48
48
  test_utils_1.assert.isTruthy(combined);
49
49
  mercury_client_1.MercuryClientFactory.setDefaultContract(combined);
50
- return await this.seedAndRegisterCurrentSkill();
50
+ return await this.seedAndRegisterSkill();
51
51
  }
52
52
  }
53
53
  exports.default = AbstractViewPluginTest;
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "@types/node"
17
17
  ]
18
18
  },
19
- "version": "47.1.14",
19
+ "version": "47.1.16",
20
20
  "files": [
21
21
  "build/**/*",
22
22
  "!build/__tests__",
@@ -67,14 +67,14 @@
67
67
  "dependencies": {
68
68
  "@sprucelabs/error": "^6.0.538",
69
69
  "@sprucelabs/globby": "^2.0.498",
70
- "@sprucelabs/heartwood-view-controllers": "^111.1.12",
70
+ "@sprucelabs/heartwood-view-controllers": "^111.1.13",
71
71
  "@sprucelabs/schema": "^30.0.555",
72
72
  "@sprucelabs/spruce-core-schemas": "^40.1.542",
73
- "@sprucelabs/spruce-event-plugin": "^62.4.14",
73
+ "@sprucelabs/spruce-event-plugin": "^62.4.15",
74
74
  "@sprucelabs/spruce-event-utils": "^40.1.318",
75
- "@sprucelabs/spruce-skill-booter": "^62.4.14",
75
+ "@sprucelabs/spruce-skill-booter": "^62.4.15",
76
76
  "@sprucelabs/spruce-skill-utils": "^31.0.618",
77
- "@sprucelabs/spruce-test-fixtures": "^62.4.14"
77
+ "@sprucelabs/spruce-test-fixtures": "^62.4.15"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@sprucelabs/esm-postbuild": "^6.0.519",