@tsmodule/tsmodule 8.1.2 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -9
- package/dist/index.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
<div align="center">
|
2
|
-
<
|
2
|
+
<img src="assets/tsmodule.png">
|
3
3
|
<h3>TypeScript Module Toolkit</h3>
|
4
4
|
</div>
|
5
5
|
|
6
|
-
|
6
|
+
## Features
|
7
7
|
|
8
|
-
|
8
|
+
### Quickly create TypeScript projects with **`tsmodule create`**
|
9
9
|
|
10
10
|
Supports React via TSX/JSX. Ready with zero config:
|
11
11
|
|
@@ -13,7 +13,7 @@ Supports React via TSX/JSX. Ready with zero config:
|
|
13
13
|
- ESLint + TypeScript configs
|
14
14
|
- CI/CD with GitHub Actions
|
15
15
|
|
16
|
-
|
16
|
+
### Build TypeScript to pure ESM with **`tsmodule build`**
|
17
17
|
|
18
18
|
- No more polyfilling to CJS or older featuresets
|
19
19
|
- Use latest syntax in source, leave backporting to downstream consumers
|
@@ -74,19 +74,17 @@ in `src/pages`:
|
|
74
74
|
|
75
75
|
## Requirements
|
76
76
|
|
77
|
-
Because
|
78
|
-
supported.
|
77
|
+
Because TS modules are pure ESM environments, **Node 16+** is required.
|
79
78
|
|
80
79
|
## Installation
|
81
80
|
|
82
|
-
Install tsmodule in your project (or globally) to run or build your module:
|
81
|
+
Install `tsmodule` in your project (or globally) to run or build your module:
|
83
82
|
|
84
83
|
```shell
|
85
84
|
yarn add @tsmodule/tsmodule
|
86
85
|
```
|
87
86
|
|
88
|
-
|
89
|
-
You can build your TypeScript module to ESM with the `build` CLI command:
|
87
|
+
You can build your TS module to ESM with the `build` CLI command:
|
90
88
|
|
91
89
|
```shell
|
92
90
|
tsmodule build
|
package/dist/index.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
var t="@tsmodule/tsmodule",r="module",a="8.
|
2
|
+
var t="@tsmodule/tsmodule",r="module",a="8.2.0",s="tsmodule/tsmodule",d="TypeScript Module loader and compiler",m="MIT",c={tsmodule:"dist/index.js"},p={".":"./dist/loader/index.js","./*":"./dist/*/index.js","./package.json":"./package.json"},l="dist/types/index.d.ts",f=[{name:"C. Lewis",email:"ctj.lewis@icloud.com",url:"https://ctjlewis.com"}],u=["dist/","template/"],v={node:">=14"},g={bootstrap:"node bootstrap.js",prebuild:"yarn bootstrap",build:"node --no-warnings --loader ./dist/loader/index.js src/index.ts build",lint:"eslint --fix src",prepare:"yarn build",test:"ava --no-worker-threads"},S={"await-shell":"^2.7.0",chalk:"^5.0.0",commander:"^8.3.0","create-debug-logger":"^1.10.1",esbuild:"^0.14.0","fast-glob":"^3.2.10",ora:"^6.0.1",path:"^0.12.7",react:"^17.0.2",rollup:"^2.63.0","rollup-plugin-preserve-shebang":"^1.0.1",typescript:"^4.5.5"},w={"@types/node":"17.0.8","@types/react":"17.0.38","@typescript-eslint/eslint-plugin":"^5.9.1","@typescript-eslint/parser":"^5.9.1",ava:"^4.0.1",eslint:"^8.6.0"},C=["esm","loader","typescript","loader hook","require hook","experimental-loader"],b={files:["test/**/*.test.ts"],extensions:{ts:"module"},nodeArguments:["--no-warnings","--loader=@tsmodule/tsmodule"]},n={name:t,type:r,version:a,repository:s,description:d,license:m,bin:c,exports:p,types:l,contributors:f,files:u,engines:v,scripts:g,dependencies:S,devDependencies:w,keywords:C,ava:b};import{Command as A}from"commander";import{build as E}from"./commands/build/index.js";import{create as h}from"./commands/create/index.js";import{execute as x}from"./commands/execute/index.js";import{normalizeImportSpecifiers as y}from"./commands/normalize/index.js";const o=new A;o.command("execute <file>",{isDefault:!0}).option("--d, --dev","Enable development mode").description("Run the given TS program, analogous to `node <file>`.").action(x),o.command("build").option("-d, --dev","Build development version (default: production)").description("Builds TS files to output in dist/. (default: src/**/*.{ts,tsx})").action(async({dev:i})=>await E(i)),o.command("create <name>").description("Create a new project.").action(h),o.command("normalize [files]").description(`Rewrites import specifiers in files to ESM-compliant paths.
|
3
3
|
(default: dist/**/*.js)`).action(async({files:i})=>{await y(i)}),o.command("version").description("Print the current version.").action(()=>{console.log(typeof n=="undefined"?"Cannot read version in development mode.":`v${n.version}`)}),o.parse(process.argv);
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tsmodule/tsmodule",
|
3
3
|
"type": "module",
|
4
|
-
"version": "8.
|
4
|
+
"version": "8.2.0",
|
5
5
|
"repository": "tsmodule/tsmodule",
|
6
6
|
"description": "TypeScript Module loader and compiler",
|
7
7
|
"license": "MIT",
|
@@ -44,6 +44,7 @@
|
|
44
44
|
"esbuild": "^0.14.0",
|
45
45
|
"fast-glob": "^3.2.10",
|
46
46
|
"ora": "^6.0.1",
|
47
|
+
"path": "^0.12.7",
|
47
48
|
"react": "^17.0.2",
|
48
49
|
"rollup": "^2.63.0",
|
49
50
|
"rollup-plugin-preserve-shebang": "^1.0.1",
|