@travetto/transformer 4.1.2 → 5.0.0-rc.1

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 ArcSine Technologies
3
+ Copyright (c) 2023 ArcSine Technologies
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/transformer",
3
- "version": "4.1.2",
3
+ "version": "5.0.0-rc.1",
4
4
  "description": "Functionality for AST transformations, with transformer registration, and general utils",
5
5
  "keywords": [
6
6
  "typescript",
@@ -24,9 +24,9 @@
24
24
  "directory": "module/transformer"
25
25
  },
26
26
  "dependencies": {
27
- "@travetto/manifest": "^4.1.0",
27
+ "@travetto/manifest": "^5.0.0-rc.1",
28
28
  "tslib": "^2.6.3",
29
- "typescript": "^5.5.2"
29
+ "typescript": "^5.5.3"
30
30
  },
31
31
  "travetto": {
32
32
  "displayName": "Transformation",
@@ -1,6 +1,6 @@
1
1
  import ts from 'typescript';
2
2
 
3
- import { ManifestIndex, ManifestModuleUtil, path } from '@travetto/manifest';
3
+ import { path, ManifestIndex, ManifestModuleUtil } from '@travetto/manifest';
4
4
 
5
5
  import type { AnyType, TransformResolver } from './types';
6
6
  import { TypeCategorize, TypeBuilder } from './builder';
package/src/state.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import ts from 'typescript';
2
2
 
3
- import { ManifestIndex, path } from '@travetto/manifest';
3
+ import { path, ManifestIndex } from '@travetto/manifest';
4
4
 
5
5
  import { ManagedType, AnyType, ForeignType } from './resolver/types';
6
6
  import { State, DecoratorMeta, Transformer, ModuleNameⲐ } from './types/visitor';
@@ -46,7 +46,6 @@ export class TransformerState implements State {
46
46
  this.#resolver = new SimpleResolver(checker, manifestIndex);
47
47
  this.#imports = new ImportManager(source, factory, this.#resolver);
48
48
  this.file = path.toPosix(this.source.fileName);
49
-
50
49
  this.importName = this.#resolver.getFileImportName(this.file, true);
51
50
  }
52
51
 
package/src/util/core.ts CHANGED
@@ -26,7 +26,7 @@ export class CoreUtil {
26
26
  * @param m
27
27
  */
28
28
  static getRangeOf<T extends ts.Node>(source: ts.SourceFile, o: T | undefined): [start: number, end: number] | undefined {
29
- if (o) {
29
+ if (o && o.pos >= 0) {
30
30
  const start = ts.getLineAndCharacterOfPosition(source, o.getStart(source));
31
31
  const end = ts.getLineAndCharacterOfPosition(source, o.getEnd());
32
32
  return [start.line + 1, end.line + 1];
@@ -1,6 +1,6 @@
1
1
  import ts from 'typescript';
2
2
 
3
- import { ManifestModuleUtil, PackageUtil, path } from '@travetto/manifest';
3
+ import { path, ManifestModuleUtil, PackageUtil } from '@travetto/manifest';
4
4
 
5
5
  import { Import } from '../types/shared';
6
6