@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.js
CHANGED
|
@@ -1006,13 +1006,15 @@ var SCAFFOLD = `// biref.schema.overrides.ts - edit freely, regen will NOT touch
|
|
|
1006
1006
|
// and list the fields you want to type.
|
|
1007
1007
|
//
|
|
1008
1008
|
// @example
|
|
1009
|
-
// export interface Overrides {
|
|
1009
|
+
// export interface Overrides extends BirefOverridesShape {
|
|
1010
1010
|
// 'identity.users': {
|
|
1011
1011
|
// profile: { plan: 'free' | 'pro'; prefs: { darkMode: boolean } };
|
|
1012
1012
|
// };
|
|
1013
1013
|
// }
|
|
1014
1014
|
|
|
1015
|
-
|
|
1015
|
+
import type { BirefOverridesShape } from '@biref/scanner';
|
|
1016
|
+
|
|
1017
|
+
export interface Overrides extends BirefOverridesShape {}
|
|
1016
1018
|
`;
|
|
1017
1019
|
function overridesScaffold() {
|
|
1018
1020
|
return SCAFFOLD;
|
|
@@ -1174,7 +1176,7 @@ function generateSchema(model) {
|
|
|
1174
1176
|
lines.push(GENERATED_BANNER);
|
|
1175
1177
|
lines.push("");
|
|
1176
1178
|
lines.push("import type { ApplySchemaOverrides } from '@biref/scanner';");
|
|
1177
|
-
lines.push("import type { Overrides } from './biref.schema.overrides';");
|
|
1179
|
+
lines.push("import type { Overrides } from './biref.schema.overrides.js';");
|
|
1178
1180
|
lines.push("");
|
|
1179
1181
|
lines.push("export interface RawBirefSchema {");
|
|
1180
1182
|
for (const namespace of sortedNamespaces) {
|
|
@@ -1274,7 +1276,7 @@ function emitIndexFile(model) {
|
|
|
1274
1276
|
lines.push(GENERATED_BANNER);
|
|
1275
1277
|
lines.push("");
|
|
1276
1278
|
lines.push("import type { ApplySchemaOverrides } from '@biref/scanner';");
|
|
1277
|
-
lines.push("import type { Overrides } from './biref.schema.overrides';");
|
|
1279
|
+
lines.push("import type { Overrides } from './biref.schema.overrides.js';");
|
|
1278
1280
|
lines.push("");
|
|
1279
1281
|
const allEntities = [];
|
|
1280
1282
|
for (const namespace of sortedNamespaces) {
|
|
@@ -1291,14 +1293,14 @@ function emitIndexFile(model) {
|
|
|
1291
1293
|
for (const { namespace, entity } of allEntities) {
|
|
1292
1294
|
const iface = entityInterfaceName(namespace, entity.name);
|
|
1293
1295
|
lines.push(
|
|
1294
|
-
`import type { ${iface} } from './${safeSegment(namespace)}/${safeSegment(entity.name)}';`
|
|
1296
|
+
`import type { ${iface} } from './${safeSegment(namespace)}/${safeSegment(entity.name)}.js';`
|
|
1295
1297
|
);
|
|
1296
1298
|
}
|
|
1297
1299
|
lines.push("");
|
|
1298
1300
|
for (const { namespace, entity } of allEntities) {
|
|
1299
1301
|
const iface = entityInterfaceName(namespace, entity.name);
|
|
1300
1302
|
lines.push(
|
|
1301
|
-
`export type { ${iface} } from './${safeSegment(namespace)}/${safeSegment(entity.name)}';`
|
|
1303
|
+
`export type { ${iface} } from './${safeSegment(namespace)}/${safeSegment(entity.name)}.js';`
|
|
1302
1304
|
);
|
|
1303
1305
|
}
|
|
1304
1306
|
lines.push("");
|