Skip to content

Commit fdfed6f

Browse files
ci: set dist tag from release tag. (#25)
1 parent 6d5c15a commit fdfed6f

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

.github/workflows/publish.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ jobs:
3333
uses: JS-DevTools/[email protected]
3434
with:
3535
token: ${{ secrets.NPM_AUTH_TOKEN }}
36+
tag: ${{ contains(github.ref, '-') && 'next' || 'latest' }}
3637
access: public

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Node.js tool for building a TypeScript dual package.
2121
First, install this package to create the `duel` executable inside your `node_modules/.bin` directory.
2222

2323
```console
24-
user@comp ~ $ npm i @knighted/duel
24+
user@comp ~ $ npm i @knighted/duel --save-dev
2525
```
2626

2727
Then, given a `package.json` that defines `"type": "module"` and a `tsconfig.json` file that looks something like the following:
@@ -86,7 +86,7 @@ The available options are limited, because you should define most of them inside
8686

8787
* `--project, -p` The path to the project's configuration file. Defaults to `tsconfig.json`.
8888
* `--pkg-dir, -k` The directory to start looking for a package.json file. Defaults to the cwd.
89-
* `--dirs, -d` Outputs both builds to directories inside of `outDir`. Defalts to `false`.
89+
* `--dirs, -d` Outputs both builds to directories inside of `outDir`. Defaults to `false`.
9090
* `--parallel, -l` Run the builds in parallel. Defaults to `false`.
9191

9292
You can run `duel --help` to get the same info. Below is the output of that:
@@ -106,7 +106,7 @@ Options:
106106

107107
These are definitely edge cases, and would only really come up if your project mixes file extensions. For example, if you have `.ts` files combined with `.mts`, and/or `.cts`. For most projects, things should just work as expected.
108108

109-
* This is going to work best if your CJS-first project uses file extensions in their _relative_ specifiers. This is completely acceptable in CJS projects, and [required in ESM projects](https://nodejs.org/api/esm.html#import-specifiers). This package makes no attempt to rewrite bare specifiers, or remap any relative specifiers to a directory index.
109+
* This is going to work best if your CJS-first project uses file extensions in _relative_ specifiers. This is completely acceptable in CJS projects, and [required in ESM projects](https://nodejs.org/api/esm.html#import-specifiers). This package makes no attempt to rewrite bare specifiers, or remap any relative specifiers to a directory index.
110110

111111
* Unfortunately, TypeScript doesn't really build [dual packages](https://nodejs.org/api/packages.html#dual-commonjses-module-packages) very well in regards to preserving module system by file extension. For instance, there doesn't appear to be a way to convert an arbitrary `.ts` file into another module system, _while also preserving the module system of `.mts` and `.cts` files_, without requiring **multiple** package.json files. In my opinion, the `tsc` compiler is fundamentally broken in this regard, and at best is enforcing usage patterns it shouldn't. This is only mentioned for transparency, `duel` will correct for this and produce files with the module system you would expect based on the file's extension, so that it works with [how Node.js determines module systems](https://nodejs.org/api/packages.html#determining-module-system).
112112

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@knighted/duel",
3-
"version": "1.0.0-rc.13",
3+
"version": "1.0.0",
44
"description": "TypeScript dual packages.",
55
"type": "module",
66
"main": "dist",
@@ -53,7 +53,7 @@
5353
"eslint": "^8.45.0",
5454
"eslint-plugin-n": "^16.0.1",
5555
"prettier": "^3.0.1",
56-
"typescript": "^5.2.0-dev.20230727",
56+
"typescript": "^5.3.0-dev.20230906",
5757
"vite": "^4.4.8"
5858
},
5959
"dependencies": {

0 commit comments

Comments
 (0)