@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.
- package/.turbo/turbo-build.log +20 -0
- package/.turbo/turbo-lint.log +8 -0
- package/.turbo/turbo-test.log +16 -0
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
- package/src/index.ts +27 -0
- package/tsconfig.json +20 -0
- package/tsup.config.ts +8 -0
|
@@ -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
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/monorepo-internal/monorepo-internal/packages/framework/definitions/function-pointer/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: ES2023
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mCJS[39m Build start
|
|
12
|
+
[34mESM[39m Build start
|
|
13
|
+
Generated an empty chunk: "index".
|
|
14
|
+
Generated an empty chunk: "index".
|
|
15
|
+
[32mESM[39m [1mdist/index.js [22m[32m68.00 B[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m89.00 B[39m
|
|
17
|
+
[32mESM[39m ⚡️ Build success in 47ms
|
|
18
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m84.00 B[39m
|
|
19
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m90.00 B[39m
|
|
20
|
+
[32mCJS[39m ⚡️ 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
|
+
[33mTesting 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.[39m
|
|
7
|
+
|
|
8
|
+
[1m[46m RUN [49m[22m [36mv3.2.4 [39m[90m/home/runner/work/monorepo-internal/monorepo-internal/packages/framework/definitions/function-pointer[39m
|
|
9
|
+
|
|
10
|
+
No test files found, exiting with code 0
|
|
11
|
+
|
|
12
|
+
[2minclude: [22m[33m**/*.{test,spec}.?(c|m)[jt]s?(x)[39m
|
|
13
|
+
[2mexclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[2m, [22m**/cypress/**[2m, [22m**/.{idea,git,cache,output,temp}/**[2m, [22m**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*[39m
|
|
14
|
+
[2mtypecheck include: [22m[33m**/*.{test,spec}-d.?(c|m)[jt]s?(x)[39m
|
|
15
|
+
[2mtypecheck exclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[2m, [22m**/cypress/**[2m, [22m**/.{idea,git,cache,output,temp}/**[2m, [22m**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*[39m
|
|
16
|
+
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -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 @@
|
|
|
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
|
+
}
|