From c9dd43c3b0863c25e4929031aa77ac8e7f83c55a Mon Sep 17 00:00:00 2001 From: Tyler Hall Date: Wed, 9 Oct 2024 20:37:27 +0000 Subject: [PATCH] feat(manifest): add support for bumping deno.json and jsr.json --- main.js | 42 ++++++++++++++++++++++++++---------------- test/main.test.js | 4 ++-- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/main.js b/main.js index e91f0d05..5b9b6bbf 100644 --- a/main.js +++ b/main.js @@ -1,24 +1,11 @@ import { join } from 'node:path' const SUPPORTED_RUNTIMES = ['node', 'deno', 'javascript'] -const DENO_MANIFEST = 'egg.json' +const DENO_MANIFEST = 'deno.json' +const JSR_MANIFEST = 'jsr.json' +const NEST_MANIFEST = 'egg.json' const NODE_MANIFEST = 'package.json' -/** @type {const('standard-version').Options} */ -const COMMON_DEFAULTS = { - noVerify: true, - // No package files means version always pulled from git tag - packageFiles: [], - // overwritten via runtime deno or node defaults - bumpFiles: [], - skip: { - bump: false, - changelog: true, // skip changelog generation - commit: false, - tag: false - } -} - /** @type {const('standard-version').Options} */ const JS_DEFAULTS = { bumpFiles: [ @@ -26,6 +13,14 @@ const JS_DEFAULTS = { filename: DENO_MANIFEST, type: 'json' }, + { + filename: JSR_MANIFEST, + type: 'json' + }, + { + filename: NEST_MANIFEST, + type: 'json' + }, { filename: NODE_MANIFEST, type: 'json' @@ -37,6 +32,21 @@ const JS_DEFAULTS = { ] } +/** @type {const('standard-version').Options} */ +const COMMON_DEFAULTS = { + noVerify: true, + // No package files means version always pulled from git tag + packageFiles: [], + // overwritten via runtime defaults + bumpFiles: [], + skip: { + bump: false, + changelog: true, // skip changelog generation + commit: false, + tag: false + } +} + /** * * @param {*} param0 diff --git a/test/main.test.js b/test/main.test.js index 9afdd820..4d112451 100644 --- a/test/main.test.js +++ b/test/main.test.js @@ -23,11 +23,11 @@ describe('main', () => { const { getRuntimeDefaults } = lib() let res = getRuntimeDefaults('node') - expect(res.bumpFiles.length).toBe(3) + expect(res.bumpFiles.length).toBeGreaterThan(0) res = getRuntimeDefaults('deno') - expect(res.bumpFiles.length).toBe(3) + expect(res.bumpFiles.length).toBeGreaterThan(0) expect(() => getRuntimeDefaults('foo_runtime')).toThrow() }) })