@tsmodule/tsmodule 41.38.0 → 41.40.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 +4 -4
- package/package.json +1 -1
- package/templates/default/.eslintrc.yml +9 -3
- package/templates/default/src/index.ts +2 -2
- package/templates/react/.eslintrc.yml +9 -3
- package/templates/react/src/components/Card/index.tsx +3 -3
- 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 +5 -5
- package/templates/react/src/pages/api/hello.ts +2 -2
- package/templates/react/src/pages/index.tsx +6 -6
package/README.md
CHANGED
@@ -107,11 +107,11 @@ With `-b, --bundle` mode, all entry points are compiled "in-place" and runtime N
|
|
107
107
|
|
108
108
|
TSModule itself builds with `-b, --bundle` flag, and requires only three runtime NPM dependencies:
|
109
109
|
|
110
|
-
1. `esbuild`, which does the heavy lifting for the build process, does not allow itself to be bundled
|
110
|
+
1. `esbuild`, which does the heavy lifting for the build process, does not allow itself to be bundled;
|
111
111
|
2. `typescript`, so TSModule can use the built `tsc` binary to generate `.d.ts`
|
112
|
-
type declarations during builds
|
113
|
-
3. `pkg`, for building binaries with `build --binary` (
|
114
|
-
|
112
|
+
type declarations during builds; and
|
113
|
+
3. `pkg`, for building binaries with `build --binary` (a specific standalone
|
114
|
+
bundle mode).
|
115
115
|
|
116
116
|
<sub>Note: Bundling every entry point in place may not be what you want, i.e. if you
|
117
117
|
only have a single entrypoint. In these cases, `tsmodule build -b src/index.ts`
|
package/package.json
CHANGED
@@ -12,6 +12,12 @@ parserOptions:
|
|
12
12
|
- tsconfig.json
|
13
13
|
- tsconfig.tests.json
|
14
14
|
|
15
|
-
rules:
|
16
|
-
"@typescript-eslint/explicit-function-return-type":
|
17
|
-
|
15
|
+
rules:
|
16
|
+
"@typescript-eslint/explicit-function-return-type":
|
17
|
+
- off
|
18
|
+
"@typescript-eslint/quotes":
|
19
|
+
- error
|
20
|
+
- double
|
21
|
+
"@typescript-eslint/semi":
|
22
|
+
- error
|
23
|
+
- always
|
@@ -1,3 +1,3 @@
|
|
1
1
|
export const helloWorld = () => {
|
2
|
-
console.log(
|
3
|
-
}
|
2
|
+
console.log("Hello World!");
|
3
|
+
};
|
@@ -19,6 +19,12 @@ parserOptions:
|
|
19
19
|
plugins:
|
20
20
|
- react
|
21
21
|
|
22
|
-
rules:
|
23
|
-
"@typescript-eslint/explicit-function-return-type":
|
24
|
-
|
22
|
+
rules:
|
23
|
+
"@typescript-eslint/explicit-function-return-type":
|
24
|
+
- off
|
25
|
+
"@typescript-eslint/quotes":
|
26
|
+
- error
|
27
|
+
- double
|
28
|
+
"@typescript-eslint/semi":
|
29
|
+
- error
|
30
|
+
- always
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { type FC, type PropsWithChildren } from
|
1
|
+
import { type FC, type PropsWithChildren } from "react";
|
2
2
|
|
3
3
|
interface CardProps extends PropsWithChildren {
|
4
4
|
href: string
|
@@ -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
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,5 +1,5 @@
|
|
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
|
@@ -9,5 +9,5 @@ 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,9 +1,9 @@
|
|
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
8
|
export default function Home () {
|
9
9
|
return (
|
@@ -22,5 +22,5 @@ export default function Home () {
|
|
22
22
|
|
23
23
|
<Footer />
|
24
24
|
</>
|
25
|
-
)
|
25
|
+
);
|
26
26
|
}
|