mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
["@babel/preset-env", { "targets": { "node": 10 } }],
|
|
||||||
"@babel/preset-typescript"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
name: Node CI
|
name: Node CI
|
||||||
|
|
||||||
on: [pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+3
-8
@@ -4,27 +4,22 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.13.10",
|
|
||||||
"@babel/preset-env": "^7.13.10",
|
|
||||||
"@babel/preset-typescript": "^7.13.0",
|
|
||||||
"@changesets/changelog-github": "^0.4.2",
|
"@changesets/changelog-github": "^0.4.2",
|
||||||
"@changesets/cli": "^2.20.0",
|
"@changesets/cli": "^2.20.0",
|
||||||
"@changesets/write": "^0.1.6",
|
"@changesets/write": "^0.1.6",
|
||||||
"@types/fs-extra": "^8.0.0",
|
"@types/fs-extra": "^8.0.0",
|
||||||
"@types/jest": "^29.5.1",
|
|
||||||
"@types/node": "^22.15.17",
|
"@types/node": "^22.15.17",
|
||||||
"@types/semver": "^7.5.0",
|
"@types/semver": "^7.5.0",
|
||||||
"babel-jest": "^29.5.0",
|
|
||||||
"esbuild": "^0.25.4",
|
"esbuild": "^0.25.4",
|
||||||
"fixturez": "^1.1.0",
|
"fixturez": "^1.1.0",
|
||||||
"husky": "^3.0.3",
|
"husky": "^3.0.3",
|
||||||
"jest": "^29.5.0",
|
|
||||||
"prettier": "^2.0.5",
|
"prettier": "^2.0.5",
|
||||||
"typescript": "^5.8.3"
|
"typescript": "^5.8.3",
|
||||||
|
"vitest": "^3.1.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "esbuild src/index.ts --bundle --platform=node --target=node20 --minify --outfile=dist/index.js",
|
"build": "esbuild src/index.ts --bundle --platform=node --target=node20 --minify --outfile=dist/index.js",
|
||||||
"test": "jest",
|
"test": "vitest",
|
||||||
"test:watch": "yarn test --watch",
|
"test:watch": "yarn test --watch",
|
||||||
"typecheck": "tsc",
|
"typecheck": "tsc",
|
||||||
"changeset": "changeset",
|
"changeset": "changeset",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||||
|
|
||||||
exports[`version creates simple PR 1`] = `
|
exports[`version > creates simple PR 1`] = `
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"base": "some-branch",
|
"base": "some-branch",
|
||||||
@@ -33,7 +33,7 @@ exports[`version creates simple PR 1`] = `
|
|||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`version does not include any release information if a message with simplified release info exceeds size limit 1`] = `
|
exports[`version > does not include any release information if a message with simplified release info exceeds size limit 1`] = `
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"base": "some-branch",
|
"base": "some-branch",
|
||||||
@@ -51,7 +51,7 @@ exports[`version does not include any release information if a message with simp
|
|||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`version does not include changelog entries if full message exceeds size limit 1`] = `
|
exports[`version > does not include changelog entries if full message exceeds size limit 1`] = `
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"base": "some-branch",
|
"base": "some-branch",
|
||||||
@@ -73,7 +73,7 @@ exports[`version does not include changelog entries if full message exceeds size
|
|||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`version doesn't include ignored package that got a dependency update in the PR body 1`] = `
|
exports[`version > doesn't include ignored package that got a dependency update in the PR body 1`] = `
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"base": "some-branch",
|
"base": "some-branch",
|
||||||
@@ -95,7 +95,7 @@ exports[`version doesn't include ignored package that got a dependency update in
|
|||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`version only includes bumped packages in the PR body 1`] = `
|
exports[`version > only includes bumped packages in the PR body 1`] = `
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"base": "some-branch",
|
"base": "some-branch",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||||
|
|
||||||
exports[`it sorts the things right 1`] = `
|
exports[`it sorts the things right 1`] = `
|
||||||
[
|
[
|
||||||
|
|||||||
+8
-7
@@ -3,11 +3,12 @@ import writeChangeset from "@changesets/write";
|
|||||||
import fixturez from "fixturez";
|
import fixturez from "fixturez";
|
||||||
import fs from "fs-extra";
|
import fs from "fs-extra";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { Git } from "./git";
|
import { Git } from "./git";
|
||||||
import { setupOctokit } from "./octokit";
|
import { setupOctokit } from "./octokit";
|
||||||
import { runVersion } from "./run";
|
import { runVersion } from "./run";
|
||||||
|
|
||||||
jest.mock("@actions/github", () => ({
|
vi.mock("@actions/github", () => ({
|
||||||
context: {
|
context: {
|
||||||
repo: {
|
repo: {
|
||||||
owner: "changesets",
|
owner: "changesets",
|
||||||
@@ -20,16 +21,16 @@ jest.mock("@actions/github", () => ({
|
|||||||
rest: mockedGithubMethods,
|
rest: mockedGithubMethods,
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
jest.mock("./git");
|
vi.mock("./git");
|
||||||
jest.mock("@changesets/ghcommit/git");
|
vi.mock("@changesets/ghcommit/git");
|
||||||
|
|
||||||
let mockedGithubMethods = {
|
let mockedGithubMethods = {
|
||||||
pulls: {
|
pulls: {
|
||||||
create: jest.fn(),
|
create: vi.fn(),
|
||||||
list: jest.fn(),
|
list: vi.fn(),
|
||||||
},
|
},
|
||||||
repos: {
|
repos: {
|
||||||
createRelease: jest.fn(),
|
createRelease: vi.fn(),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ const writeChangesets = (changesets: Changeset[], cwd: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("version", () => {
|
describe("version", () => {
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
import { getChangelogEntry, BumpLevels, sortTheThings } from "./utils";
|
import { expect, test } from "vitest";
|
||||||
|
import { BumpLevels, getChangelogEntry, sortTheThings } from "./utils";
|
||||||
|
|
||||||
let changelog = `# @keystone-alpha/email
|
let changelog = `# @keystone-alpha/email
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -6,6 +6,7 @@
|
|||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"moduleResolution": "node16",
|
"moduleResolution": "node16",
|
||||||
"erasableSyntaxOnly": true
|
"erasableSyntaxOnly": true,
|
||||||
|
"skipLibCheck": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user