@layerzerolabs/function-pointer 0.2.8

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.
@@ -0,0 +1,20 @@
1
+
2
+ > @layerzerolabs/function-pointer@0.0.0 build /home/runner/work/monorepo-internal/monorepo-internal/packages/framework/definitions/function-pointer
3
+ > tsup
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Using tsup config: /home/runner/work/monorepo-internal/monorepo-internal/packages/framework/definitions/function-pointer/tsup.config.ts
9
+ CLI Target: ES2023
10
+ CLI Cleaning output folder
11
+ CJS Build start
12
+ ESM Build start
13
+ Generated an empty chunk: "index".
14
+ Generated an empty chunk: "index".
15
+ ESM dist/index.js 68.00 B
16
+ ESM dist/index.js.map 89.00 B
17
+ ESM ⚡️ Build success in 47ms
18
+ CJS dist/index.cjs 84.00 B
19
+ CJS dist/index.cjs.map 90.00 B
20
+ CJS ⚡️ Build success in 48ms
@@ -0,0 +1,8 @@
1
+
2
+ > @layerzerolabs/function-pointer@0.0.0 lint /home/runner/work/monorepo-internal/monorepo-internal/packages/framework/definitions/function-pointer
3
+ > eslint . --max-warnings 0 || (eslint . --fix --max-warnings 0 && false)
4
+
5
+ (node:26428) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/eslint.config.js?mtime=1766427679294 is not specified and it doesn't parse as CommonJS.
6
+ Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
7
+ To eliminate this warning, add "type": "module" to /home/runner/work/monorepo-internal/monorepo-internal/package.json.
8
+ (Use `node --trace-warnings ...` to show where the warning was created)
@@ -0,0 +1,16 @@
1
+
2
+ > @layerzerolabs/function-pointer@0.0.0 test /home/runner/work/monorepo-internal/monorepo-internal/packages/framework/definitions/function-pointer
3
+ > vitest --run --pass-with-no-tests --typecheck
4
+
5
+ Testing types with tsc and vue-tsc is an experimental feature.
6
+ Breaking changes might not follow SemVer, please pin Vitest's version when using it.
7
+
8
+  RUN  v3.2.4 /home/runner/work/monorepo-internal/monorepo-internal/packages/framework/definitions/function-pointer
9
+
10
+ No test files found, exiting with code 0
11
+
12
+ include: **/*.{test,spec}.?(c|m)[jt]s?(x)
13
+ exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*
14
+ typecheck include: **/*.{test,spec}-d.?(c|m)[jt]s?(x)
15
+ typecheck exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*
16
+
package/dist/index.cjs ADDED
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=index.cjs.map
4
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
@@ -0,0 +1,22 @@
1
+ declare const fpSym: unique symbol;
2
+ declare const dimSym: unique symbol;
3
+ /**
4
+ * <!-- anchor:FunctionPointer -->
5
+ */
6
+ export type FunctionPointer<_Activity extends (...args: any[]) => Promise<any> = any> = {
7
+ factoryName: string;
8
+ dimKey: string;
9
+ methodName: string;
10
+ } & {
11
+ [fpSym]: _Activity;
12
+ };
13
+ export type DimensionlessFunctionPointer<_Activity extends (...args: any[]) => Promise<any> = any, Dim = any> = {
14
+ factoryName: string;
15
+ methodName: string;
16
+ } & {
17
+ [fpSym]: _Activity;
18
+ [dimSym]: Dim;
19
+ };
20
+ export type UnderlyingMethodOfFunctionPointer<Pointer extends FunctionPointer> = Pointer extends FunctionPointer<infer M> ? M : never;
21
+ export {};
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK,eAAoB,CAAC;AAChC,QAAA,MAAM,MAAM,eAAqB,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACtB,GAAG;IACA,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,4BAA4B,CACpC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,EACxD,GAAG,GAAG,GAAG,IACT;IACA,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB,GAAG;IACA,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IACnB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iCAAiC,CAAC,OAAO,SAAS,eAAe,IACzE,OAAO,SAAS,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@layerzerolabs/function-pointer",
3
+ "version": "0.2.8",
4
+ "private": false,
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ "types": "./dist/index.d.ts",
9
+ "require": "./dist/index.cjs",
10
+ "import": "./dist/index.js",
11
+ "default": "./dist/index.cjs"
12
+ },
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "devDependencies": {
17
+ "tsup": "^8.4.0",
18
+ "vitest": "^3.2.3",
19
+ "@layerzerolabs/tsup-configuration": "0.2.8",
20
+ "@layerzerolabs/typescript-configuration": "0.2.8"
21
+ },
22
+ "publishConfig": {
23
+ "access": "restricted",
24
+ "registry": "https://registry.npmjs.org/"
25
+ },
26
+ "scripts": {
27
+ "build": "tsup",
28
+ "lint": "eslint . --max-warnings 0 || (eslint . --fix --max-warnings 0 && false)",
29
+ "test": "vitest --run --pass-with-no-tests --typecheck"
30
+ }
31
+ }
package/src/index.ts ADDED
@@ -0,0 +1,27 @@
1
+ const fpSym = Symbol('_fp_tag');
2
+ const dimSym = Symbol('_dim_tag');
3
+
4
+ /**
5
+ * <!-- anchor:FunctionPointer -->
6
+ */
7
+ export type FunctionPointer<_Activity extends (...args: any[]) => Promise<any> = any> = {
8
+ factoryName: string;
9
+ dimKey: string;
10
+ methodName: string;
11
+ } & {
12
+ [fpSym]: _Activity;
13
+ };
14
+
15
+ export type DimensionlessFunctionPointer<
16
+ _Activity extends (...args: any[]) => Promise<any> = any,
17
+ Dim = any,
18
+ > = {
19
+ factoryName: string;
20
+ methodName: string;
21
+ } & {
22
+ [fpSym]: _Activity;
23
+ [dimSym]: Dim;
24
+ };
25
+
26
+ export type UnderlyingMethodOfFunctionPointer<Pointer extends FunctionPointer> =
27
+ Pointer extends FunctionPointer<infer M> ? M : never;
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "extends": "@layerzerolabs/typescript-configuration/tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./src",
5
+ "outDir": "./dist",
6
+ "strictPropertyInitialization": false,
7
+ "noUnusedLocals": false,
8
+ "noUnusedParameters": false,
9
+ "jsx": "react-jsx"
10
+ },
11
+ "exclude": [
12
+ "node_modules",
13
+ "**/__mocks__/*",
14
+ "**/__tests__/*",
15
+ "**/*.spec.ts",
16
+ "**/*.test.ts",
17
+ "dist"
18
+ ],
19
+ "include": ["src/**/*"]
20
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'tsup';
2
+
3
+ import { createPackageTsupConfig } from '@layerzerolabs/tsup-configuration';
4
+
5
+ export default defineConfig(({ watch }) => ({
6
+ ...createPackageTsupConfig(),
7
+ clean: !watch,
8
+ }));