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
1,258 changes: 1,258 additions & 0 deletions packages/workspace-tools/__test__/execute.test.ts

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions packages/workspace-tools/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function generateDistPackageJson() {
'esm',
'types',
'shared',
'README.md'
],
// napi configuration for runtime binary loading
napi: pkgJson.napi,
Expand All @@ -83,6 +84,24 @@ function generateDistPackageJson() {
console.log('[build:done]', 'Generated dist/package.json with correct relative paths')
}

/**
* Copy README.md to dist folder for npm publishing.
*
* The README is included in the published package to provide documentation
* on npm and when users install the package.
*/
function copyReadme() {
const readmeSrc = nodePath.resolve('README.md')
const readmeDest = nodePath.resolve(outputDir, 'README.md')

if (fsExtra.existsSync(readmeSrc)) {
fsExtra.copyFileSync(readmeSrc, readmeDest)
console.log('[build:done]', 'Copied README.md to dist/')
} else {
console.warn('[build:warn]', 'README.md not found, skipping copy')
}
}

/**
* Generate index.d.ts that re-exports from binding.d.ts
*/
Expand Down Expand Up @@ -188,6 +207,9 @@ const configs = defineConfig([

// Generate dist/package.json with correct paths
generateDistPackageJson()

// Copy README.md to dist/
copyReadme()
},
},

Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools-darwin-arm64",
"version": "2.0.17",
"version": "2.0.18",
"cpu": [
"arm64"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools-darwin-x64",
"version": "2.0.17",
"version": "2.0.18",
"cpu": [
"x64"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools-linux-arm64-gnu",
"version": "2.0.17",
"version": "2.0.18",
"cpu": [
"arm64"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools-linux-arm64-musl",
"version": "2.0.17",
"version": "2.0.18",
"cpu": [
"arm64"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools-linux-x64-gnu",
"version": "2.0.17",
"version": "2.0.18",
"cpu": [
"x64"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools-linux-x64-musl",
"version": "2.0.17",
"version": "2.0.18",
"cpu": [
"x64"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/npm/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools-win32-arm64-msvc",
"version": "2.0.17",
"version": "2.0.18",
"cpu": [
"arm64"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools-win32-x64-msvc",
"version": "2.0.17",
"version": "2.0.18",
"cpu": [
"x64"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@websublime/workspace-tools",
"version": "2.0.17",
"version": "2.0.18",
"description": "Bindings for node from crate workspace-tools",
"main": "./dist/cjs/index.cjs",
"types": "./dist/types/index.d.cts",
Expand Down
104 changes: 52 additions & 52 deletions packages/workspace-tools/src/binding.js

Large diffs are not rendered by default.

Loading