@lytjs/cli 3.2.3 → 3.2.5
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/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -258,7 +258,7 @@ a:hover {
|
|
|
258
258
|
<text x="16" y="22" text-anchor="middle" fill="white" font-size="18" font-weight="bold">L</text>
|
|
259
259
|
</svg>
|
|
260
260
|
`}function ke(){return JSON.stringify({root:!0,env:{browser:!0,es2021:!0,node:!0},extends:["eslint:recommended"],parserOptions:{ecmaVersion:"latest",sourceType:"module"},rules:{"no-unused-vars":"warn","no-console":"warn"}},null,2)+`
|
|
261
|
-
`}async function L(e){let{name:o,template:n,ts:r,router:s,store:a,eslint:u}=e,l=D.resolve(process.cwd(),o);if(i.info(`\u6B63\u5728\u521B\u5EFA Lyt \u9879\u76EE: ${t(o,"brightCyan")}`),i.info(`\u4F7F\u7528\u6A21\u677F: ${t(n,"brightCyan")}`),F(l))throw i.error(`\u76EE\u5F55 "${o}" \u5DF2\u5B58\u5728\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6\u540D\u79F0\u6216\u5220\u9664\u5DF2\u6709\u76EE\u5F55`),new Error(`Directory "${o}" already exists`);$(l);let c=[{filePath:"package.json",content:ve(e)},{filePath:"index.html",content:we(e)},{filePath:"lytx.config.ts",content:Se(e)},{filePath:"src/main.ts",content:Ce(e)},{filePath:"src/App.lyt",content:je()},{filePath:"src/pages/index.ts",content:Me()},{filePath:"src/pages/about.ts",content:Pe()},{filePath:"src/components/Header.ts",content:Re()},{filePath:"src/styles/main.css",content:Ee()},{filePath:"public/favicon.svg",content:Fe()}];r&&c.push({filePath:"tsconfig.json",content:$e(e)}),s&&c.push({filePath:"src/router/index.ts",content:He()}),a&&c.push({filePath:"src/store/index.ts",content:Ae()}),u&&c.push({filePath:".eslintrc.json",content:ke()});for(let p of c){let d=D.join(l,p.filePath);S(d,p.content),i.success(` \u521B\u5EFA ${p.filePath}`)}console.log(""),i.success(`\u9879\u76EE ${t(o,"brightCyan")} \u521B\u5EFA\u6210\u529F\uFF01`),console.log(""),console.log(" \u8BF7\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u542F\u52A8\u9879\u76EE\uFF1A"),console.log(""),console.log(` ${t("cd","brightGreen")} ${o}`),console.log(` ${t("npm install","brightGreen")}`),console.log(` ${t("npm run dev","brightGreen")}`),console.log("")}var K=m(require("
|
|
261
|
+
`}async function L(e){let{name:o,template:n,ts:r,router:s,store:a,eslint:u}=e,l=D.resolve(process.cwd(),o);if(i.info(`\u6B63\u5728\u521B\u5EFA Lyt \u9879\u76EE: ${t(o,"brightCyan")}`),i.info(`\u4F7F\u7528\u6A21\u677F: ${t(n,"brightCyan")}`),F(l))throw i.error(`\u76EE\u5F55 "${o}" \u5DF2\u5B58\u5728\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6\u540D\u79F0\u6216\u5220\u9664\u5DF2\u6709\u76EE\u5F55`),new Error(`Directory "${o}" already exists`);$(l);let c=[{filePath:"package.json",content:ve(e)},{filePath:"index.html",content:we(e)},{filePath:"lytx.config.ts",content:Se(e)},{filePath:"src/main.ts",content:Ce(e)},{filePath:"src/App.lyt",content:je()},{filePath:"src/pages/index.ts",content:Me()},{filePath:"src/pages/about.ts",content:Pe()},{filePath:"src/components/Header.ts",content:Re()},{filePath:"src/styles/main.css",content:Ee()},{filePath:"public/favicon.svg",content:Fe()}];r&&c.push({filePath:"tsconfig.json",content:$e(e)}),s&&c.push({filePath:"src/router/index.ts",content:He()}),a&&c.push({filePath:"src/store/index.ts",content:Ae()}),u&&c.push({filePath:".eslintrc.json",content:ke()});for(let p of c){let d=D.join(l,p.filePath);S(d,p.content),i.success(` \u521B\u5EFA ${p.filePath}`)}console.log(""),i.success(`\u9879\u76EE ${t(o,"brightCyan")} \u521B\u5EFA\u6210\u529F\uFF01`),console.log(""),console.log(" \u8BF7\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u542F\u52A8\u9879\u76EE\uFF1A"),console.log(""),console.log(` ${t("cd","brightGreen")} ${o}`),console.log(` ${t("npm install","brightGreen")}`),console.log(` ${t("npm run dev","brightGreen")}`),console.log("")}var K=m(require("http")),B=m(require("fs")),M=m(require("path"));var J=m(require("http")),j=m(require("fs")),b=m(require("path")),q=m(require("crypto")),O=class{constructor(){this.clients=[]}handleUpgrade(o,n,r){let s=o.headers["sec-websocket-key"];if(!s){n.destroy();return}let a=q.createHash("sha1").update(s+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11").digest("base64");n.write(`HTTP/1.1 101 Switching Protocols\r
|
|
262
262
|
Upgrade: websocket\r
|
|
263
263
|
Connection: Upgrade\r
|
|
264
264
|
Sec-WebSocket-Accept: ${a}\r
|
package/dist/index.mjs
CHANGED
|
@@ -258,7 +258,7 @@ a:hover {
|
|
|
258
258
|
<text x="16" y="22" text-anchor="middle" fill="white" font-size="18" font-weight="bold">L</text>
|
|
259
259
|
</svg>
|
|
260
260
|
`}function Se(){return JSON.stringify({root:!0,env:{browser:!0,es2021:!0,node:!0},extends:["eslint:recommended"],parserOptions:{ecmaVersion:"latest",sourceType:"module"},rules:{"no-unused-vars":"warn","no-console":"warn"}},null,2)+`
|
|
261
|
-
`}async function O(e){let{name:o,template:n,ts:r,router:i,store:a,eslint:u}=e,l=k.resolve(process.cwd(),o);if(s.info(`\u6B63\u5728\u521B\u5EFA Lyt \u9879\u76EE: ${t(o,"brightCyan")}`),s.info(`\u4F7F\u7528\u6A21\u677F: ${t(n,"brightCyan")}`),A(l))throw s.error(`\u76EE\u5F55 "${o}" \u5DF2\u5B58\u5728\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6\u540D\u79F0\u6216\u5220\u9664\u5DF2\u6709\u76EE\u5F55`),new Error(`Directory "${o}" already exists`);v(l);let c=[{filePath:"package.json",content:pe(e)},{filePath:"index.html",content:de(e)},{filePath:"lytx.config.ts",content:fe(e)},{filePath:"src/main.ts",content:ge(e)},{filePath:"src/App.lyt",content:me()},{filePath:"src/pages/index.ts",content:he()},{filePath:"src/pages/about.ts",content:ye()},{filePath:"src/components/Header.ts",content:be()},{filePath:"src/styles/main.css",content:$e()},{filePath:"public/favicon.svg",content:we()}];r&&c.push({filePath:"tsconfig.json",content:ue(e)}),i&&c.push({filePath:"src/router/index.ts",content:xe()}),a&&c.push({filePath:"src/store/index.ts",content:ve()}),u&&c.push({filePath:".eslintrc.json",content:Se()});for(let p of c){let d=k.join(l,p.filePath);w(d,p.content),s.success(` \u521B\u5EFA ${p.filePath}`)}console.log(""),s.success(`\u9879\u76EE ${t(o,"brightCyan")} \u521B\u5EFA\u6210\u529F\uFF01`),console.log(""),console.log(" \u8BF7\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u542F\u52A8\u9879\u76EE\uFF1A"),console.log(""),console.log(` ${t("cd","brightGreen")} ${o}`),console.log(` ${t("npm install","brightGreen")}`),console.log(` ${t("npm run dev","brightGreen")}`),console.log("")}import*as J from"
|
|
261
|
+
`}async function O(e){let{name:o,template:n,ts:r,router:i,store:a,eslint:u}=e,l=k.resolve(process.cwd(),o);if(s.info(`\u6B63\u5728\u521B\u5EFA Lyt \u9879\u76EE: ${t(o,"brightCyan")}`),s.info(`\u4F7F\u7528\u6A21\u677F: ${t(n,"brightCyan")}`),A(l))throw s.error(`\u76EE\u5F55 "${o}" \u5DF2\u5B58\u5728\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6\u540D\u79F0\u6216\u5220\u9664\u5DF2\u6709\u76EE\u5F55`),new Error(`Directory "${o}" already exists`);v(l);let c=[{filePath:"package.json",content:pe(e)},{filePath:"index.html",content:de(e)},{filePath:"lytx.config.ts",content:fe(e)},{filePath:"src/main.ts",content:ge(e)},{filePath:"src/App.lyt",content:me()},{filePath:"src/pages/index.ts",content:he()},{filePath:"src/pages/about.ts",content:ye()},{filePath:"src/components/Header.ts",content:be()},{filePath:"src/styles/main.css",content:$e()},{filePath:"public/favicon.svg",content:we()}];r&&c.push({filePath:"tsconfig.json",content:ue(e)}),i&&c.push({filePath:"src/router/index.ts",content:xe()}),a&&c.push({filePath:"src/store/index.ts",content:ve()}),u&&c.push({filePath:".eslintrc.json",content:Se()});for(let p of c){let d=k.join(l,p.filePath);w(d,p.content),s.success(` \u521B\u5EFA ${p.filePath}`)}console.log(""),s.success(`\u9879\u76EE ${t(o,"brightCyan")} \u521B\u5EFA\u6210\u529F\uFF01`),console.log(""),console.log(" \u8BF7\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u542F\u52A8\u9879\u76EE\uFF1A"),console.log(""),console.log(` ${t("cd","brightGreen")} ${o}`),console.log(` ${t("npm install","brightGreen")}`),console.log(` ${t("npm run dev","brightGreen")}`),console.log("")}import*as J from"http";import*as D from"fs";import*as j from"path";import*as z from"http";import*as C from"fs";import*as y from"path";import*as _ from"crypto";var T=class{constructor(){this.clients=[]}handleUpgrade(o,n,r){let i=o.headers["sec-websocket-key"];if(!i){n.destroy();return}let a=_.createHash("sha1").update(i+"258EAFA5-E914-47DA-95CA-C5AB0DC85B11").digest("base64");n.write(`HTTP/1.1 101 Switching Protocols\r
|
|
262
262
|
Upgrade: websocket\r
|
|
263
263
|
Connection: Upgrade\r
|
|
264
264
|
Sec-WebSocket-Accept: ${a}\r
|