@biref/scanner 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen/cli.js +10 -5148
- package/dist/codegen/cli.js.map +1 -1
- package/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1008,13 +1008,15 @@ var SCAFFOLD = `// biref.schema.overrides.ts - edit freely, regen will NOT touch
|
|
|
1008
1008
|
// and list the fields you want to type.
|
|
1009
1009
|
//
|
|
1010
1010
|
// @example
|
|
1011
|
-
// export interface Overrides {
|
|
1011
|
+
// export interface Overrides extends BirefOverridesShape {
|
|
1012
1012
|
// 'identity.users': {
|
|
1013
1013
|
// profile: { plan: 'free' | 'pro'; prefs: { darkMode: boolean } };
|
|
1014
1014
|
// };
|
|
1015
1015
|
// }
|
|
1016
1016
|
|
|
1017
|
-
|
|
1017
|
+
import type { BirefOverridesShape } from '@biref/scanner';
|
|
1018
|
+
|
|
1019
|
+
export interface Overrides extends BirefOverridesShape {}
|
|
1018
1020
|
`;
|
|
1019
1021
|
function overridesScaffold() {
|
|
1020
1022
|
return SCAFFOLD;
|
|
@@ -1176,7 +1178,7 @@ function generateSchema(model) {
|
|
|
1176
1178
|
lines.push(GENERATED_BANNER);
|
|
1177
1179
|
lines.push("");
|
|
1178
1180
|
lines.push("import type { ApplySchemaOverrides } from '@biref/scanner';");
|
|
1179
|
-
lines.push("import type { Overrides } from './biref.schema.overrides';");
|
|
1181
|
+
lines.push("import type { Overrides } from './biref.schema.overrides.js';");
|
|
1180
1182
|
lines.push("");
|
|
1181
1183
|
lines.push("export interface RawBirefSchema {");
|
|
1182
1184
|
for (const namespace of sortedNamespaces) {
|
|
@@ -1276,7 +1278,7 @@ function emitIndexFile(model) {
|
|
|
1276
1278
|
lines.push(GENERATED_BANNER);
|
|
1277
1279
|
lines.push("");
|
|
1278
1280
|
lines.push("import type { ApplySchemaOverrides } from '@biref/scanner';");
|
|
1279
|
-
lines.push("import type { Overrides } from './biref.schema.overrides';");
|
|
1281
|
+
lines.push("import type { Overrides } from './biref.schema.overrides.js';");
|
|
1280
1282
|
lines.push("");
|
|
1281
1283
|
const allEntities = [];
|
|
1282
1284
|
for (const namespace of sortedNamespaces) {
|
|
@@ -1293,14 +1295,14 @@ function emitIndexFile(model) {
|
|
|
1293
1295
|
for (const { namespace, entity } of allEntities) {
|
|
1294
1296
|
const iface = entityInterfaceName(namespace, entity.name);
|
|
1295
1297
|
lines.push(
|
|
1296
|
-
`import type { ${iface} } from './${safeSegment(namespace)}/${safeSegment(entity.name)}';`
|
|
1298
|
+
`import type { ${iface} } from './${safeSegment(namespace)}/${safeSegment(entity.name)}.js';`
|
|
1297
1299
|
);
|
|
1298
1300
|
}
|
|
1299
1301
|
lines.push("");
|
|
1300
1302
|
for (const { namespace, entity } of allEntities) {
|
|
1301
1303
|
const iface = entityInterfaceName(namespace, entity.name);
|
|
1302
1304
|
lines.push(
|
|
1303
|
-
`export type { ${iface} } from './${safeSegment(namespace)}/${safeSegment(entity.name)}';`
|
|
1305
|
+
`export type { ${iface} } from './${safeSegment(namespace)}/${safeSegment(entity.name)}.js';`
|
|
1304
1306
|
);
|
|
1305
1307
|
}
|
|
1306
1308
|
lines.push("");
|