@hubspot/npm-scripts 0.3.3-beta.0 → 0.3.3-beta.1
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 +1 -1
- package/src/release.js +4 -4
- package/src/{release → utils/release}/__tests__/steps.test.js +11 -11
- package/src/{release → utils/release}/__tests__/validate.test.js +1 -1
- package/src/{release → utils/release}/__tests__/version.test.js +1 -1
- package/src/{release → utils/release}/errors.js +1 -1
- package/src/{release → utils/release}/steps.js +6 -6
- package/src/{release → utils/release}/types.d.ts +1 -1
- package/src/{release → utils/release}/validate.d.ts +1 -1
- package/src/{release → utils/release}/validate.js +1 -1
- package/src/{release → utils/release}/version.js +1 -1
- /package/src/{release → utils/release}/__tests__/steps.test.d.ts +0 -0
- /package/src/{release → utils/release}/__tests__/validate.test.d.ts +0 -0
- /package/src/{release → utils/release}/__tests__/version.test.d.ts +0 -0
- /package/src/{release → utils/release}/errors.d.ts +0 -0
- /package/src/{release → utils/release}/steps.d.ts +0 -0
- /package/src/{release → utils/release}/types.js +0 -0
- /package/src/{release → utils/release}/version.d.ts +0 -0
package/package.json
CHANGED
package/src/release.js
CHANGED
|
@@ -5,10 +5,10 @@ import { EXIT_CODES } from './utils/process.js';
|
|
|
5
5
|
import { DEFAULT_MAIN_BRANCH, TAG, TAG_OPTIONS, VERSION_INCREMENT_OPTIONS, } from './constants/release.js';
|
|
6
6
|
import { getCurrentGitBranch } from './utils/git.js';
|
|
7
7
|
import { getDistTags } from './utils/npm.js';
|
|
8
|
-
import { ReleaseError } from './release/errors.js';
|
|
9
|
-
import { validatePreviousBranchConfigured, validateBranchForTag, validateTagIncrementCombination, validateVersionSync, validateNextReleaseIsNotOverIncrement, } from './release/validate.js';
|
|
10
|
-
import { computeNewVersion } from './release/version.js';
|
|
11
|
-
import { confirmRelease, createTempBranch, bumpVersion, tryBuild, ensureNpmAuth, tryPublish, updateDistTagsForLatest, finalizeRelease, logReleaseSuccess, } from './release/steps.js';
|
|
8
|
+
import { ReleaseError } from './utils/release/errors.js';
|
|
9
|
+
import { validatePreviousBranchConfigured, validateBranchForTag, validateTagIncrementCombination, validateVersionSync, validateNextReleaseIsNotOverIncrement, } from './utils/release/validate.js';
|
|
10
|
+
import { computeNewVersion } from './utils/release/version.js';
|
|
11
|
+
import { confirmRelease, createTempBranch, bumpVersion, tryBuild, ensureNpmAuth, tryPublish, updateDistTagsForLatest, finalizeRelease, logReleaseSuccess, } from './utils/release/steps.js';
|
|
12
12
|
function buildHandler({ build, postLatestRelease, packageName, localVersion, registry, repositoryUrl, mainBranch, previousBranch, ignoreScripts, }) {
|
|
13
13
|
return async function handler({ versionIncrement, tag, dryRun, skipBranchValidation, skipVersionCheck, }) {
|
|
14
14
|
try {
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
2
|
import { exec as _exec, execSync } from 'node:child_process';
|
|
3
3
|
import open from 'open';
|
|
4
|
-
import { logger } from '
|
|
5
|
-
import { EXIT_CODES } from '
|
|
6
|
-
import { gitCleanup } from '
|
|
7
|
-
import { publish, updateNextTag, updatePreviousTag } from '
|
|
8
|
-
import { confirm } from '
|
|
9
|
-
import { TAG, INCREMENT } from '
|
|
4
|
+
import { logger } from '../../../utils/logging.js';
|
|
5
|
+
import { EXIT_CODES } from '../../../utils/process.js';
|
|
6
|
+
import { gitCleanup } from '../../../utils/git.js';
|
|
7
|
+
import { publish, updateNextTag, updatePreviousTag, } from '../../../utils/npm.js';
|
|
8
|
+
import { confirm } from '../../../utils/prompting.js';
|
|
9
|
+
import { TAG, INCREMENT } from '../../../constants/release.js';
|
|
10
10
|
import { confirmRelease, runBuild, tryBuild, createTempBranch, bumpVersion, ensureNpmAuth, tryPublish, updateDistTagsForLatest, finalizeRelease, logReleaseSuccess, } from '../steps.js';
|
|
11
11
|
import { ReleaseError } from '../errors.js';
|
|
12
12
|
vi.mock('util', () => ({ promisify: vi.fn(fn => fn) }));
|
|
13
13
|
vi.mock('node:child_process', () => ({ exec: vi.fn(), execSync: vi.fn() }));
|
|
14
14
|
vi.mock('open', () => ({ default: vi.fn().mockResolvedValue(undefined) }));
|
|
15
|
-
vi.mock('
|
|
15
|
+
vi.mock('../../../utils/logging.js', () => ({
|
|
16
16
|
logger: { log: vi.fn(), error: vi.fn(), success: vi.fn() },
|
|
17
17
|
}));
|
|
18
|
-
vi.mock('
|
|
18
|
+
vi.mock('../../../utils/process.js', () => ({
|
|
19
19
|
EXIT_CODES: { SUCCESS: 0, ERROR: 1 },
|
|
20
20
|
}));
|
|
21
|
-
vi.mock('
|
|
22
|
-
vi.mock('
|
|
21
|
+
vi.mock('../../../utils/git.js', () => ({ gitCleanup: vi.fn() }));
|
|
22
|
+
vi.mock('../../../utils/npm.js', () => ({
|
|
23
23
|
publish: vi.fn(),
|
|
24
24
|
updateNextTag: vi.fn(),
|
|
25
25
|
updatePreviousTag: vi.fn(),
|
|
26
26
|
}));
|
|
27
|
-
vi.mock('
|
|
27
|
+
vi.mock('../../../utils/prompting.js', () => ({ confirm: vi.fn() }));
|
|
28
28
|
const mockedExec = vi.mocked(_exec);
|
|
29
29
|
const mockedExecSync = vi.mocked(execSync);
|
|
30
30
|
const mockedGitCleanup = vi.mocked(gitCleanup);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { validatePreviousBranchConfigured, validateBranchForTag, validateTagIncrementCombination, validateVersionSync, validateNextReleaseIsNotOverIncrement, } from '../validate.js';
|
|
3
3
|
import { ReleaseError } from '../errors.js';
|
|
4
|
-
import { TAG, INCREMENT } from '
|
|
4
|
+
import { TAG, INCREMENT } from '../../../constants/release.js';
|
|
5
5
|
const DIST_TAGS = {
|
|
6
6
|
latest: '1.0.0',
|
|
7
7
|
next: '1.0.0-beta.1',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { computeNewVersion } from '../version.js';
|
|
3
3
|
import { ReleaseError } from '../errors.js';
|
|
4
|
-
import { TAG, INCREMENT } from '
|
|
4
|
+
import { TAG, INCREMENT } from '../../../constants/release.js';
|
|
5
5
|
const DIST_TAGS = {
|
|
6
6
|
latest: '1.0.0',
|
|
7
7
|
next: '1.0.0-beta.1',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { exec as _exec, execSync } from 'node:child_process';
|
|
2
2
|
import { promisify } from 'util';
|
|
3
3
|
import open from 'open';
|
|
4
|
-
import { logger } from '
|
|
5
|
-
import { EXIT_CODES } from '
|
|
6
|
-
import { gitCleanup } from '
|
|
7
|
-
import { publish, updateNextTag, updatePreviousTag } from '
|
|
8
|
-
import { confirm } from '
|
|
9
|
-
import { TAG, INCREMENT, PRERELEASE_IDENTIFIER } from '
|
|
4
|
+
import { logger } from '../../utils/logging.js';
|
|
5
|
+
import { EXIT_CODES } from '../../utils/process.js';
|
|
6
|
+
import { gitCleanup } from '../../utils/git.js';
|
|
7
|
+
import { publish, updateNextTag, updatePreviousTag } from '../../utils/npm.js';
|
|
8
|
+
import { confirm } from '../../utils/prompting.js';
|
|
9
|
+
import { TAG, INCREMENT, PRERELEASE_IDENTIFIER, } from '../../constants/release.js';
|
|
10
10
|
import { ReleaseError } from './errors.js';
|
|
11
11
|
const exec = promisify(_exec);
|
|
12
12
|
export async function confirmRelease({ isDryRun, currentVersion, newVersion, tag, localVersion, versionIncrement, }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tag } from '
|
|
1
|
+
import type { Tag } from '../../types.js';
|
|
2
2
|
import type { BranchValidationOptions, NextReleaseIncrementOptions, VersionSyncOptions } from './types.js';
|
|
3
3
|
export declare function validatePreviousBranchConfigured(isPrevious: boolean, previousBranch?: string): void;
|
|
4
4
|
export declare function validateBranchForTag({ isExperimental, isPrevious, branch, mainBranch, previousBranch, }: BranchValidationOptions): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
|
-
import { TAG, INCREMENT, PRERELEASE_IDENTIFIER } from '
|
|
2
|
+
import { TAG, INCREMENT, PRERELEASE_IDENTIFIER, } from '../../constants/release.js';
|
|
3
3
|
import { ReleaseError } from './errors.js';
|
|
4
4
|
export function validatePreviousBranchConfigured(isPrevious, previousBranch) {
|
|
5
5
|
if (!isPrevious || previousBranch) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
|
-
import { TAG, INCREMENT, PRERELEASE_IDENTIFIER } from '
|
|
2
|
+
import { TAG, INCREMENT, PRERELEASE_IDENTIFIER, } from '../../constants/release.js';
|
|
3
3
|
import { ReleaseError } from './errors.js';
|
|
4
4
|
function computeIncrementType(tag, versionIncrement) {
|
|
5
5
|
if (tag === TAG.LATEST ||
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|