diff --git a/tools/schematics/.gitkeep b/.cache/.gitkeep similarity index 100% rename from tools/schematics/.gitkeep rename to .cache/.gitkeep diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f222b95 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +*.Dockerfile \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 544138b..234ca19 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,3 +1,3 @@ { - "singleQuote": true -} + "printWidth": 100 +} \ No newline at end of file diff --git a/README.md b/README.md index 31a712f..7fa19f2 100644 --- a/README.md +++ b/README.md @@ -2,57 +2,12 @@ This project was generated using [Nx](https://nx.dev). -

- šŸ”Ž **Nx is a set of Extensible Dev Tools for Monorepos.** -## Adding capabilities to your workspace - -Nx supports many plugins which add capabilities for developing different types of applications and different tools. - -These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well. - -Below are our core plugins: - -- [React](https://reactjs.org) - - `npm install --save-dev @nrwl/react` -- Web (no framework frontends) - - `npm install --save-dev @nrwl/web` -- [Angular](https://angular.io) - - `npm install --save-dev @nrwl/angular` -- [Nest](https://nestjs.com) - - `npm install --save-dev @nrwl/nest` -- [Express](https://expressjs.com) - - `npm install --save-dev @nrwl/express` -- [Node](https://nodejs.org) - - `npm install --save-dev @nrwl/node` - -There are also many [community plugins](https://nx.dev/nx-community) you could add. - -## Generate an application - -Run `nx g @nrwl/react:app my-app` to generate an application. - -> You can use any of the plugins above to generate applications as well. - -When using Nx, you can create multiple applications and libraries in the same workspace. - -## Generate a library - -Run `nx g @nrwl/react:lib my-lib` to generate a library. - -> You can also use any of the plugins above to generate libraries as well. - -Libraries are sharable across libraries and applications. They can be imported from `@factorio-sites/mylib`. - ## Development server Run `nx serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. -## Code scaffolding - -Run `nx g @nrwl/react:component my-component --project=my-app` to generate a new component. - ## Build Run `nx build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. @@ -76,15 +31,3 @@ Run `nx dep-graph` to see a diagram of the dependencies of your projects. ## Further help Visit the [Nx Documentation](https://nx.dev) to learn more. - -## ā˜ Nx Cloud - -### Computation Memoization in the Cloud - -

- -Nx Cloud pairs with Nx in order to enable you to build and test code more rapidly, by up to 10 times. Even teams that are new to Nx can connect to Nx Cloud and start saving time instantly. - -Teams using Nx gain the advantage of building full-stack applications with their preferred framework alongside Nxā€™s advanced code generation and project dependency graph, plus a unified experience for both frontend and backend developers. - -Visit [Nx Cloud](https://nx.app/) to learn more. diff --git a/apps/blueprint-image-function/.eslintrc.json b/apps/blueprint-image-function/.eslintrc.json new file mode 100644 index 0000000..54ac395 --- /dev/null +++ b/apps/blueprint-image-function/.eslintrc.json @@ -0,0 +1 @@ +{ "extends": "../../.eslintrc.json", "ignorePatterns": ["!**/*"], "rules": {} } diff --git a/apps/blueprint-image-function/README.md b/apps/blueprint-image-function/README.md new file mode 100644 index 0000000..cbbe6d7 --- /dev/null +++ b/apps/blueprint-image-function/README.md @@ -0,0 +1,3 @@ +### Deployment + +Run `nx build blueprint-image-function` and copy the contents of `dist/apps/blueprint-image-function/main.js` into the function diff --git a/apps/blueprint-image-function/jest.config.js b/apps/blueprint-image-function/jest.config.js new file mode 100644 index 0000000..d97cb41 --- /dev/null +++ b/apps/blueprint-image-function/jest.config.js @@ -0,0 +1,14 @@ +module.exports = { + displayName: "blueprint-image-function", + preset: "../../jest.preset.js", + globals: { + "ts-jest": { + tsConfig: "/tsconfig.spec.json", + }, + }, + transform: { + "^.+\\.[tj]s$": "ts-jest", + }, + moduleFileExtensions: ["ts", "js", "html"], + coverageDirectory: "../../coverage/apps/blueprint-image-function", +}; diff --git a/apps/blueprint-image-function/src/environments/environment.prod.ts b/apps/blueprint-image-function/src/environments/environment.prod.ts new file mode 100644 index 0000000..c966979 --- /dev/null +++ b/apps/blueprint-image-function/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true, +}; diff --git a/apps/blueprint-image-function/src/environments/environment.ts b/apps/blueprint-image-function/src/environments/environment.ts new file mode 100644 index 0000000..a20cfe5 --- /dev/null +++ b/apps/blueprint-image-function/src/environments/environment.ts @@ -0,0 +1,3 @@ +export const environment = { + production: false, +}; diff --git a/apps/blueprint-image-function/src/main.ts b/apps/blueprint-image-function/src/main.ts new file mode 100644 index 0000000..2d19de8 --- /dev/null +++ b/apps/blueprint-image-function/src/main.ts @@ -0,0 +1,15 @@ +import { generateScreenshot } from "@factorio-sites/generate-bp-image"; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type Handler = (req: any, res: any) => void; // Don't want to install express types just for this + +export const handler: Handler = async (req, res) => { + if (!req.query.source) { + return res.status(400).end("No source string given"); + } + const string = (req.query.source as string).replace(/ /g, "+"); + const stream = await generateScreenshot(string, "/tmp"); + res.status(200); + res.setHeader("content-type", "image/png"); + stream.pipe(res); +}; diff --git a/apps/blueprint-image-function/tsconfig.app.json b/apps/blueprint-image-function/tsconfig.app.json new file mode 100644 index 0000000..bb717c5 --- /dev/null +++ b/apps/blueprint-image-function/tsconfig.app.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": ["node"] + }, + "exclude": ["**/*.spec.ts"], + "include": ["**/*.ts"] +} diff --git a/apps/blueprint-image-function/tsconfig.json b/apps/blueprint-image-function/tsconfig.json new file mode 100644 index 0000000..63dbe35 --- /dev/null +++ b/apps/blueprint-image-function/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/apps/blueprint-image-function/tsconfig.spec.json b/apps/blueprint-image-function/tsconfig.spec.json new file mode 100644 index 0000000..29efa43 --- /dev/null +++ b/apps/blueprint-image-function/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["**/*.spec.ts", "**/*.d.ts"] +} diff --git a/apps/blueprints/pages/_app.tsx b/apps/blueprints/pages/_app.tsx index aff3806..be9b032 100644 --- a/apps/blueprints/pages/_app.tsx +++ b/apps/blueprints/pages/_app.tsx @@ -1,19 +1,46 @@ -import React from 'react'; -import { AppProps } from 'next/app'; -import Head from 'next/head'; -import { ReactComponent as NxLogo } from '../public/nx-logo-white.svg'; -import './styles.css'; +/** @jsx jsx */ +import React from "react"; +import { AppProps } from "next/app"; +import Head from "next/head"; +import { jsx, css } from "@emotion/core"; +import { normalize } from "./normalize"; +import { Global } from "@emotion/core"; + +const mainStyles = css` + font-family: sans-serif; + + header { + display: flex; + align-items: center; + justify-content: left; + background-color: #143055; + color: white; + padding: 5px 20px; + + h1 { + margin: 10px 0; + } + } + + main { + padding: 0 20px; + } + + .sidebar { + background: #ccc; + } +`; const CustomApp = ({ Component, pageProps }: AppProps) => { return ( <> + Welcome to blueprints! -
-
- -

Welcome to blueprints!

+
+
+

Factorio Blueprints

diff --git a/apps/blueprints/pages/index.tsx b/apps/blueprints/pages/index.tsx index a03bf70..37453ef 100644 --- a/apps/blueprints/pages/index.tsx +++ b/apps/blueprints/pages/index.tsx @@ -1,136 +1,4 @@ -import React from 'react'; -import styled from '@emotion/styled'; - -const StyledPage = styled.div` - .app { - font-family: sans-serif; - min-width: 300px; - max-width: 600px; - margin: 50px auto; - } - - .app .gutter-left { - margin-left: 9px; - } - - .app .col-span-2 { - grid-column: span 2; - } - - .app .flex { - display: flex; - align-items: center; - justify-content: center; - } - - .app header { - background-color: #143055; - color: white; - padding: 5px; - border-radius: 3px; - } - - .app main { - padding: 0 36px; - } - - .app p { - text-align: center; - } - - .app h1 { - text-align: center; - margin-left: 18px; - font-size: 24px; - } - - .app h2 { - text-align: center; - font-size: 20px; - margin: 40px 0 10px 0; - } - - .app .resources { - text-align: center; - list-style: none; - padding: 0; - display: grid; - grid-gap: 9px; - grid-template-columns: 1fr 1fr; - } - - .app .resource { - color: #0094ba; - height: 36px; - background-color: rgba(0, 0, 0, 0); - border: 1px solid rgba(0, 0, 0, 0.12); - border-radius: 4px; - padding: 3px 9px; - text-decoration: none; - } - - .app .resource:hover { - background-color: rgba(68, 138, 255, 0.04); - } - - .app pre { - padding: 9px; - border-radius: 4px; - background-color: black; - color: #eee; - } - - .app details { - border-radius: 4px; - color: #333; - background-color: rgba(0, 0, 0, 0); - border: 1px solid rgba(0, 0, 0, 0.12); - padding: 3px 9px; - margin-bottom: 9px; - } - - .app summary { - outline: none; - height: 36px; - line-height: 36px; - } - - .app .github-star-container { - margin-top: 12px; - line-height: 20px; - } - - .app .github-star-container a { - display: flex; - align-items: center; - text-decoration: none; - color: #333; - } - - .app .github-star-badge { - color: #24292e; - display: flex; - align-items: center; - font-size: 12px; - padding: 3px 10px; - border: 1px solid rgba(27, 31, 35, 0.2); - border-radius: 3px; - background-image: linear-gradient(-180deg, #fafbfc, #eff3f6 90%); - margin-left: 4px; - font-weight: 600; - } - - .app .github-star-badge:hover { - background-image: linear-gradient(-180deg, #f0f3f6, #e6ebf1 90%); - border-color: rgba(27, 31, 35, 0.35); - background-position: -0.5em; - } - .app .github-star-badge .material-icons { - height: 16px; - width: 16px; - margin-right: 4px; - } -`; +import React from "react"; export const Index = () => { /* @@ -138,89 +6,7 @@ export const Index = () => { * * Note: The corresponding styles are in the ./${fileName}.${style} file. */ - return ( - -

Resources & Tools

-

Thank you for using and showing some ā™„ for Nx.

- -

Here are some links to help you get started.

- -

Next Steps

-

Here are some things you can do with Nx.

-
- Add UI library -
{`# Generate UI lib
-nx g @nrwl/react:lib ui
-
-# Add a component
-nx g @nrwl/react:component xyz --project ui`}
-
-
- View dependency graph -
{`nx dep-graph`}
-
-
- Run affected commands -
{`# see what's been affected by changes
-nx affected:dep-graph
-
-# run tests for current changes
-nx affected:test
-
-# run e2e tests for current changes
-nx affected:e2e
-`}
-
-
- ); + return
app
; }; export default Index; diff --git a/apps/blueprints/pages/normalize.ts b/apps/blueprints/pages/normalize.ts new file mode 100644 index 0000000..b10c00d --- /dev/null +++ b/apps/blueprints/pages/normalize.ts @@ -0,0 +1,355 @@ +import { css } from "@emotion/core"; + +export const normalize = css` + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ + + /* Document + ========================================================================== */ + + /** + * 1. Correct the line height in all browsers. + * 2. Prevent adjustments of font size after orientation changes in iOS. + */ + + html { + line-height: 1.15; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + } + + /* Sections + ========================================================================== */ + + /** + * Remove the margin in all browsers. + */ + + body { + margin: 0; + } + + /** + * Render the \`main\` element consistently in IE. + */ + + main { + display: block; + } + + /** + * Correct the font size and margin on \`h1\` elements within \`section\` and + * \`article\` contexts in Chrome, Firefox, and Safari. + */ + + h1 { + font-size: 2em; + margin: 0.67em 0; + } + + /* Grouping content + ========================================================================== */ + + /** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + + hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ + } + + /** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd \`em\` font sizing in all browsers. + */ + + pre { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ + } + + /* Text-level semantics + ========================================================================== */ + + /** + * Remove the gray background on active links in IE 10. + */ + + a { + background-color: transparent; + } + + /** + * 1. Remove the bottom border in Chrome 57- + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + + abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ + } + + /** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + + b, + strong { + font-weight: bolder; + } + + /** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd \`em\` font sizing in all browsers. + */ + + code, + kbd, + samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ + } + + /** + * Add the correct font size in all browsers. + */ + + small { + font-size: 80%; + } + + /** + * Prevent \`sub\` and \`sup\` elements from affecting the line height in + * all browsers. + */ + + sub, + sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + sub { + bottom: -0.25em; + } + + sup { + top: -0.5em; + } + + /* Embedded content + ========================================================================== */ + + /** + * Remove the border on images inside links in IE 10. + */ + + img { + border-style: none; + } + + /* Forms + ========================================================================== */ + + /** + * 1. Change the font styles in all browsers. + * 2. Remove the margin in Firefox and Safari. + */ + + button, + input, + optgroup, + select, + textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ + } + + /** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + + button, + input { + /* 1 */ + overflow: visible; + } + + /** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + + button, + select { + /* 1 */ + text-transform: none; + } + + /** + * Correct the inability to style clickable types in iOS and Safari. + */ + + button, + [type="button"], + [type="reset"], + [type="submit"] { + -webkit-appearance: button; + } + + /** + * Remove the inner border and padding in Firefox. + */ + + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; + } + + /** + * Restore the focus styles unset by the previous rule. + */ + + button:-moz-focusring, + [type="button"]:-moz-focusring, + [type="reset"]:-moz-focusring, + [type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; + } + + /** + * Correct the padding in Firefox. + */ + + fieldset { + padding: 0.35em 0.75em 0.625em; + } + + /** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from \`fieldset\` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * \`fieldset\` elements in all browsers. + */ + + legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ + } + + /** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + + progress { + vertical-align: baseline; + } + + /** + * Remove the default vertical scrollbar in IE 10+. + */ + + textarea { + overflow: auto; + } + + /** + * 1. Add the correct box sizing in IE 10. + * 2. Remove the padding in IE 10. + */ + + [type="checkbox"], + [type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ + } + + /** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + + [type="number"]::-webkit-inner-spin-button, + [type="number"]::-webkit-outer-spin-button { + height: auto; + } + + /** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + + [type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ + } + + /** + * Remove the inner padding in Chrome and Safari on macOS. + */ + + [type="search"]::-webkit-search-decoration { + -webkit-appearance: none; + } + + /** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to \`inherit\` in Safari. + */ + + ::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ + } + + /* Interactive + ========================================================================== */ + + /* + * Add the correct display in Edge, IE 10+, and Firefox. + */ + + details { + display: block; + } + + /* + * Add the correct display in all browsers. + */ + + summary { + display: list-item; + } + + /* Misc + ========================================================================== */ + + /** + * Add the correct display in IE 10+. + */ + + template { + display: none; + } + + /** + * Add the correct display in IE 10. + */ + + [hidden] { + display: none; + } +`; diff --git a/apps/blueprints/pages/styles.css b/apps/blueprints/pages/styles.css deleted file mode 100644 index 5d5777c..0000000 --- a/apps/blueprints/pages/styles.css +++ /dev/null @@ -1,128 +0,0 @@ -.app { - font-family: sans-serif; - min-width: 300px; - max-width: 600px; - margin: 50px auto; -} - -.app .gutter-left { - margin-left: 9px; -} - -.app .col-span-2 { - grid-column: span 2; -} - -.app .flex { - display: flex; - align-items: center; - justify-content: center; -} - -.app header { - background-color: #143055; - color: white; - padding: 5px; - border-radius: 3px; -} - -.app main { - padding: 0 36px; -} - -.app p { - text-align: center; -} - -.app h1 { - text-align: center; - margin-left: 18px; - font-size: 24px; -} - -.app h2 { - text-align: center; - font-size: 20px; - margin: 40px 0 10px 0; -} - -.app .resources { - text-align: center; - list-style: none; - padding: 0; - display: grid; - grid-gap: 9px; - grid-template-columns: 1fr 1fr; -} - -.app .resource { - color: #0094ba; - height: 36px; - background-color: rgba(0, 0, 0, 0); - border: 1px solid rgba(0, 0, 0, 0.12); - border-radius: 4px; - padding: 3px 9px; - text-decoration: none; -} - -.app .resource:hover { - background-color: rgba(68, 138, 255, 0.04); -} - -.app pre { - padding: 9px; - border-radius: 4px; - background-color: black; - color: #eee; -} - -.app details { - border-radius: 4px; - color: #333; - background-color: rgba(0, 0, 0, 0); - border: 1px solid rgba(0, 0, 0, 0.12); - padding: 3px 9px; - margin-bottom: 9px; -} - -.app summary { - outline: none; - height: 36px; - line-height: 36px; -} - -.app .github-star-container { - margin-top: 12px; - line-height: 20px; -} - -.app .github-star-container a { - display: flex; - align-items: center; - text-decoration: none; - color: #333; -} - -.app .github-star-badge { - color: #24292e; - display: flex; - align-items: center; - font-size: 12px; - padding: 3px 10px; - border: 1px solid rgba(27, 31, 35, 0.2); - border-radius: 3px; - background-image: linear-gradient(-180deg, #fafbfc, #eff3f6 90%); - margin-left: 4px; - font-weight: 600; -} - -.app .github-star-badge:hover { - background-image: linear-gradient(-180deg, #f0f3f6, #e6ebf1 90%); - border-color: rgba(27, 31, 35, 0.35); - background-position: -0.5em; -} -.app .github-star-badge .material-icons { - height: 16px; - width: 16px; - margin-right: 4px; -} diff --git a/apps/blueprints/prod.package.json b/apps/blueprints/prod.package.json new file mode 100644 index 0000000..727c18c --- /dev/null +++ b/apps/blueprints/prod.package.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "@emotion/core": "10.0.28", + "@emotion/styled": "10.0.27", + "document-register-element": "1.13.1", + "emotion-server": "10.0.27", + "next": "9.5.2", + "react": "16.13.1", + "react-dom": "16.13.1" + } +} diff --git a/apps/blueprints/public/nx-logo-white.svg b/apps/blueprints/public/nx-logo-white.svg deleted file mode 100644 index 5779442..0000000 --- a/apps/blueprints/public/nx-logo-white.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/blueprints/tsconfig.json b/apps/blueprints/tsconfig.json index 91332bc..d9c25fd 100644 --- a/apps/blueprints/tsconfig.json +++ b/apps/blueprints/tsconfig.json @@ -12,5 +12,6 @@ "resolveJsonModule": true, "isolatedModules": true }, - "include": ["**/*.ts", "**/*.tsx", "next-env.d.ts"] + "include": ["**/*.ts", "**/*.tsx", "next-env.d.ts"], + "exclude": ["node_modules"] } diff --git a/blueprints.Dockerfile b/blueprints.Dockerfile new file mode 100644 index 0000000..e4d5f69 --- /dev/null +++ b/blueprints.Dockerfile @@ -0,0 +1,24 @@ +FROM node:14-slim as builder + +WORKDIR /usr/src/app + +COPY package.json . +COPY yarn.lock . + +RUN yarn + +COPY . . + +RUN yarn nx build blueprints + +FROM node:14-slim + +WORKDIR /usr/src/app +COPY apps/blueprints/prod.package.json ./package.json +COPY yarn.lock . + +RUN yarn install --production + +COPY --from=builder /usr/src/app/dist/apps/blueprints . + +CMD ["yarn", "next", "start"] \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 0201430..d2d90da 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,7 @@ module.exports = { - projects: ['/apps/blueprints'], + projects: [ + "/apps/blueprints", + "/libs/generate-bp-image", + "/apps/blueprint-image-function", + ], }; diff --git a/libs/generate-bp-image/.eslintrc.json b/libs/generate-bp-image/.eslintrc.json new file mode 100644 index 0000000..54ac395 --- /dev/null +++ b/libs/generate-bp-image/.eslintrc.json @@ -0,0 +1 @@ +{ "extends": "../../.eslintrc.json", "ignorePatterns": ["!**/*"], "rules": {} } diff --git a/libs/generate-bp-image/README.md b/libs/generate-bp-image/README.md new file mode 100644 index 0000000..97de76e --- /dev/null +++ b/libs/generate-bp-image/README.md @@ -0,0 +1,7 @@ +# generate-bp-image + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test generate-bp-image` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/generate-bp-image/jest.config.js b/libs/generate-bp-image/jest.config.js new file mode 100644 index 0000000..45d8292 --- /dev/null +++ b/libs/generate-bp-image/jest.config.js @@ -0,0 +1,14 @@ +module.exports = { + displayName: "generate-bp-image", + preset: "../../jest.preset.js", + globals: { + "ts-jest": { + tsConfig: "/tsconfig.spec.json", + }, + }, + transform: { + "^.+\\.[tj]sx?$": "ts-jest", + }, + moduleFileExtensions: ["ts", "tsx", "js", "jsx"], + coverageDirectory: "../../coverage/libs/generate-bp-image", +}; diff --git a/libs/generate-bp-image/src/index.ts b/libs/generate-bp-image/src/index.ts new file mode 100644 index 0000000..2c55ba1 --- /dev/null +++ b/libs/generate-bp-image/src/index.ts @@ -0,0 +1 @@ +export * from "./lib/generate-bp-image"; diff --git a/libs/generate-bp-image/src/lib/generate-bp-image.spec.ts b/libs/generate-bp-image/src/lib/generate-bp-image.spec.ts new file mode 100644 index 0000000..0553006 --- /dev/null +++ b/libs/generate-bp-image/src/lib/generate-bp-image.spec.ts @@ -0,0 +1,11 @@ +// import { generateBpImage } from './generate-bp-image'; + +/** + * tests can not be properly written because all methods have major side effects + */ + +describe("generateBpImage", () => { + it("should work", () => { + expect(true); + }); +}); diff --git a/libs/generate-bp-image/src/lib/generate-bp-image.ts b/libs/generate-bp-image/src/lib/generate-bp-image.ts new file mode 100644 index 0000000..a66cf59 --- /dev/null +++ b/libs/generate-bp-image/src/lib/generate-bp-image.ts @@ -0,0 +1,83 @@ +import * as Puppeteer from "puppeteer"; +import * as crypto from "crypto"; +import * as path from "path"; +import * as fs from "fs"; +import { promisify } from "util"; + +const fsMkdir = promisify(fs.mkdir); +const fsStat = promisify(fs.stat); +const fsRmdir = promisify(fs.rmdir); + +async function downloadScreenshot(blueprint: string, dir: string, on_complete: Promise) { + const browser = await Puppeteer.launch({ + headless: true, + args: ["--no-sandbox"], + }); + + const [page] = await browser.pages(); + + await (page as any)._client.send("Page.setDownloadBehavior", { + behavior: "allow", + downloadPath: dir, + }); + + const start = Date.now(); + + await page.goto("https://teoxoy.github.io/factorio-blueprint-editor/?source=" + blueprint, { + waitUntil: "load", + }); + console.log(`[status] page load complete at ${Date.now() - start}`); + + await page.waitForFunction(`!!document.querySelector('.toasts-text')`); + + console.log(`[status] app initialized at ${Date.now() - start}`); + + await page.click("canvas"); + await page.keyboard.down("Control"); + await page.keyboard.press("S"); + await page.keyboard.up("Control"); + + console.log("[status] save image command entered"); + + on_complete.finally(() => { + browser.close(); + }); +} + +export async function generateScreenshot(blueprint: string, _cache_dir?: string) { + const start_time = Date.now(); + const hash = crypto.createHash("sha256").update(blueprint).digest("hex"); + const cache_dir = _cache_dir || path.join(process.cwd(), ".cache"); + const dir = path.join(cache_dir, hash); + + await fsMkdir(cache_dir).catch((error) => { + if (error.code !== "EEXIST") throw error; + }); + await fsMkdir(dir).catch((error) => { + if (error.code !== "EEXIST") throw error; + }); + + const promise = new Promise((resolve, reject) => { + const watcher = fs.watch(dir, async (type, file) => { + if (type === "change" && !file.endsWith(".crdownload")) { + const file_path = path.join(dir, file); + fsStat(file_path) + .then(() => resolve(file_path)) + .catch(reject) + .finally(() => watcher.close()); + } + }); + }); + + await downloadScreenshot(blueprint, dir, promise); + + const file_path = await promise; + + console.log(`Downloaded image in ${Date.now() - start_time}ms`, file_path); + const stream = fs.createReadStream(file_path); + stream.on("close", () => { + fsRmdir(dir, { recursive: true }).catch((reason) => console.error(reason)); + }); + + return stream; +} diff --git a/libs/generate-bp-image/tsconfig.json b/libs/generate-bp-image/tsconfig.json new file mode 100644 index 0000000..4a06c0d --- /dev/null +++ b/libs/generate-bp-image/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "lib": ["ES2018", "ES2019"] + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/generate-bp-image/tsconfig.lib.json b/libs/generate-bp-image/tsconfig.lib.json new file mode 100644 index 0000000..037d796 --- /dev/null +++ b/libs/generate-bp-image/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["**/*.spec.ts"], + "include": ["**/*.ts"] +} diff --git a/libs/generate-bp-image/tsconfig.spec.json b/libs/generate-bp-image/tsconfig.spec.json new file mode 100644 index 0000000..515f3c2 --- /dev/null +++ b/libs/generate-bp-image/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.spec.js", "**/*.spec.jsx", "**/*.d.ts"] +} diff --git a/nx.json b/nx.json index 4e57349..21fc9c4 100644 --- a/nx.json +++ b/nx.json @@ -29,6 +29,12 @@ "blueprints-e2e": { "tags": [], "implicitDependencies": ["blueprints"] + }, + "generate-bp-image": { + "tags": [] + }, + "blueprint-image-function": { + "tags": [] } } } diff --git a/package.json b/package.json index a8387d8..d4e378d 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "document-register-element": "1.13.1", "emotion-server": "10.0.27", "next": "9.5.2", + "puppeteer": "5.3.1", "react": "16.13.1", "react-dom": "16.13.1" }, @@ -46,12 +47,14 @@ "@nrwl/eslint-plugin-nx": "10.3.1", "@nrwl/jest": "10.3.1", "@nrwl/next": "10.3.1", + "@nrwl/node": "10.3.1", "@nrwl/react": "10.3.1", "@nrwl/web": "10.3.1", "@nrwl/workspace": "10.3.1", "@testing-library/react": "10.4.1", "@types/jest": "26.0.8", - "@types/node": "~8.9.4", + "@types/node": "14.11.10", + "@types/puppeteer": "3.0.2", "@types/react": "16.9.38", "@types/react-dom": "16.9.8", "@typescript-eslint/eslint-plugin": "4.3.0", diff --git a/tools/tsconfig.tools.json b/tools/tsconfig.tools.json deleted file mode 100644 index 5f6f15d..0000000 --- a/tools/tsconfig.tools.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "outDir": "../dist/out-tsc/tools", - "rootDir": ".", - "module": "commonjs", - "target": "es5", - "types": ["node"] - }, - "include": ["**/*.ts"] -} diff --git a/tsconfig.base.json b/tsconfig.base.json index a5099b5..f6ecfc3 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -14,8 +14,11 @@ "lib": ["es2017", "dom"], "skipLibCheck": true, "skipDefaultLibCheck": true, + "strict": true, "baseUrl": ".", - "paths": {} + "paths": { + "@factorio-sites/generate-bp-image": ["libs/generate-bp-image/src/index.ts"] + } }, "exclude": ["node_modules", "tmp"] } diff --git a/workspace.json b/workspace.json index 57ef801..d4f429a 100644 --- a/workspace.json +++ b/workspace.json @@ -76,6 +76,77 @@ } } } + }, + "generate-bp-image": { + "root": "libs/generate-bp-image", + "sourceRoot": "libs/generate-bp-image/src", + "projectType": "library", + "schematics": {}, + "architect": { + "lint": { + "builder": "@nrwl/linter:eslint", + "options": { + "lintFilePatterns": ["libs/generate-bp-image/**/*.ts"] + } + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "libs/generate-bp-image/jest.config.js", + "passWithNoTests": true + } + } + } + }, + "blueprint-image-function": { + "root": "apps/blueprint-image-function", + "sourceRoot": "apps/blueprint-image-function/src", + "projectType": "application", + "prefix": "blueprint-image-function", + "schematics": {}, + "architect": { + "build": { + "builder": "@nrwl/node:build", + "options": { + "outputPath": "dist/apps/blueprint-image-function", + "main": "apps/blueprint-image-function/src/main.ts", + "tsConfig": "apps/blueprint-image-function/tsconfig.app.json", + "assets": [] + }, + "configurations": { + "production": { + "optimization": true, + "extractLicenses": true, + "inspect": false, + "fileReplacements": [ + { + "replace": "apps/blueprint-image-function/src/environments/environment.ts", + "with": "apps/blueprint-image-function/src/environments/environment.prod.ts" + } + ] + } + } + }, + "serve": { + "builder": "@nrwl/node:execute", + "options": { + "buildTarget": "blueprint-image-function:build" + } + }, + "lint": { + "builder": "@nrwl/linter:eslint", + "options": { + "lintFilePatterns": ["apps/blueprint-image-function/**/*.ts"] + } + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "apps/blueprint-image-function/jest.config.js", + "passWithNoTests": true + } + } + } } }, "cli": { diff --git a/yarn.lock b/yarn.lock index 4ab0557..69514b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1896,6 +1896,30 @@ "@svgr/webpack" "^5.4.0" url-loader "^3.0.0" +"@nrwl/node@^10.3.1": + version "10.3.1" + resolved "https://registry.yarnpkg.com/@nrwl/node/-/node-10.3.1.tgz#adee0c95c8c9bdcc3e6a9d4b0b9d3adaa727f37c" + integrity sha512-1avh9aQ993K1w81bN33i1Ig6uFXkCXfNnqWed1yWxlOgu0htx5+hGdg+8mkaRBSif7hk/4bi8B5e/79iMPGntg== + dependencies: + "@angular-devkit/architect" "~0.1001.3" + "@angular-devkit/build-webpack" "~0.1001.3" + "@angular-devkit/core" "~10.1.3" + "@angular-devkit/schematics" "~10.1.3" + "@nrwl/jest" "10.3.1" + "@nrwl/linter" "10.3.1" + circular-dependency-plugin "5.2.0" + copy-webpack-plugin "6.0.3" + fork-ts-checker-webpack-plugin "^3.1.1" + license-webpack-plugin "2.1.2" + source-map-support "0.5.16" + tree-kill "1.2.2" + ts-loader "5.4.5" + tsconfig-paths-webpack-plugin "3.2.0" + webpack "4.42.0" + webpack-dev-server "3.11.0" + webpack-merge "4.2.1" + webpack-node-externals "1.7.2" + "@nrwl/react@10.3.1": version "10.3.1" resolved "https://registry.yarnpkg.com/@nrwl/react/-/react-10.3.1.tgz#554b4cedbc4e2a2cf776beabe7f34aa8eed8eefd" @@ -2392,10 +2416,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.9.tgz#8ffcae8b41606e6c8d3dfb1ab2a84c85cb20d645" integrity sha512-iXuiZ65PL5c8VAlF426GVJGKcsnAb2rW2037LJe3G6eM6nz35bK9QAUOH3Ic3kF4ZcKLpM02sFkSzCflIpoIKA== -"@types/node@~8.9.4": - version "8.9.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.9.5.tgz#162b864bc70be077e6db212b322754917929e976" - integrity sha512-jRHfWsvyMtXdbhnz5CVHxaBgnV6duZnPlQuRSo/dm/GnmikNcmZhxIES4E9OZjUmQ8C+HCl4KJux+cXN/ErGDQ== +"@types/node@^14.11.10": + version "14.11.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.11.10.tgz#8c102aba13bf5253f35146affbf8b26275069bef" + integrity sha512-yV1nWZPlMFpoXyoknm4S56y2nlTAuFYaJuQtYRAOU7xA/FJ9RY0Xm7QOkaYMMmr8ESdHIuUb6oQgR/0+2NqlyA== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -2417,6 +2441,13 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== +"@types/puppeteer@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-3.0.2.tgz#20085220593b560c7332b6d46aecaf81ae263540" + integrity sha512-JRuHPSbHZBadOxxFwpyZPeRlpPTTeMbQneMdpFd8LXdyNfFSiX950CGewdm69g/ipzEAXAmMyFF1WOWJOL/nKw== + dependencies: + "@types/node" "*" + "@types/q@^1.5.1": version "1.5.4" resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" @@ -2493,6 +2524,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yauzl@^2.9.1": + version "2.9.1" + resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.1.tgz#d10f69f9f522eef3cf98e30afb684a1e1ec923af" + integrity sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA== + dependencies: + "@types/node" "*" + "@typescript-eslint/eslint-plugin@4.3.0": version "4.3.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.3.0.tgz#1a23d904bf8ea248d09dc3761af530d90f39c8fa" @@ -2975,6 +3013,11 @@ adjust-sourcemap-loader@2.0.0: object-path "0.11.4" regex-parser "2.2.10" +agent-base@5: + version "5.1.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" + integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g== + agent-base@6: version "6.0.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.1.tgz#808007e4e5867decb0ab6ab2f928fbdb5a596db4" @@ -3620,6 +3663,15 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" +bl@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.0.3.tgz#12d6287adc29080e22a705e5764b2a9522cdc489" + integrity sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + bluebird@3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" @@ -3864,7 +3916,7 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= -buffer@5.6.0: +buffer@5.6.0, buffer@^5.2.1, buffer@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== @@ -5275,6 +5327,11 @@ detect-node@^2.0.4: resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== +devtools-protocol@0.0.799653: + version "0.0.799653" + resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.799653.tgz#86fc95ce5bf4fdf4b77a58047ba9d2301078f119" + integrity sha512-t1CcaZbvm8pOlikqrsIM9GOa7Ipp07+4h/q9u0JXBWjPCjHdBl9KkddX87Vv9vBHoBGtwV79sYQNGnQM6iS5gg== + dezalgo@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" @@ -5585,7 +5642,7 @@ encoding@^0.1.12: dependencies: iconv-lite "^0.6.2" -end-of-stream@^1.0.0, end-of-stream@^1.1.0: +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== @@ -6208,6 +6265,17 @@ extract-zip@^1.7.0: mkdirp "^0.5.4" yauzl "^2.10.0" +extract-zip@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" + integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== + dependencies: + debug "^4.1.1" + get-stream "^5.1.0" + yauzl "^2.10.0" + optionalDependencies: + "@types/yauzl" "^2.9.1" + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -6528,6 +6596,11 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + fs-extra@7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -6639,7 +6712,7 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" -get-stream@^5.0.0: +get-stream@^5.0.0, get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== @@ -7096,6 +7169,14 @@ https-proxy-agent@5.0.0, https-proxy-agent@^5.0.0: agent-base "6" debug "4" +https-proxy-agent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" + integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== + dependencies: + agent-base "5" + debug "4" + human-signals@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" @@ -9042,6 +9123,11 @@ mixin-object@^2.0.1: for-in "^0.1.3" is-extendable "^0.1.1" +mkdirp-classic@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + mkdirp@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c" @@ -10635,7 +10721,7 @@ process@0.11.10, process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -progress@^2.0.0: +progress@^2.0.0, progress@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== @@ -10699,6 +10785,11 @@ proxy-addr@~2.0.5: forwarded "~0.1.2" ipaddr.js "1.9.1" +proxy-from-env@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -10761,6 +10852,23 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +puppeteer@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-5.3.1.tgz#324e190d89f25ac33dba539f57b82a18553f8646" + integrity sha512-YTM1RaBeYrj6n7IlRXRYLqJHF+GM7tasbvrNFx6w1S16G76NrPq7oYFKLDO+BQsXNtS8kW2GxWCXjIMPvfDyaQ== + dependencies: + debug "^4.1.0" + devtools-protocol "0.0.799653" + extract-zip "^2.0.0" + https-proxy-agent "^4.0.0" + pkg-dir "^4.2.0" + progress "^2.0.1" + proxy-from-env "^1.0.0" + rimraf "^3.0.2" + tar-fs "^2.0.0" + unbzip2-stream "^1.3.3" + ws "^7.2.3" + q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -10944,7 +11052,7 @@ read-pkg@^5.2.0: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.0.6, readable-stream@^3.5.0, readable-stream@^3.6.0: +readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.5.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -12442,6 +12550,27 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== +tar-fs@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.0.tgz#d1cdd121ab465ee0eb9ccde2d35049d3f3daf0d5" + integrity sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg== + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.0.0" + +tar-stream@^2.0.0: + version "2.1.4" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.4.tgz#c4fb1a11eb0da29b893a5b25476397ba2d053bfa" + integrity sha512-o3pS2zlG4gxr67GmFYBLlq+dM8gyRGUOvsrHclSkvtVtQbjV0s/+ZE8OpICbaj8clrX3tjeHngYGP7rweaBnuw== + dependencies: + bl "^4.0.3" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + tar@^6.0.1, tar@^6.0.2: version "6.0.5" resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.5.tgz#bde815086e10b39f1dcd298e89d596e1535e200f" @@ -12888,6 +13017,14 @@ typescript@~4.0.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5" integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg== +unbzip2-stream@^1.3.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" + integrity sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg== + dependencies: + buffer "^5.2.1" + through "^2.3.8" + unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818"