Skip to content

Commit 3df36b1

Browse files
authored
Updated the environment files and angular.json to be correct (CenterForOpenScience#413)
* chore(environments): updated the environment files * chore(environments): replaced the environment files
1 parent 4bf4773 commit 3df36b1

6 files changed

Lines changed: 119 additions & 11 deletions

File tree

angular.json

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,36 +79,58 @@
7979
"outputHashing": "none",
8080
"namedChunks": true
8181
},
82-
"local": {
82+
"development": {
8383
"optimization": false,
8484
"extractLicenses": false,
8585
"sourceMap": true,
8686
"fileReplacements": [
8787
{
8888
"replace": "src/environments/environment.ts",
89-
"with": "src/environments/environment.local.ts"
89+
"with": "src/environments/environment.development.ts"
9090
}
9191
]
9292
},
93-
"test-osf": {
93+
"docker": {
9494
"optimization": false,
9595
"extractLicenses": false,
9696
"sourceMap": true,
9797
"fileReplacements": [
9898
{
9999
"replace": "src/environments/environment.ts",
100-
"with": "src/environments/environment.test-osf.ts"
100+
"with": "src/environments/environment.docker.ts"
101101
}
102102
]
103103
},
104-
"development": {
104+
"staging": {
105105
"optimization": false,
106106
"extractLicenses": false,
107107
"sourceMap": true,
108108
"fileReplacements": [
109109
{
110110
"replace": "src/environments/environment.ts",
111-
"with": "src/environments/environment.development.ts"
111+
"with": "src/environments/environment.staging.ts"
112+
}
113+
]
114+
},
115+
"test": {
116+
"optimization": false,
117+
"extractLicenses": false,
118+
"sourceMap": true,
119+
"fileReplacements": [
120+
{
121+
"replace": "src/environments/environment.ts",
122+
"with": "src/environments/environment.test.ts"
123+
}
124+
]
125+
},
126+
"test-osf": {
127+
"optimization": false,
128+
"extractLicenses": false,
129+
"sourceMap": true,
130+
"fileReplacements": [
131+
{
132+
"replace": "src/environments/environment.ts",
133+
"with": "src/environments/environment.test-osf.ts"
112134
}
113135
]
114136
}
@@ -125,8 +147,16 @@
125147
"buildTarget": "osf:build:development",
126148
"hmr": false
127149
},
128-
"local": {
129-
"buildTarget": "osf:build:local",
150+
"docker": {
151+
"buildTarget": "osf:build:docker",
152+
"hmr": false
153+
},
154+
"staging": {
155+
"buildTarget": "osf:build:staging",
156+
"hmr": false
157+
},
158+
"test": {
159+
"buildTarget": "osf:build:test",
130160
"hmr": false
131161
},
132162
"test-osf": {

docker/scripts/check-config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const fs = require('fs');
22
const path = require('path');
3-
const { config } = require('process');
43

54
const configPath = path.join(__dirname, '../src/assets/config/config.json');
65
const templatePath = path.join(__dirname, '../src/assets/config/template.json');

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
"ngxs:store": "ng generate @ngxs/store:store --name --path",
2020
"prepare": "husky",
2121
"start": "ng serve",
22+
"start:docker": "npm run check:config && ng serve --host 0.0.0.0 --port 4200 --poll 2000 --configuration development",
23+
"start:docker:local": "npm run check:config && ng serve --host 0.0.0.0 --port 4200 --poll 2000 --configuration docker",
2224
"start:test": "ng serve --configuration test-osf",
23-
"start:docker": "npm run check:config && ng serve --host 0.0.0.0 --port 4200 --poll 2000",
24-
"start:docker:local": "npm run check:config && ng serve --host 0.0.0.0 --port 4200 --poll 2000 --configuration local",
25+
"start:test:future": "ng serve --configuration test",
2526
"test": "jest",
2627
"test:watch": "jest --watch",
2728
"test:coverage": "jest --coverage && npm run test:display",
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/**
2+
* Production environment configuration for the OSF Angular application.
3+
*
4+
* These values are used at runtime to define base URLs, API endpoints,
5+
* and third-party integrations. This configuration is typically replaced
6+
* during the Angular build process depending on the target environment.
7+
*/
8+
export const environment = {
9+
/**
10+
* Flag indicating whether the app is running in production mode.
11+
*/
12+
production: true,
13+
/**
14+
* Base URL of the OSF web application.
15+
*/
16+
webUrl: 'https://staging4.osf.io',
17+
/**
18+
* Domain URL used for JSON:API v2 services.
19+
*/
20+
apiDomainUrl: 'https://api.staging4.osf.io',
21+
/**
22+
* Base URL for SHARE discovery search (Trove).
23+
*/
24+
shareTroveUrl: 'https://staging-share.osf.io/trove',
25+
/**
26+
* URL for the OSF Addons API (v1).
27+
*/
28+
addonsApiUrl: 'https://addons.staging4.osf.io/v1',
29+
/**
30+
* API endpoint for funder metadata resolution via Crossref.
31+
*/
32+
funderApiUrl: 'https://api.crossref.org/',
33+
/**
34+
* URL for OSF Central Authentication Service (CAS).
35+
*/
36+
casUrl: 'https://accounts.staging4.osf.io',
37+
/**
38+
* Site key used for reCAPTCHA v2 validation in staging.
39+
*/
40+
recaptchaSiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
41+
/**
42+
* Twitter handle for OSF.
43+
*/
44+
twitterHandle: 'OSFramework',
45+
/**
46+
* Facebook App ID used for social authentication or sharing.
47+
*/
48+
facebookAppId: '1022273774556662',
49+
/**
50+
* Support contact email for users.
51+
*/
52+
supportEmail: 'support@osf.io',
53+
/**
54+
* Default provider for OSF content and routing.
55+
*/
56+
defaultProvider: 'osf',
57+
dataciteTrackerRepoId: null,
58+
dataciteTrackerAddress: 'https://analytics.datacite.org/api/metric',
59+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Test osf environment configuration for the OSF Angular application.
3+
*/
4+
export const environment = {
5+
production: false,
6+
webUrl: 'https://test.osf.io',
7+
apiDomainUrl: 'https://api.test.osf.io',
8+
shareTroveUrl: 'https://staging-share.osf.io/trove',
9+
addonsApiUrl: 'https://addons.test.osf.io/v1',
10+
funderApiUrl: 'https://api.crossref.org/',
11+
casUrl: 'https://accounts.test.osf.io',
12+
recaptchaSiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
13+
twitterHandle: 'OSFramework',
14+
facebookAppId: '1022273774556662',
15+
supportEmail: 'support@osf.io',
16+
defaultProvider: 'osf',
17+
dataciteTrackerRepoId: null,
18+
dataciteTrackerAddress: 'https://analytics.datacite.org/api/metric',
19+
};

0 commit comments

Comments
 (0)