studiokit-scaffolding-js 7.0.10-alpha.2 → 7.0.10-next.1.1
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/README.md +3 -0
- package/lib/redux/sagas/appInsightsSaga.js +1 -1
- package/lib/startup.js +3 -4
- package/lib/types/AppConfiguration.d.ts +1 -1
- package/lib/utils/events.js +1 -1
- package/lib/utils/shard.js +9 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,6 +105,9 @@ Components and utils can be imported from `studiokit-scaffolding-js/lib/...`
|
|
|
105
105
|
* e.g. `1.0.1-alpha.1` => `1.0.1-alpha.2` for a hotfix branch
|
|
106
106
|
1. Push to gitlab. Azure DevOps will run a pipeline and publish this version to npmjs.org
|
|
107
107
|
1. Install the new version in the project(s) you are working on by updating its `package.json` and running `yarn`
|
|
108
|
+
* As an alternative to the two steps above, if you don't need to make changes available to other devs yet you can:
|
|
109
|
+
1. In the studiokit directory, run `yarn build` then `yarn pack`. You'll still need to have incremented the version number to avoid having it cached.
|
|
110
|
+
1. Over in the Circuit/Variate/etc. directory, run `yarn add ../studiokit-scaffolding-js/package.tgz`.
|
|
108
111
|
1. Repeat as needed
|
|
109
112
|
1. Merging
|
|
110
113
|
* After the Merge Request is approved, **remove** the "next" or "alpha" suffix from the version **before** merging to develop or master
|
|
@@ -36,7 +36,7 @@ function appInsightsSaga() {
|
|
|
36
36
|
switch (_a.label) {
|
|
37
37
|
case 0:
|
|
38
38
|
appConfig = constants_1.getAppConfig();
|
|
39
|
-
appInsightsKey = appConfig.
|
|
39
|
+
appInsightsKey = appConfig.APP_INSIGHTS_CONNECTION_STRING;
|
|
40
40
|
if (!appInsightsKey) {
|
|
41
41
|
return [2 /*return*/];
|
|
42
42
|
}
|
package/lib/startup.js
CHANGED
|
@@ -64,10 +64,9 @@ var startup = function (appConfig, endpointMappings) {
|
|
|
64
64
|
react_ga4_1.default.send({ hitType: 'pageview', page: window.location.pathname });
|
|
65
65
|
}
|
|
66
66
|
// Application Insights
|
|
67
|
-
if (appConfig.
|
|
67
|
+
if (appConfig.APP_INSIGHTS_CONNECTION_STRING) {
|
|
68
68
|
var appInsightsConfig = {
|
|
69
|
-
|
|
70
|
-
instrumentationKey: appConfig.APP_INSIGHTS_KEY
|
|
69
|
+
connectionString: appConfig.APP_INSIGHTS_CONNECTION_STRING
|
|
71
70
|
};
|
|
72
71
|
var appInsights = new applicationinsights_web_1.ApplicationInsights({ config: appInsightsConfig });
|
|
73
72
|
appInsights.loadAppInsights();
|
|
@@ -81,7 +80,7 @@ var startup = function (appConfig, endpointMappings) {
|
|
|
81
80
|
react_ga4_1.default.send({ hitType: 'pageview', page: location.pathname, user_id: configuration_1.getUserId() });
|
|
82
81
|
}
|
|
83
82
|
// send pageview to Application Insights
|
|
84
|
-
if (appConfig.
|
|
83
|
+
if (appConfig.APP_INSIGHTS_CONNECTION_STRING) {
|
|
85
84
|
var appInsights = configuration_1.getAppInsights();
|
|
86
85
|
appInsights.trackPageView({ uri: location.pathname });
|
|
87
86
|
}
|
|
@@ -25,7 +25,7 @@ export interface AppConfiguration {
|
|
|
25
25
|
SENTRY_TRACES_SAMPLE_RATE?: number;
|
|
26
26
|
SENTRY_REPLAYS_SESSION_SAMPLE_RATE?: number;
|
|
27
27
|
SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE?: number;
|
|
28
|
-
|
|
28
|
+
APP_INSIGHTS_CONNECTION_STRING?: string;
|
|
29
29
|
CLIENT_ID: string;
|
|
30
30
|
CLIENT_SECRET: string;
|
|
31
31
|
IS_DOWNTIME: boolean;
|
package/lib/utils/events.js
CHANGED
package/lib/utils/shard.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getShardKey = exports.isDemoShard = exports.isPurdueShard = void 0;
|
|
7
|
-
var lodash_1 =
|
|
4
|
+
var lodash_1 = require("lodash");
|
|
8
5
|
var configuration_1 = require("../constants/configuration");
|
|
9
6
|
var shard_1 = require("../constants/shard");
|
|
10
7
|
var windowService_1 = require("../services/windowService");
|
|
@@ -22,15 +19,16 @@ function getShardKey(host, localhostShardKey) {
|
|
|
22
19
|
var finalHost = host || location.host;
|
|
23
20
|
var finalLocalhostShardKey = localhostShardKey || appConfig.LOCALHOST_SHARD_KEY;
|
|
24
21
|
var rootDomain = appConfig.ROOT_DOMAIN;
|
|
25
|
-
if (lodash_1.
|
|
22
|
+
if (lodash_1.startsWith(finalHost, 'localhost') && !!finalLocalhostShardKey) {
|
|
26
23
|
return finalLocalhostShardKey;
|
|
27
24
|
}
|
|
28
|
-
if (lodash_1.
|
|
29
|
-
lodash_1.
|
|
30
|
-
lodash_1.
|
|
31
|
-
lodash_1.
|
|
32
|
-
lodash_1.
|
|
33
|
-
lodash_1.
|
|
25
|
+
if (lodash_1.startsWith(finalHost, 'localhost') ||
|
|
26
|
+
lodash_1.includes(finalHost, 'azurewebsites.net') ||
|
|
27
|
+
lodash_1.includes(finalHost, 'web.core.windows.net') ||
|
|
28
|
+
lodash_1.includes(finalHost, 'azureedge.net') ||
|
|
29
|
+
lodash_1.includes(finalHost, 'azurefd.net') ||
|
|
30
|
+
lodash_1.includes(finalHost, 'azurestaticapps.net') ||
|
|
31
|
+
lodash_1.includes(finalHost, 'ngrok.io')) {
|
|
34
32
|
return shard_1.SHARD.PURDUE;
|
|
35
33
|
}
|
|
36
34
|
var urlParts = finalHost.split('.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "studiokit-scaffolding-js",
|
|
3
|
-
"version": "7.0.10-
|
|
3
|
+
"version": "7.0.10-next.1.1",
|
|
4
4
|
"description": "Common scaffolding for Studio apps at Purdue",
|
|
5
5
|
"repository": "https://gitlab.com/purdue-informatics/studiokit/studiokit-scaffolding-js",
|
|
6
6
|
"license": "MIT",
|