@layerzerolabs/common-node-utils 0.2.68 → 0.2.69

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/common-node-utils",
3
- "version": "0.2.68",
3
+ "version": "0.2.69",
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.68",
20
- "@layerzerolabs/typescript-configuration": "0.2.68"
22
+ "@layerzerolabs/typescript-configuration": "0.2.69",
23
+ "@layerzerolabs/tsup-configuration": "0.2.69"
21
24
  },
22
25
  "publishConfig": {
23
26
  "access": "public",
@@ -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
- CLI Building entry: src/files.ts, src/index.ts
7
- CLI Using tsconfig: tsconfig.json
8
- CLI tsup v8.5.1
9
- CLI Using tsup config: /home/runner/work/monorepo-internal/monorepo-internal/packages/common/common-node-utils/tsup.config.ts
10
- CLI Target: ES2023
11
- CLI Cleaning output folder
12
- CJS Build start
13
- ESM Build start
14
- ESM dist/files.js 141.00 B
15
- ESM dist/index.js 1.24 KB
16
- ESM dist/OKSMIGRA.js 1.61 KB
17
- ESM dist/files.js.map 69.00 B
18
- ESM dist/index.js.map 2.75 KB
19
- ESM dist/OKSMIGRA.js.map 3.46 KB
20
- ESM ⚡️ Build success in 182ms
21
- CJS dist/index.cjs 2.15 KB
22
- CJS dist/files.cjs 421.00 B
23
- CJS dist/II2MVA6U.cjs 1.42 KB
24
- CJS dist/index.cjs.map 2.78 KB
25
- CJS dist/files.cjs.map 70.00 B
26
- CJS dist/II2MVA6U.cjs.map 2.68 KB
27
- CJS ⚡️ Build success in 183ms
@@ -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)
@@ -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
- 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/common/common-node-utils
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/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
- }
package/tsup.config.ts DELETED
@@ -1,8 +0,0 @@
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
- }));