[ACA-2952] Remove unnecessary build steps for dev-server start, add first bit of .env usage (#1379)

* [ACA-2952] Remove unnecessary build steps for dev-server start, add first bit of .env usage

* Fix doc owner
This commit is contained in:
Popovics András 2020-03-26 17:03:38 +01:00 committed by GitHub
parent 0cca87b382
commit 9a87564c8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 18 deletions

2
.github/CODEOWNERS vendored
View File

@ -27,7 +27,7 @@ protractor.conf.js @adinapitul
# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
#docs/* docs@example.com
docs/* @m-hulbert
# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.

1
.gitignore vendored
View File

@ -35,6 +35,7 @@ npm-debug.log
testem.log
/typings
/www
.env
# e2e
/e2e/*.js

View File

@ -145,7 +145,7 @@
"browserTarget": "app:build",
"port": 4200,
"host": "0.0.0.0",
"proxyConfig": "proxy.conf.js"
"proxyConfig": "src/proxy.conf.js"
},
"configurations": {
"production": {

View File

@ -27,11 +27,19 @@ npm start
The application runs at port `4200` by default, and should automatically open in the default browser once the project has compiled.
## Setting up environment variables
You might need to set some environment variables to be able to run the local dev server. In the project's root folder, create a `.env` file (this is gitignored) with the following data:
```bash
API_HOST_CONTENT="http://your-url-here"
```
## Proxy settings
The Content App provides a proxy configuration for a local development server that allows you to address specific scenarios with CORS and a native authentication dialog.
You can find settings in the `proxy.conf.js` file in the project root directory.
You can find settings in the `proxy.conf.js` file in the project's `src` directory. By default, your settings coming from environment variables are preferenced.
**Note:** The proxy settings get automatically applied every time you run the application with the `npm start` script.
You must restart the application every time you change its settings.

6
package-lock.json generated
View File

@ -4065,6 +4065,12 @@
"is-obj": "^1.0.0"
}
},
"dotenv": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz",
"integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==",
"dev": true
},
"duplexer3": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",

View File

@ -4,7 +4,7 @@
"license": "LGPL-3.0",
"scripts": {
"ng": "ng",
"start": "npm run validate-config && npm run build.extensions && ng serve --open",
"start": "npm run validate-config && ng serve --open",
"start:prod": "npm run validate-config && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve --prod --open",
"build:aos-extension": "npx rimraf dist/@alfresco/adf-office-services-ext && ng build adf-office-services-ext && cpr projects/adf-office-services-ext/ngi.json dist/@alfresco/adf-office-services-ext/ngi.json && cpr projects/adf-office-services-ext/assets dist/@alfresco/adf-office-services-ext/assets",
"build.shared": "ng build aca-shared",
@ -83,12 +83,13 @@
"@types/jasminewd2": "^2.0.2",
"@types/node": "9.3.0",
"@types/selenium-webdriver": "^3.0.8",
"ajv-cli": "^3.0.0",
"adf-tslint-rules": "0.0.7",
"ajv-cli": "^3.0.0",
"chrome-remote-interface": "^0.26.1",
"codelyzer": "^4.5.0",
"cpr": "^3.0.1",
"cspell": "^3.2.17",
"dotenv": "6.2.0",
"husky": "^2.4.0",
"jasmine-core": "~2.8.0",
"jasmine-reporters": "^2.2.1",

View File

@ -1,6 +1,10 @@
require('dotenv').config();
const API_HOST_CONTENT = process.env.API_HOST_CONTENT || 'http://0.0.0.0:8080';
module.exports = {
'/alfresco': {
target: 'http://0.0.0.0:8080',
target: API_HOST_CONTENT,
secure: false,
changeOrigin: true,
// workaround for REPO-2260
@ -10,5 +14,10 @@ module.exports = {
proxyRes.headers['www-authenticate'] = 'x' + header;
}
}
},
'/auth': {
target: API_HOST_CONTENT,
secure: false,
changeOrigin: true
}
};

View File

@ -1,31 +1,28 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"target": "es5",
"resolveJsonModule": true,
"typeRoots": ["node_modules/@types"],
"lib": ["es2018", "dom"],
"module": "es2015",
"baseUrl": "./",
"paths": {
"@alfresco/adf-office-services-ext": [
"dist/@alfresco/adf-office-services-ext"
],
"@alfresco/adf-office-services-ext/*": [
"dist/@alfresco/adf-office-services-ext/*"
],
"@alfresco/aca-shared": ["dist/@alfresco/aca-shared"],
"@alfresco/aca-shared/*": ["dist/@alfresco/aca-shared/*"]
},
"resolveJsonModule": true
"@alfresco/aca-shared": ["projects/aca-shared/src/public-api.ts"],
"@alfresco/aca-shared/store": ["projects/aca-shared/store/src/public_api.ts"],
"@alfresco/aca-shared/rules": ["projects/aca-shared/rules/src/public_api.ts"],
"@alfresco/adf-office-services-ext": ["projects/adf-office-services-ext/src/public_api.ts"],
"@alfresco/adf-office-services-ext/*": ["projects/adf-office-services-ext/src/lib/*"]
}
},
"exclude": ["node_modules"],
"angularCompilerOptions": {