@cjhd/cj-event-emitter 1.1.2 → 1.2.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/.cj-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": "cj-package-v1",
3
3
  "name": "@cjhd/cj-event-emitter",
4
- "version": "1.1.2",
4
+ "version": "1.2.1",
5
5
  "payloadManifest": "encrypted-payload/manifest.json",
6
6
  "entry": "index.js",
7
7
  "assetsDir": "assets",
@@ -1,6 +1,22 @@
1
- function __cjLicenseError() {
2
- throw new Error("[CJHD License] Runtime package is not unlocked. Expected license file: extensions/pkg/node_modules/@cjhd/cj-cocos-license/bin/cj-runtime-license.json. Then run: node extensions/pkg/node_modules/@cjhd/cj-cocos-license/bin/cj-license.js --mode install --force");
3
- }
1
+ // CJHD editor-safe runtime stub. Generated by cj-cocos-license.
2
+
3
+ const __cjSafeValue = new Proxy(function __cjSafeValue() {}, {
4
+ get(target, key) {
5
+ if (key === Symbol.toPrimitive) return function () { return 0; };
6
+ if (key === 'valueOf') return function () { return 0; };
7
+ if (key === 'toString') return function () { return '[CJHD editor-safe stub]'; };
8
+ return __cjSafeValue;
9
+ },
10
+ apply() { return __cjSafeValue; },
11
+ construct() { return __cjSafeValue; },
12
+ });
4
13
 
5
- export class EventEmitter { constructor() { __cjLicenseError(); } }
6
- export function __cj_package_not_unlocked__() { __cjLicenseError(); }
14
+ export class EventEmitter {
15
+ constructor(...args) {}
16
+ on(...args) { return __cjSafeValue; }
17
+ once(...args) { return __cjSafeValue; }
18
+ off(...args) { return __cjSafeValue; }
19
+ targetOff(...args) { return __cjSafeValue; }
20
+ offAll(...args) { return __cjSafeValue; }
21
+ emit(...args) { return __cjSafeValue; }
22
+ }
@@ -1,29 +1,39 @@
1
1
  {
2
2
  "schema": "cj-encrypted-payload-v1",
3
3
  "packageName": "@cjhd/cj-event-emitter",
4
- "packageVersion": "1.1.2",
5
- "algorithm": "AES-256-GCM",
6
- "kdf": "HKDF-SHA256",
7
- "sourceHash": "129d209fe3d626f9a33f9216f6b24379cbbabdb908e47ee39e52b83229db23f9",
8
- "payloadHash": "ecd16fc90841f80044abe4015b6747ca885630de24ebd5f31fb3dd9949195b2f",
4
+ "version": "1.2.1",
5
+ "packageVersion": "1.2.1",
6
+ "algorithm": "aes-256-gcm",
7
+ "kdf": "hkdf-sha256",
8
+ "content": "obfuscated-esm-js",
9
+ "sourceHash": "817c20503306e3d8ae961c30791813df84e7bfc70bc46cc539b582a4367befa4",
10
+ "payloadHash": "35befde9d729241373ce0f7550b4a50374c874b711bcbbb781057b6106cba5e5",
9
11
  "files": [
10
12
  {
13
+ "path": "assets/EventEmitter.js",
11
14
  "out": "assets/EventEmitter.js",
15
+ "encrypted": "files/assets__EventEmitter.js.bin",
12
16
  "bin": "files/assets__EventEmitter.js.bin",
13
- "iv": "P5DYctQ0GGurRdvi",
14
- "authTag": "VfHs22dc8x1hfIYmhyUPBA==",
15
- "sha256": "9158b2e2f5ed0e5a7cec070510d483cbf0d7e9ec1e0c88ea216662f0710d5186"
17
+ "iv": "7cjupQMdMdxxlveq",
18
+ "authTag": "aNVW9+8aavRTfdhDsGJ3+A==",
19
+ "sha256": "108f8974d077db789629c2732b861e590d0ee9c5909f98cc8bb9eb9df2093e28",
20
+ "originalSize": 1145,
21
+ "encryptedSize": 1145
16
22
  },
17
23
  {
24
+ "path": "index.js",
18
25
  "out": "index.js",
26
+ "encrypted": "files/index.js.bin",
19
27
  "bin": "files/index.js.bin",
20
- "iv": "AebTV57yPFrNgIyJ",
21
- "authTag": "NMZYANeFvh6MRuqScDm8hw==",
22
- "sha256": "4742c8af69dcde9e83eeedd2dbcbe2fe5d51881cc201eeb3bc6b5c59750df402"
28
+ "iv": "i6sXH2tab4cLDIiB",
29
+ "authTag": "qnlBAGjiwqFJ5Hr4oB26Gg==",
30
+ "sha256": "ddc2dcd090bbd197a9235a14932a799a1699c43410cd54213133bc3555be4611",
31
+ "originalSize": 52,
32
+ "encryptedSize": 52
23
33
  }
24
34
  ],
25
35
  "publicExports": [
26
36
  "EventEmitter"
27
37
  ],
28
- "createdAt": "2026-05-20T02:39:03.265Z"
38
+ "createdAt": "2026-05-22T08:23:01.836Z"
29
39
  }
package/index.js CHANGED
@@ -1,6 +1,14 @@
1
- function __cjLicenseError() {
2
- throw new Error("[CJHD License] Runtime package is not unlocked. Expected license file: extensions/pkg/node_modules/@cjhd/cj-cocos-license/bin/cj-runtime-license.json. Then run: node extensions/pkg/node_modules/@cjhd/cj-cocos-license/bin/cj-license.js --mode install --force");
3
- }
1
+ // CJHD editor-safe runtime stub. Generated by cj-cocos-license.
2
+
3
+ const __cjSafeValue = new Proxy(function __cjSafeValue() {}, {
4
+ get(target, key) {
5
+ if (key === Symbol.toPrimitive) return function () { return 0; };
6
+ if (key === 'valueOf') return function () { return 0; };
7
+ if (key === 'toString') return function () { return '[CJHD editor-safe stub]'; };
8
+ return __cjSafeValue;
9
+ },
10
+ apply() { return __cjSafeValue; },
11
+ construct() { return __cjSafeValue; },
12
+ });
4
13
 
5
14
  export { EventEmitter } from './assets/EventEmitter.js';
6
- export function __cj_package_not_unlocked__() { __cjLicenseError(); }
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@cjhd/cj-event-emitter",
3
- "version": "1.1.2",
3
+ "version": "1.2.1",
4
4
  "description": "全局事件触发器:零依赖、轻量级",
5
5
  "main": "./index.js",
6
- "scripts": {
7
- "postinstall": "node ./bin/package-postinstall.js"
8
- },
9
6
  "repository": {
10
7
  "type": "git",
11
8
  "url": "https://gitee.com/cocos2d-zp/cococs-creator-frame-3d"
@@ -26,6 +23,12 @@
26
23
  "import": "./index.js",
27
24
  "default": "./index.js"
28
25
  },
26
+ "./index.js": {
27
+ "types": "./index.d.ts",
28
+ "browser": "./index.js",
29
+ "import": "./index.js",
30
+ "default": "./index.js"
31
+ },
29
32
  "./assets/*": {
30
33
  "types": "./assets/*.d.ts",
31
34
  "browser": "./assets/*.js",
@@ -42,16 +45,7 @@
42
45
  "assets/**/*.d.ts",
43
46
  "assets/**/*.js",
44
47
  "encrypted-payload/**",
45
- "bin/**",
46
48
  ".cj-package.json"
47
49
  ],
48
- "dependencies": {},
49
- "peerDependencies": {
50
- "@cjhd/cj-cocos-license": "^1.0.0"
51
- },
52
- "peerDependenciesMeta": {
53
- "@cjhd/cj-cocos-license": {
54
- "optional": true
55
- }
56
- }
50
+ "dependencies": {}
57
51
  }
@@ -1,32 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import childProcess from 'node:child_process';
4
- import { fileURLToPath } from 'node:url';
5
-
6
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
- const packageRoot = path.resolve(__dirname, '..');
8
- const cjhdRoot = path.dirname(packageRoot);
9
- const pkgRoot = path.resolve(cjhdRoot, '../..');
10
- const cli = path.join(cjhdRoot, 'cj-cocos-license', 'bin', 'cj-license.js');
11
-
12
- if (!fs.existsSync(cli)) {
13
- console.warn('[CJHD License] @cjhd/cj-cocos-license is not installed; keeping unauthorized stubs.');
14
- process.exit(0);
15
- }
16
-
17
- const result = childProcess.spawnSync(process.execPath, [
18
- cli,
19
- '--mode',
20
- 'install',
21
- '--soft',
22
- '--pkg-root',
23
- pkgRoot
24
- ], {
25
- cwd: pkgRoot,
26
- stdio: 'inherit',
27
- shell: false
28
- });
29
-
30
- if (result.status !== 0) {
31
- console.warn('[CJHD License] install unlock check did not complete; keeping unauthorized stubs.');
32
- }