@tsmodule/tsmodule 40.0.11 → 40.0.14
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/dist/bin.d.ts +2 -0
- package/dist/bin.js +7 -0
- package/dist/commands/build/index.d.ts +1 -0
- package/dist/commands/build/index.js +6 -62
- package/dist/commands/build/lib/emitTsDeclarations.js +1 -18
- package/dist/commands/convert/index.js +1 -51
- package/dist/commands/create/index.js +1 -51
- package/dist/commands/create/lib/templates.js +1 -51
- package/dist/commands/dev/index.js +3 -66
- package/dist/commands/execute/index.js +1 -10
- package/dist/commands/index.js +1 -66
- package/dist/commands/normalize/index.js +1 -47
- package/dist/commands/normalize/lib/typescriptApi.js +1 -14
- package/dist/constants.js +1 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -89
- package/dist/loader/index.js +1 -12
- package/dist/loader/types.js +0 -3
- package/dist/specification/index.js +1 -4
- package/dist/specification/types.js +0 -3
- package/dist/types/index.js +1 -66
- package/dist/utils/cwd.js +1 -8
- package/dist/utils/packageJson.js +1 -4
- package/dist/utils/programCatch.d.ts +1 -0
- package/dist/utils/programCatch.js +1 -0
- package/dist/utils/require.js +1 -4
- package/dist/utils/resolve.js +1 -4
- package/dist/utils/showProgress.d.ts +11 -0
- package/dist/utils/showProgress.js +1 -0
- package/dist/utils/stdin.js +1 -12
- package/package.json +14 -16
- package/templates/default/.eslintrc +0 -52
- package/templates/default/.github/workflows/ci.yml +0 -30
- package/templates/default/.gitignore +0 -10
- package/templates/default/LICENSE +0 -16
- package/templates/default/README.md +0 -35
- package/templates/default/package.json +0 -5
- package/templates/default/src/index.ts +0 -4
- package/templates/default/test/example.test.ts +0 -7
- package/templates/default/tsconfig.json +0 -40
- package/templates/react/.eslintrc +0 -54
- package/templates/react/.gitignore +0 -11
- package/templates/react/LICENSE +0 -16
- package/templates/react/README.md +0 -48
- package/templates/react/next-env.d.ts +0 -5
- package/templates/react/next.config.js +0 -18
- package/templates/react/package.json +0 -5
- package/templates/react/postcss.config.js +0 -11
- package/templates/react/public/vercel.svg +0 -4
- package/templates/react/src/components/Card/index.css +0 -18
- package/templates/react/src/components/Card/index.tsx +0 -13
- package/templates/react/src/components/CardGrid/index.tsx +0 -29
- package/templates/react/src/components/Footer/index.tsx +0 -19
- package/templates/react/src/components/GetStarted/index.tsx +0 -8
- package/templates/react/src/components/Welcome/index.tsx +0 -7
- package/templates/react/src/components/index.css +0 -19
- package/templates/react/src/components/index.ts +0 -4
- package/templates/react/src/index.css +0 -20
- package/templates/react/src/index.ts +0 -1
- package/templates/react/src/pages/_app.tsx +0 -14
- package/templates/react/src/pages/api/hello.ts +0 -13
- package/templates/react/src/pages/index.tsx +0 -26
- package/templates/react/tailwind.config.js +0 -19
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import t from"chalk";import{Command as n}from"commander";import{build as r}from"./commands/build/index.js";import{convert as a}from"./commands/convert/index.js";import{create as s}from"./commands/create/index.js";import{dev as m}from"./commands/dev/index.js";import{execute as d}from"./commands/execute/index.js";import{localPackageJson as p}from"./constants.js";import{normalizeImportSpecifiers as c}from"./commands/normalize/index.js";import{programCatch as e}from"./utils/programCatch.js";const{version:l}=await p(),o=new n;o.name(t.white(t.bold("tsmodule"))).usage(t.white(t.bold("<file | command> [options]"))).description(t.blueBright(`A tool for building TypeScript modules.
|
3
|
+
|
4
|
+
Run TS directly: ${t.bold("tsmodule src/index.ts")}
|
5
|
+
Use a command: ${t.bold("tsmodule build")}`)).version(String(l)),o.command("dev").description("Build and watch for changes.").action(e(m)),o.command("build").description("Builds TS files to output in dist/.").option("-i, --input <files>","Entrypoints to compile.").option("-j, --js-only","Do not build styles").option("-s, --styles <styles>","Specify stylesheet entrypoint.").option("-t, --target <target>","ECMAScript featureset to target.").option("-b, --bundle","Bundle dependencies into entrypoints.").option("-d, --dev","Build development runtime.").option("-r, --runtime-only","Do not emit type declarations, only build JS runtime.").option("--stdin [source]","Read from a string or stdin.").option("--stdin-file [file]","File path to mock for stdin.").option("--no-write",`Return code from build() rather than write to disk.
|
6
|
+
For programmatic use alongside { stdin: ... }.`).action(e(async i=>{await r(i)})),o.command("create <name>").option("--react","Create React component library with Next.js").description("Create a new project.").action(e(s)),o.command("convert").description("Convert an existing project to a TS module.").action(e(a)),o.command("normalize [files]").description(`Rewrites import specifiers in files to ESM-compliant paths.
|
7
|
+
(default: dist/**/*.js)`).action(e(async({files:i})=>{await c(i)})),o.command("execute",{isDefault:!0}).argument("<file>","The file to execute.").option("--d, --dev","Enable development mode").description("Run the given TS program, analogous to `node <file>`.").action(e(d)),o.parse(process.argv);
|