Skip to content

refactor!: to biolerplate v2 (MAPCO 6292) - #53

Merged
Powfu2 merged 14 commits into
masterfrom
update-to-biolerplate-v2
Sep 14, 2026
Merged

Powfu2 merged 14 commits into
masterfrom
update-to-biolerplate-v2

Conversation

@Powfu2

@Powfu2 Powfu2 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Related issues: MAPCO-6292
Closes #XXX ...

Further information:

@Powfu2
Powfu2 requested a review from NivGreenstein July 9, 2026 15:52
Comment thread .github/workflows/pull_request.yaml Outdated
Comment on lines 67 to 69
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note:
You can add top-level ENVs and reference them.
See example here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the env
you added a top-level env

Comment thread config/default.json
Comment thread src/common/db/index.ts Outdated
...connectionOptions,
password: undefined,
ssl: {
key: readFileSync(ssl.key),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If readFilesSync fails, it throws an error. make sure it throws an indicative one

Comment thread src/common/db/index.ts Outdated
const dbConfig = config.get<DbConfig>('db');
const connectionOptions = createConnectionOptions({ entities: ENTITIES_DIRS, ...dbConfig });
const config = container.resolve<ConfigType>(SERVICES.CONFIG);
const dbConfig: DbConfig = config.get('db');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to assign DbConfig type. The type will auto resolve

Comment thread src/common/constants.ts Outdated
import { readPackageJsonSync } from '@map-colonies/read-pkg';

export const SERVICE_NAME = readPackageJsonSync().name ?? 'unknown_service';
export const DEFAULT_SERVER_PORT = 80;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please default to port 8080

Comment thread src/containerConfig.ts Outdated
Comment on lines +107 to +109
useFactory: (container): HealthCheck => {
const connection = container.resolve<Connection>(Connection);
return getDbHealthCheckFunction(connection);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a function somewhere else. Don't create logic at containerConfig

Comment thread src/index.ts Outdated
Comment on lines +23 to +24
console.error('😢 - failed initializing the server');
console.error(error);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using logger if its available? revert relevant changes

Comment thread src/instrumentation.mts
Comment thread tests/helpers/index.ts
Comment thread ormconfig.ts Outdated
Comment on lines +5 to +6
// The typeorm CLI cannot await the async application config, so the db section is read directly
// from the local config file, honoring the same DB_* env overrides the schema defines for the application.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ai slop?

@NivGreenstein

Copy link
Copy Markdown
Contributor

Also, missing some files

Comment thread .github/workflows/pull_request.yaml Outdated
DB_NAME: postgres
DB_USERNAME: postgres
DB_PASSWORD: postgres
# DB_SCHEMA: public

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

Comment thread .github/workflows/pull_request.yaml Outdated
Comment on lines 67 to 69
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the env
you added a top-level env

Comment thread src/common/constants.ts Outdated

export const SERVICE_NAME = readPackageJsonSync().name ?? 'unknown_service';
export const DEFAULT_SERVER_PORT = 80;
export const DB_HEALTHCHECK_TIMEOUT_MS = 5000;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it if you added it to the config

Comment thread src/containerConfig.ts Outdated
Comment thread src/containerConfig.ts Outdated
Comment thread src/containerConfig.ts Outdated
Comment thread ormconfig.ts Outdated
@Powfu2
Powfu2 requested a review from NivGreenstein July 21, 2026 15:36
NivGreenstein
NivGreenstein previously approved these changes Jul 23, 2026
Comment thread src/common/db/index.ts
Comment thread package.json Outdated
@Powfu2 Powfu2 changed the title Update to biolerplate v2 refactor: to biolerplate v2 (MAPCO 6292) Jul 27, 2026
@Powfu2 Powfu2 changed the title refactor: to biolerplate v2 (MAPCO 6292) refactor!: to biolerplate v2 (MAPCO 6292) Sep 14, 2026
@Powfu2
Powfu2 merged commit fbda491 into master Sep 14, 2026
4 checks passed
@Powfu2
Powfu2 deleted the update-to-biolerplate-v2 branch September 14, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants