Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"commit": true,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
}
20 changes: 20 additions & 0 deletions .changeset/seven-colts-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"rts.js": patch
---

CI/CD
Replace manual Changesets version/publish with changesets/action@v1
Trigger release when a PR is merged into master; keep workflow_dispatch
Update permissions: contents: write, pull-requests: write, id-token: write
Step order: Checkout → pnpm (v10) → Node 20 → Install → Test → Build → Changesets Action
Tests
Use system temporary directory via os.tmpdir() for all temp files (cross-platform)
Unify cleanup with fs.rmSync(..., { recursive: true, force: true })
Remove test/temp directory and related references
Update ava.config.js (remove exclude for test/temp/**/*.ts)
Docs
Update test/README.md to document the new temp file strategy
Config/Misc
Set .changeset/config.json baseBranch to master and enable commit: true
Allow committing Changeset entries by adjusting .gitignore
Keep Node 20 and pnpm cache configuration for faster installs and builds
16 changes: 0 additions & 16 deletions .changeset/ten-chefs-slide.md

This file was deleted.

17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
pull-requests: write
id-token: write # for npm provenance
steps:
- name: Checkout
Expand All @@ -31,17 +32,17 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: |
pnpm run --if-present release:build || pnpm run --if-present build

- name: Test
run: pnpm run --if-present test

- name: Publish with Changesets (pnpm)
run: pnpm run changeset:publish
- name: Build
run: pnpm run --if-present release:build || pnpm run --if-present build

- name: Changesets - Version or Publish
uses: changesets/action@v1
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true


17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# rts.js

## 0.0.4

### Patch Changes

- 1ad20ab: Ci (release): Triggering release when PR is merged into master; Test temporary files to use system temporary directory instead
-Ci: Modify. ithub/workflows/release. yml
-The triggering condition is changed to pull_dequest.clost to master, and only executed when merged==true
-Retain manual triggering of workflow_ispatch
-Change the workflow name to release
-Upgrade pnpm/action setup to v10 and adjust the installation order to match pnpm cache
-Test: Migration of temporary files to system temporary directory
-All use cases use the rts tests/_ subdirectories under os. tpdir() uniformly, compatible with Windows/Linux
-Adjust file creation and cleanup to fs.rmSync (..., {recursive: true, force: true})
-Delete the test/temp directory and related dependency paths in the repository
-Chore (ava): Remove the exclusion of test/temp/_ _/_. ts in ava.cnfig.js
-Docs (test): Update temporary file policy instructions in test/README.md

## 0.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rts.js",
"version": "0.0.3",
"version": "0.0.4",
"description": "nodejs runtime transformer,cans transform ts、js、jsx、tsx、css code to nodejs code",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
46 changes: 0 additions & 46 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,45 +237,6 @@ function createGitTag(config: ReleaseConfig): void {
}
}

/**
* Push changes to git
*/
function pushToGit(): void {
console.log("📤 Pushing changes to git...");
try {
execSync("git add .", { stdio: "inherit" });
execSync('git commit -m "chore: release"', { stdio: "inherit" });
execSync("git push", { stdio: "inherit" });
console.log("✅ Changes pushed to git");
} catch (error) {
console.error("❌ Failed to push to git");
process.exit(1);
}
}

/**
* Clean up changeset files
*/
function cleanupChangesetFiles(): void {
console.log("🧹 Cleaning up changeset files...");
try {
const changesetDir = ".changeset";
if (fs.existsSync(changesetDir)) {
const files = fs
.readdirSync(changesetDir)
.filter((file) => file.endsWith(".md") && file !== "README.md");

files.forEach((file) => {
fs.unlinkSync(path.join(changesetDir, file));
});
}
console.log("✅ Changeset files cleaned up");
} catch (error) {
console.error("❌ Failed to clean up changeset files");
process.exit(1);
}
}

/**
* Main release function
*/
Expand Down Expand Up @@ -307,12 +268,6 @@ function release(config: ReleaseConfig): void {

// Publish to npm
publishToNpm(config);
// Push changes to git
pushToGit();
cleanupChangesetFiles();

// Create git tag for the release
createGitTag(config);
}

console.log("🎉 Release completed successfully!");
Expand Down Expand Up @@ -374,7 +329,6 @@ Examples:
pnpm run release --dry-run # Dry run
pnpm run release init # Initialize changeset
pnpm run release --skip-build # Skip build step
pnpm run release tag # Create git tag
`);
process.exit(1);
}
Expand Down