Skip to content

Commit

Permalink
refactor(octra): ignore logging for prod beta version
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Oct 18, 2024
1 parent 5eb1065 commit 0449311
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 12 deletions.
23 changes: 23 additions & 0 deletions apps/octra/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,29 @@
],
"outputHashing": "all"
},
"beta-dev": {
"buildOptimizer": true,
"optimization": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "6mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
],
"fileReplacements": [
{
"replace": "apps/octra/src/environments/environment.ts",
"with": "apps/octra/src/environments/environment.beta-dev.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
Expand Down
17 changes: 8 additions & 9 deletions apps/octra/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,21 @@ import { RouterModule } from '@angular/router';
},
}
),
StoreDevtoolsModule.instrument({
trace: true,
maxAge: 50,
logOnly: !environment.production,
connectInZone: true,
}),
!environment.production
? StoreDevtoolsModule.instrument({
trace: !environment.production,
maxAge: 50,
logOnly: !environment.production,
connectInZone: true,
})
: [],
EffectsModule.forRoot([
IDBEffects,
ApplicationEffects,
AsrEffects,
APIEffects,
AuthenticationEffects,
]),
!environment.production
? StoreDevtoolsModule.instrument({ connectInZone: true })
: [],
EffectsModule.forFeature([]),
NgbDropdownModule,
NgbNavModule,
Expand Down
14 changes: 14 additions & 0 deletions apps/octra/src/environments/environment.beta-dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const environment = {
production: true,
dev_version: false,
beta_version: true,
useCookies: true,
debugging: {
enabled: true,
logging: {
console: true,
actions: true,
routes: true
}
}
};
2 changes: 1 addition & 1 deletion apps/octra/src/environments/environment.beta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const environment = {
enabled: true,
logging: {
console: true,
actions: true,
actions: false,
routes: false
}
}
Expand Down
6 changes: 5 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ if (process.argv[2] === "beta=true") {
dev = "--configuration=beta";
}

if (process.argv[2] === "beta=dev") {
dev = "--configuration=beta-dev";
}

if (process.argv[3] === "isUpdate=true") {
isUpdate = true;
}
Expand All @@ -35,7 +39,7 @@ if (process.argv[4].indexOf("url=") > -1) {
baseHref = process.argv[4].replace("url=", "");
}

console.log(`Building OCTRA with dev=${dev}, isUpdate=${isUpdate} for ${baseHref}`);
console.log(`Building OCTRA with ${dev}, isUpdate=${isUpdate} for ${baseHref}`);
console.log(`Remove dist...`);
execSync(`rm -rf "./${buildDir}"`);
let command = ["./node_modules/nx/bin/nx.js", "build", "octra", "--prod", dev, `--base-href=${baseHref}`];
Expand Down
2 changes: 1 addition & 1 deletion runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const OCTRA = {
},
buildBetaDevUpdate: async function () {
await run(
'node ./build.js beta=true isUpdate=true url=/apps/octra/octra-dev/'
'node ./build.js beta=dev isUpdate=true url=/apps/octra/octra-dev/'
);
await setBuildVariable();
},
Expand Down

0 comments on commit 0449311

Please sign in to comment.