From 006394c4c63ff61b1d1df5c8f934443dc5b48cae Mon Sep 17 00:00:00 2001 From: Puru Vijay Date: Sat, 13 Jul 2024 18:13:30 +0530 Subject: [PATCH] modern build works --- examples/try-esm/index.js | 20 ++++++++++++++++++++ examples/try-esm/package.json | 16 ++++++++++++++++ examples/try-esm/pnpm-lock.yaml | 23 +++++++++++++++++++++++ package.json | 2 +- 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 examples/try-esm/index.js create mode 100644 examples/try-esm/package.json create mode 100644 examples/try-esm/pnpm-lock.yaml diff --git a/examples/try-esm/index.js b/examples/try-esm/index.js new file mode 100644 index 0000000..41583ce --- /dev/null +++ b/examples/try-esm/index.js @@ -0,0 +1,20 @@ +import { Traverse } from 'neotraverse/modern'; + +const obj = { + a: 1, + b: 2, + c: { + d: 3, + e: 4, + f: { + g: 5, + h: 6, + }, + }, +}; + +new Traverse(obj).forEach((ctx, node) => { + if (node === 6) ctx.update(68); +}); + +console.log(obj); diff --git a/examples/try-esm/package.json b/examples/try-esm/package.json new file mode 100644 index 0000000..d7af030 --- /dev/null +++ b/examples/try-esm/package.json @@ -0,0 +1,16 @@ +{ + "name": "try-esm", + "version": "1.0.0", + "main": "index.js", + "type": "module", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "neotraverse": "0.6.9-test.1" + } +} diff --git a/examples/try-esm/pnpm-lock.yaml b/examples/try-esm/pnpm-lock.yaml new file mode 100644 index 0000000..2925a99 --- /dev/null +++ b/examples/try-esm/pnpm-lock.yaml @@ -0,0 +1,23 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + neotraverse: + specifier: 0.6.9-test.1 + version: 0.6.9-test.1 + +packages: + + neotraverse@0.6.9-test.1: + resolution: {integrity: sha512-6Dpca9wu7pVdQcl6P9sYfDArFd8zlZTpOnuXNuoVC+kG2vWZ9xS4IFZfeqyqxbzRUSxhqmkjlX9QMZsgRAa5VQ==} + engines: {node: '>= 18'} + +snapshots: + + neotraverse@0.6.9-test.1: {} diff --git a/package.json b/package.json index f16e414..e00837b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "neotraverse", - "version": "0.6.8", + "version": "0.6.9-test.1", "description": "traverse and transform objects by visiting every node on a recursive walk", "main": "dist/legacy/legacy.cjs", "type": "module",