Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@travetto/registry

Package Overview
Dependencies
Maintainers
0
Versions
290
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/registry - npm Package Compare versions

Comparing version 5.0.0-rc.1 to 5.0.0-rc.2

8

package.json
{
"name": "@travetto/registry",
"version": "5.0.0-rc.1",
"version": "5.0.0-rc.2",
"description": "Patterns and utilities for handling registration of metadata and functionality for run-time use",

@@ -30,7 +30,7 @@ "keywords": [

"dependencies": {
"@travetto/base": "^5.0.0-rc.1"
"@travetto/runtime": "^5.0.0-rc.2"
},
"peerDependencies": {
"@travetto/cli": "^5.0.0-rc.1",
"@travetto/transformer": "^5.0.0-rc.0"
"@travetto/cli": "^5.0.0-rc.2",
"@travetto/transformer": "^5.0.0-rc.2"
},

@@ -37,0 +37,0 @@ "peerDependenciesMeta": {

@@ -30,3 +30,3 @@ <!-- This file was generated by @travetto/doc and should not be modified directly -->

```typescript
import { Class } from '@travetto/base';
import { Class } from '@travetto/runtime';
import { MetadataRegistry } from '@travetto/registry';

@@ -116,5 +116,5 @@

} else {
const prevMeta = RuntimeIndex.getFunctionMetadataFromClass(prev.get(k));
const nextMeta = RuntimeIndex.getFunctionMetadataFromClass(next.get(k));
if (prevMeta?.hash !== nextMeta?.hash) {
const prevHash = describeFunction(prev.get(k)!)?.hash;
const nextHash = describeFunction(next.get(k)!)?.hash;
if (prevHash !== nextHash) {
changes += 1;

@@ -121,0 +121,0 @@ this.emit({ type: 'changed', curr: next.get(k)!, prev: prev.get(k) });

@@ -1,3 +0,2 @@

import { Class } from '@travetto/base';
import { RuntimeIndex } from '@travetto/manifest';
import { Class, Runtime } from '@travetto/runtime';

@@ -15,3 +14,3 @@ /**

add(cls: Class): void {
const src = RuntimeIndex.getFunctionMetadata(cls)!.source;
const src = Runtime.getSource(cls);
if (!this.map.has(src)) {

@@ -18,0 +17,0 @@ const sub: Class[] = [];

import { Module } from 'node:module';
import { path, RuntimeIndex } from '@travetto/manifest';
import { Env } from '@travetto/base';
import { path } from '@travetto/manifest';
import { Runtime, RuntimeIndex } from '@travetto/runtime';

@@ -35,3 +35,3 @@ import { RetargettingProxy } from '../proxy';

const name = Module._resolveFilename!(request, parent);
if (err instanceof Error && Env.dynamic && !name.startsWith('test/')) {
if (err instanceof Error && Runtime.dynamic && !name.startsWith('test/')) {
const errMsg = err.message;

@@ -38,0 +38,0 @@ console.debug(`Unable to load ${name}: stubbing out with error proxy.`, errMsg);

@@ -1,3 +0,3 @@

import { ManifestModuleUtil, RuntimeIndex } from '@travetto/manifest';
import { watchCompiler, WatchEvent, RuntimeContext } from '@travetto/base';
import { ManifestModuleUtil } from '@travetto/manifest';
import { watchCompiler, WatchEvent, Runtime, RuntimeIndex } from '@travetto/runtime';

@@ -27,3 +27,3 @@ interface ModuleLoader {

if (ev.action === 'create' || ev.action === 'delete') {
RuntimeIndex.reinitForModule(RuntimeContext.main.name);
RuntimeIndex.reinitForModule(Runtime.main.name);
}

@@ -30,0 +30,0 @@ if (ev.action === 'create' || ev.action === 'update') {

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ConcreteClass<T = any> = new (...args: any[]) => T;
const ProxyTargetⲐ = Symbol.for('@travetto/base:proxy-target');
const ProxyTargetⲐ = Symbol.for('@travetto/runtime:proxy-target');

@@ -5,0 +5,0 @@ const AsyncGeneratorFunction = Object.getPrototypeOf(async function* () { });

import { EventEmitter } from 'node:events';
import { Class, Env } from '@travetto/base';
import { Class, Env } from '@travetto/runtime';
import { ChangeSource, ChangeEvent, ChangeHandler } from './types';

@@ -4,0 +4,0 @@

@@ -1,2 +0,2 @@

import { Class } from '@travetto/base';
import { Class } from '@travetto/runtime';

@@ -3,0 +3,0 @@ import { Registry } from '../registry';

@@ -1,2 +0,2 @@

import { Class } from '@travetto/base';
import { Class } from '@travetto/runtime';

@@ -3,0 +3,0 @@ import { Registry } from '../registry';

import { EventEmitter } from 'node:events';
import { type FindConfig, RuntimeIndex } from '@travetto/manifest';
import { Class, Env } from '@travetto/base';
import { type FindConfig } from '@travetto/manifest';
import { Class, Env, Runtime, RuntimeIndex, describeFunction } from '@travetto/runtime';

@@ -14,3 +14,3 @@ import { DynamicFileLoader } from '../internal/file-loader';

return m.roles.includes('std') && (
!Env.production || m.prod ||
!Runtime.production || m.prod ||
((role === 'doc' || role === 'test') && m.roles.includes(role))

@@ -47,3 +47,3 @@ );

for (const cls of classes) {
const src = RuntimeIndex.getFunctionMetadata(cls)!.source;
const src = Runtime.getSource(cls);
this.#classes.get(src)!.set(cls.Ⲑid, cls);

@@ -88,5 +88,5 @@ this.emit({ type: 'added', curr: cls });

} else {
const prevMeta = RuntimeIndex.getFunctionMetadataFromClass(prev.get(k));
const nextMeta = RuntimeIndex.getFunctionMetadataFromClass(next.get(k));
if (prevMeta?.hash !== nextMeta?.hash) {
const prevHash = describeFunction(prev.get(k)!)?.hash;
const nextHash = describeFunction(next.get(k)!)?.hash;
if (prevHash !== nextHash) {
changes += 1;

@@ -117,3 +117,3 @@ this.emit({ type: 'changed', curr: next.get(k)!, prev: prev.get(k) });

async init(): Promise<void> {
if (Env.dynamic) {
if (Runtime.dynamic) {
DynamicFileLoader.onLoadEvent(ev => {

@@ -120,0 +120,0 @@ for (const [file, classes] of PendingRegister.flush(true)) {

import { EventEmitter } from 'node:events';
import { Class } from '@travetto/base';
import { RuntimeIndex } from '@travetto/manifest';
import { Class, describeFunction } from '@travetto/runtime';

@@ -33,4 +32,4 @@ import { ChangeSource, ChangeEvent, ChangeHandler } from '../types';

onClassEvent(e: ChangeEvent<Class>): void {
const next = RuntimeIndex.getFunctionMetadataFromClass(e.curr!)?.methods ?? {};
const prev = RuntimeIndex.getFunctionMetadataFromClass(e.prev!)?.methods ?? {};
const next = describeFunction(e.curr!)?.methods ?? {};
const prev = describeFunction(e.prev!)?.methods ?? {};

@@ -37,0 +36,0 @@ /**

@@ -6,3 +6,4 @@ import ts from 'typescript';

const REGISTER_MOD = '@travetto/registry/src/decorator';
const SKIP_SRC = /^@travetto\/(base|manifest)\/(src|support)/;
const SKIP_SRC = /^@travetto\/(runtime|manifest)\/(src|support)/;
const SKIP_FUNCTION = /^@travetto\/registry\/src\/function/;

@@ -21,3 +22,4 @@ /**

state.importName === REGISTER_MOD ||
SKIP_SRC.test(state.importName)
SKIP_SRC.test(state.importName) ||
SKIP_FUNCTION.test(state.importName)
) { // Cannot process self

@@ -24,0 +26,0 @@ return node;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc