@tsmodule/tsmodule 41.28.0 → 41.29.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/bin.js +21 -18
- package/dist/{chunk-SXU4PYPZ.js → chunk-UNZJKJGP.js} +1 -1
- package/dist/chunk-WPZUH6WI.js +79 -0
- package/dist/index.js +1 -1
- package/dist/loader/index.js +1 -1
- package/package.json +8 -9
- package/templates/default/.eslintrc.yml +15 -0
- package/templates/default/src/index.ts +2 -3
- package/templates/default/test/tsconfig.json +31 -0
- package/templates/react/.eslintrc.yml +22 -0
- package/templates/react/next.config.js +3 -16
- package/templates/react/{postcss.config.js → postcss.config.cjs} +0 -0
- package/templates/react/src/components/Card/index.tsx +4 -4
- package/templates/react/src/components/CardGrid/index.tsx +3 -3
- package/templates/react/src/components/Footer/index.tsx +4 -4
- package/templates/react/src/components/GetStarted/index.tsx +3 -3
- package/templates/react/src/components/Welcome/index.tsx +2 -2
- package/templates/react/src/components/index.ts +4 -4
- package/templates/react/src/index.ts +1 -1
- package/templates/react/src/pages/_app.tsx +6 -6
- package/templates/react/src/pages/api/hello.ts +5 -5
- package/templates/react/src/pages/index.tsx +7 -7
- package/templates/react/{tailwind.config.js → tailwind.config.cjs} +0 -0
- package/dist/chunk-6WWVW6W6.js +0 -61
- package/templates/default/.eslintrc +0 -41
- package/templates/default/tsconfig.export.json +0 -6
- package/templates/react/.eslintrc +0 -43
- package/templates/react/tsconfig.export.json +0 -6
package/dist/index.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:i}=await import("url");globalThis.__filename=i(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}
|
|
4
4
|
/** __ESM_SHIM_END */
|
|
5
5
|
|
|
6
|
-
import{c as o,d as r,e,f,g as m,h as p,k as t,l as x,m as a}from"./chunk-
|
|
6
|
+
import{c as o,d as r,e,f,g as m,h as p,k as t,l as x,m as a}from"./chunk-WPZUH6WI.js";import"./chunk-UNZJKJGP.js";export{e as bannerError,r as bannerLog,f as build,m as buildCommand,t as create,x as dev,a as execute,o as normalizeImportSpecifiers,p as specification};
|
package/dist/loader/index.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:i}=await import("url");globalThis.__filename=i(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}
|
|
4
4
|
/** __ESM_SHIM_END */
|
|
5
5
|
|
|
6
|
-
import{d as u,
|
|
6
|
+
import{d as u,g as h,h as v,k as c,l as x,m as k,n as R}from"../chunk-UNZJKJGP.js";import{extname as m,isAbsolute as F,join as S,normalize as M,resolve as T}from"path";import{posix as D}from"path";import{win32 as b}from"path";import{fileURLToPath as C,pathToFileURL as w,URL as U}from"url";import{readFile as G}from"fs/promises";import{transform as E}from"esbuild";var y=async(o,r,t)=>{let{parentURL:s}=r,e=u(y);if(e.log("Resolving specifier:",{importedFromURL:s,specifier:o}),!o.startsWith(".")&&!F(o))return e.log("Using defaultResolve for named module:",{specifier:o}),t(o,r,t);let{href:l}=w(process.cwd()),{href:i}=new U(s||l);e.log("Finding import URL for",{specifier:o,baseURL:i});let n=o;o.startsWith("file://")||(F(o)?(e.log("Setting import URL to absolute specifier."),n=w(T(M(o))).href):(e.log("Setting import URL relative to baseURL."),n=new U(o,i).href),e.log("Resolved import URL:",{importedFileURL:n,importedFromURL:s}));let d=m(s??"").toLowerCase(),f=m(n).toLowerCase();if(e.log("Rewriting file extension:",{parentExtension:d,specifierExtension:f}),f){let a=n.substring(0,n.lastIndexOf(f));if(e.log("Re-resolving specifier:",{unresolvedSpecifier:a}),v.test(f)&&h.test(d)){let L=k(a);if(L)return e.log("Found JS import in TS:",{unresolvedSpecifier:a,resolvedTsSourceFile:L}),{url:L,shortCircuit:!0}}return x(a)?(e.log("Found file at unresolved specifier:",{unresolvedSpecifier:a}),{url:a,shortCircuit:!0}):t(o,r,t)}e.log("Resolving incomplete URL import to file:",{specifier:o});let g=R(n);if(g)return e.log("Resolved import URL to file:",{resolvedFile:g}),{url:g,shortCircuit:!0};let H=new U(S(n,"index")).href,p=R(H);return p?(e.log("Resolved import URL to index file:",{resolvedIndexFile:p}),{url:p,shortCircuit:!0}):t(o,r,t)},N=async(o,r,t)=>{let s=u(N);if(s.log("Loading source file:",{url:o}),!o.includes(b.sep)&&!o.includes(D.sep))return s.log("Using defaultLoad for named module:",{url:o}),t(o,r,t);let e=m(o),l=c[e];if(!l)return s.log("No loader found, using defaultLoad:",{url:o}),t(o,r,t);let i=C(o),n=await G(i,"utf8");return{format:"module",source:(await E(n.toString(),{...l,sourcefile:i,format:"esm"})).code,shortCircuit:!0}},B=async(o,r,t)=>{let s=u(B);s.log("Getting format for source file:",{url:o});let e=m(o);return c[e]?{format:"module"}:(s.log("No loader found, using default format:",{url:o}),t(o,r,t))},O=async(o,r,t)=>{let s=u(O);s.log("Transforming source from context:",{context:r});let{url:e}=r,l=m(e),i=c[l];return i?{source:(await E(o.toString(),{...i,logLevel:"info",charset:"utf8",target:"esnext",sourcefile:r.url,format:r.format==="module"?"esm":"cjs"})).code}:(s.log("No loader found, using default transformer:",{url:e}),t(o,r,t))};export{B as getFormat,N as load,y as resolve,O as transformSource};
|
package/package.json
CHANGED
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
"name": "@tsmodule/tsmodule",
|
|
3
3
|
"platform": "node",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "41.
|
|
5
|
+
"version": "41.29.0",
|
|
6
6
|
"repository": "tsmodule/tsmodule",
|
|
7
7
|
"description": "TypeScript Module loader and compiler",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"types": "dist/types/index.d.ts",
|
|
10
10
|
"module": "dist/bin.js",
|
|
11
|
-
"bin":
|
|
12
|
-
"tsmodule": "dist/bin.js"
|
|
13
|
-
},
|
|
11
|
+
"bin": "dist/bin.js",
|
|
14
12
|
"exports": {
|
|
15
13
|
".": "./dist/bin.js",
|
|
16
14
|
"./*": "./dist/*/index.js",
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
"scripts": {
|
|
29
27
|
"prebootload": "node scripts/bootstrap.js",
|
|
30
28
|
"bootload": "node --no-warnings --loader ./dist/loader/index.js src/index.ts build -r",
|
|
31
|
-
"prebuild": "yarn bootload && npm link -f --no-save
|
|
29
|
+
"prebuild": "yarn bootload && npm link -f --no-save",
|
|
32
30
|
"build": "node dist/bin.js build --standalone \"src/{index.ts,bin.ts,loader/index.ts}\"",
|
|
33
31
|
"dev": "node dist/bin.js dev",
|
|
34
32
|
"test-bundle": "yarn build && ava",
|
|
@@ -39,7 +37,7 @@
|
|
|
39
37
|
"prepublishOnly": "node scripts/prepublish.js"
|
|
40
38
|
},
|
|
41
39
|
"dependencies": {
|
|
42
|
-
"esbuild": "^0.
|
|
40
|
+
"esbuild": "^0.17.8",
|
|
43
41
|
"typescript": "^4.9.3"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
@@ -48,9 +46,9 @@
|
|
|
48
46
|
"@typescript-eslint/eslint-plugin": "^5.44.0",
|
|
49
47
|
"@typescript-eslint/parser": "^5.44.0",
|
|
50
48
|
"assert": "^2.0.0",
|
|
51
|
-
"ava": "^5.
|
|
49
|
+
"ava": "^5.2.0",
|
|
52
50
|
"chalk": "^5.1.2",
|
|
53
|
-
"commander": "^
|
|
51
|
+
"commander": "^10.0.0",
|
|
54
52
|
"debug-logging": "^4.1.2",
|
|
55
53
|
"es-module-lexer": "^1.1.0",
|
|
56
54
|
"eslint": "^8.28.0",
|
|
@@ -89,5 +87,6 @@
|
|
|
89
87
|
"email": "ctj.lewis@icloud.com",
|
|
90
88
|
"url": "https://ctjlewis.com"
|
|
91
89
|
}
|
|
92
|
-
]
|
|
90
|
+
],
|
|
91
|
+
"packageManager": "yarn@3.4.1"
|
|
93
92
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
env:
|
|
2
|
+
es2021: true
|
|
3
|
+
node: true
|
|
4
|
+
|
|
5
|
+
extends: standard-with-typescript
|
|
6
|
+
overrides: []
|
|
7
|
+
|
|
8
|
+
parserOptions:
|
|
9
|
+
project: tsconfig.json
|
|
10
|
+
ecmaVersion: latest
|
|
11
|
+
sourceType: module
|
|
12
|
+
|
|
13
|
+
rules: {
|
|
14
|
+
"@typescript-eslint/explicit-function-return-type": off
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Test-level tsconfig.json. Files are not included in parent program.
|
|
2
|
+
{
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"strict": true,
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"lib": ["ESNext"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"target": "ESNext",
|
|
9
|
+
"checkJs": true,
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"strictBindCallApply": true,
|
|
12
|
+
"allowSyntheticDefaultImports": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
"strictFunctionTypes": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"strictNullChecks": true,
|
|
17
|
+
"noImplicitThis": true,
|
|
18
|
+
"noImplicitAny": true,
|
|
19
|
+
"alwaysStrict": true,
|
|
20
|
+
"declaration": true,
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
"jsx": "preserve",
|
|
23
|
+
},
|
|
24
|
+
"include": [
|
|
25
|
+
"./**/*"
|
|
26
|
+
],
|
|
27
|
+
"exclude": [
|
|
28
|
+
"node_modules",
|
|
29
|
+
"dist"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
env:
|
|
2
|
+
browser: true
|
|
3
|
+
es2021: true
|
|
4
|
+
node: true
|
|
5
|
+
|
|
6
|
+
extends:
|
|
7
|
+
- plugin:react/recommended
|
|
8
|
+
- standard-with-typescript
|
|
9
|
+
- next
|
|
10
|
+
|
|
11
|
+
overrides: []
|
|
12
|
+
parserOptions:
|
|
13
|
+
project: tsconfig.json
|
|
14
|
+
ecmaVersion: latest
|
|
15
|
+
sourceType: module
|
|
16
|
+
|
|
17
|
+
plugins:
|
|
18
|
+
- react
|
|
19
|
+
|
|
20
|
+
rules: {
|
|
21
|
+
"@typescript-eslint/explicit-function-return-type": off
|
|
22
|
+
}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
const nextConfig = {
|
|
2
2
|
reactStrictMode: true,
|
|
3
|
-
webpack: (config) => {
|
|
4
|
-
// config.experiments = { topLevelAwait: true };
|
|
5
|
-
// config.resolve.fallback = {
|
|
6
|
-
// assert: false,
|
|
7
|
-
// process: false,
|
|
8
|
-
// events: false,
|
|
9
|
-
// fs: false,
|
|
10
|
-
// util: false,
|
|
11
|
-
// path: false,
|
|
12
|
-
// stream: false,
|
|
13
|
-
// constants: false,
|
|
14
|
-
// os: false,
|
|
15
|
-
// };
|
|
16
|
-
return config;
|
|
17
|
-
},
|
|
18
3
|
};
|
|
4
|
+
|
|
5
|
+
export default nextConfig;
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from
|
|
1
|
+
import { type FC, type PropsWithChildren } from 'react'
|
|
2
2
|
|
|
3
3
|
interface CardProps extends PropsWithChildren {
|
|
4
|
-
href: string
|
|
4
|
+
href: string
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export const Card: FC<CardProps> = ({ href, children }) => {
|
|
@@ -9,5 +9,5 @@ export const Card: FC<CardProps> = ({ href, children }) => {
|
|
|
9
9
|
<a href={href} className="card">
|
|
10
10
|
{children}
|
|
11
11
|
</a>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Image from
|
|
1
|
+
import Image from 'next/image'
|
|
2
2
|
|
|
3
3
|
export const Footer = () => {
|
|
4
4
|
return (
|
|
@@ -9,11 +9,11 @@ export const Footer = () => {
|
|
|
9
9
|
target="_blank"
|
|
10
10
|
rel="noopener noreferrer"
|
|
11
11
|
>
|
|
12
|
-
Powered by{
|
|
12
|
+
Powered by{' '}
|
|
13
13
|
<span className="h-4 ml-2 flex-center">
|
|
14
14
|
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
|
|
15
15
|
</span>
|
|
16
16
|
</a>
|
|
17
17
|
</footer>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from './Card'
|
|
2
|
+
export * from './CardGrid'
|
|
3
|
+
export * from './GetStarted'
|
|
4
|
+
export * from './Welcome'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './components'
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../index.css'
|
|
2
2
|
|
|
3
|
-
import type { AppProps } from
|
|
4
|
-
import { StrictMode } from
|
|
3
|
+
import type { AppProps } from 'next/app'
|
|
4
|
+
import { StrictMode } from 'react'
|
|
5
5
|
|
|
6
|
-
function App({ Component, pageProps }: AppProps) {
|
|
6
|
+
function App ({ Component, pageProps }: AppProps) {
|
|
7
7
|
return (
|
|
8
8
|
<StrictMode>
|
|
9
9
|
<Component {...pageProps} />
|
|
10
10
|
</StrictMode>
|
|
11
|
-
)
|
|
11
|
+
)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export default App
|
|
14
|
+
export default App
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
|
2
|
-
import type { NextApiRequest, NextApiResponse } from
|
|
2
|
+
import type { NextApiRequest, NextApiResponse } from 'next'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface Data {
|
|
5
5
|
name: string
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
|
|
8
|
-
export default function handler(
|
|
8
|
+
export default function handler (
|
|
9
9
|
_: NextApiRequest,
|
|
10
10
|
res: NextApiResponse<Data>
|
|
11
11
|
) {
|
|
12
|
-
res.status(200).json({ name:
|
|
12
|
+
res.status(200).json({ name: 'John Doe' })
|
|
13
13
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Head from
|
|
1
|
+
import Head from 'next/head'
|
|
2
2
|
|
|
3
|
-
import { CardGrid } from
|
|
4
|
-
import { Footer } from
|
|
5
|
-
import { GetStarted } from
|
|
6
|
-
import { Welcome } from
|
|
3
|
+
import { CardGrid } from '../components/CardGrid'
|
|
4
|
+
import { Footer } from '../components/Footer'
|
|
5
|
+
import { GetStarted } from '../components/GetStarted'
|
|
6
|
+
import { Welcome } from '../components/Welcome'
|
|
7
7
|
|
|
8
|
-
export default function Home() {
|
|
8
|
+
export default function Home () {
|
|
9
9
|
return (
|
|
10
10
|
<>
|
|
11
11
|
<Head>
|
|
@@ -22,5 +22,5 @@ export default function Home() {
|
|
|
22
22
|
|
|
23
23
|
<Footer />
|
|
24
24
|
</>
|
|
25
|
-
)
|
|
25
|
+
)
|
|
26
26
|
}
|
|
File without changes
|