@tsmodule/tsmodule 10.3.0 → 15.1.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/dist/commands/build/index.js +3 -3
- package/dist/commands/create/index.js +1 -1
- package/dist/commands/create/lib/createTemplate.js +1 -0
- package/dist/commands/create/lib/rewritePkgJson.js +1 -0
- package/dist/commands/dev/index.js +2 -2
- package/dist/commands/execute/index.js +1 -1
- package/dist/index.js +5 -2
- package/dist/utils/index.js +1 -1
- package/package.json +12 -9
- package/dist/commands/build/index.d.ts +0 -11
- package/dist/commands/build/lib/emitTsDeclarations.d.ts +0 -1
- package/dist/commands/create/index.d.ts +0 -1
- package/dist/commands/dev/index.d.ts +0 -1
- package/dist/commands/execute/index.d.ts +0 -1
- package/dist/commands/normalize/index.d.ts +0 -19
- package/dist/commands/normalize/lib/typescriptApi.d.ts +0 -13
- package/dist/index.d.ts +0 -2
- package/dist/loader/index.d.ts +0 -11
- package/dist/loader/types.d.ts +0 -22
- package/dist/package.json +0 -3
- package/dist/types/index.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -27
- package/dist/utils/pkgJson.d.ts +0 -1
- package/template/.eslintrc +0 -52
- package/template/.github/workflows/ci.yml +0 -30
- package/template/.gitignore +0 -10
- package/template/README.md +0 -5
- package/template/package.json +0 -33
- package/template/src/index.ts +0 -4
- package/template/test/example.test.ts +0 -7
- package/template/tsconfig.json +0 -41
@@ -1,3 +1,3 @@
|
|
1
|
-
import{build as
|
2
|
-
`}}),
|
3
|
-
This might take a moment.`),
|
1
|
+
import{build as T}from"esbuild";import{existsSync as O,readFileSync as k,writeFileSync as x}from"fs";import{extname as B,isAbsolute as D,resolve as C,resolve as d}from"path";import m from"chalk";import{copy as P}from"fs-extra";import{env as h}from"process";import J from"fs/promises";import W from"fast-glob";import l from"ora";import{createDebugLogger as $,log as g}from"create-debug-logger";import{isJsOrTs as v,isTs as p,isTsxOrJsx as a}from"../../utils/index.js";import{emitTsDeclarations as G}from"./lib/emitTsDeclarations.js";import{getPackageJsonFile as _}from"../../utils/pkgJson.js";import{normalizeImportSpecifiers as A}from"../normalize/index.js";const E=t=>{g(m.bgBlue(m.white(` ${t} `)))},L=async({files:t="src/**/*",dev:o=!1,fast:y=!1})=>{h.NODE_ENV=o?"development":"production";const s=$(L);s.log("Building",{files:t,dev:o,fast:y}),E(`${m.bold("TS Module")} [${h.NODE_ENV}]`);const F=await _(),r=process.cwd(),S={absWorkingDir:r,outbase:"src",outdir:"dist",assetNames:"[name].js",logLevel:o?"warning":"error",charset:"utf8",format:"esm",target:"esnext",minify:!o,define:{PACKAGE_JSON:F}},f=d(r,"src"),i=d(r,"dist");if(D(t)){const e=t.replace(f,i).replace(p,".js").replace(a,".js");s.log("Cleaning emitted file:",{outfile:e}),await J.rm(e,{force:!0})}else s.log("Cleaning old output:",{outDir:i}),await J.rm(i,{force:!0,recursive:!0});console.log();const n=W.sync(t,{cwd:r}).filter(e=>B(e)!==".d.ts").map(e=>d(e)),j=n.filter(e=>p.test(e)).filter(e=>!a.test(e));s.log("Compiling TS files:",{tsFiles:j}),await T({...S,entryPoints:j.filter(e=>!e.endsWith(".d.ts"))}),l("Built TS files.").succeed();const b=n.filter(e=>a.test(e));s.log("Compiling TSX files:",{tsxFiles:b}),await T({...S,entryPoints:b.filter(e=>!e.endsWith(".d.ts")),jsxFactory:"createElement",banner:{js:`import { createElement } from "react";
|
2
|
+
`}}),l("Built TSX files.").succeed();const N=n.filter(e=>!v.test(e));if(s.log("Copying non-JS/TS files."),await Promise.all(N.map(async e=>{const w=C(r,e).replace(f,i).replace(p,".js").replace(a,".js");s.log("Copying non-source file:",{file:e,outfile:w}),await P(e,w)})),process.env.NO_REWRITES)return;const u=t.replace(f,i).replace(/^(\.\/)?src\//,"dist/").replace(p,".js").replace(a,".js");if(await A(u.endsWith(".js")?u:`${u}.js`),l("Normalized import specifiers.").succeed(),console.log(),o||y)return;E("Running post-build setup."),g(`Generating type declarations.
|
3
|
+
This might take a moment.`),G(n),l(`Generated delcarations for ${n.length} files.`).succeed();let c;O("dist/package.json")?c=JSON.parse(k("dist/package.json","utf-8")):c={},c.type="module",x("dist/package.json",JSON.stringify(c,null,2)),l('Forced "type": "module" in output.').succeed(),g(m.green("Build complete."))};export{E as bannerLog,L as build};
|
@@ -1 +1 @@
|
|
1
|
-
import
|
1
|
+
import o from"chalk";import c from"ora";import{shell as r}from"await-shell";import{createTemplate as a}from"./lib/createTemplate.js";import{rewritePkgJson as d}from"./lib/rewritePkgJson.js";globalThis.SHELL_OPTIONS={stdio:["ignore","ignore","inherit"]};const h=async(e,{react:s=!1})=>{const t=c(`Creating new module ${o.blueBright(e)}.`).start();await a("default",e),s&&await a("react",e),await d(e),t.succeed("Project created."),process.chdir(e);const i=[],n=["@tsmodule/tsmodule"];s&&(i.push("react","react-dom"),n.push("next","eslint-config-next","tailwindcss","postcss","autoprefixer")),t.start("Installing dependencies."),i.length&&await r(`yarn add ${i.join(" ")}`),n.length&&await r(`yarn add -D ${n.join(" ")}`),t.succeed("Dependencies installed."),t.start("Initializing git."),await r("git init"),t.succeed("Git initialized.")};export{h as create};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{fileURLToPath as m,URL as p}from"url";import{copy as s}from"fs-extra";import{resolve as a}from"path";const f=async(t,e)=>{const o=process.cwd(),r=new p(`../../../../templates/${t}`,import.meta.url);await s(m(r),a(o,e))};export{f as createTemplate};
|
@@ -0,0 +1 @@
|
|
1
|
+
import o from"fs/promises";import{resolve as t}from"path";const p=async s=>{const a=t(process.cwd(),s,"package.json"),n=await o.readFile(a,"utf-8"),e=JSON.parse(n);e.name=s,await o.writeFile(a,JSON.stringify(e,null,2))};export{p as rewritePkgJson};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import{relative as a,resolve as m}from"path";import{build as o}from"../build/index.js";import e from"chalk";import{log as l}from"create-debug-logger";import p from"ora";import{
|
1
|
+
import{relative as a,resolve as m}from"path";import{build as o}from"../build/index.js";import e from"chalk";import{log as l}from"create-debug-logger";import p from"ora";import{shell as d}from"await-shell";import u from"node-watch";const s=()=>{console.clear()},i=r=>{l(`
|
2
2
|
`,e.gray(`Built ${e.bold(r)}.`),`
|
3
|
-
`,e.blue(new Date().toLocaleString()))},
|
3
|
+
`,e.blue(new Date().toLocaleString()))},B=async()=>{const r=process.cwd();await d("clear"),s(),await o({dev:!0}),i("src/**/*"),u(m(r,"src"),{recursive:!0,persistent:!0}).on("change",async(f,t)=>{s();const c=Date.now();await o({dev:!0,files:t});const n=Date.now()-c;p(e.blueBright(`Dev refresh finished in ${e.bold(`${n}ms`)}.`)).succeed(),i(a(r,t))})};export{B as dev};
|
@@ -1 +1 @@
|
|
1
|
-
import{URL as
|
1
|
+
import{URL as n}from"url";import{shell as s}from"await-shell";const l=async()=>{const e=import.meta.url,o=new n("../../../dist/loader/index.js",e),r=["--no-warnings","--loader",o.href,...process.argv.slice(2)];await s(`node ${r.join(" ")}`)};export{l as execute};
|
package/dist/index.js
CHANGED
@@ -1,3 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
var r="@tsmodule/tsmodule",a="module",m="
|
3
|
-
|
2
|
+
var r="@tsmodule/tsmodule",a="module",m="15.1.0",d="tsmodule/tsmodule",s="TypeScript Module loader and compiler",l="MIT",c={tsmodule:"dist/index.js"},p={".":"./dist/loader/index.js","./*":"./dist/*/index.js","./package.json":"./package.json"},u="dist/types/index.d.ts",f=[{name:"C. Lewis",email:"ctj.lewis@icloud.com",url:"https://ctjlewis.com"}],b=["dist/","template/"],v={node:">=14"},g={bootstrap:"node bootstrap.js",bootload:"node --no-warnings --loader ./dist/loader/index.js src/index.ts build -f",prebuild:"yarn bootstrap && yarn bootload && yarn link -f",build:"tsmodule build",dev:"tsmodule dev",lint:"eslint --fix src",prepare:"yarn build -f",prepublishOnly:"yarn build && yarn test",pretest:"yarn build -f",test:"ava --no-worker-threads"},h={"@types/node":"^17.0.15","@types/react":"^17.0.39","@types/react-dom":"^17.0.11","@typescript-eslint/eslint-plugin":"^5.9.1","@typescript-eslint/parser":"^5.9.1",ava:"^4.0.1","await-shell":"^16.0.0",chalk:"^5.0.0",commander:"^8.3.0","create-debug-logger":"^1.10.1",esbuild:"^0.14.0",eslint:"^8.8.0","fast-glob":"^3.2.10","fs-extra":"^10.0.0","node-watch":"^0.7.3",ora:"^6.0.1",path:"^0.12.7",typescript:"^4.5.5"},S=["esm","loader","typescript","loader hook","require hook","experimental-loader"],w={timeout:"10 minutes",files:["test/**/*.test.ts"],extensions:{ts:"module"},nodeArguments:["--no-warnings","--loader=@tsmodule/tsmodule"]},y={"@types/fs-extra":"^9.0.13"},t={name:r,type:a,version:m,repository:d,description:s,license:l,bin:c,exports:p,types:u,contributors:f,files:b,engines:v,scripts:g,dependencies:h,keywords:S,ava:w,devDependencies:y};import e from"chalk";import{Command as T}from"commander";import{build as B}from"./commands/build/index.js";import{create as C}from"./commands/create/index.js";import{dev as R}from"./commands/dev/index.js";import{execute as j}from"./commands/execute/index.js";import{normalizeImportSpecifiers as x}from"./commands/normalize/index.js";const{version:A}=t,i=new T;i.name(e.white(e.bold("tsmodule"))).usage(e.white(e.bold("<file | command> [options]"))).description(e.blueBright(`A tool for building TypeScript modules.
|
3
|
+
|
4
|
+
Run TS directly: ${e.bold("tsmodule src/index.ts")}
|
5
|
+
Use a command: ${e.bold("tsmodule build")}`)).version(String(A)),i.command("dev").description("Build and watch for changes.").action(R),i.command("build").option("--files <files>","The files to build (default: all)").option("-d, --dev","Build development version").option("-f, --fast","Do not emit type declarations, only transform to JS").description("Builds TS files to output in dist/.").action(B),i.command("create <name>").option("--react","Create React component library with Next.js").description("Create a new project.").action(C),i.command("normalize [files]").description(`Rewrites import specifiers in files to ESM-compliant paths.
|
6
|
+
(default: dist/**/*.js)`).action(async({files:n})=>{await x(n)}),i.command("run",{isDefault:!0}).argument("<file>","The file to run.").option("--d, --dev","Enable development mode").description("Run the given TS program, analogous to `node <file>`.").action(j),i.parse(process.argv);
|
package/dist/utils/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{existsSync as i}from"fs";import{fileURLToPath as c}from"url";import{posix as
|
1
|
+
import{existsSync as i}from"fs";import{fileURLToPath as c}from"url";import{posix as x}from"path";import{sep as p}from"path";const O=!1,h=/\.[mc]?tsx?(?=\?|$)/,S=/\.([mc])?js$/,L=/\.([mc])?[tj]sx$/,M=/\.([mc])?[tj]sx?$/,e={format:"esm",charset:"utf8",sourcemap:"inline",target:"node16",minify:!1},a={".mts":{...e,loader:"ts"},".jsx":{...e,loader:"jsx"},".tsx":{...e,loader:"tsx"},".cts":{...e,loader:"ts"},".ts":{...e,loader:"ts"},".json":{...e,loader:"json"}},n=Object.keys(a),T=s=>s.split(p).join(x.sep),l=s=>{const t=c(s);if(i(t))return s},r=s=>{for(const t of s)if(l(t))return t},m=s=>{const t=n.filter(o=>o.includes("ts")).concat([".js"]);return r(t.map(o=>s+o))},f=s=>{const t=n.filter(o=>o.includes("js")).concat([".js"]);return r(t.map(o=>s+o))},y=s=>{const t=f(s);if(t)return t;const o=m(s);if(o)return o};export{e as BASE_CONFIG,O as DEVELOPMENT_MODE,a as MODULE_LOADERS,n as POSSIBLE_EXTENSIONS,y as checkExtensions,f as checkJsExtension,m as checkTsExtensions,l as fileExists,r as fileExistsAny,S as isJs,M as isJsOrTs,h as isTs,L as isTsxOrJsx,T as normalizeSpecifier};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tsmodule/tsmodule",
|
3
3
|
"type": "module",
|
4
|
-
"version": "
|
4
|
+
"version": "15.1.0",
|
5
5
|
"repository": "tsmodule/tsmodule",
|
6
6
|
"description": "TypeScript Module loader and compiler",
|
7
7
|
"license": "MIT",
|
@@ -37,27 +37,27 @@
|
|
37
37
|
"lint": "eslint --fix src",
|
38
38
|
"prepare": "yarn build -f",
|
39
39
|
"prepublishOnly": "yarn build && yarn test",
|
40
|
+
"pretest": "yarn build -f",
|
40
41
|
"test": "ava --no-worker-threads"
|
41
42
|
},
|
42
43
|
"dependencies": {
|
43
|
-
"@types/
|
44
|
-
"@types/
|
45
|
-
"@types/react": "17.0.
|
44
|
+
"@types/node": "^17.0.15",
|
45
|
+
"@types/react": "^17.0.39",
|
46
|
+
"@types/react-dom": "^17.0.11",
|
46
47
|
"@typescript-eslint/eslint-plugin": "^5.9.1",
|
47
48
|
"@typescript-eslint/parser": "^5.9.1",
|
48
49
|
"ava": "^4.0.1",
|
49
|
-
"await-shell": "^
|
50
|
+
"await-shell": "^16.0.0",
|
50
51
|
"chalk": "^5.0.0",
|
51
|
-
"chokidar": "^3.5.3",
|
52
52
|
"commander": "^8.3.0",
|
53
53
|
"create-debug-logger": "^1.10.1",
|
54
|
-
"cross-spawn": "^7.0.3",
|
55
54
|
"esbuild": "^0.14.0",
|
56
|
-
"eslint": "^8.
|
55
|
+
"eslint": "^8.8.0",
|
57
56
|
"fast-glob": "^3.2.10",
|
57
|
+
"fs-extra": "^10.0.0",
|
58
|
+
"node-watch": "^0.7.3",
|
58
59
|
"ora": "^6.0.1",
|
59
60
|
"path": "^0.12.7",
|
60
|
-
"react": "^17.0.2",
|
61
61
|
"typescript": "^4.5.5"
|
62
62
|
},
|
63
63
|
"keywords": [
|
@@ -80,5 +80,8 @@
|
|
80
80
|
"--no-warnings",
|
81
81
|
"--loader=@tsmodule/tsmodule"
|
82
82
|
]
|
83
|
+
},
|
84
|
+
"devDependencies": {
|
85
|
+
"@types/fs-extra": "^9.0.13"
|
83
86
|
}
|
84
87
|
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
export declare const bannerLog: (msg: string) => void;
|
2
|
-
/**
|
3
|
-
* Build TS to JS. This will contain incomplete specifiers like `./foo` which
|
4
|
-
* could mean many things, all of which is handled by the loader which will
|
5
|
-
* resolve them for us.
|
6
|
-
*/
|
7
|
-
export declare const build: ({ files, dev, fast }: {
|
8
|
-
files?: string;
|
9
|
-
dev?: boolean;
|
10
|
-
fast?: boolean;
|
11
|
-
}) => Promise<void>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const emitTsDeclarations: (files: string[]) => void;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const create: (name: string) => Promise<void>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const dev: () => Promise<void>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const execute: () => void;
|
@@ -1,19 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @fileoverview
|
3
|
-
* This module contains the logic for normalizing import specifiers. It must use
|
4
|
-
* fully-specified filepaths here, since the bootstrap script will compile it
|
5
|
-
* with esbuild and then use it to normalize emitted output.
|
6
|
-
*/
|
7
|
-
/**
|
8
|
-
* Matches a complete import statement, including the import keyword, as well as
|
9
|
-
* dynamic imports, requires, and export statements.
|
10
|
-
*/
|
11
|
-
export declare const generateImportPattern: (importSource: string) => RegExp;
|
12
|
-
/**
|
13
|
-
* Rewrite an import/export/require statement.
|
14
|
-
*/
|
15
|
-
export declare const rewriteImportStatement: (importStatement: string, specifierToReplace: string, specifierReplacement: string) => string;
|
16
|
-
/**
|
17
|
-
* Rewrite imports in the emitted JS to ESM-compliant paths.
|
18
|
-
*/
|
19
|
-
export declare const normalizeImportSpecifiers: (files?: string) => Promise<any>;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import ts from "typescript";
|
2
|
-
export declare const TS_CONFIG: ts.CompilerOptions;
|
3
|
-
export declare const compilerHost: ts.CompilerHost;
|
4
|
-
interface SpecifierReplacement {
|
5
|
-
specifierToReplace: string;
|
6
|
-
specifierReplacement: string;
|
7
|
-
}
|
8
|
-
/**
|
9
|
-
* Get the rewritten specifiers for a given module. Import/export specifiers
|
10
|
-
* will be resolved ahead-of-time by the TypeScript compiler and returned.
|
11
|
-
*/
|
12
|
-
export declare const getRewrittenSpecifiers: (modulePath: string) => SpecifierReplacement[];
|
13
|
-
export {};
|
package/dist/index.d.ts
DELETED
package/dist/loader/index.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { GetFormatHook as ModuleGetFormatHook, LoadHook as ModuleLoadHook, ResolveHook as ModuleResolveHook, TransformHook as ModuleTransformSourceHook } from "./types";
|
2
|
-
export declare const resolve: ModuleResolveHook;
|
3
|
-
export declare const load: ModuleLoadHook;
|
4
|
-
/**
|
5
|
-
* @deprecated As of Node 17.
|
6
|
-
*/
|
7
|
-
export declare const getFormat: ModuleGetFormatHook;
|
8
|
-
/**
|
9
|
-
* @deprecated As of Node 17.
|
10
|
-
*/
|
11
|
-
export declare const transformSource: ModuleTransformSourceHook;
|
package/dist/loader/types.d.ts
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
export declare type Promisable<T> = Promise<T> | T;
|
2
|
-
export declare type ModuleSource = string | SharedArrayBuffer | Uint8Array;
|
3
|
-
export declare type ModuleFormat = "builtin" | "commonjs" | "json" | "module" | "wasm";
|
4
|
-
export declare type ResolveHook = (specifier: string, context: {
|
5
|
-
conditions: string[];
|
6
|
-
parentURL?: string;
|
7
|
-
}, fallback: ResolveHook) => Promisable<{
|
8
|
-
url: string;
|
9
|
-
format?: ModuleFormat;
|
10
|
-
}>;
|
11
|
-
export declare type GetFormatHook = (url: string, context: object, fallback: GetFormatHook) => Promisable<{
|
12
|
-
format: ModuleFormat;
|
13
|
-
}>;
|
14
|
-
export declare type TransformHook = (source: ModuleSource, context: Record<"url" | "format", string>, fallback: TransformHook) => Promisable<{
|
15
|
-
source: ModuleSource;
|
16
|
-
}>;
|
17
|
-
export declare type LoadHook = (url: string, context: {
|
18
|
-
format?: ModuleFormat;
|
19
|
-
}, fallback: LoadHook) => Promisable<{
|
20
|
-
format: ModuleFormat;
|
21
|
-
source: ModuleSource;
|
22
|
-
}>;
|
package/dist/package.json
DELETED
package/dist/types/index.d.ts
DELETED
package/dist/utils/index.d.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
export declare const DEVELOPMENT_MODE: boolean;
|
2
|
-
export declare const isTs: RegExp;
|
3
|
-
export declare const isJs: RegExp;
|
4
|
-
export declare const isTsxOrJsx: RegExp;
|
5
|
-
export declare const BASE_CONFIG: {
|
6
|
-
format: string;
|
7
|
-
charset: string;
|
8
|
-
sourcemap: string;
|
9
|
-
target: string;
|
10
|
-
minify: boolean;
|
11
|
-
};
|
12
|
-
export declare type ModuleLoaders = {
|
13
|
-
[extension: string]: {
|
14
|
-
[configKey: string]: unknown;
|
15
|
-
};
|
16
|
-
};
|
17
|
-
export declare const MODULE_LOADERS: ModuleLoaders;
|
18
|
-
export declare const POSSIBLE_EXTENSIONS: string[];
|
19
|
-
/**
|
20
|
-
* Force a Unix-like path.
|
21
|
-
*/
|
22
|
-
export declare const normalizeSpecifier: (specifier: string) => string;
|
23
|
-
export declare const fileExists: (fileUrl: string) => string | void;
|
24
|
-
export declare const fileExistsAny: (fileUrls: string[]) => string | void;
|
25
|
-
export declare const checkTsExtensions: (specifier: string) => string | void;
|
26
|
-
export declare const checkJsExtension: (specifier: string) => string | void;
|
27
|
-
export declare const checkExtensions: (specifier: string) => string;
|
package/dist/utils/pkgJson.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const getPackageJsonFile: () => Promise<string>;
|
package/template/.eslintrc
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": [
|
3
|
-
"plugin:@typescript-eslint/recommended"
|
4
|
-
],
|
5
|
-
"parser": "@typescript-eslint/parser",
|
6
|
-
"plugins": ["@typescript-eslint"],
|
7
|
-
"rules": {
|
8
|
-
|
9
|
-
"no-console": "error",
|
10
|
-
"no-trailing-spaces": "error",
|
11
|
-
"max-len": [1, 80, 2, {
|
12
|
-
"ignorePattern": "^import\\s.+\\sfrom\\s.+;$",
|
13
|
-
"ignoreUrls": true,
|
14
|
-
"ignoreStrings": true,
|
15
|
-
"ignoreTemplateLiterals": true,
|
16
|
-
"ignoreRegExpLiterals": true
|
17
|
-
}],
|
18
|
-
|
19
|
-
"@typescript-eslint/type-annotation-spacing": ["error"],
|
20
|
-
|
21
|
-
"@typescript-eslint/ban-ts-comment": [
|
22
|
-
"error",
|
23
|
-
{
|
24
|
-
"ts-nocheck": "allow-with-description",
|
25
|
-
"ts-ignore": "allow-with-description"
|
26
|
-
}
|
27
|
-
],
|
28
|
-
|
29
|
-
"indent": "off",
|
30
|
-
"@typescript-eslint/indent": ["error", 2],
|
31
|
-
|
32
|
-
"semi": "off",
|
33
|
-
"@typescript-eslint/semi": ["error", "always"],
|
34
|
-
|
35
|
-
"quotes": "off",
|
36
|
-
"@typescript-eslint/quotes": ["error", "double"],
|
37
|
-
|
38
|
-
"object-curly-spacing": "off",
|
39
|
-
"@typescript-eslint/object-curly-spacing": ["error", "always"],
|
40
|
-
|
41
|
-
"sort-imports": [
|
42
|
-
"warn",
|
43
|
-
{
|
44
|
-
"ignoreCase": false,
|
45
|
-
"ignoreDeclarationSort": false,
|
46
|
-
"ignoreMemberSort": true,
|
47
|
-
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
|
48
|
-
"allowSeparatedGroups": true
|
49
|
-
}
|
50
|
-
]
|
51
|
-
}
|
52
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
name: CI
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches:
|
6
|
-
- '**'
|
7
|
-
pull_request:
|
8
|
-
branches:
|
9
|
-
- '**'
|
10
|
-
|
11
|
-
jobs:
|
12
|
-
test:
|
13
|
-
name: Node ${{ matrix.nodejs }} on ${{ matrix.os }}
|
14
|
-
runs-on: ${{ matrix.os }}
|
15
|
-
timeout-minutes: 10
|
16
|
-
strategy:
|
17
|
-
matrix:
|
18
|
-
nodejs: [14, 16, "lts/*"]
|
19
|
-
os: [ubuntu-latest, windows-latest, macos-latest]
|
20
|
-
steps:
|
21
|
-
- uses: actions/checkout@v2
|
22
|
-
- uses: actions/setup-node@v2
|
23
|
-
with:
|
24
|
-
node-version: ${{ matrix.nodejs }}
|
25
|
-
|
26
|
-
- name: Install and link
|
27
|
-
run: yarn install --frozen-lockfile && yarn build
|
28
|
-
|
29
|
-
- name: Test
|
30
|
-
run: yarn test
|
package/template/.gitignore
DELETED
package/template/README.md
DELETED
package/template/package.json
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "template",
|
3
|
-
"type": "module",
|
4
|
-
"version": "0.0.1",
|
5
|
-
"license": "MIT",
|
6
|
-
"types": "dist/index.d.ts",
|
7
|
-
"files": [
|
8
|
-
"dist"
|
9
|
-
],
|
10
|
-
"exports": {
|
11
|
-
"./package.json": "./package.json",
|
12
|
-
".": "./dist/index.js",
|
13
|
-
"./*": "./dist/*/index.js"
|
14
|
-
},
|
15
|
-
"scripts": {
|
16
|
-
"build": "tsmodule build",
|
17
|
-
"test": "ava",
|
18
|
-
"lint": "eslint src --fix"
|
19
|
-
},
|
20
|
-
"ava": {
|
21
|
-
"timout": 240000,
|
22
|
-
"files": [
|
23
|
-
"test/**/*.test.ts"
|
24
|
-
],
|
25
|
-
"extensions": {
|
26
|
-
"ts": "module"
|
27
|
-
},
|
28
|
-
"nodeArguments": [
|
29
|
-
"--no-warnings",
|
30
|
-
"--loader=@tsmodule/tsmodule"
|
31
|
-
]
|
32
|
-
}
|
33
|
-
}
|
package/template/src/index.ts
DELETED
package/template/tsconfig.json
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"include": [
|
3
|
-
"*env.d.ts",
|
4
|
-
"src/**/*"
|
5
|
-
],
|
6
|
-
"exclude": [
|
7
|
-
"node_modules",
|
8
|
-
"test/**"
|
9
|
-
],
|
10
|
-
"compilerOptions": {
|
11
|
-
"moduleResolution": "Node",
|
12
|
-
"target": "ESNext",
|
13
|
-
"module": "ESNext",
|
14
|
-
"lib": [
|
15
|
-
"DOM",
|
16
|
-
"DOM.Iterable",
|
17
|
-
"ESNext"
|
18
|
-
],
|
19
|
-
"jsx": "preserve",
|
20
|
-
"rootDir": "src",
|
21
|
-
"outDir": "dist",
|
22
|
-
"allowJs": true,
|
23
|
-
"importHelpers": true,
|
24
|
-
"esModuleInterop": true,
|
25
|
-
"allowSyntheticDefaultImports": true,
|
26
|
-
"strict": true,
|
27
|
-
"noUnusedLocals": true,
|
28
|
-
"noUnusedParameters": true,
|
29
|
-
"noImplicitReturns": true,
|
30
|
-
"noFallthroughCasesInSwitch": true,
|
31
|
-
"skipLibCheck": true,
|
32
|
-
"resolveJsonModule": true,
|
33
|
-
"declaration": true,
|
34
|
-
"sourceMap": true,
|
35
|
-
"checkJs": true,
|
36
|
-
"noEmit": false,
|
37
|
-
"forceConsistentCasingInFileNames": true,
|
38
|
-
"isolatedModules": true,
|
39
|
-
"incremental": false
|
40
|
-
}
|
41
|
-
}
|