type-crafter 0.13.3 → 0.14.0

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.
Files changed (2) hide show
  1. package/dist/index.js +34 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21360,7 +21360,7 @@ function formatModulePath(relativePath, writtenAt, config) {
21360
21360
  }
21361
21361
  const formattedPath = path.replace(/\//g, config.separator);
21362
21362
  if (parentPart === '') {
21363
- return formattedPath;
21363
+ return config.selfRef + config.separator + formattedPath;
21364
21364
  }
21365
21365
  return parentPart + config.separator + formattedPath;
21366
21366
  }
@@ -22354,8 +22354,38 @@ async function config(inputFilePath, outputDirectory, typesWriterMode, groupedTy
22354
22354
  exporterModuleName: 'mod',
22355
22355
  typeMapper: {
22356
22356
  string: { default: 'String', date: 'time::Date', 'date-time': 'time::OffsetDateTime' },
22357
- number: { default: 'i32' },
22358
- integer: { default: 'i32' },
22357
+ number: {
22358
+ default: 'f64',
22359
+ float: 'f32',
22360
+ double: 'f64',
22361
+ i8: 'i8',
22362
+ i16: 'i16',
22363
+ int32: 'i32',
22364
+ int64: 'i64',
22365
+ i128: 'i128',
22366
+ isize: 'isize',
22367
+ u8: 'u8',
22368
+ u16: 'u16',
22369
+ u32: 'u32',
22370
+ u64: 'u64',
22371
+ u128: 'u128',
22372
+ usize: 'usize'
22373
+ },
22374
+ integer: {
22375
+ default: 'i32',
22376
+ int32: 'i32',
22377
+ int64: 'i64',
22378
+ i8: 'i8',
22379
+ i16: 'i16',
22380
+ i128: 'i128',
22381
+ isize: 'isize',
22382
+ u8: 'u8',
22383
+ u16: 'u16',
22384
+ u32: 'u32',
22385
+ u64: 'u64',
22386
+ u128: 'u128',
22387
+ usize: 'usize'
22388
+ },
22359
22389
  boolean: 'bool',
22360
22390
  array: 'Vec<~ItemType~>',
22361
22391
  object: 'type',
@@ -22496,7 +22526,7 @@ async function runner(language, inputFilePath, outputDirectory, _typesWriterMode
22496
22526
  }
22497
22527
  }
22498
22528
  greeting();
22499
- const program = new Command().version('0.13.3');
22529
+ const program = new Command().version('0.14.0');
22500
22530
  program
22501
22531
  .command('generate')
22502
22532
  .description('Generate types for your language from a type spec file')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "type-crafter",
3
- "version": "0.13.3",
3
+ "version": "0.14.0",
4
4
  "description": "A tool to generate types from a yaml schema for any language",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",