Skip to content

Commit

Permalink
extra cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
theoephraim committed Dec 3, 2024
1 parent 9fc3280 commit 189a7e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/cli/lib/init-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export async function initDmnoForService(workspaceInfo: ScannedWorkspaceInfo, se
let recommendedServiceName: string | undefined;
if (workspaceInfo.isMonorepo) {
if (service.isRoot) recommendedServiceName = 'root';
else recommendedServiceName = service.name.replace(/^@[^/]+\//, '');
// else recommendedServiceName = service.name.replace(/^@[^/]+\//, '');
}
// we used to prompt the user here to pick/confirm the service name, but it was a bit confusing

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/cli/lib/schema-scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export function generateDmnoConfigInitialCode(opts: {
opts.isRoot && ' settings: {\n redactSensitiveLogs: true,\n interceptSensitiveLeakRequests: true,\n preventClientLeaks: true,\n },',
opts.serviceName
? ` name: '${opts.serviceName}',`
: (opts.isMonorepo ? ' // no name specified - inherit from package.json' : undefined),
: (opts.isMonorepo ? ' // no `name` specified - will inherit from package.json' : undefined),
!opts.isRoot && ' pick: [],',
' schema: {',
...schemaConfigAsCode.split('\n').map((line) => ` ${line}`),
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/config-engine/type-generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function generateServiceTypes(service: DmnoService, writeToFile = f
// write global file which defines a DMNO_CONFIG global
// this used in our config.mts files and in front-end apps where we inject rollup rewrites
await fs.promises.writeFile(`${typeGenFolderPath}/global.d.ts`, `${AUTOGENERATED_FILE_BANNER}
import { DmnoGeneratedConfigSchema } from './schema.d';
import type { DmnoGeneratedConfigSchema } from './schema.d.ts';
declare global {
/** ${service.serviceName} config global obj */
Expand All @@ -40,7 +40,7 @@ declare global {
// write global file which defines a DMNO_CONFIG global
// this used in our config.mts files and in front-end apps where we inject rollup rewrites
await fs.promises.writeFile(`${typeGenFolderPath}/global-public.d.ts`, `${AUTOGENERATED_FILE_BANNER}
import { DmnoGeneratedPublicConfigSchema } from './schema.d';
import type { DmnoGeneratedPublicConfigSchema } from './schema.d.ts';
declare global {
/** ${service.serviceName} config global obj - public (non-sensitive) items only */
Expand Down

0 comments on commit 189a7e8

Please sign in to comment.