-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add: script of package for jsr * add: workflow of publish to jsr * fix: change directory name to include packages other than npm (`npm` -> `pkg`) * chore: add installation command from jsr.io * fix: package name of jsr.io (`clang-fmt` -> `clang-format`) * chore: Add jsr.jsonc to .npmignore * fix: Update import paths to use the "pkg" directory instead of "npm" --------- Co-authored-by: magic-akari <[email protected]>
- Loading branch information
1 parent
82de3b3
commit 9b78877
Showing
10 changed files
with
60 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -32,6 +32,6 @@ | |
*.app | ||
|
||
.DS_Store | ||
npm | ||
pkg | ||
node_modules | ||
build |
This file contains 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 +1,2 @@ | ||
*.tgz | ||
*.tgz | ||
jsr.jsonc |
This file contains 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 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 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,25 @@ | ||
#!/usr/bin/env node | ||
import process from "node:process"; | ||
import path from "node:path"; | ||
import fs from "node:fs"; | ||
|
||
const pkg_path = path.resolve(process.cwd(), process.argv[2]); | ||
const pkg_text = fs.readFileSync(pkg_path, { encoding: "utf-8" }); | ||
const pkg_json = JSON.parse(pkg_text); | ||
|
||
// JSR | ||
|
||
const jsr_path = path.resolve(pkg_path, "..", "pkg", "jsr.jsonc"); | ||
pkg_json.name = "@fmt/clang-format"; | ||
pkg_json.exports = "./clang-format.js"; | ||
pkg_json.publish = { | ||
include: [ | ||
"clang-format.js", | ||
"clang-format.d.ts", | ||
"clang-format.wasm", | ||
"jsr.jsonc", | ||
"LICENSE", | ||
"README.md", | ||
], | ||
}; | ||
fs.writeFileSync(jsr_path, JSON.stringify(pkg_json, null, 4)); |
This file contains 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 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts"; | ||
import { walk } from "https://deno.land/[email protected]/fs/walk.ts"; | ||
import { relative } from "https://deno.land/[email protected]/path/mod.ts"; | ||
import init, { format } from "../npm/clang-format.js"; | ||
import init, { format } from "../pkg/clang-format.js"; | ||
|
||
await init(); | ||
|
||
|
This file contains 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