-
Notifications
You must be signed in to change notification settings - Fork 3
Add npm publishing support for dual JSR and npm distribution #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
takker99
merged 5 commits into
main
from
copilot/fix-23021ea6-5d9d-44b9-9088-d6c00ca8bc47
Aug 12, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
313504d
Initial plan
Copilot a8009e2
Add npm publishing support with dual JSR+npm distribution
Copilot 1853882
Fix doc tests by adding ignore directive to README examples
Copilot 3c38461
Add Node.js & npm experimental support notice to README
Copilot ed33b8c
docs: Publish npm since 0.11.1
takker99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: [push, pull_request] | |
|
||
env: | ||
DENO_VERSION: 2.x | ||
DENO_TLS_CA_STORE: system | ||
|
||
jobs: | ||
test: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
docs/ | ||
coverage/ | ||
coverage/ | ||
npm/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { build, emptyDir } from "@deno/dnt"; | ||
|
||
await emptyDir("./npm"); | ||
|
||
await build({ | ||
entryPoints: [ | ||
{ | ||
name: "./rest", | ||
path: "./rest.ts", | ||
}, | ||
{ | ||
name: "./userscript", | ||
path: "./userscript.ts", | ||
}, | ||
{ | ||
name: "./websocket", | ||
path: "./websocket.ts", | ||
}, | ||
], | ||
outDir: "./npm", | ||
shims: { deno: "dev" }, | ||
package: { | ||
// package.json properties | ||
name: "@cosense/types", | ||
version: Deno.env.get("VERSION") ?? "0.0.0", | ||
description: "Type definitions for cosense", | ||
author: "scrapbox-jp", | ||
license: "MIT", | ||
repository: { | ||
type: "git", | ||
url: "git+https://github.com/scrapbox-jp/types.git", | ||
}, | ||
homepage: "https://github.com/scrapbox-jp/types#readme", | ||
bugs: { | ||
url: "https://github.com/scrapbox-jp/types/issues", | ||
}, | ||
keywords: [ | ||
"scrapbox", | ||
"cosense", | ||
"types", | ||
"typescript", | ||
"deno", | ||
], | ||
engines: { | ||
node: ">=16.0.0", | ||
}, | ||
}, | ||
// Don't run type checking during build to avoid Node.js compatibility issues | ||
typeCheck: false, | ||
declaration: "separate", | ||
scriptModule: false, | ||
compilerOptions: { | ||
lib: ["ESNext", "DOM", "DOM.Iterable"], | ||
target: "ES2023", | ||
}, | ||
postBuild: async () => { | ||
await Deno.copyFile("LICENSE", "npm/LICENSE"); | ||
await Deno.copyFile("README.md", "npm/README.md"); | ||
}, | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.