diff --git a/angular.json b/angular.json index 3b582a75b..7f0feeb64 100644 --- a/angular.json +++ b/angular.json @@ -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" } ] } @@ -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": { diff --git a/docker/scripts/check-config.js b/docker/scripts/check-config.js index 6375bcd8a..4dc32d9aa 100644 --- a/docker/scripts/check-config.js +++ b/docker/scripts/check-config.js @@ -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'); diff --git a/package.json b/package.json index b42736ec6..056c09220 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/environments/environment.local.ts b/src/environments/environment.docker.ts similarity index 100% rename from src/environments/environment.local.ts rename to src/environments/environment.docker.ts diff --git a/src/environments/environment.staging.ts b/src/environments/environment.staging.ts new file mode 100644 index 000000000..8473fe0a9 --- /dev/null +++ b/src/environments/environment.staging.ts @@ -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', +}; diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts new file mode 100644 index 000000000..eaa045a52 --- /dev/null +++ b/src/environments/environment.test.ts @@ -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', +};