@tsmodule/tsmodule 28.4.0 → 29.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- import a from"chalk";import{createShell as c}from"await-shell";import d from"ora";import{copyTemplate as n}from"./lib/createTemplate.js";import{rewritePkgJson as l}from"./lib/rewritePkgJson.js";globalThis.SHELL_OPTIONS={stdio:["ignore","ignore","inherit"]};const w=async(e,{react:o=!1})=>{const i=c(),s=d(`Creating new module ${a.blueBright(e)}.`).start();await n("default",e),o&&await n("react",e),await l(e),s.succeed("Project created."),process.chdir(e);const r=[],t=["@tsmodule/tsmodule"];o?(r.push("react","react-dom"),t.push("@types/react","@types/react-dom","next","eslint","eslint-config-next","tailwindcss","postcss","postcss-import","autoprefixer")):t.push("@types/node"),r.length&&await i.run(`yarn add ${r.join(" ")}`),t.length&&await i.run(`yarn add -D ${t.join(" ")}`),s.succeed("Dependencies installed."),await i.run("git init"),s.succeed("Git initialized.")};export{w as create};
1
+ import c from"chalk";import{createShell as l}from"await-shell";import d from"ora";import{dependencies as p,devDependencies as n}from"../../constants.js";import{copyTemplate as a}from"./lib/createTemplate.js";import{rewritePkgJson as u}from"./lib/rewritePkgJson.js";globalThis.SHELL_OPTIONS={stdio:["ignore","ignore","inherit"]};const D=async(e,{react:o=!1})=>{const i=l(),r=d(`Creating new module ${c.blueBright(e)}.`).start();await a("default",e),o&&await a("react",e),await u(e),r.succeed("Project created."),process.chdir(e);const s=[],t=["@tsmodule/tsmodule"];o?(s.push(...p.react),t.push(...n.react)):t.push(...n.default),s.length&&await i.run(`yarn add ${s.join(" ")}`),t.length&&await i.run(`yarn add -D ${t.join(" ")}`),r.succeed("Dependencies installed."),await i.run("git init"),r.succeed("Git initialized.")};export{D as create};
@@ -0,0 +1 @@
1
+ const t={default:[],react:["react","react-dom"]},s={default:["@types/node"],react:["next","@types/react","@types/react-dom","eslint","eslint-config-next","tailwindcss","autoprefixer","cssnano","postcss","postcss-import"]};export{t as dependencies,s as devDependencies};
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var r="@tsmodule/tsmodule",s="node",a="module",d="28.4.0",m="tsmodule/tsmodule",l="TypeScript Module loader and compiler",p="MIT",c={tsmodule:"dist/index.js"},u={".":"./dist/loader/index.js","./*":"./dist/*/index.js","./package.json":"./package.json"},f="dist/types/index.d.ts",g=[{name:"C. Lewis",email:"ctj.lewis@icloud.com",url:"https://ctjlewis.com"}],b=["dist/","templates/"],y={node:">=14"},h={bootstrap:"node bootstrap.js",bootload:"node --no-warnings --loader ./dist/loader/index.js src/index.ts build -r",prebuild:"yarn bootstrap && yarn bootload && yarn link -f",build:"tsmodule build",dev:"tsmodule dev",lint:"eslint --fix src",prepare:"yarn build -r",prepublishOnly:"yarn build && yarn test",pretest:"yarn build -r",test:"ava --no-worker-threads",retest:"SKIP_TEST_SETUP=1 yarn test"},v={"@types/glob":"^7.2.0","@types/node":"^17.0.21","@typescript-eslint/eslint-plugin":"^5.14.0","@typescript-eslint/parser":"^5.14.0",ava:"^4.1.0","await-shell":"^32.0.0",chalk:"^5.0.1",commander:"^9.0.0","create-debug-logger":"^3.0.0",esbuild:"^0.14.25",eslint:"^8.11.0","fast-glob":"^3.2.10","fs-extra":"^10.0.1",glob:"^7.2.0","node-watch":"^0.7.3",ora:"^6.1.0",path:"^0.12.7",typescript:"^4.6.2"},w=["esm","loader","typescript","loader hook","require hook","experimental-loader"],S={timeout:"10 minutes",files:["test/**/*.test.ts"],extensions:{ts:"module"},nodeArguments:["--no-warnings","--loader=@tsmodule/tsmodule"]},R={"@types/fs-extra":"^9.0.13"},n={name:r,platform:s,type:a,version:d,repository:m,description:l,license:p,bin:c,exports:u,types:f,contributors:g,files:b,engines:y,scripts:h,dependencies:v,keywords:w,ava:S,devDependencies:R};import t from"chalk";import{Command as x}from"commander";import{build as B}from"./commands/build/index.js";import{create as C}from"./commands/create/index.js";import{dev as E}from"./commands/dev/index.js";import{execute as T}from"./commands/execute/index.js";import{normalizeImportSpecifiers as A}from"./commands/normalize/index.js";const{version:j}=n,o=new x;o.name(t.white(t.bold("tsmodule"))).usage(t.white(t.bold("<file | command> [options]"))).description(t.blueBright(`A tool for building TypeScript modules.
2
+ var r="@tsmodule/tsmodule",s="node",a="module",d="29.0.0",m="tsmodule/tsmodule",l="TypeScript Module loader and compiler",p="MIT",c={tsmodule:"dist/index.js"},u={".":"./dist/loader/index.js","./*":"./dist/*/index.js","./package.json":"./package.json"},f="dist/types/index.d.ts",g=[{name:"C. Lewis",email:"ctj.lewis@icloud.com",url:"https://ctjlewis.com"}],b=["dist/","templates/"],y={node:">=14"},h={bootstrap:"node bootstrap.js",bootload:"node --no-warnings --loader ./dist/loader/index.js src/index.ts build -r",prebuild:"yarn bootstrap && yarn bootload && yarn link -f",build:"tsmodule build",dev:"tsmodule dev",lint:"eslint --fix src",prepare:"yarn build -r",prepublishOnly:"yarn build && yarn test",pretest:"yarn build -r",test:"ava --no-worker-threads",retest:"SKIP_TEST_SETUP=1 yarn test"},v={"@types/glob":"^7.2.0","@types/node":"^17.0.21","@typescript-eslint/eslint-plugin":"^5.14.0","@typescript-eslint/parser":"^5.14.0",ava:"^4.1.0","await-shell":"^32.0.0",chalk:"^5.0.1",commander:"^9.0.0","create-debug-logger":"^3.0.0",esbuild:"^0.14.25",eslint:"^8.11.0","fast-glob":"^3.2.10","fs-extra":"^10.0.1",glob:"^7.2.0","node-watch":"^0.7.3",ora:"^6.1.0",path:"^0.12.7",typescript:"^4.6.2"},w=["esm","loader","typescript","loader hook","require hook","experimental-loader"],S={timeout:"10 minutes",files:["test/**/*.test.ts"],extensions:{ts:"module"},nodeArguments:["--no-warnings","--loader=@tsmodule/tsmodule"]},R={"@types/fs-extra":"^9.0.13","eslint-config-next":"^12.1.0"},n={name:r,platform:s,type:a,version:d,repository:m,description:l,license:p,bin:c,exports:u,types:f,contributors:g,files:b,engines:y,scripts:h,dependencies:v,keywords:w,ava:S,devDependencies:R};import t from"chalk";import{Command as x}from"commander";import{build as B}from"./commands/build/index.js";import{create as C}from"./commands/create/index.js";import{dev as E}from"./commands/dev/index.js";import{execute as T}from"./commands/execute/index.js";import{normalizeImportSpecifiers as A}from"./commands/normalize/index.js";const{version:j}=n,o=new x;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
3
 
4
4
  Run TS directly: ${t.bold("tsmodule src/index.ts")}
5
5
  Use a command: ${t.bold("tsmodule build")}`)).version(String(j)),o.command("dev").description("Build and watch for changes.").action(E),o.command("build").option("--files <files>","Entrypoints to compile.\r","src/**/*").option("--styles <styles>","Specify stylesheet entrypoint.\r","src/styles/components/index.css").option("-t, --target <target>","ECMAScript featureset to target.\r","esnext").option("-b, --bundle","Bundle dependencies into entrypoints.\r",!1).option("-d, --dev","Build development runtime.\r",!1).option("-r, --runtime-only","Do not emit type declarations, only build JS runtime.\r",!1).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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tsmodule/tsmodule",
3
3
  "platform": "node",
4
4
  "type": "module",
5
- "version": "28.4.0",
5
+ "version": "29.0.0",
6
6
  "repository": "tsmodule/tsmodule",
7
7
  "description": "TypeScript Module loader and compiler",
8
8
  "license": "MIT",
@@ -84,6 +84,7 @@
84
84
  ]
85
85
  },
86
86
  "devDependencies": {
87
- "@types/fs-extra": "^9.0.13"
87
+ "@types/fs-extra": "^9.0.13",
88
+ "eslint-config-next": "^12.1.0"
88
89
  }
89
90
  }
@@ -0,0 +1,16 @@
1
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
2
+ this software and associated documentation files (the "Software"), to deal in
3
+ the Software without restriction, including without limitation the rights to
4
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
5
+ the Software, and to permit persons to whom the Software is furnished to do so,
6
+ subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all
9
+ copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
13
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
15
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
1
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
2
+ this software and associated documentation files (the "Software"), to deal in
3
+ the Software without restriction, including without limitation the rights to
4
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
5
+ the Software, and to permit persons to whom the Software is furnished to do so,
6
+ subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all
9
+ copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
13
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
15
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,7 +1,11 @@
1
1
  module.exports = {
2
2
  plugins: {
3
+ /**
4
+ * PostCSS import resolution must come first.
5
+ */
3
6
  "postcss-import": {},
4
7
  tailwindcss: {},
5
8
  autoprefixer: {},
9
+ ...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {})
6
10
  },
7
- }
11
+ };
@@ -2,11 +2,11 @@ import { Card } from "../Card";
2
2
 
3
3
  export const CardGrid = () => {
4
4
  return (
5
- <div className="grid md:grid-cols-2">
6
- <a href="https://nextjs.org/docs" className="card">
5
+ <div className="px-4 grid md:grid-cols-2 gap-8">
6
+ <Card href="https://nextjs.org/learn">
7
7
  <h4>Documentation &rarr;</h4>
8
8
  <p>Find in-depth information about Next.js features and API.</p>
9
- </a>
9
+ </Card>
10
10
 
11
11
  <Card href="https://nextjs.org/learn">
12
12
  <h4>Learn &rarr;</h4>
@@ -21,7 +21,7 @@ export const CardGrid = () => {
21
21
  <Card href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app">
22
22
  <h4>Deploy &rarr;</h4>
23
23
  <p>
24
- Instantly deploy your Next.js site to a public URL with Vercel.
24
+ Instantly deploy your Next.js site to a public URL with Vercel.
25
25
  </p>
26
26
  </Card>
27
27
  </div>
@@ -1,8 +1,8 @@
1
1
  export const GetStarted = () => {
2
2
  return (
3
- <p className="my-8 text-center md:my-16 font-size-3">
3
+ <p className="text-gray-700 text-center font-size-3">
4
4
  Get started by editing{" "}
5
- <code className="code">pages/index.js</code>
5
+ <code className="code">pages/index.js</code>.
6
6
  </p>
7
7
  );
8
8
  };
@@ -1,9 +1,9 @@
1
1
  .card {
2
- @apply m-4 p-6 text-left rounded-lg;
2
+ @apply p-6 text-left rounded-lg;
3
+ @apply max-w-[20rem];
3
4
  text-decoration: none;
4
5
  border: 1px solid #eaeaea;
5
6
  transition: color 0.15s ease, border-color 0.15s ease;
6
- /* max-width: 300px; */
7
7
  }
8
8
 
9
9
  .card:hover,
@@ -11,4 +11,8 @@
11
11
  .card:active {
12
12
  color: #0070f3;
13
13
  border-color: #0070f3;
14
+ }
15
+
16
+ .card > p {
17
+ @apply text-gray-700;
14
18
  }
@@ -60,12 +60,6 @@ h6 a {
60
60
  }
61
61
  }
62
62
 
63
- @media (min-width: 1441px) {
64
- html {
65
- font-size: 1.8em;
66
- }
67
- }
68
-
69
63
  @media (min-width: 1921px) {
70
64
  html {
71
65
  font-size: 2.5em;
@@ -108,6 +102,10 @@ h6, .h6 {
108
102
  @apply text-sm;
109
103
  }
110
104
 
105
+ p {
106
+ @apply text-base;
107
+ }
108
+
111
109
  .title {
112
110
  @apply mt-2 display font-bold;
113
111
  }
@@ -160,9 +158,9 @@ h6, .h6 {
160
158
  code {}
161
159
 
162
160
  main {
163
- /* @apply px-0 py-0; */
164
- padding: 0 !important;
165
- @apply flex-col center expanded filled gap-16;
161
+ @apply flex-center flex-col space-y-8 md:space-y-16;
162
+ @apply min-h-full w-full;
163
+ @apply px-4 py-16;
166
164
  }
167
165
 
168
166
  header {
@@ -3,7 +3,7 @@
3
3
  * styling, which it likes to do for the #__next selector.
4
4
  */
5
5
  /* purgecss start ignore */
6
- html, body, main, #__next {
6
+ html, body, #__next {
7
7
  @apply m-0 p-0 box-border;
8
8
  @apply min-h-screen;
9
9
  @apply w-full h-full;
@@ -10,8 +10,6 @@ module.exports = {
10
10
  "gradient-radial": "radial-gradient(var(--tw-gradient-stops))"
11
11
  },
12
12
  border : [ "hover"],
13
-
14
-
15
13
  },
16
14
  },
17
15
  variants: {