@travetto/registry 4.1.1 → 5.0.0-rc.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.
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/registry",
3
- "version": "4.1.1",
3
+ "version": "5.0.0-rc.0",
4
4
  "description": "Patterns and utilities for handling registration of metadata and functionality for run-time use",
5
5
  "keywords": [
6
6
  "ast-transformations",
@@ -27,11 +27,11 @@
27
27
  "directory": "module/registry"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/base": "^4.1.1"
30
+ "@travetto/base": "^5.0.0-rc.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@travetto/cli": "^4.1.1",
34
- "@travetto/transformer": "^4.1.1"
33
+ "@travetto/cli": "^5.0.0-rc.0",
34
+ "@travetto/transformer": "^5.0.0-rc.0"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@travetto/transformer": {
@@ -1,6 +1,6 @@
1
1
  import { Module } from 'node:module';
2
2
 
3
- import { RuntimeIndex, path } from '@travetto/manifest';
3
+ import { path, RuntimeIndex } from '@travetto/manifest';
4
4
  import { Env } from '@travetto/base';
5
5
 
6
6
  import { RetargettingProxy } from '../proxy';
@@ -93,7 +93,7 @@ export abstract class MetadataRegistry<C extends { class: Class }, M = unknown,
93
93
  * Trigger initial install, moves pending to finalized (active)
94
94
  */
95
95
  override initialInstall(): Class[] {
96
- return Array.from(this.pending.values()).map(x => x.class).filter((x): x is Class => !!x);
96
+ return Array.from(this.pending.values()).map(x => x.class).filter(x => !!x);
97
97
  }
98
98
 
99
99
  /**
@@ -3,8 +3,7 @@ import ts from 'typescript';
3
3
  import { TransformerState, AfterClass, DecoratorUtil } from '@travetto/transformer';
4
4
 
5
5
  const REGISTER_MOD = '@travetto/registry/src/decorator';
6
- const BASE_MOD_SRC = '@travetto/base/src';
7
- const MANIFEST_MOD = '@travetto/manifest';
6
+ const SKIP_SRC = /^@travetto\/(base|manifest)\/(src|support)/;
8
7
 
9
8
  /**
10
9
  * Registration of all classes to support the registry
@@ -18,8 +17,7 @@ export class RegisterTransformer {
18
17
  static registerClass(state: TransformerState, node: ts.ClassDeclaration): ts.ClassDeclaration {
19
18
  if (
20
19
  state.importName === REGISTER_MOD ||
21
- state.importName.startsWith(BASE_MOD_SRC) ||
22
- state.importName.startsWith(MANIFEST_MOD)
20
+ SKIP_SRC.test(state.importName)
23
21
  ) { // Cannot process self
24
22
  return node;
25
23
  }