@travetto/registry 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/registry",
3
- "version": "4.1.2",
3
+ "version": "5.0.0-rc.1",
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.2"
30
+ "@travetto/base": "^5.0.0-rc.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@travetto/cli": "^4.1.2",
34
- "@travetto/transformer": "^4.1.2"
33
+ "@travetto/cli": "^5.0.0-rc.1",
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';
@@ -1,5 +1,5 @@
1
- import { ManifestModuleUtil, RuntimeIndex, RuntimeContext } from '@travetto/manifest';
2
- import { watchCompiler, FullWatchEvent, WatchEvent } from '@travetto/base';
1
+ import { ManifestModuleUtil, RuntimeIndex } from '@travetto/manifest';
2
+ import { watchCompiler, WatchEvent, RuntimeContext } from '@travetto/base';
3
3
 
4
4
  interface ModuleLoader {
5
5
  init?(): Promise<void>;
@@ -19,7 +19,7 @@ class $DynamicFileLoader {
19
19
  #loader: ModuleLoader;
20
20
  #initialized = false;
21
21
 
22
- async dispatch(ev: FullWatchEvent): Promise<void> {
22
+ async dispatch(ev: WatchEvent): Promise<void> {
23
23
  if (ev.action === 'update' || ev.action === 'delete') {
24
24
  await this.#loader.unload(ev.output);
25
25
  }
@@ -66,7 +66,7 @@ class $DynamicFileLoader {
66
66
 
67
67
  // Fire off, and let it run in the bg. Restart on exit
68
68
  (async (): Promise<void> => {
69
- for await (const ev of watchCompiler<FullWatchEvent>({ restartOnExit: true })) {
69
+ for await (const ev of watchCompiler({ restartOnExit: true })) {
70
70
  if (ev.file && RuntimeIndex.hasModule(ev.module) && VALID_FILE_TYPES.has(ManifestModuleUtil.getFileType(ev.file))) {
71
71
  await this.dispatch(ev);
72
72
  }
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
 
3
- import { FindConfig, RuntimeIndex } from '@travetto/manifest';
3
+ import { type FindConfig, RuntimeIndex } from '@travetto/manifest';
4
4
  import { Class, Env } from '@travetto/base';
5
5
 
6
6
  import { DynamicFileLoader } from '../internal/file-loader';
@@ -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
  }