create-layer
Advanced tools
Comparing version 1.0.2 to 1.0.3
#!/usr/bin/env node | ||
(()=>{"use strict";var e={274:(e,n,t)=>{var r=t(834),s=t(431),o=t(604),i=t(217),l=t(127);const a=JSON.parse('{"presets":["@babel/preset-env","@babel/preset-typescript"]}'),p=JSON.parse('{"env":{"node":true,"es6":true},"settings":{"import/resolver":{"typescript":{}}},"parser":"@typescript-eslint/parser","parserOptions":{"project":"tsconfig.json","tsconfigRootDir":"."},"plugins":["prettier","import","@typescript-eslint"],"extends":["prettier","eslint:recommended","plugin:prettier/recommended","plugin:import/errors","plugin:@typescript-eslint/recommended"],"rules":{"prettier/prettier":2,"import/first":2,"import/newline-after-import":2,"import/order":[2,{"pathGroups":[{"pattern":"@/**","group":"external"}],"newlines-between":"always"}],"no-else-return":2,"no-return-await":2,"camelcase":2,"no-return-assign":2,"prefer-destructuring":[2,{"object":true,"array":false}],"curly":[2,"all"],"no-unused-expressions":2,"object-shorthand":[2,"always",{"avoidQuotes":true,"avoidExplicitReturnArrows":true}],"no-await-in-loop":2,"no-loss-of-precision":2,"no-promise-executor-return":2,"no-useless-backreference":2,"array-callback-return":2,"consistent-return":2,"dot-notation":2,"no-extend-native":2,"no-lone-blocks":2,"no-multi-str":2,"no-proto":2,"require-await":2,"prefer-template":2,"max-len":[2,{"code":80}],"padding-line-between-statements":["error",{"blankLine":"always","prev":"*","next":"return"},{"blankLine":"always","prev":"*","next":["multiline-block-like","multiline-const","multiline-let"]},{"blankLine":"always","prev":["multiline-block-like","multiline-const","multiline-let"],"next":"*"},{"blankLine":"always","prev":"singleline-const","next":"*"},{"blankLine":"always","prev":"singleline-let","next":"*"},{"blankLine":"always","prev":"*","next":"singleline-const"},{"blankLine":"always","prev":"*","next":"singleline-let"},{"blankLine":"any","prev":"singleline-let","next":"singleline-let"},{"blankLine":"any","prev":"singleline-const","next":"singleline-const"}]}}'),c=JSON.parse('{"semi":false,"singleQuote":true,"arrowParens":"avoid","quoteProps":"consistent"}');var d=t(296),u=t(504);const m=JSON.parse('{"private":true,"scripts":{"test":"jest","ts":"tsc --noemit","lint":"eslint . --ext .ts --fix","format-json":"prettier **/*.json .*rc --write"},"devDependencies":{"@babel/core":"^7.13.15","@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@types/jest":"^26.0.22","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","babel-jest":"^26.6.3","eslint":"^7.24.0","eslint-config-prettier":"^8.2.0","eslint-import-resolver-typescript":"^2.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.4.0","jest":"^26.6.3","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.2.4"}}'),g=JSON.parse('{"compilerOptions":{"strict":true,"target":"esnext","lib":["esnext"],"moduleResolution":"node","esModuleInterop":true,"resolveJsonModule":true,"skipLibCheck":true,"typeRoots":["node_modules/@types","index.d.ts"],"baseUrl":"src","paths":{"@/*":["./*"]}}}');var v=t(362),f=t(152),x=t(630);const b=()=>({scaffold:{".idea/inspectionProfiles/Project_Default.xml":r,".idea/jsLinters/eslint.xml":s,".idea/watcherTasks.xml":o,".vscode/settings.json":i,"dev-helpers/alias.ts":l,".babelrc":a,".eslintrc":p,".prettierrc":c,".gitignore":d,"index.d.ts":"","jest.config.ts":u,"package.json":m,"tsconfig.json":g,"README.md":v},getSrc:()=>({"array-sum.ts":f,"array-sum.spec.ts":x})});var y=t(901),w=t(872),h=t(642),k=t(285),j=t(169),P=t(986),S=t(556),R=t(402),C=t(191);const M={code:b,frontend:()=>{const e=b();e.scaffold["tsconfig.json"].compilerOptions.lib.push("dom"),e.scaffold["index.d.ts"]=y;const n=e.scaffold["package.json"],t=n.scripts,r=n.devDependencies;return t.build="webpack",t.serve="webpack serve",n.devDependencies={...r,webpack:"^5.28.0","webpack-cli":"^4.6.0","webpack-dev-server":"^3.11.2","babel-loader":"^8.2.2","css-loader":"^5.2.0","sass-loader":"^11.0.1","style-loader":"^2.0.0","mini-css-extract-plugin":"^1.4.0",sass:"^1.32.8","html-webpack-plugin":"^5.3.1","clean-webpack-plugin":"^3.0.0","copy-webpack-plugin":"^8.1.0","@types/mini-css-extract-plugin":"^1.4.1","@types/copy-webpack-plugin":"^6.4.1"},{scaffold:{...e.scaffold,"dev-helpers/webpack-dev.ts":w,"dev-helpers/webpack-prod.ts":h,"webpack.config.ts":k,"README.md":j},getSrc:()=>({"favicon.svg":P,"index.html":S,"main.scss":R,"main.ts":C})}}},O=require("path"),D=require("fs"),E=require("child_process"),$=e=>n=>`[${e}m${n}[0m`,F=$(92),L=$(91),N=(e,n="...")=>{process.stdout.write(`- ${e}${n}`);const t=n=>()=>{process.stdout.clearLine(0),process.stdout.cursorTo(0),process.stdout.write(n?F(`+ ${e}`):L(`* ${e}`)),process.stdout.write("\n")};return{resolve:t(!0),reject:t(!1)}},[,,A,_]=process.argv;(()=>{if(!A||!_)return void console.log("Expected name of layer and name");const e=M[A];if(!e)return void console.log(`Unknown layer: ${A}`);const n=N("file copying");((e,n)=>{const{scaffold:t,getSrc:r}=e,s=t["package.json"];t["package.json"]={name:n,...s},t["README.md"]=[`# ${n}`,t["README.md"]].join("\n\n");const o={...t,...Object.entries(r()).reduce(((e,[n,t])=>(e[`src/${n}`]=t,e)),{})};Object.entries(o).forEach((([e,t])=>{const r=(0,O.resolve)(n,e),s="string"==typeof t?t:JSON.stringify(t,null,2);(0,D.mkdirSync)((0,O.dirname)(r),{recursive:!0}),(0,D.writeFileSync)(r,s)}))})(e(),_),n.resolve(),(async(e,n)=>{const t=(0,O.resolve)(n),r=e=>new Promise((n=>{(0,E.exec)(e,{cwd:t},n)})),s=N("node_modules installing"," (this can take much time)");await r("npm i"),s.resolve();const o=N("final preparations");await r("npm run lint"),await r("npm run format-json"),await r("git init"),await r("git add ."),await r(`git commit -m "${e} created"`),o.resolve()})(A,_).then((()=>{console.log(""),console.log("done.")}))})()},127:e=>{e.exports="import { join, resolve } from 'path'\n\nimport tsconfig from '../tsconfig.json'\n\nconst { baseUrl, paths } = tsconfig.compilerOptions\n\nexport default Object.entries(paths).reduce((acc, [key, [value]]) => {\n const [symbol] = key.split('/*')\n const [path] = value.split('/*')\n\n acc[symbol] = resolve(join(baseUrl, path))\n\n return acc\n}, {} as Record<string, string>)\n"},296:e=>{e.exports=".vscode\n.idea\n\nnode_modules\ndist\n\npackage-lock.json\n"},504:e=>{e.exports="import alias from './dev-helpers/alias'\n\nexport default {\n verbose: true,\n moduleNameMapper: Object.entries(alias).reduce((acc, [key, value]) => {\n acc[key + '/(.*)'] = value + '/$1'\n\n return acc\n }, {} as Record<string, string>),\n}\n"},362:e=>{e.exports="Readme of 'code'\n"},431:e=>{e.exports='<?xml version="1.0" encoding="UTF-8"?>\n<project version="4">\n <component name="EslintConfiguration">\n <option name="fix-on-save" value="true" />\n </component>\n</project>\n'},834:e=>{e.exports='<component name="InspectionProjectProfileManager">\n <profile version="1.0">\n <option name="myName" value="Project Default" />\n <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />\n </profile>\n</component>\n'},217:e=>{e.exports='{\n "editor.codeActionsOnSave": { "source.fixAll.eslint": true }\n}\n'},604:e=>{e.exports='<?xml version="1.0" encoding="UTF-8"?>\n<project version="4">\n <component name="ProjectTasksOptions" suppressed-tasks="SCSS" />\n</project>\n'},630:e=>{e.exports="import { arraySum } from '@/array-sum'\n\ndescribe('array-sum', () => {\n it('should be defined', () => {\n expect(arraySum).toBeDefined()\n })\n\n it('should count correctly', () => {\n expect(arraySum([1, 2, 3])).toBe(6)\n })\n})\n"},152:e=>{e.exports="export const arraySum = (arr: number[]): number =>\n arr.reduce((acc, cur) => acc + cur)\n"},901:e=>{e.exports="declare module '*.jpg' {\r\n const text: string\r\n\r\n export default text\r\n}\r\n\r\ndeclare module '*.png' {\r\n const text: string\r\n\r\n export default text\r\n}\r\n\r\ndeclare module '*.webp' {\r\n const text: string\r\n\r\n export default text\r\n}\r\n\r\ndeclare module '*.svg' {\r\n const text: string\r\n\r\n export default text\r\n}\r\n"},169:e=>{e.exports="Readme of 'frontend'\n"},285:e=>{e.exports="import { resolve } from 'path'\n\nimport HtmlPlugin from 'html-webpack-plugin'\nimport CopyPlugin from 'copy-webpack-plugin'\nimport MiniCssPlugin from 'mini-css-extract-plugin'\n\nimport alias from './dev-helpers/alias'\nimport { devRoot, devPlugins } from './dev-helpers/webpack-dev'\nimport { prodRoot, prodPlugins } from './dev-helpers/webpack-prod'\n\nconst isDev = process.argv[2] == 'serve'\n\nexport default {\n ...(isDev ? devRoot : prodRoot),\n\n entry: resolve('src/main.ts'),\n resolve: {\n alias,\n extensions: ['.js', '.ts'],\n },\n module: {\n rules: [\n {\n test: /\\.ts$/,\n loader: 'babel-loader',\n },\n {\n test: /\\.s[ac]ss$/,\n use: [\n (isDev ? 'style-loader' : MiniCssPlugin.loader),\n 'css-loader',\n 'sass-loader',\n ],\n },\n {\n test: /\\.(jpg|png|webp|svg)/,\n type: 'asset',\n },\n ],\n },\n plugins: [\n ...(isDev ? devPlugins : prodPlugins),\n\n new HtmlPlugin({ template: resolve('src/index.html') }),\n new CopyPlugin({\n patterns: [\n {\n from: resolve('src/favicon.svg'),\n to: resolve('dist'),\n },\n ],\n }),\n ],\n}\n"},872:e=>{e.exports="import { HotModuleReplacementPlugin } from 'webpack'\n\nexport const devRoot = {\n mode: 'development',\n devServer: {\n hot: true,\n port: 5445,\n },\n devtool: 'inline-source-map',\n}\n\nexport const devPlugins = [new HotModuleReplacementPlugin]\n"},642:e=>{e.exports="import { resolve } from 'path'\n\nimport { CleanWebpackPlugin } from 'clean-webpack-plugin'\nimport MiniCssPlugin from 'mini-css-extract-plugin'\n\nexport const prodRoot = {\n mode: 'production',\n output: {\n filename: 'bundle.[contenthash].js',\n path: resolve('dist'),\n },\n}\n\nexport const prodPlugins = [\n new CleanWebpackPlugin,\n new MiniCssPlugin({ filename: '[contenthash].css' }),\n]\n"},986:e=>{e.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0"\n\t viewBox="0 0 512 512" style="enable-background:new 0 0 512 512" xml:space="preserve">\n<path fill="#0078CF" d="M512,256c0,23.155-3.072,45.599-8.84,66.936c-13.479,49.894-41.66,93.748-79.621,126.631\n\tC378.64,488.469,320.073,512,256,512C114.615,512,0,397.385,0,256S114.615,0,256,0S512,114.615,512,256z"/>\n<g>\n\t<path fill="#F2F2F2" d="M503.16,322.936c-13.479,49.894-41.66,93.748-79.621,126.631c-3.709,0.199-7.586,0.293-11.609,0.293\n\t\tc-53.154,0-82.693-33.217-97.374-58.138l48.191-28.954c0,0,16.394,34.837,47.125,34.837c30.741,0,43.039-10.25,43.039-33.813\n\t\tc0-28.693-99.391-38.933-114.761-88.116c-15.37-49.183,5.12-118.868,76.852-113.737c44.826,3.197,70.04,25.213,82.651,41.273\n\t\tl-47.815,34.544c-10.25-29.706-52.255-29.706-60.458-5.12c-8.192,24.597,19.466,38.933,62.506,53.279\n\t\tC473.997,293.282,491.781,306.876,503.16,322.936z"/>\n\t<polygon fill="#F2F2F2" points="300.943,169.786 83.106,169.786 83.106,221.202 162.935,221.202 162.935,444.45\n\t\t221.115,444.45 221.115,221.202 300.943,221.202"/>\n</g>\n</svg>\n'},556:e=>{e.exports='<!doctype html>\n<html lang="ru">\n<head>\n <meta charset="UTF-8">\n <meta\n name="viewport"\n content="width=device-width,\n user-scalable=no,\n initial-scale=1.0,\n maximum-scale=1.0,\n minimum-scale=1.0"\n >\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n <title>Frontend layer</title>\n <link rel="icon" href="favicon.svg">\n</head>\n<body>\n\n<div class="demo-app">\n <h1>Ваше frontend приложение</h1>\n <p>Подробнее на\n <a\n href="https://github.com/nelkor/create-layer"\n target="_blank"\n rel="noopener noreferrer"\n >github</a>\n </p>\n</div>\n\n</body>\n</html>\n'},402:e=>{e.exports="html {\n font-family: sans-serif;\n color: #333;\n}\n\nbody {\n padding: 0;\n margin: 0;\n width: 100vw;\n height: 100vh;\n}\n\n.demo-app {\n width: 100%;\n height: calc(100% - 100px);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n h1 {\n font-size: 26px;\n }\n\n p {\n font-size: 20px;\n margin: 0;\n }\n}\n"},191:e=>{e.exports="import '@/main.scss'\n"}},n={};!function t(r){var s=n[r];if(void 0!==s)return s.exports;var o=n[r]={exports:{}};return e[r](o,o.exports,t),o.exports}(274)})(); | ||
(()=>{"use strict";var e={117:(e,n,t)=>{var r=t(834),s=t(431),o=t(604),i=t(217),a=t(127);const l=JSON.parse('{"presets":["@babel/preset-env","@babel/preset-typescript"]}'),p=JSON.parse('{"env":{"node":true,"es6":true},"settings":{"import/resolver":{"typescript":{}}},"parser":"@typescript-eslint/parser","parserOptions":{"project":"tsconfig.json","tsconfigRootDir":"."},"plugins":["prettier","import","@typescript-eslint"],"extends":["prettier","eslint:recommended","plugin:prettier/recommended","plugin:import/errors","plugin:@typescript-eslint/recommended"],"rules":{"prettier/prettier":2,"import/first":2,"import/newline-after-import":2,"import/order":[2,{"pathGroups":[{"pattern":"@/**","group":"external"}],"newlines-between":"always"}],"no-else-return":2,"no-return-await":2,"camelcase":2,"no-return-assign":2,"prefer-destructuring":[2,{"object":true,"array":false}],"curly":[2,"all"],"no-unused-expressions":2,"object-shorthand":[2,"always",{"avoidQuotes":true,"avoidExplicitReturnArrows":true}],"no-await-in-loop":2,"no-loss-of-precision":2,"no-promise-executor-return":2,"no-useless-backreference":2,"array-callback-return":2,"consistent-return":2,"dot-notation":2,"no-extend-native":2,"no-lone-blocks":2,"no-multi-str":2,"no-proto":2,"require-await":2,"prefer-template":2,"prefer-arrow-callback":2,"max-len":[2,{"code":80}],"padding-line-between-statements":["error",{"blankLine":"always","prev":"*","next":"return"},{"blankLine":"always","prev":"*","next":["multiline-block-like","multiline-const","multiline-let"]},{"blankLine":"always","prev":["multiline-block-like","multiline-const","multiline-let"],"next":"*"},{"blankLine":"always","prev":"singleline-const","next":"*"},{"blankLine":"always","prev":"singleline-let","next":"*"},{"blankLine":"always","prev":"*","next":"singleline-const"},{"blankLine":"always","prev":"*","next":"singleline-let"},{"blankLine":"any","prev":"singleline-let","next":"singleline-let"},{"blankLine":"any","prev":"singleline-const","next":"singleline-const"}]}}'),c=JSON.parse('{"semi":false,"singleQuote":true,"arrowParens":"avoid","quoteProps":"consistent"}');var d=t(296),m=t(504);const u=JSON.parse('{"private":true,"scripts":{"test":"jest","ts":"tsc --noemit","lint":"eslint . --ext .ts --fix","format-json":"prettier **/*.json .*rc --write"},"devDependencies":{"@babel/core":"^7.13.15","@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@types/jest":"^26.0.22","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0","babel-jest":"^26.6.3","eslint":"^7.24.0","eslint-config-prettier":"^8.2.0","eslint-import-resolver-typescript":"^2.4.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.4.0","jest":"^26.6.3","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.2.4"}}'),g=JSON.parse('{"compilerOptions":{"strict":true,"target":"esnext","lib":["esnext"],"moduleResolution":"node","esModuleInterop":true,"resolveJsonModule":true,"skipLibCheck":true,"typeRoots":["node_modules/@types","index.d.ts"],"baseUrl":"src","paths":{"@/*":["./*"]}}}');var f=t(362),v=t(152),x=t(630);const b=()=>({scaffold:{".idea/inspectionProfiles/Project_Default.xml":r,".idea/jsLinters/eslint.xml":s,".idea/watcherTasks.xml":o,".vscode/settings.json":i,"dev-helpers/alias.ts":a,".babelrc":l,".eslintrc":p,".prettierrc":c,".gitignore":d,"index.d.ts":"","jest.config.ts":m,"package.json":u,"tsconfig.json":g},getSrc:()=>({"array-sum.ts":v,"array-sum.spec.ts":x}),getReadme:()=>f}),w=e=>e.scaffold["package.json"];var y=t(901),h=t(872),k=t(642),j=t(285),P=t(169),S=t(986),R=t(556),O=t(402),$=t(191),C=t(110),D=t(856),F=t(510),L=t(160),J=t(233),M=t(130),N=t(551);const _={code:b,frontend:()=>{const e=b();e.scaffold["tsconfig.json"].compilerOptions.lib.push("dom"),e.scaffold["index.d.ts"]=y;const n=w(e),{scripts:t,devDependencies:r}=n;return t.build="webpack",t.serve="webpack serve",n.devDependencies={...r,webpack:"^5.28.0","webpack-cli":"^4.6.0","webpack-dev-server":"^3.11.2","babel-loader":"^8.2.2","css-loader":"^5.2.0","sass-loader":"^11.0.1","style-loader":"^2.0.0","mini-css-extract-plugin":"^1.4.0",sass:"^1.32.8","html-webpack-plugin":"^5.3.1","clean-webpack-plugin":"^3.0.0","copy-webpack-plugin":"^8.1.0","@types/mini-css-extract-plugin":"^1.4.1","@types/copy-webpack-plugin":"^6.4.1"},{scaffold:{...e.scaffold,"dev-helpers/webpack-dev.ts":h,"dev-helpers/webpack-prod.ts":k,"webpack.config.ts":j},getSrc:()=>({"favicon.svg":S,"index.html":R,"main.scss":O,"main.ts":$,"array-sum.ts":v,"array-sum.spec.ts":x}),getReadme:()=>P}},backend:()=>{const e=b(),n=w(e),{scripts:t,devDependencies:r}=n;return t.build="webpack && ts-node dev-helpers/create-package.ts",t.start="node dist",n.devDependencies={...r,"@types/node":"^14.14.39",webpack:"^5.28.0","webpack-cli":"^4.6.0","babel-loader":"^8.2.2"},{scaffold:{...e.scaffold,"dev-helpers/dependencies.ts":C,"dev-helpers/create-package.ts":D,"webpack.config.ts":F},getSrc:()=>({"main.ts":J,"app.ts":M,"app.spec.ts":N}),getReadme:()=>L}}},q=require("path"),U=require("fs"),E=require("child_process"),A=e=>n=>`[${e}m${n}[0m`,T=A(92),z=A(91),B=(e,n="...")=>{process.stdout.write(`- ${e}${n}`);const t=n=>()=>{process.stdout.clearLine(0),process.stdout.cursorTo(0),process.stdout.write(n?T(`+ ${e}`):z(`* ${e}`)),process.stdout.write("\n")};return{resolve:t(!0),reject:t(!1)}},[,,H,I]=process.argv;(()=>{if(!H||!I)return void console.log("Expected name of layer and name");const e=_[H];if(!e)return void console.log(`Unknown layer: ${H}`);const n=B("file copying");((e,n)=>{const{scaffold:t,getSrc:r}=e;((e,n)=>{e.scaffold["package.json"]={name:n,...w(e)},e.scaffold["README.md"]=`# ${n}\n\n${e.getReadme()}`})(e,n);const s={...t,...Object.entries(r()).reduce(((e,[n,t])=>(e[`src/${n}`]=t,e)),{})};Object.entries(s).forEach((([e,t])=>{const r=(0,q.resolve)(n,e),s="string"==typeof t?t:JSON.stringify(t,null,2);(0,U.mkdirSync)((0,q.dirname)(r),{recursive:!0}),(0,U.writeFileSync)(r,s)}))})(e(),I),n.resolve(),(async(e,n)=>{const t=(0,q.resolve)(n),r=e=>new Promise((n=>{(0,E.exec)(e,{cwd:t},n)})),s=B("node_modules installing"," (this can take much time)");await r("npm i"),s.resolve();const o=B("raw text formatting");await r("npm run lint"),await r("npm run format-json"),o.resolve();const i=B("making the first commit");await r("git init"),await r("git add ."),await r(`git commit -m "${e} created"`),i.resolve()})(H,I).then((()=>{console.log(""),console.log("done.")}))})()},856:e=>{e.exports="import { writeFileSync } from 'fs'\n\nimport { distPackageJson } from './dependencies'\n\nwriteFileSync('dist/package.json', distPackageJson)\n"},110:e=>{e.exports="import packageJson from '../package.json'\n\nconst { dependencies: deps } = packageJson as {\n dependencies?: Record<string, string>\n}\n\nexport const dependencies = deps || {}\n\nexport const externals = Object.keys(dependencies).reduce((acc, cur) => {\n acc[cur] = `commonjs ${cur}`\n\n return acc\n}, {} as Record<string, string>)\n\nexport const distPackageJson = JSON.stringify({ dependencies })\n"},160:e=>{e.exports="Readme of 'backend'\n"},510:e=>{e.exports="import { resolve } from 'path'\n\nimport { alias } from './dev-helpers/alias'\nimport { externals } from './dev-helpers/dependencies'\n\nexport default {\n target: 'node',\n mode: 'production',\n entry: resolve('src/main.ts'),\n output: {\n path: resolve('dist'),\n filename: 'index.js',\n },\n resolve: {\n alias,\n extensions: ['.js', '.ts'],\n },\n externals,\n module: {\n rules: [\n {\n test: /\\.ts$/,\n exclude: /node_modules/,\n loader: 'babel-loader',\n options: {\n babelrc: false,\n presets: ['@babel/preset-typescript'],\n },\n },\n ],\n },\n}\n"},551:e=>{e.exports="import { app } from '@/app'\n\ndescribe('app', () => {\n it('should be defined', () => {\n expect(app).toBeDefined()\n })\n})\n"},130:e=>{e.exports="import { RequestListener } from 'http'\n\nexport const app: RequestListener = (_, res) => {\n res.write('It works!')\n res.end()\n}\n"},233:e=>{e.exports="import { createServer } from 'http'\n\nimport { app } from '@/app'\n\nconst port = 8088\n\ncreateServer(app).listen(port)\n\nconsole.log(`server is listening ${port} port`)\n"},127:e=>{e.exports="import { join, resolve } from 'path'\n\nimport tsconfig from '../tsconfig.json'\n\nconst { baseUrl, paths } = tsconfig.compilerOptions\n\nexport const alias = Object.entries(paths).reduce((acc, [key, [value]]) => {\n const [symbol] = key.split('/*')\n const [path] = value.split('/*')\n\n acc[symbol] = resolve(join(baseUrl, path))\n\n return acc\n}, {} as Record<string, string>)\n"},296:e=>{e.exports=".vscode\n.idea\n\nnode_modules\ndist\n\npackage-lock.json\n"},504:e=>{e.exports="import { alias } from './dev-helpers/alias'\n\nexport default {\n verbose: true,\n moduleNameMapper: Object.entries(alias).reduce((acc, [key, value]) => {\n acc[key + '/(.*)'] = value + '/$1'\n\n return acc\n }, {} as Record<string, string>),\n}\n"},362:e=>{e.exports="Readme of 'code'\n"},431:e=>{e.exports='<?xml version="1.0" encoding="UTF-8"?>\n<project version="4">\n <component name="EslintConfiguration">\n <option name="fix-on-save" value="true" />\n </component>\n</project>\n'},834:e=>{e.exports='<component name="InspectionProjectProfileManager">\n <profile version="1.0">\n <option name="myName" value="Project Default" />\n <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />\n </profile>\n</component>\n'},217:e=>{e.exports='{\n "editor.codeActionsOnSave": { "source.fixAll.eslint": true }\n}\n'},604:e=>{e.exports='<?xml version="1.0" encoding="UTF-8"?>\n<project version="4">\n <component name="ProjectTasksOptions" suppressed-tasks="SCSS" />\n</project>\n'},630:e=>{e.exports="import { arraySum } from '@/array-sum'\n\ndescribe('array-sum', () => {\n it('should be defined', () => {\n expect(arraySum).toBeDefined()\n })\n\n it('should count correctly', () => {\n expect(arraySum([1, 2, 3])).toBe(6)\n })\n})\n"},152:e=>{e.exports="export const arraySum = (arr: number[]): number =>\n arr.reduce((acc, cur) => acc + cur)\n"},901:e=>{e.exports="declare module '*.jpg' {\r\n const text: string\r\n\r\n export default text\r\n}\r\n\r\ndeclare module '*.png' {\r\n const text: string\r\n\r\n export default text\r\n}\r\n\r\ndeclare module '*.webp' {\r\n const text: string\r\n\r\n export default text\r\n}\r\n\r\ndeclare module '*.svg' {\r\n const text: string\r\n\r\n export default text\r\n}\r\n"},169:e=>{e.exports="Readme of 'frontend'\n"},285:e=>{e.exports="import { resolve } from 'path'\n\nimport HtmlPlugin from 'html-webpack-plugin'\nimport CopyPlugin from 'copy-webpack-plugin'\nimport MiniCssPlugin from 'mini-css-extract-plugin'\n\nimport { alias } from './dev-helpers/alias'\nimport { devRoot, devPlugins } from './dev-helpers/webpack-dev'\nimport { prodRoot, prodPlugins } from './dev-helpers/webpack-prod'\n\nconst isDev = process.argv[2] == 'serve'\n\nexport default {\n ...(isDev ? devRoot : prodRoot),\n\n entry: resolve('src/main.ts'),\n resolve: {\n alias,\n extensions: ['.js', '.ts'],\n },\n module: {\n rules: [\n {\n test: /\\.ts$/,\n loader: 'babel-loader',\n },\n {\n test: /\\.s[ac]ss$/,\n use: [\n (isDev ? 'style-loader' : MiniCssPlugin.loader),\n 'css-loader',\n 'sass-loader',\n ],\n },\n {\n test: /\\.(jpg|png|webp|svg)/,\n type: 'asset',\n },\n ],\n },\n plugins: [\n ...(isDev ? devPlugins : prodPlugins),\n\n new HtmlPlugin({ template: resolve('src/index.html') }),\n new CopyPlugin({\n patterns: [\n {\n from: resolve('src/favicon.svg'),\n to: resolve('dist'),\n },\n ],\n }),\n ],\n}\n"},872:e=>{e.exports="import { HotModuleReplacementPlugin } from 'webpack'\n\nexport const devRoot = {\n mode: 'development',\n devServer: {\n hot: true,\n port: 5445,\n },\n devtool: 'inline-source-map',\n}\n\nexport const devPlugins = [new HotModuleReplacementPlugin]\n"},642:e=>{e.exports="import { resolve } from 'path'\n\nimport { CleanWebpackPlugin } from 'clean-webpack-plugin'\nimport MiniCssPlugin from 'mini-css-extract-plugin'\n\nexport const prodRoot = {\n mode: 'production',\n output: {\n filename: 'bundle.[contenthash].js',\n path: resolve('dist'),\n },\n}\n\nexport const prodPlugins = [\n new CleanWebpackPlugin,\n new MiniCssPlugin({ filename: '[contenthash].css' }),\n]\n"},986:e=>{e.exports='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0"\n\t viewBox="0 0 512 512" style="enable-background:new 0 0 512 512" xml:space="preserve">\n<path fill="#0078CF" d="M512,256c0,23.155-3.072,45.599-8.84,66.936c-13.479,49.894-41.66,93.748-79.621,126.631\n\tC378.64,488.469,320.073,512,256,512C114.615,512,0,397.385,0,256S114.615,0,256,0S512,114.615,512,256z"/>\n<g>\n\t<path fill="#F2F2F2" d="M503.16,322.936c-13.479,49.894-41.66,93.748-79.621,126.631c-3.709,0.199-7.586,0.293-11.609,0.293\n\t\tc-53.154,0-82.693-33.217-97.374-58.138l48.191-28.954c0,0,16.394,34.837,47.125,34.837c30.741,0,43.039-10.25,43.039-33.813\n\t\tc0-28.693-99.391-38.933-114.761-88.116c-15.37-49.183,5.12-118.868,76.852-113.737c44.826,3.197,70.04,25.213,82.651,41.273\n\t\tl-47.815,34.544c-10.25-29.706-52.255-29.706-60.458-5.12c-8.192,24.597,19.466,38.933,62.506,53.279\n\t\tC473.997,293.282,491.781,306.876,503.16,322.936z"/>\n\t<polygon fill="#F2F2F2" points="300.943,169.786 83.106,169.786 83.106,221.202 162.935,221.202 162.935,444.45\n\t\t221.115,444.45 221.115,221.202 300.943,221.202"/>\n</g>\n</svg>\n'},556:e=>{e.exports='<!doctype html>\n<html lang="ru">\n<head>\n <meta charset="UTF-8">\n <meta\n name="viewport"\n content="width=device-width,\n user-scalable=no,\n initial-scale=1.0,\n maximum-scale=1.0,\n minimum-scale=1.0"\n >\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n <title>Frontend layer</title>\n <link rel="icon" href="favicon.svg">\n</head>\n<body>\n\n<div class="demo-app">\n <h1>Ваше frontend приложение</h1>\n <p>Подробнее на\n <a\n href="https://github.com/nelkor/create-layer"\n target="_blank"\n rel="noopener noreferrer"\n >github</a>\n </p>\n</div>\n\n</body>\n</html>\n'},402:e=>{e.exports="html {\n font-family: sans-serif;\n color: #333;\n}\n\nbody {\n padding: 0;\n margin: 0;\n width: 100vw;\n height: 100vh;\n}\n\n.demo-app {\n width: 100%;\n height: calc(100% - 100px);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n h1 {\n font-size: 26px;\n }\n\n p {\n font-size: 20px;\n margin: 0;\n }\n}\n"},191:e=>{e.exports="import '@/main.scss'\n"}},n={};!function t(r){var s=n[r];if(void 0!==s)return s.exports;var o=n[r]={exports:{}};return e[r](o,o.exports,t),o.exports}(117)})(); |
{ | ||
"name": "create-layer", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "generator of starters", | ||
@@ -5,0 +5,0 @@ "preferGlobal": true, |
@@ -19,1 +19,7 @@ # create-layer | ||
``` | ||
Allowed layers: | ||
* code | ||
* backend | ||
* frontend |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
16573
25