@layerzerolabs/common-node-utils 0.2.68 → 0.2.70
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/package.json +6 -3
- package/.turbo/turbo-build.log +0 -27
- package/.turbo/turbo-lint.log +0 -8
- package/.turbo/turbo-test.log +0 -16
- package/src/files.ts +0 -41
- package/src/index.ts +0 -40
- package/tsconfig.json +0 -20
- package/tsup.config.ts +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/common-node-utils",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.70",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
"main": "./dist/index.cjs",
|
|
14
14
|
"module": "./dist/index.js",
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/**/*"
|
|
18
|
+
],
|
|
16
19
|
"devDependencies": {
|
|
17
20
|
"tsup": "^8.4.0",
|
|
18
21
|
"vitest": "^3.2.3",
|
|
19
|
-
"@layerzerolabs/tsup-configuration": "0.2.
|
|
20
|
-
"@layerzerolabs/typescript-configuration": "0.2.
|
|
22
|
+
"@layerzerolabs/tsup-configuration": "0.2.70",
|
|
23
|
+
"@layerzerolabs/typescript-configuration": "0.2.70"
|
|
21
24
|
},
|
|
22
25
|
"publishConfig": {
|
|
23
26
|
"access": "public",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
WARN Issue while reading "/home/runner/work/monorepo-internal/monorepo-internal/.npmrc". Failed to replace env in config: ${NPM_TOKEN}
|
|
2
|
-
|
|
3
|
-
> @layerzerolabs/common-node-utils@0.0.0 build /home/runner/work/monorepo-internal/monorepo-internal/packages/common/common-node-utils
|
|
4
|
-
> tsup
|
|
5
|
-
|
|
6
|
-
[34mCLI[39m Building entry: src/files.ts, src/index.ts
|
|
7
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
-
[34mCLI[39m tsup v8.5.1
|
|
9
|
-
[34mCLI[39m Using tsup config: /home/runner/work/monorepo-internal/monorepo-internal/packages/common/common-node-utils/tsup.config.ts
|
|
10
|
-
[34mCLI[39m Target: ES2023
|
|
11
|
-
[34mCLI[39m Cleaning output folder
|
|
12
|
-
[34mCJS[39m Build start
|
|
13
|
-
[34mESM[39m Build start
|
|
14
|
-
[32mESM[39m [1mdist/files.js [22m[32m141.00 B[39m
|
|
15
|
-
[32mESM[39m [1mdist/index.js [22m[32m1.24 KB[39m
|
|
16
|
-
[32mESM[39m [1mdist/OKSMIGRA.js [22m[32m1.61 KB[39m
|
|
17
|
-
[32mESM[39m [1mdist/files.js.map [22m[32m69.00 B[39m
|
|
18
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m2.75 KB[39m
|
|
19
|
-
[32mESM[39m [1mdist/OKSMIGRA.js.map [22m[32m3.46 KB[39m
|
|
20
|
-
[32mESM[39m ⚡️ Build success in 182ms
|
|
21
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m2.15 KB[39m
|
|
22
|
-
[32mCJS[39m [1mdist/files.cjs [22m[32m421.00 B[39m
|
|
23
|
-
[32mCJS[39m [1mdist/II2MVA6U.cjs [22m[32m1.42 KB[39m
|
|
24
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m2.78 KB[39m
|
|
25
|
-
[32mCJS[39m [1mdist/files.cjs.map [22m[32m70.00 B[39m
|
|
26
|
-
[32mCJS[39m [1mdist/II2MVA6U.cjs.map [22m[32m2.68 KB[39m
|
|
27
|
-
[32mCJS[39m ⚡️ Build success in 183ms
|
package/.turbo/turbo-lint.log
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @layerzerolabs/common-node-utils@0.0.0 lint /home/runner/work/monorepo-internal/monorepo-internal/packages/common/common-node-utils
|
|
3
|
-
> eslint . --max-warnings 0 || (eslint . --fix --max-warnings 0 && false)
|
|
4
|
-
|
|
5
|
-
(node:67160) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/eslint.config.js?mtime=1775694520701 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)
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @layerzerolabs/common-node-utils@0.0.0 test /home/runner/work/monorepo-internal/monorepo-internal/packages/common/common-node-utils
|
|
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/common/common-node-utils[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/src/files.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { mkdir, stat, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { dirname } from 'node:path';
|
|
3
|
-
|
|
4
|
-
const dirCache = new Map<string, Promise<string | undefined>>();
|
|
5
|
-
|
|
6
|
-
export const writeFileAndCreateDirsCached = async (path: string, data: string) => {
|
|
7
|
-
const dir = dirname(path);
|
|
8
|
-
const ensureDir = () => {
|
|
9
|
-
const cached = dirCache.get(dir);
|
|
10
|
-
if (cached) return cached;
|
|
11
|
-
|
|
12
|
-
const created = mkdir(dir, { recursive: true }).catch((err) => {
|
|
13
|
-
dirCache.delete(dir);
|
|
14
|
-
throw err;
|
|
15
|
-
});
|
|
16
|
-
dirCache.set(dir, created);
|
|
17
|
-
return created;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
await ensureDir();
|
|
22
|
-
await writeFile(path, data, { encoding: 'utf-8' });
|
|
23
|
-
} catch (err: any) {
|
|
24
|
-
if (err?.code !== 'ENOENT') {
|
|
25
|
-
throw err;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
dirCache.delete(dir);
|
|
29
|
-
await ensureDir();
|
|
30
|
-
await writeFile(path, data, { encoding: 'utf-8' });
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export async function pathExists(path: string): Promise<boolean> {
|
|
35
|
-
try {
|
|
36
|
-
await stat(path);
|
|
37
|
-
return true;
|
|
38
|
-
} catch (err: any) {
|
|
39
|
-
return err.code !== 'ENOENT' ? true : false;
|
|
40
|
-
}
|
|
41
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs/promises';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
|
|
4
|
-
let _fullyQualifiedRepoRootPath: Promise<string> | undefined = undefined;
|
|
5
|
-
/**
|
|
6
|
-
* Get the fully qualified path to the repository root by searching for pnpm-workspace.yaml
|
|
7
|
-
* @returns The absolute path to the repository root
|
|
8
|
-
*/
|
|
9
|
-
export const getFullyQualifiedRepoRootPath = (): Promise<string> => {
|
|
10
|
-
if (!_fullyQualifiedRepoRootPath) {
|
|
11
|
-
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
12
|
-
if (process.env.REPO_ROOT) {
|
|
13
|
-
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
14
|
-
_fullyQualifiedRepoRootPath = Promise.resolve(process.env.REPO_ROOT);
|
|
15
|
-
} else {
|
|
16
|
-
_fullyQualifiedRepoRootPath = (async (): Promise<string> => {
|
|
17
|
-
let currentDir = __dirname;
|
|
18
|
-
while (true) {
|
|
19
|
-
const candidate = path.join(currentDir, 'pnpm-workspace.yaml');
|
|
20
|
-
try {
|
|
21
|
-
await fs.access(candidate);
|
|
22
|
-
return currentDir;
|
|
23
|
-
} catch {
|
|
24
|
-
const parent = path.dirname(currentDir);
|
|
25
|
-
if (parent === currentDir) {
|
|
26
|
-
throw new Error(
|
|
27
|
-
`Could not locate root (pnpm-workspace.yaml not found)--started from ${__dirname}, ended at ${currentDir}`,
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
currentDir = parent;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
})();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return _fullyQualifiedRepoRootPath;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export * from './files';
|
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
}
|