Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 38 additions & 8 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,36 +79,58 @@
"outputHashing": "none",
"namedChunks": true
},
"local": {
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.local.ts"
"with": "src/environments/environment.development.ts"
}
]
},
"test-osf": {
"docker": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test-osf.ts"
"with": "src/environments/environment.docker.ts"
}
]
},
"development": {
"staging": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
"with": "src/environments/environment.staging.ts"
}
]
},
"test": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test.ts"
}
]
},
"test-osf": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.test-osf.ts"
}
]
}
Expand All @@ -125,8 +147,16 @@
"buildTarget": "osf:build:development",
"hmr": false
},
"local": {
"buildTarget": "osf:build:local",
"docker": {
"buildTarget": "osf:build:docker",
"hmr": false
},
"staging": {
"buildTarget": "osf:build:staging",
"hmr": false
},
"test": {
"buildTarget": "osf:build:test",
"hmr": false
},
"test-osf": {
Expand Down
1 change: 0 additions & 1 deletion docker/scripts/check-config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const fs = require('fs');
const path = require('path');
const { config } = require('process');

const configPath = path.join(__dirname, '../src/assets/config/config.json');
const templatePath = path.join(__dirname, '../src/assets/config/template.json');
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
"ngxs:store": "ng generate @ngxs/store:store --name --path",
"prepare": "husky",
"start": "ng serve",
"start:docker": "npm run check:config && ng serve --host 0.0.0.0 --port 4200 --poll 2000 --configuration development",
"start:docker:local": "npm run check:config && ng serve --host 0.0.0.0 --port 4200 --poll 2000 --configuration docker",
"start:test": "ng serve --configuration test-osf",
"start:docker": "npm run check:config && ng serve --host 0.0.0.0 --port 4200 --poll 2000",
"start:docker:local": "npm run check:config && ng serve --host 0.0.0.0 --port 4200 --poll 2000 --configuration local",
"start:test:future": "ng serve --configuration test",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage && npm run test:display",
Expand Down
59 changes: 59 additions & 0 deletions src/environments/environment.staging.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* Production environment configuration for the OSF Angular application.
*
* These values are used at runtime to define base URLs, API endpoints,
* and third-party integrations. This configuration is typically replaced
* during the Angular build process depending on the target environment.
*/
export const environment = {
/**
* Flag indicating whether the app is running in production mode.
*/
production: true,
/**
* Base URL of the OSF web application.
*/
webUrl: 'https://staging4.osf.io',
/**
* Domain URL used for JSON:API v2 services.
*/
apiDomainUrl: 'https://api.staging4.osf.io',
/**
* Base URL for SHARE discovery search (Trove).
*/
shareTroveUrl: 'https://staging-share.osf.io/trove',
/**
* URL for the OSF Addons API (v1).
*/
addonsApiUrl: 'https://addons.staging4.osf.io/v1',
/**
* API endpoint for funder metadata resolution via Crossref.
*/
funderApiUrl: 'https://api.crossref.org/',
/**
* URL for OSF Central Authentication Service (CAS).
*/
casUrl: 'https://accounts.staging4.osf.io',
/**
* Site key used for reCAPTCHA v2 validation in staging.
*/
recaptchaSiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
/**
* Twitter handle for OSF.
*/
twitterHandle: 'OSFramework',
/**
* Facebook App ID used for social authentication or sharing.
*/
facebookAppId: '1022273774556662',
/**
* Support contact email for users.
*/
supportEmail: 'support@osf.io',
/**
* Default provider for OSF content and routing.
*/
defaultProvider: 'osf',
dataciteTrackerRepoId: null,
dataciteTrackerAddress: 'https://analytics.datacite.org/api/metric',
};
19 changes: 19 additions & 0 deletions src/environments/environment.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Test osf environment configuration for the OSF Angular application.
*/
export const environment = {
production: false,
webUrl: 'https://test.osf.io',
apiDomainUrl: 'https://api.test.osf.io',
shareTroveUrl: 'https://staging-share.osf.io/trove',
addonsApiUrl: 'https://addons.test.osf.io/v1',
funderApiUrl: 'https://api.crossref.org/',
casUrl: 'https://accounts.test.osf.io',
recaptchaSiteKey: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
twitterHandle: 'OSFramework',
facebookAppId: '1022273774556662',
supportEmail: 'support@osf.io',
defaultProvider: 'osf',
dataciteTrackerRepoId: null,
dataciteTrackerAddress: 'https://analytics.datacite.org/api/metric',
};