-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish adl typescript runtime to npm
- Loading branch information
Showing
6 changed files
with
165 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm/ |
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,3 +1,4 @@ | ||
Runtime support code for the [ADL][] system. | ||
|
||
[ADL]: https://github.com/adl-lang/adl | ||
|
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,11 +1,14 @@ | ||
{ | ||
|
||
"name": "@adllang/adl-runtime", | ||
"version": "0.0.2", | ||
"license": "BSD", | ||
"exports": "./src/mod.ts", | ||
"imports": { | ||
"@adllang/jsonbinding": "jsr:@adllang/jsonbinding@^0.2.3", | ||
"@deno/dnt": "jsr:@deno/dnt@^0.41.3", | ||
"@std/encoding": "jsr:@std/encoding@^1.0.5" | ||
}, | ||
"tasks": { | ||
"build_npm": "deno run -A scripts/build_npm.ts" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,13 @@ | ||
To publish to jsr | ||
|
||
``` | ||
deno check src/mod.rs | ||
deno publish # publish to jsr | ||
``` | ||
|
||
To publish to npm | ||
|
||
``` | ||
deno task build_npm | ||
(cd npm; npm publish --access public) | ||
``` |
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,34 @@ | ||
import { build, emptyDir } from "@deno/dnt"; | ||
|
||
await emptyDir("./npm"); | ||
|
||
const version : string | undefined = JSON.parse(await Deno.readTextFile("deno.json"))['version']; | ||
if (!version) { | ||
throw new Error("can't get version from deno.json") | ||
} | ||
|
||
await build({ | ||
entryPoints: ["./src/mod.ts"], | ||
outDir: "./npm", | ||
shims: { | ||
deno: true, | ||
}, | ||
importMap: "deno.json", | ||
package: { | ||
name: "@adllang/adl-runtime", | ||
version, | ||
description: "Runtime support code for the ADL system", | ||
license: "BSD", | ||
repository: { | ||
type: "git", | ||
url: "git+https://github.com/adl-lang/adl.git", | ||
}, | ||
bugs: { | ||
url: "https://github.com/adl-lang/adl/issues", | ||
}, | ||
}, | ||
postBuild() { | ||
Deno.copyFileSync("LICENSE", "npm/LICENSE"); | ||
Deno.copyFileSync("README.md", "npm/README.md"); | ||
}, | ||
}); |