From 2f4da1585ddc9a98dce62904cd5f5ae8122c120b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 19:40:03 +0000 Subject: [PATCH 1/2] fix(deps): bump the all group across 1 directory with 5 updates Bumps the all group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [@znemz/cft-utils](https://github.com/nmccready/cft-utils) | `0.1.19` | `0.1.22` | | [glob](https://github.com/isaacs/node-glob) | `11.1.0` | `12.0.0` | | [js-yaml](https://github.com/nodeca/js-yaml) | `3.14.2` | `4.1.1` | | [yargs](https://github.com/yargs/yargs) | `17.7.2` | `18.0.0` | | [mocha](https://github.com/mochajs/mocha) | `11.7.2` | `11.7.5` | Updates `@znemz/cft-utils` from 0.1.19 to 0.1.22 - [Release notes](https://github.com/nmccready/cft-utils/releases) - [Changelog](https://github.com/nmccready/cft-utils/blob/main/CHANGELOG.md) - [Commits](https://github.com/nmccready/cft-utils/compare/v0.1.19...v0.1.22) Updates `glob` from 11.1.0 to 12.0.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](https://github.com/isaacs/node-glob/compare/v11.1.0...v12.0.0) Updates `js-yaml` from 3.14.2 to 4.1.1 - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.14.2...4.1.1) Updates `yargs` from 17.7.2 to 18.0.0 - [Release notes](https://github.com/yargs/yargs/releases) - [Changelog](https://github.com/yargs/yargs/blob/main/CHANGELOG.md) - [Commits](https://github.com/yargs/yargs/compare/v17.7.2...v18.0.0) Updates `mocha` from 11.7.2 to 11.7.5 - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/v11.7.5/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v11.7.2...v11.7.5) --- updated-dependencies: - dependency-name: "@znemz/cft-utils" dependency-version: 0.1.22 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all - dependency-name: glob dependency-version: 12.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all - dependency-name: yargs dependency-version: 18.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all - dependency-name: mocha dependency-version: 11.7.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3cd58ab..1792b6f 100644 --- a/package.json +++ b/package.json @@ -43,19 +43,19 @@ "dependencies": { "@aws-sdk/client-cloudformation": "^3.637.0", "@aws-sdk/client-s3": "^3.637.0", - "@znemz/cft-utils": "0.1.19", + "@znemz/cft-utils": "0.1.22", "@znemz/sort-object": "^3.0.4", "aws-sdk-v3-proxy": "2.2.0", "bluebird": "^3.7.2", "deepmerge": "^4.2.2", - "glob": "^11.0.1", + "glob": "^12.0.0", "jmespath": "^0.16.0", - "js-yaml": "^3.14.1", + "js-yaml": "^4.1.1", "jsonminify": "^0.4.1", "lodash": "^4.17.21", "path-parse": "~1.0.7", "proxy-agent": "6.5.0", - "yargs": "~17.7.2" + "yargs": "~18.0.0" }, "devDependencies": { "@commitlint/cli": "^20", @@ -67,7 +67,7 @@ "eslint-config-prettier": "10", "eslint-plugin-mocha": "11", "eslint-plugin-prettier": "5", - "mocha": "11.7.2", + "mocha": "11.7.5", "npm-run-all": "4.1.5", "prettier": "3", "serve": "14.2.5", From 1f1176da0480dfe9f37e615907410a33888905d9 Mon Sep 17 00:00:00 2001 From: nmccready Date: Tue, 18 Nov 2025 17:18:17 -0500 Subject: [PATCH 2/2] fix: esm support on yargs --- .github/workflows/tests.yml | 2 +- bin/cli.js | 14 +++++++++----- lib/schema.js | 2 +- lib/yaml.js | 2 +- package.json | 3 +-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b2eaafd..f6e4f3d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: test: strategy: matrix: - node-version: ['18.x', '20.x', '22.x'] + node-version: ['20.x', '22.x', '24.x'] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/bin/cli.js b/bin/cli.js index 5b5ca6b..61ef0a3 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -4,7 +4,6 @@ const exec = require('child_process').execSync; const path = require('path'); const _ = require('lodash'); const pathParse = require('path-parse'); -const yargs = require('yargs'); const include = require('../index'); const yaml = require('../lib/yaml'); @@ -12,11 +11,14 @@ const Client = require('../lib/cfnclient'); const pkg = require('../package.json'); const replaceEnv = require('../lib/replaceEnv'); -yargs.version(false); - const { env } = process; - -const opts = yargs + +(async () => { + const { default : yargs } = await import('yargs'); + const { hideBin } = await import('yargs/helpers'); + + const opts = yargs(hideBin(process.argv)) + .version(false) .command('$0 [path] [options]', pkg.description, (y) => y.positional('path', { positional: true, @@ -189,3 +191,5 @@ promise console.log(err.stack); process.exit(1); }); + +})(); diff --git a/lib/schema.js b/lib/schema.js index 0e93948..b8d2388 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -103,7 +103,7 @@ const BANG_AMAZON_FUNCS = [ const EXPLICIT_AMAZON_FUNCS = BANG_AMAZON_FUNCS.map((f) => `Fn::${f}`); -module.exports = yaml.Schema.create(tags); +module.exports = yaml.DEFAULT_SCHEMA.extend(tags); module.exports.EXPLICIT_AMAZON_FUNCS = EXPLICIT_AMAZON_FUNCS; module.exports.BANG_AMAZON_FUNCS = BANG_AMAZON_FUNCS; diff --git a/lib/yaml.js b/lib/yaml.js index f77400a..117280a 100644 --- a/lib/yaml.js +++ b/lib/yaml.js @@ -6,7 +6,7 @@ module.exports = { load: (res) => { let json; try { - json = yaml.safeLoad(res, { schema: yamlSchema }); + json = yaml.load(res, { schema: yamlSchema }); } catch (yamlErr) { try { json = JSON.parse(minify(res)); diff --git a/package.json b/package.json index 1792b6f..d72bfcd 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "name": "Nicholas McCready", "email": "nemtcan@gmail.com" }, - "main": "index.js", "bin": { "cfn-include": "bin/cli.js" }, @@ -43,7 +42,7 @@ "dependencies": { "@aws-sdk/client-cloudformation": "^3.637.0", "@aws-sdk/client-s3": "^3.637.0", - "@znemz/cft-utils": "0.1.22", + "@znemz/cft-utils": "0.1.23", "@znemz/sort-object": "^3.0.4", "aws-sdk-v3-proxy": "2.2.0", "bluebird": "^3.7.2",