├── .bmp.yml ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md └── workflows │ └── ci.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── build_test.ts ├── bundle_util.ts ├── bundle_util_test.ts ├── cli.ts ├── cli_test.ts ├── deno.json ├── deps.ts ├── docs ├── .gitignore ├── Makefile ├── _config.js ├── _includes │ └── layout.njk ├── _site │ ├── examples │ │ ├── preact │ │ │ └── index.html │ │ ├── react │ │ │ └── index.html │ │ ├── simple │ │ │ └── index.html │ │ └── styled-components │ │ │ └── index.html │ ├── getting-started │ │ ├── cli-command │ │ │ └── index.html │ │ ├── getting-started │ │ │ └── index.html │ │ └── type-checking │ │ │ └── index.html │ ├── guides │ │ ├── registry-cdn │ │ │ └── index.html │ │ └── static-dir │ │ │ └── index.html │ ├── index.html │ ├── logo-v2.svg │ ├── markdown.css │ ├── monaco-editor │ │ └── min │ │ │ └── vs │ │ │ ├── basic-languages │ │ │ ├── bat │ │ │ │ └── bat.js │ │ │ ├── coffee │ │ │ │ └── coffee.js │ │ │ ├── css │ │ │ │ └── css.js │ │ │ ├── dockerfile │ │ │ │ └── dockerfile.js │ │ │ ├── graphql │ │ │ │ └── graphql.js │ │ │ ├── handlebars │ │ │ │ └── handlebars.js │ │ │ ├── html │ │ │ │ └── html.js │ │ │ ├── ini │ │ │ │ └── ini.js │ │ │ ├── javascript │ │ │ │ └── javascript.js │ │ │ ├── less │ │ │ │ └── less.js │ │ │ ├── markdown │ │ │ │ └── markdown.js │ │ │ ├── powershell │ │ │ │ └── powershell.js │ │ │ ├── pug │ │ │ │ └── pug.js │ │ │ ├── restructuredtext │ │ │ │ └── restructuredtext.js │ │ │ ├── scss │ │ │ │ └── scss.js │ │ │ ├── shell │ │ │ │ └── shell.js │ │ │ ├── typescript │ │ │ │ └── typescript.js │ │ │ ├── xml │ │ │ │ └── xml.js │ │ │ └── yaml │ │ │ │ └── yaml.js │ │ │ ├── editor │ │ │ ├── editor.main.css │ │ │ ├── editor.main.js │ │ │ └── editor.main.nls.js │ │ │ ├── language │ │ │ ├── css │ │ │ │ └── cssMode.js │ │ │ ├── html │ │ │ │ └── htmlMode.js │ │ │ ├── json │ │ │ │ └── jsonMode.js │ │ │ └── typescript │ │ │ │ └── tsMode.js │ │ │ └── loader.js │ └── styles.css ├── deploy.js ├── examples │ ├── _data.yml │ ├── preact.md │ ├── react.md │ ├── simple.md │ └── styled-components.md ├── getting-started │ ├── _data.yml │ ├── cli-command.md │ ├── getting-started.md │ └── type-checking.md ├── guides │ ├── _data.yml │ ├── registry-cdn.md │ └── static-dir.md ├── index.md ├── logo-v2.svg ├── logo.png ├── logo.sketch ├── markdown.css ├── monaco-editor │ └── min │ │ └── vs │ │ ├── basic-languages │ │ ├── bat │ │ │ └── bat.js │ │ ├── coffee │ │ │ └── coffee.js │ │ ├── css │ │ │ └── css.js │ │ ├── dockerfile │ │ │ └── dockerfile.js │ │ ├── graphql │ │ │ └── graphql.js │ │ ├── handlebars │ │ │ └── handlebars.js │ │ ├── html │ │ │ └── html.js │ │ ├── ini │ │ │ └── ini.js │ │ ├── javascript │ │ │ └── javascript.js │ │ ├── less │ │ │ └── less.js │ │ ├── markdown │ │ │ └── markdown.js │ │ ├── powershell │ │ │ └── powershell.js │ │ ├── pug │ │ │ └── pug.js │ │ ├── restructuredtext │ │ │ └── restructuredtext.js │ │ ├── scss │ │ │ └── scss.js │ │ ├── shell │ │ │ └── shell.js │ │ ├── typescript │ │ │ └── typescript.js │ │ ├── xml │ │ │ └── xml.js │ │ └── yaml │ │ │ └── yaml.js │ │ ├── editor │ │ ├── editor.main.css │ │ ├── editor.main.js │ │ └── editor.main.nls.js │ │ ├── language │ │ ├── css │ │ │ └── cssMode.js │ │ ├── html │ │ │ └── htmlMode.js │ │ ├── json │ │ │ └── jsonMode.js │ │ └── typescript │ │ │ └── tsMode.js │ │ └── loader.js ├── package.json ├── script.js ├── styles.css └── twd.ts ├── examples ├── external-reference │ ├── index.html │ └── main.js ├── import-map │ ├── css │ │ └── style.css │ ├── import_map.json │ ├── index.html │ ├── js │ │ └── script.tsx │ └── tsconfig.json ├── react-router │ ├── css │ │ └── style.css │ ├── index.html │ ├── js │ │ └── script.tsx │ └── tsconfig.json ├── react-simple │ ├── css │ │ └── style.css │ ├── index.html │ ├── js │ │ └── script.tsx │ └── tsconfig.json ├── scss-no-import │ ├── index.html │ └── style.scss ├── simple │ └── index.html ├── static-dir │ ├── css │ │ └── style.css │ ├── hi.html │ ├── index.html │ ├── js │ │ ├── foo.js │ │ └── script.js │ └── static │ │ ├── bar.txt │ │ ├── baz.txt │ │ └── foo.txt ├── styled-components │ ├── index.html │ ├── js │ │ └── script.tsx │ └── tsconfig.json ├── with-imports │ ├── css │ │ └── style.css │ ├── images │ │ ├── logo.svg │ │ └── logo.webp │ ├── index.html │ └── js │ │ ├── foo.js │ │ └── script.js └── with-simple-assets │ ├── css │ └── style.css │ ├── hi.html │ ├── images │ └── logo.svg │ ├── index.html │ └── js │ └── script.js ├── generate_assets.ts ├── generate_assets_test.ts ├── generate_static_assets.ts ├── livereload_server.ts ├── livereload_server_test.ts ├── logger_util.ts ├── sass_util.ts ├── sass_util_test.ts ├── serve_test.ts ├── test_deps.ts ├── testdata ├── bar.js ├── baz.js └── foo.js ├── util.ts └── util_test.ts /.bmp.yml: -------------------------------------------------------------------------------- 1 | version: 0.2.6 2 | commit: 'chore: bump to %.%.%' 3 | files: 4 | README.md: 5 | - packup v%.%.% 6 | - packup@v%.%.% 7 | deps.ts: const VERSION = "v%.%.%"; 8 | docs/_includes/layout.njk: 9 | - 'https://deno.land/x/packup@v%.%.%' 10 | - v%.%.% 11 | docs/getting-started/getting-started.md: 12 | - 'https://deno.land/x/packup@v%.%.%/cli.ts' 13 | - packup v%.%.% 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Describe the bug** A clear and concise description of what the bug is. 10 | 11 | **To Reproduce** Steps to reproduce the behavior: 12 | 13 | 1. Go to '...' 14 | 2. Click on '....' 15 | 3. Scroll down to '....' 16 | 4. See error 17 | 18 | **Expected behavior** A clear and concise description of what you expected to 19 | happen. 20 | 21 | **Screenshots** If applicable, add screenshots to help explain your problem. 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** A clear and 11 | concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** A clear and concise description of what you 14 | want to happen. 15 | 16 | **Describe alternatives you've considered** A clear and concise description of 17 | any alternative solutions or features you've considered. 18 | 19 | **Additional context** Add any other context or screenshots about the feature 20 | request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | push: 4 | branches: main 5 | pull_request: 6 | branches: main 7 | jobs: 8 | build: 9 | strategy: 10 | matrix: 11 | os: 12 | - ubuntu-latest 13 | - windows-latest 14 | runs-on: ${{ matrix.os }} 15 | timeout-minutes: 5 16 | steps: 17 | - uses: actions/checkout@v4 18 | - uses: denoland/setup-deno@v1 19 | with: 20 | deno-version: v1.x 21 | - run: deno fmt --check 22 | if: matrix.os == 'ubuntu-latest' 23 | - run: deno lint 24 | if: matrix.os == 'ubuntu-latest' 25 | - run: deno task cov 26 | - uses: codecov/codecov-action@v3 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | dist 3 | /.vscode 4 | /.vim 5 | 6 | # parcel 7 | .parcel-cache 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | Copyright © 2021 Yoshiya Hinosawa ( @kt3k ) 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ex-build: 2 | deno run -A cli.ts build examples/simple/index.html 3 | 4 | ex-serve: 5 | deno run -A cli.ts serve examples/simple/index.html 6 | 7 | ex2: 8 | deno run -A cli.ts serve --static-dir examples/static-dir/static examples/with-imports/index.html 9 | 10 | ex2-o: 11 | deno run -A cli.ts serve -o --static-dir examples/static-dir/static examples/with-imports/index.html 12 | 13 | ex2-debug: 14 | deno run -A cli.ts serve --log-level=debug --static-dir examples/static-dir/static examples/with-imports/index.html 15 | 16 | ex2-build: 17 | deno run -A cli.ts build --static-dir examples/static-dir/static examples/with-imports/index.html 18 | 19 | ex2-build-debug: 20 | deno run -A cli.ts build --log-level=debug --static-dir examples/static-dir/static examples/with-imports/index.html 21 | 22 | ex-react: 23 | deno run -A cli.ts serve examples/react-simple/index.html 24 | 25 | ex-rr: 26 | deno run -A cli.ts serve examples/react-router/index.html 27 | 28 | ex-sc: 29 | deno run -A cli.ts serve -L debug examples/styled-components/index.html 30 | 31 | publish-doc: 32 | $(MAKE) -C docs d 33 | git add docs/_site 34 | git commit -m "chore: update doc site" 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # packup v0.2.6 4 | 5 | [![ci](https://github.com/kt3k/packup/actions/workflows/ci.yml/badge.svg)](https://github.com/kt3k/packup/actions/workflows/ci.yml) 6 | [![codecov](https://codecov.io/gh/kt3k/packup/branch/main/graph/badge.svg?token=OjZni3m4yk)](https://codecov.io/gh/kt3k/packup) 7 | 8 | > Zero-config web application packager for [Deno][Deno]. 9 | 10 | # Features 11 | 12 | - 📦 Bundle web application like [Parcel][Parcel]. 13 | - ✨ Support TypeScript out of the box. 14 | - 🦕 Deno-compatible ES Modules resolution. 15 | - 💨 Fast build with [esbuild][esbuild] bundler. 16 | 17 | # Usage 18 | 19 | Install via deno.land/x: 20 | 21 | ```shell 22 | deno install -qAf https://deno.land/x/packup@v0.2.6/cli.ts 23 | ``` 24 | 25 | Write HTML and JavaScript: 26 | 27 | index.html 28 | 29 | ```html 30 | 31 | 32 | 33 |

Hi from packup!

34 | 35 | 36 | ``` 37 | 38 | main.ts 39 | 40 | ```js 41 | console.log("hello world"); 42 | ``` 43 | 44 | `packup` has the development server builtin. Run the following command to start 45 | the server. 46 | 47 | ``` 48 | packup index.html 49 | ``` 50 | 51 | Then open http://localhost:1234/ in your browser. 52 | 53 | See `packup serve -h` and `packup build -h` for more usages. 54 | 55 | # Typings 56 | 57 | You can type check the script with [Deno][Deno]. 58 | 59 | You need the following `tsconfig.json` for your frontend scripts correctly type 60 | checked. 61 | 62 | ```json 63 | { 64 | "compilerOptions": { 65 | "lib": ["esnext", "dom"] 66 | } 67 | } 68 | ``` 69 | 70 | If you use vscode you need to set 'deno.config' property in 71 | `.vscode/settings.json` file to point the tsconfig.json: 72 | 73 | ```json 74 | { 75 | "deno.enable": true, 76 | "deno.lint": true, 77 | "deno.unstable": true, 78 | "deno.config": "./tsconfig.json" 79 | } 80 | ``` 81 | 82 | If you'd prefer to use CLI directly to type check your script, you can use the 83 | following command for it: 84 | 85 | ```sh 86 | deno cache --config tsconfig.json 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/_site/monaco-editor/min/vs/basic-languages/bat/bat.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/bat/bat",["require","exports"],(function(e,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.language=s.conf=void 0,s.conf={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},s.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},n.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=>",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}}})); -------------------------------------------------------------------------------- /docs/_site/monaco-editor/min/vs/basic-languages/dockerfile/dockerfile.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/dockerfile/dockerfile",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.language=o.conf=void 0,o.conf={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},o.language={defaultToken:"",tokenPostfix:".dockerfile",variable:/\${?[\w]+}?/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/(ONBUILD)(\s+)/,["keyword",""]],[/(ENV)(\s+)([\w]+)/,["keyword","",{token:"variable",next:"@arguments"}]],[/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/,{token:"keyword",next:"@arguments"}]],arguments:[{include:"@whitespace"},{include:"@strings"},[/(@variable)/,{cases:{"@eos":{token:"variable",next:"@popall"},"@default":"variable"}}],[/\\/,{cases:{"@eos":"","@default":""}}],[/./,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],whitespace:[[/\s+/,{cases:{"@eos":{token:"",next:"@popall"},"@default":""}}]],comment:[[/(^#.*$)/,"comment","@popall"]],strings:[[/\\'$/,"","@popall"],[/\\'/,""],[/'$/,"string","@popall"],[/'/,"string","@stringBody"],[/"$/,"string","@popall"],[/"/,"string","@dblStringBody"]],stringBody:[[/[^\\\$']/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/'$/,"string","@popall"],[/'/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]],dblStringBody:[[/[^\\\$"]/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/\\./,"string.escape"],[/"$/,"string","@popall"],[/"/,"string","@pop"],[/(@variable)/,"variable"],[/\\$/,"string"],[/$/,"string","@popall"]]}}})); -------------------------------------------------------------------------------- /docs/_site/monaco-editor/min/vs/basic-languages/graphql/graphql.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/graphql/graphql",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""',notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"""',close:'"""'},{open:'"',close:'"'}],folding:{offSide:!0}},n.language={defaultToken:"invalid",tokenPostfix:".gql",keywords:["null","true","false","query","mutation","subscription","extend","schema","directive","scalar","type","interface","union","enum","input","implements","fragment","on"],typeKeywords:["Int","Float","String","Boolean","ID"],directiveLocations:["SCHEMA","SCALAR","OBJECT","FIELD_DEFINITION","ARGUMENT_DEFINITION","INTERFACE","UNION","ENUM","ENUM_VALUE","INPUT_OBJECT","INPUT_FIELD_DEFINITION","QUERY","MUTATION","SUBSCRIPTION","FIELD","FRAGMENT_DEFINITION","FRAGMENT_SPREAD","INLINE_FRAGMENT","VARIABLE_DEFINITION"],operators:["=","!","?",":","&","|"],symbols:/[=!?:&|]+/,escapes:/\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/,tokenizer:{root:[[/[a-z_][\w$]*/,{cases:{"@keywords":"keyword","@default":"key.identifier"}}],[/[$][\w$]*/,{cases:{"@keywords":"keyword","@default":"argument.identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@typeKeywords":"keyword","@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,{token:"annotation",log:"annotation token: $0"}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"""/,{token:"string",next:"@mlstring",nextEmbedded:"markdown"}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}]],mlstring:[[/[^"]+/,"string"],['"""',{token:"string",next:"@pop",nextEmbedded:"@pop"}]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/#.*$/,"comment"]]}}})); -------------------------------------------------------------------------------- /docs/_site/monaco-editor/min/vs/basic-languages/html/html.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/html/html",["require","exports","../fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0;var i=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["\x3c!--","--\x3e"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp("<(?!(?:"+i.join("|")+"))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:n.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(?!(?:"+i.join("|")+"))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:n.languages.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#endregion\\b.*--\x3e")}}},t.language={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}})); -------------------------------------------------------------------------------- /docs/_site/monaco-editor/min/vs/basic-languages/ini/ini.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/ini/ini",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}})); -------------------------------------------------------------------------------- /docs/_site/monaco-editor/min/vs/basic-languages/javascript/javascript.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/typescript/typescript",["require","exports","../fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:n.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:n.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:n.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:n.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},t.language={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","package","private","protected","public","readonly","require","global","return","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}}})),define("vs/basic-languages/javascript/javascript",["require","exports","../typescript/typescript"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf=n.conf,t.language={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:n.language.operators,symbols:n.language.symbols,escapes:n.language.escapes,digits:n.language.digits,octaldigits:n.language.octaldigits,binarydigits:n.language.binarydigits,hexdigits:n.language.hexdigits,regexpctl:n.language.regexpctl,regexpesc:n.language.regexpesc,tokenizer:n.language.tokenizer}})); -------------------------------------------------------------------------------- /docs/_site/monaco-editor/min/vs/basic-languages/less/less.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/less/less",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},t.language={defaultToken:"",tokenPostfix:".less",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",identifierPlus:"-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@nestedJSBegin"},["[ \\t\\r\\n]+",""],{include:"@comments"},{include:"@keyword"},{include:"@strings"},{include:"@numbers"},["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))","attribute.name","@attribute"],["url(\\-prefix)?\\(",{token:"tag",next:"@urldeclaration"}],["[{}()\\[\\]]","@brackets"],["[,:;]","delimiter"],["#@identifierPlus","tag.id"],["&","tag"],["\\.@identifierPlus(?=\\()","tag.class","@attribute"],["\\.@identifierPlus","tag.class"],["@identifierPlus","tag"],{include:"@operators"},["@(@identifier(?=[:,\\)]))","variable","@attribute"],["@(@identifier)","variable"],["@","key","@atRules"]],nestedJSBegin:[["``","delimiter.backtick"],["`",{token:"delimiter.backtick",next:"@nestedJSEnd",nextEmbedded:"text/javascript"}]],nestedJSEnd:[["`",{token:"delimiter.backtick",next:"@pop",nextEmbedded:"@pop"}]],operators:[["[<>=\\+\\-\\*\\/\\^\\|\\~]","operator"]],keyword:[["(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b","keyword"]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"tag",next:"@pop"}]],attribute:[{include:"@nestedJSBegin"},{include:"@comments"},{include:"@strings"},{include:"@numbers"},{include:"@keyword"},["[a-zA-Z\\-]+(?=\\()","attribute.value","@attribute"],[">","operator","@pop"],["@identifier","attribute.value"],{include:"@operators"},["@(@identifier)","variable"],["[)\\}]","@brackets","@pop"],["[{}()\\[\\]>]","@brackets"],["[;]","delimiter","@pop"],["[,=:]","delimiter"],["\\s",""],[".","attribute.value"]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],numbers:[["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],strings:[['~?"',{token:"string.delimiter",next:"@stringsEndDoubleQuote"}],["~?'",{token:"string.delimiter",next:"@stringsEndQuote"}]],stringsEndDoubleQuote:[['\\\\"',"string"],['"',{token:"string.delimiter",next:"@popall"}],[".","string"]],stringsEndQuote:[["\\\\'","string"],["'",{token:"string.delimiter",next:"@popall"}],[".","string"]],atRules:[{include:"@comments"},{include:"@strings"},["[()]","delimiter"],["[\\{;]","delimiter","@pop"],[".","key"]]}}})); -------------------------------------------------------------------------------- /docs/_site/monaco-editor/min/vs/basic-languages/markdown/markdown.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/markdown/markdown",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},t.language={defaultToken:"",tokenPostfix:".md",control:/[\\`*_\[\]{}()#+\-\.!]/,noncontrol:/[^\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,jsescapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],tokenizer:{root:[[/^\s*\|/,"@rematch","@table_header"],[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,["white","keyword","keyword","keyword"]],[/^\s*(=+|\-+)\s*$/,"keyword"],[/^\s*((\*[ ]?)+)\s*$/,"meta.separator"],[/^\s*>+/,"comment"],[/^\s*([\*\-+:]|\d+\.)\s/,"keyword"],[/^(\t|[ ]{4})[^ ].*$/,"string"],[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/,{token:"string",next:"@codeblock"}],[/^\s*```\s*((?:\w|[\/\-#])+).*$/,{token:"string",next:"@codeblockgh",nextEmbedded:"$1"}],[/^\s*```\s*$/,{token:"string",next:"@codeblock"}],{include:"@linecontent"}],table_header:[{include:"@table_common"},[/[^\|]+/,"keyword.table.header"]],table_body:[{include:"@table_common"},{include:"@linecontent"}],table_common:[[/\s*[\-:]+\s*/,{token:"keyword",switchTo:"table_body"}],[/^\s*\|/,"keyword.table.left"],[/^\s*[^\|]/,"@rematch","@pop"],[/^\s*$/,"@rematch","@pop"],[/\|/,{cases:{"@eos":"keyword.table.right","@default":"keyword.table.middle"}}]],codeblock:[[/^\s*~~~\s*$/,{token:"string",next:"@pop"}],[/^\s*```\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblockgh:[[/```\s*$/,{token:"variable.source",next:"@pop",nextEmbedded:"@pop"}],[/[^`]+/,"variable.source"]],linecontent:[[/&\w+;/,"string.escape"],[/@escapes/,"escape"],[/\b__([^\\_]|@escapes|_(?!_))+__\b/,"strong"],[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/,"strong"],[/\b_[^_]+_\b/,"emphasis"],[/\*([^\\*]|@escapes)+\*/,"emphasis"],[/`([^\\`]|@escapes)+`/,"variable"],[/\{+[^}]+\}+/,"string.target"],[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/,["string.link","","string.link"]],[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/,"string.link"],{include:"html"}],html:[[/<(\w+)\/>/,"tag"],[/<(\w+)/,{cases:{"@empty":{token:"tag",next:"@tag.$1"},"@default":{token:"tag",next:"@tag.$1"}}}],[/<\/(\w+)\s*>/,{token:"tag"}],[//,"comment","@pop"],[//,{token:"comment",next:"@pop"}],[//,{token:"comment",next:"@pop"}],[//,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}})); -------------------------------------------------------------------------------- /docs/monaco-editor/min/vs/basic-languages/ini/ini.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/ini/ini",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}})); -------------------------------------------------------------------------------- /docs/monaco-editor/min/vs/basic-languages/javascript/javascript.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/typescript/typescript",["require","exports","../fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:n.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:n.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:n.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:n.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},t.language={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","package","private","protected","public","readonly","require","global","return","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([gimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}}})),define("vs/basic-languages/javascript/javascript",["require","exports","../typescript/typescript"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf=n.conf,t.language={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:n.language.operators,symbols:n.language.symbols,escapes:n.language.escapes,digits:n.language.digits,octaldigits:n.language.octaldigits,binarydigits:n.language.binarydigits,hexdigits:n.language.hexdigits,regexpctl:n.language.regexpctl,regexpesc:n.language.regexpesc,tokenizer:n.language.tokenizer}})); -------------------------------------------------------------------------------- /docs/monaco-editor/min/vs/basic-languages/less/less.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/less/less",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={wordPattern:/(#?-?\d*\.\d\w*%?)|([@#!.:]?[\w-?]+%?)|[@#!.]/g,comments:{blockComment:["/*","*/"],lineComment:"//"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},t.language={defaultToken:"",tokenPostfix:".less",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",identifierPlus:"-?-?([a-zA-Z:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-:.]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@nestedJSBegin"},["[ \\t\\r\\n]+",""],{include:"@comments"},{include:"@keyword"},{include:"@strings"},{include:"@numbers"},["[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))","attribute.name","@attribute"],["url(\\-prefix)?\\(",{token:"tag",next:"@urldeclaration"}],["[{}()\\[\\]]","@brackets"],["[,:;]","delimiter"],["#@identifierPlus","tag.id"],["&","tag"],["\\.@identifierPlus(?=\\()","tag.class","@attribute"],["\\.@identifierPlus","tag.class"],["@identifierPlus","tag"],{include:"@operators"},["@(@identifier(?=[:,\\)]))","variable","@attribute"],["@(@identifier)","variable"],["@","key","@atRules"]],nestedJSBegin:[["``","delimiter.backtick"],["`",{token:"delimiter.backtick",next:"@nestedJSEnd",nextEmbedded:"text/javascript"}]],nestedJSEnd:[["`",{token:"delimiter.backtick",next:"@pop",nextEmbedded:"@pop"}]],operators:[["[<>=\\+\\-\\*\\/\\^\\|\\~]","operator"]],keyword:[["(@[\\s]*import|![\\s]*important|true|false|when|iscolor|isnumber|isstring|iskeyword|isurl|ispixel|ispercentage|isem|hue|saturation|lightness|alpha|lighten|darken|saturate|desaturate|fadein|fadeout|fade|spin|mix|round|ceil|floor|percentage)\\b","keyword"]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"tag",next:"@pop"}]],attribute:[{include:"@nestedJSBegin"},{include:"@comments"},{include:"@strings"},{include:"@numbers"},{include:"@keyword"},["[a-zA-Z\\-]+(?=\\()","attribute.value","@attribute"],[">","operator","@pop"],["@identifier","attribute.value"],{include:"@operators"},["@(@identifier)","variable"],["[)\\}]","@brackets","@pop"],["[{}()\\[\\]>]","@brackets"],["[;]","delimiter","@pop"],["[,=:]","delimiter"],["\\s",""],[".","attribute.value"]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[".","comment"]],numbers:[["(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],strings:[['~?"',{token:"string.delimiter",next:"@stringsEndDoubleQuote"}],["~?'",{token:"string.delimiter",next:"@stringsEndQuote"}]],stringsEndDoubleQuote:[['\\\\"',"string"],['"',{token:"string.delimiter",next:"@popall"}],[".","string"]],stringsEndQuote:[["\\\\'","string"],["'",{token:"string.delimiter",next:"@popall"}],[".","string"]],atRules:[{include:"@comments"},{include:"@strings"},["[()]","delimiter"],["[\\{;]","delimiter","@pop"],[".","key"]]}}})); -------------------------------------------------------------------------------- /docs/monaco-editor/min/vs/basic-languages/markdown/markdown.js: -------------------------------------------------------------------------------- 1 | /*!----------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53) 4 | * Released under the MIT license 5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md 6 | *-----------------------------------------------------------------------------*/ 7 | define("vs/basic-languages/markdown/markdown",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},t.language={defaultToken:"",tokenPostfix:".md",control:/[\\`*_\[\]{}()#+\-\.!]/,noncontrol:/[^\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,jsescapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],tokenizer:{root:[[/^\s*\|/,"@rematch","@table_header"],[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/,["white","keyword","keyword","keyword"]],[/^\s*(=+|\-+)\s*$/,"keyword"],[/^\s*((\*[ ]?)+)\s*$/,"meta.separator"],[/^\s*>+/,"comment"],[/^\s*([\*\-+:]|\d+\.)\s/,"keyword"],[/^(\t|[ ]{4})[^ ].*$/,"string"],[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/,{token:"string",next:"@codeblock"}],[/^\s*```\s*((?:\w|[\/\-#])+).*$/,{token:"string",next:"@codeblockgh",nextEmbedded:"$1"}],[/^\s*```\s*$/,{token:"string",next:"@codeblock"}],{include:"@linecontent"}],table_header:[{include:"@table_common"},[/[^\|]+/,"keyword.table.header"]],table_body:[{include:"@table_common"},{include:"@linecontent"}],table_common:[[/\s*[\-:]+\s*/,{token:"keyword",switchTo:"table_body"}],[/^\s*\|/,"keyword.table.left"],[/^\s*[^\|]/,"@rematch","@pop"],[/^\s*$/,"@rematch","@pop"],[/\|/,{cases:{"@eos":"keyword.table.right","@default":"keyword.table.middle"}}]],codeblock:[[/^\s*~~~\s*$/,{token:"string",next:"@pop"}],[/^\s*```\s*$/,{token:"string",next:"@pop"}],[/.*$/,"variable.source"]],codeblockgh:[[/```\s*$/,{token:"variable.source",next:"@pop",nextEmbedded:"@pop"}],[/[^`]+/,"variable.source"]],linecontent:[[/&\w+;/,"string.escape"],[/@escapes/,"escape"],[/\b__([^\\_]|@escapes|_(?!_))+__\b/,"strong"],[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/,"strong"],[/\b_[^_]+_\b/,"emphasis"],[/\*([^\\*]|@escapes)+\*/,"emphasis"],[/`([^\\`]|@escapes)+`/,"variable"],[/\{+[^}]+\}+/,"string.target"],[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/,["string.link","","string.link"]],[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/,"string.link"],{include:"html"}],html:[[/<(\w+)\/>/,"tag"],[/<(\w+)/,{cases:{"@empty":{token:"tag",next:"@tag.$1"},"@default":{token:"tag",next:"@tag.$1"}}}],[/<\/(\w+)\s*>/,{token:"tag"}],[//,"comment","@pop"],[//,{token:"comment",next:"@pop"}],[//,{token:"comment",next:"@pop"}],[/ 5 | 6 | 7 | 8 | 9 |

Hi!

10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/static-dir/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | with-simple-assets document 4 | 5 | 6 | 7 | 8 | 9 |

Hey!

10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/static-dir/js/foo.js: -------------------------------------------------------------------------------- 1 | export function foo() { 2 | console.log("hello from foo.js"); 3 | } 4 | -------------------------------------------------------------------------------- /examples/static-dir/js/script.js: -------------------------------------------------------------------------------- 1 | import { foo } from "./foo.js"; 2 | foo(); 3 | -------------------------------------------------------------------------------- /examples/static-dir/static/bar.txt: -------------------------------------------------------------------------------- 1 | bar 2 | -------------------------------------------------------------------------------- /examples/static-dir/static/baz.txt: -------------------------------------------------------------------------------- 1 | baz 2 | -------------------------------------------------------------------------------- /examples/static-dir/static/foo.txt: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /examples/styled-components/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | styled-components example 4 | 5 | 6 | 7 |
8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/styled-components/js/script.tsx: -------------------------------------------------------------------------------- 1 | import React from "https://esm.sh/react@17.0.2"; 2 | import ReactDOM from "https://esm.sh/react-dom@17.0.2"; 3 | import { 4 | BrowserRouter as Router, 5 | Link, 6 | Route, 7 | Switch, 8 | } from "https://esm.sh/react-router-dom@5.2.0"; 9 | import styled, { 10 | createGlobalStyle, 11 | } from "https://esm.sh/styled-components@5.3.0"; 12 | import { css } from "https://esm.sh/@emotion/css@11.1.3"; 13 | 14 | const GlobalStyle = createGlobalStyle` 15 | body { 16 | margin: 0; 17 | } 18 | `; 19 | 20 | function App() { 21 | return ( 22 | 23 | 24 |
25 | 38 | 39 | { 40 | /* A looks through its children s and 41 | renders the first one that matches the current URL. */ 42 | } 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
55 |
56 | ); 57 | } 58 | 59 | const List = styled.ul` 60 | display: flex; 61 | padding-inline-start: 0; 62 | 63 | li { 64 | list-style-type: none; 65 | margin-right: 8px; 66 | } 67 | `; 68 | 69 | const Nav = styled.nav` 70 | width: 100%; 71 | padding: 15px; 72 | border-bottom-width: 1px; 73 | border-bottom-style: solid; 74 | border-bottom-color: #eee; 75 | `; 76 | 77 | const Main = styled.main` 78 | padding: 15px; 79 | `; 80 | 81 | function Home() { 82 | return ( 83 |
84 | Home 85 |

86 | This text is styled by{" "} 87 | 88 | @emotion/css@11.1.3 89 | 90 |

91 |

92 | The heading is styled by{" "} 93 | 94 | styled-components@5.3.0 95 | 96 |

97 |
98 | ); 99 | } 100 | 101 | function About() { 102 | return ( 103 |
104 | About 105 |

106 | This text is styled by{" "} 107 | 108 | @emotion/css@11.1.3 109 | 110 |

111 |

112 | The heading is styled by{" "} 113 | 114 | styled-components@5.3.0 115 | 116 |

117 |
118 | ); 119 | } 120 | 121 | function Users() { 122 | return ( 123 |
124 | Users 125 |

126 | This text is styled by{" "} 127 | 128 | @emotion/css@11.1.3 129 | 130 |

131 |

132 | The heading is styled by{" "} 133 | 134 | styled-components@5.3.0 135 | 136 |

137 |
138 | ); 139 | } 140 | 141 | const Heading = styled.h2` 142 | font-size: 24px; 143 | font-weight: 900; 144 | color: #500; 145 | `; 146 | 147 | const textStyle = css` 148 | font-size: 12px; 149 | color: #050; 150 | `; 151 | 152 | function main() { 153 | ReactDOM.render(, document.querySelector("#main")); 154 | } 155 | 156 | addEventListener("DOMContentLoaded", () => { 157 | main(); 158 | }); 159 | -------------------------------------------------------------------------------- /examples/styled-components/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["esnext", "dom"] 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/with-imports/css/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | body { 7 | background-color: yellow; 8 | } 9 | -------------------------------------------------------------------------------- /examples/with-imports/images/logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kt3k/packup/6bd72fffa249774d2e6aa9cd6ff6fa9ce0dc05cf/examples/with-imports/images/logo.webp -------------------------------------------------------------------------------- /examples/with-imports/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | with-simple-assets document 4 | 5 | 6 | 7 | 8 | 9 |

Hey!

10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/with-imports/js/foo.js: -------------------------------------------------------------------------------- 1 | export function foo() { 2 | console.log("hello from foo.js"); 3 | } 4 | -------------------------------------------------------------------------------- /examples/with-imports/js/script.js: -------------------------------------------------------------------------------- 1 | import { foo } from "./foo.js"; 2 | 3 | window.addEventListener("DOMContentLoaded", () => { 4 | foo(); 5 | }); 6 | -------------------------------------------------------------------------------- /examples/with-simple-assets/css/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | body { 7 | background-color: yellow; 8 | } 9 | -------------------------------------------------------------------------------- /examples/with-simple-assets/hi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | with-simple-assets document 4 | 5 | 6 | 7 | 8 | 9 |

Hi!

10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/with-simple-assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | with-simple-assets document 4 | 5 | 6 | 7 | 8 | 9 |

Hi!

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/with-simple-assets/js/script.js: -------------------------------------------------------------------------------- 1 | console.log("hello from with-simple-assets document"); 2 | -------------------------------------------------------------------------------- /generate_assets_test.ts: -------------------------------------------------------------------------------- 1 | import { DOMParser } from "./deps.ts"; 2 | import { assert, assertEquals } from "./test_deps.ts"; 3 | import { extractReferencedAssets, generateAssets } from "./generate_assets.ts"; 4 | 5 | Deno.test("extractReferencedAssets - extracts referenced assets in the html document", () => { 6 | const assets = [...extractReferencedAssets( 7 | new DOMParser().parseFromString( 8 | ` 9 | 10 | 11 | Test document 12 | 13 | 14 | 15 | 16 | 17 |

18 | 21 | 22 | 23 | `, 24 | "text/html", 25 | )!, 26 | )]; 27 | assertEquals(assets.length, 3); 28 | assertEquals(assets[0].constructor.name, "ScriptAsset"); 29 | assertEquals(assets[1].constructor.name, "CssAsset"); 30 | assertEquals(assets[2].constructor.name, "ImageAsset"); 31 | }); 32 | 33 | Deno.test("extractReferencedAssets - references to http(s):// schemes are treated as external reference", () => { 34 | const assets = [...extractReferencedAssets( 35 | new DOMParser().parseFromString( 36 | ` 37 | 38 | 39 | Test document 40 | 41 | 42 | 43 | 44 |

45 | 48 | 49 | 50 | `, 51 | "text/html", 52 | )!, 53 | )]; 54 | assertEquals(assets.length, 0); 55 | }); 56 | 57 | Deno.test("generateAssets", async () => { 58 | const [gen] = await generateAssets("examples/with-imports/index.html", { 59 | publicUrl: ".", 60 | }); 61 | const assets = []; 62 | for await (const asset of gen) { 63 | assets.push(asset); 64 | } 65 | assertEquals(assets.length, 5); 66 | 67 | const [js, css, imgSrc, imgSrcset, html] = assets; 68 | assert(js.name.endsWith(".js")); 69 | assert(css.name.endsWith(".css")); 70 | assert(imgSrc.name.endsWith(".svg")); 71 | assert(imgSrcset.name.endsWith(".webp")); 72 | 73 | assertEquals(html.name, "index.html"); 74 | 75 | const htmlText = await html.text(); 76 | assert(htmlText.includes(`"${js.name}"`)); 77 | assert(htmlText.includes(`"${css.name}"`)); 78 | assert(htmlText.includes(`"${imgSrc.name}"`)); 79 | assert(htmlText.includes(`"${imgSrcset.name} 2x,`)); 80 | }); 81 | Deno.test("generateAssets - publicUrl=/", async () => { 82 | const [gen] = await generateAssets("examples/with-imports/index.html", { 83 | publicUrl: "/", 84 | }); 85 | const assets = []; 86 | for await (const asset of gen) { 87 | assets.push(asset); 88 | } 89 | const [js, css, imgSrc, imgSrcset, html] = assets; 90 | const htmlText = await html.text(); 91 | assert(htmlText.includes(`"/${js.name}"`)); 92 | assert(htmlText.includes(`"/${css.name}"`)); 93 | assert(htmlText.includes(`"/${imgSrc.name}"`)); 94 | assert(htmlText.includes(`"/${imgSrcset.name} 2x,`)); 95 | }); 96 | -------------------------------------------------------------------------------- /generate_static_assets.ts: -------------------------------------------------------------------------------- 1 | import { join, relative, walk } from "./deps.ts"; 2 | import { logger } from "./logger_util.ts"; 3 | 4 | export async function checkStaticDir(dir: string): Promise { 5 | try { 6 | const stat = await Deno.lstat(dir); 7 | if (stat.isDirectory) { 8 | logger.info(`Using "${dir}" as static directory`); 9 | return true; 10 | } else { 11 | logger.warn(`Error: "${dir}" is not directory`); 12 | return false; 13 | } 14 | } catch (e) { 15 | if (e.name === "NotFound") { 16 | logger.info(`No static dir "${dir}"`); 17 | return false; 18 | } 19 | logger.error(e); 20 | return false; 21 | } 22 | } 23 | 24 | type GenerateStaticAssetsOptions = { 25 | distPrefix: string; 26 | }; 27 | 28 | export async function* generateStaticAssets( 29 | dir: string, 30 | opts: GenerateStaticAssetsOptions, 31 | ): AsyncIterable { 32 | if (!await checkStaticDir(dir)) { 33 | return; 34 | } 35 | 36 | for await (const entry of walk(dir)) { 37 | if (!entry.isDirectory) { 38 | yield createStaticAssetFromPath(entry.path, dir, opts.distPrefix); 39 | } 40 | } 41 | } 42 | 43 | export async function* watchAndGenStaticAssets( 44 | dir: string, 45 | opts: GenerateStaticAssetsOptions, 46 | ): AsyncIterable { 47 | if (!await checkStaticDir(dir)) { 48 | return; 49 | } 50 | 51 | for await (const entry of walk(dir)) { 52 | if (!entry.isDirectory) { 53 | yield createStaticAssetFromPath(entry.path, dir, opts.distPrefix); 54 | } 55 | } 56 | 57 | for await (const e of Deno.watchFs(dir)) { 58 | for (const path of e.paths) { 59 | // TODO(kt3k): Make this concurrent 60 | try { 61 | const stat = await Deno.lstat(path); 62 | if (stat.isDirectory) { 63 | continue; 64 | } 65 | yield await createStaticAssetFromPath(path, dir, opts.distPrefix); 66 | } catch (e) { 67 | logger.error(e); 68 | } 69 | } 70 | } 71 | } 72 | 73 | async function createStaticAssetFromPath( 74 | path: string, 75 | root: string, 76 | distPrefix: string, 77 | ): Promise { 78 | logger.debug("Reading", path); 79 | const bytes = await Deno.readFile(path); 80 | const webkitRelativePath = relative(root, path); 81 | return new File([bytes], join(distPrefix, webkitRelativePath), { 82 | lastModified: 0, 83 | }); 84 | } 85 | -------------------------------------------------------------------------------- /livereload_server.ts: -------------------------------------------------------------------------------- 1 | import { logger } from "./logger_util.ts"; 2 | 3 | function livereloadScript(port: number) { 4 | return `window.onload = () => { 5 | new WebSocket("ws://localhost:${port}/livereload").onmessage = () => location.reload(); 6 | };`; 7 | } 8 | 9 | function handleWs(sock: WebSocket, eventtarget: EventTarget): void { 10 | logger.debug("socket connected!"); 11 | sock.onmessage = (ev) => { 12 | logger.debug("ws:Message", ev.data); 13 | sock.send(ev.data); 14 | }; 15 | sock.onopen = () => logger.debug("ws:Open"); 16 | sock.onclose = (ev) => { 17 | const { code, reason } = ev; 18 | logger.debug("ws:Close", code, reason); 19 | }; 20 | sock.onerror = (ev) => { 21 | logger.error("failed to receive frame:", ev); 22 | if (canCloseSocket(sock)) { 23 | sock.close(1000); 24 | } 25 | }; 26 | eventtarget.addEventListener("built", () => { 27 | logger.debug("got reload event!"); 28 | if (canCloseSocket(sock)) { 29 | sock.send(JSON.stringify({ type: "reload" })); 30 | sock.close(1000); 31 | } 32 | }, { once: true }); 33 | } 34 | 35 | function canCloseSocket(socket: WebSocket): boolean { 36 | return socket.readyState === socket.OPEN; 37 | } 38 | 39 | function handleHttp( 40 | request: Request, 41 | eventtarget: EventTarget, 42 | port: number, 43 | ): Response { 44 | const url = new URL(request.url); 45 | switch (url.pathname) { 46 | case "/livereload.js": 47 | return new Response(livereloadScript(port), { 48 | headers: { "content-type": "text/javascript" }, 49 | }); 50 | case "/livereload": { 51 | if (request.headers.get("upgrade") !== "websocket") { 52 | return new Response(null, { status: 404 }); 53 | } 54 | const { response, socket } = Deno.upgradeWebSocket(request); 55 | handleWs(socket, eventtarget); 56 | return response; 57 | } 58 | default: 59 | return new Response(null, { status: 404 }); 60 | } 61 | } 62 | 63 | interface LivereloadServer { 64 | close(): Promise; 65 | } 66 | 67 | export function livereloadServer( 68 | port = 35729, 69 | eventtarget: EventTarget, 70 | ): LivereloadServer { 71 | logger.debug(`livereload websocket server is running on port=${port}`); 72 | 73 | const server = Deno.serve({ 74 | port, 75 | // suppress unnecessary log 76 | onListen: () => {}, 77 | }, (request) => handleHttp(request, eventtarget, port)); 78 | 79 | return { 80 | async close() { 81 | await server.shutdown(); 82 | }, 83 | }; 84 | } 85 | -------------------------------------------------------------------------------- /livereload_server_test.ts: -------------------------------------------------------------------------------- 1 | import { livereloadServer } from "./livereload_server.ts"; 2 | import { 3 | assert, 4 | assertEquals, 5 | assertStringIncludes, 6 | deferred, 7 | } from "./test_deps.ts"; 8 | 9 | Deno.test("livereloadServer", async () => { 10 | const port = 34567; 11 | const eventtarget = new EventTarget(); 12 | const server = livereloadServer(port, eventtarget); 13 | try { 14 | const wsURL = `ws://localhost:${port}`; 15 | 16 | // Livereload server should serve livereload.js 17 | const res = await fetch(`http://localhost:${port}/livereload.js`); 18 | const text = await res.text(); 19 | assertStringIncludes(text, `new WebSocket("${wsURL}/livereload")`); 20 | 21 | // Livereload server should accept websocket requests 22 | const done = deferred(); 23 | let receivedMessage: string | undefined; 24 | const ws = new WebSocket(`${wsURL}/livereload`); 25 | // Livereload server automatically closes a websocket connection when 'built' event is dispatched 26 | ws.onclose = () => done.resolve(); 27 | ws.onopen = async () => { 28 | await new Promise((resolve) => setTimeout(resolve, 200)); 29 | eventtarget.dispatchEvent(new Event("built")); 30 | }; 31 | ws.onmessage = (ev: MessageEvent) => { 32 | receivedMessage = ev.data; 33 | }; 34 | ws.onerror = (ev) => done.reject(ev); 35 | 36 | await done; 37 | assert(receivedMessage); 38 | assertEquals(JSON.parse(receivedMessage), { type: "reload" }); 39 | } finally { 40 | await server.close(); 41 | } 42 | }); 43 | -------------------------------------------------------------------------------- /logger_util.ts: -------------------------------------------------------------------------------- 1 | import { 2 | create, 3 | Level, 4 | } from "https://raw.githubusercontent.com/kt3k/simple_logger/v0.0.3/mod.ts"; 5 | 6 | export let logger = create("info"); 7 | 8 | export function setLogLevel(l: Level) { 9 | logger = create(l); 10 | } 11 | -------------------------------------------------------------------------------- /sass_util.ts: -------------------------------------------------------------------------------- 1 | /** Compiles the given string into css. 2 | * 3 | * TODO(kt3k): Support importer 4 | */ 5 | export async function compile(text: string): Promise { 6 | // Use dynamic import because sass.js is slow to import 7 | const start = performance.now(); 8 | console.log("Importing sass"); 9 | const sass = await import("npm:sass@1.77.2"); 10 | console.log(`Imported sass in ${(performance.now() - start).toFixed(1)}ms`); 11 | const result = await sass.compileStringAsync(text); 12 | return result.css; 13 | } 14 | -------------------------------------------------------------------------------- /sass_util_test.ts: -------------------------------------------------------------------------------- 1 | import { compile } from "./sass_util.ts"; 2 | import { assertEquals } from "./test_deps.ts"; 3 | 4 | Deno.test("sass_util - compile", async () => { 5 | const scss = ".foo { &__bar { margin: 0; } }"; 6 | const css = await compile(scss); 7 | 8 | assertEquals(css, ".foo__bar {\n margin: 0;\n}"); 9 | }); 10 | -------------------------------------------------------------------------------- /serve_test.ts: -------------------------------------------------------------------------------- 1 | import { assertEquals, assertStringIncludes } from "./test_deps.ts"; 2 | 3 | Deno.test("cli.ts serve --port --livereload-port -- serves the site at the given port and livereload port", async () => { 4 | const cmd = new Deno.Command(Deno.execPath(), { 5 | args: [ 6 | "run", 7 | "-A", 8 | "cli.ts", 9 | "serve", 10 | "examples/simple/index.html", 11 | "--port", 12 | "4567", 13 | "--livereload-port", 14 | "34567", 15 | ], 16 | stdout: "piped", 17 | stderr: "inherit", 18 | }); 19 | const p = cmd.spawn(); 20 | const textDecoder = new TextDecoder(); 21 | 22 | const r = p.stdout.getReader(); 23 | const log = textDecoder.decode((await r.read()).value); 24 | 25 | console.log(log); 26 | assertStringIncludes(log, "Server running"); 27 | 28 | let res = await fetch("http://localhost:4567/index.html"); 29 | 30 | assertEquals( 31 | await res.text(), 32 | `
aaa
\n`, 33 | ); 34 | 35 | // Non existent path returns the same response as the main html. 36 | // This is useful for apps which use client side routing. 37 | res = await fetch("http://localhost:4567/asdf"); 38 | assertEquals( 39 | await res.text(), 40 | `
aaa
\n`, 41 | ); 42 | 43 | p.kill(); 44 | await r.cancel(); 45 | await p.status; 46 | }); 47 | -------------------------------------------------------------------------------- /test_deps.ts: -------------------------------------------------------------------------------- 1 | export { 2 | assert, 3 | assertEquals, 4 | assertStringIncludes, 5 | assertThrows, 6 | } from "https://deno.land/std@0.155.0/testing/asserts.ts"; 7 | 8 | export { deferred } from "https://deno.land/std@0.155.0/async/deferred.ts"; 9 | -------------------------------------------------------------------------------- /testdata/bar.js: -------------------------------------------------------------------------------- 1 | import { baz } from "./baz.js"; 2 | import { join } from "https://deno.land/std@0.95.0/path/mod.ts"; 3 | 4 | export { baz as bar, join }; 5 | -------------------------------------------------------------------------------- /testdata/baz.js: -------------------------------------------------------------------------------- 1 | export function baz() { 2 | console.log("hi"); 3 | } 4 | -------------------------------------------------------------------------------- /testdata/foo.js: -------------------------------------------------------------------------------- 1 | import { bar } from "./bar.js"; 2 | bar(); 3 | -------------------------------------------------------------------------------- /util.ts: -------------------------------------------------------------------------------- 1 | import { 2 | basename, 3 | crypto, 4 | Document, 5 | Element, 6 | fromFileUrl, 7 | MuxAsyncIterator, 8 | } from "./deps.ts"; 9 | 10 | export const decoder = new TextDecoder(); 11 | export const encoder = new TextEncoder(); 12 | 13 | export function md5(data: string | ArrayBuffer): string { 14 | const digest = crypto.subtle.digestSync( 15 | "MD5", 16 | typeof data === "string" ? new TextEncoder().encode(data) : data, 17 | ); 18 | const byteArray = Array.from(new Uint8Array(digest)); 19 | return byteArray.map((byte) => byte.toString(16).padStart(2, "0")).join(""); 20 | } 21 | 22 | export async function getDependencies(path: string): Promise { 23 | const p = new Deno.Command(Deno.execPath(), { 24 | args: ["info", "--json", path], 25 | stdout: "piped", 26 | stderr: "piped", 27 | }).spawn(); 28 | const [status, output, stderrOutput] = await Promise.all([ 29 | p.status, 30 | p.output(), 31 | p.stderr, 32 | ]); 33 | if (status.code !== 0) { 34 | throw new Error( 35 | decoder.decode((await stderrOutput.getReader().read()).value), 36 | ); 37 | } 38 | const denoInfo = JSON.parse(decoder.decode(output.stdout)) as DenoInfo; 39 | return denoInfo.modules.map((m) => m.specifier); 40 | } 41 | 42 | export async function getLocalDependencies(path: string): Promise { 43 | return (await getDependencies(path)).filter((s) => s.startsWith("file:")); 44 | } 45 | 46 | export async function getLocalDependencyPaths(path: string): Promise { 47 | return (await getLocalDependencies(path)).map(fromFileUrl); 48 | } 49 | 50 | type Dependency = { 51 | specifier: string; 52 | isDynamic: boolean; 53 | code: string; 54 | }; 55 | 56 | type Module = { 57 | specifier: string; 58 | dependencies: Dependency[]; 59 | size: number; 60 | mediaType: string; 61 | local: string; 62 | checksum: string; 63 | emit: string; 64 | }; 65 | 66 | type DenoInfo = { 67 | root: string; 68 | modules: Module[]; 69 | size: number; 70 | }; 71 | 72 | /** 73 | * querySelectorAll wrapper 74 | */ 75 | export function* qs( 76 | doc: Document, 77 | query: string, 78 | ): Generator { 79 | for (const node of doc.querySelectorAll(query)) { 80 | // deno-lint-ignore no-explicit-any 81 | yield node as any as Element; 82 | } 83 | } 84 | 85 | const KB = 2 ** 10; 86 | const MB = 2 ** 20; 87 | /** 88 | * Returns human readable byte size expression. 89 | * 90 | * e.g. 91 | * 1700 bytes -> 1.66KB 92 | * 1300000 bytes -> 1.24MB 93 | */ 94 | export function byteSize(n: number) { 95 | if (n > MB) { 96 | return `${(n / MB).toFixed(2)}MB`; 97 | } else if (n > KB) { 98 | return `${(n / KB).toFixed(2)}KB`; 99 | } 100 | return `${n}B`; 101 | } 102 | 103 | // TODO(kt3k): Remove this util when https://github.com/denoland/deno_std/pull/923 is merged. 104 | function asyncIterableToAsyncIterableIterator( 105 | iterable: AsyncIterable, 106 | ): AsyncIterableIterator { 107 | const iterator = iterable[Symbol.asyncIterator](); 108 | const iterableIterator = Object.assign(iterator, { 109 | [Symbol.asyncIterator]() { 110 | return iterableIterator; 111 | }, 112 | }); 113 | return iterableIterator; 114 | } 115 | 116 | export function mux(...iters: AsyncIterable[]): AsyncIterable { 117 | return iters.reduce((mux: MuxAsyncIterator, iter) => { 118 | mux.add(asyncIterableToAsyncIterableIterator(iter)); 119 | return mux; 120 | }, new MuxAsyncIterator()); 121 | } 122 | 123 | export function checkUniqueEntrypoints(paths: string[]): void { 124 | // Throw if there are any duplicate basenames 125 | const uniqueBasenames = new Set(paths.map((p) => basename(p))); 126 | if (uniqueBasenames.size !== paths.length) { 127 | throw new Error("Duplicate basenames"); 128 | } 129 | } 130 | 131 | /** 132 | * Returns `true` if the URL refers to a local file, 133 | * else retuns `false` if the URL is for an external resource. 134 | */ 135 | export function isLocalUrl(url: string): boolean { 136 | return !(url.startsWith("http://") || url.startsWith("https://")); 137 | } 138 | -------------------------------------------------------------------------------- /util_test.ts: -------------------------------------------------------------------------------- 1 | import { assertEquals, assertThrows } from "./test_deps.ts"; 2 | import { join } from "./deps.ts"; 3 | import { 4 | byteSize, 5 | checkUniqueEntrypoints, 6 | getDependencies, 7 | getLocalDependencies, 8 | getLocalDependencyPaths, 9 | md5, 10 | } from "./util.ts"; 11 | 12 | const normalize = (p: string) => join(p); 13 | 14 | Deno.test("md5 - returns md5 of the given data", () => { 15 | assertEquals(md5("a"), "0cc175b9c0f1b6a831c399e269772661"); 16 | assertEquals(md5("b"), "92eb5ffee6ae2fec3ad71c777531578f"); 17 | assertEquals(md5("c"), "4a8a08f09d37b73795649038408b5f33"); 18 | }); 19 | 20 | Deno.test("getDependencies - returns dependency specifiers", async () => { 21 | const cwd = Deno.cwd(); 22 | assertEquals( 23 | (await getDependencies("testdata/foo.js")).map(normalize), 24 | [ 25 | "file://" + join(cwd, "testdata/bar.js"), 26 | "file://" + join(cwd, "testdata/baz.js"), 27 | "file://" + join(cwd, "testdata/foo.js"), 28 | "https://deno.land/std@0.95.0/_util/assert.ts", 29 | "https://deno.land/std@0.95.0/_util/os.ts", 30 | "https://deno.land/std@0.95.0/path/_constants.ts", 31 | "https://deno.land/std@0.95.0/path/_interface.ts", 32 | "https://deno.land/std@0.95.0/path/_util.ts", 33 | "https://deno.land/std@0.95.0/path/common.ts", 34 | "https://deno.land/std@0.95.0/path/glob.ts", 35 | "https://deno.land/std@0.95.0/path/mod.ts", 36 | "https://deno.land/std@0.95.0/path/posix.ts", 37 | "https://deno.land/std@0.95.0/path/separator.ts", 38 | "https://deno.land/std@0.95.0/path/win32.ts", 39 | ].map(normalize), 40 | ); 41 | }); 42 | 43 | Deno.test("getLocalDependencies - returns local dependency specifiers", async () => { 44 | const cwd = Deno.cwd(); 45 | assertEquals( 46 | (await getLocalDependencies("testdata/foo.js")).map(normalize), 47 | [ 48 | "file://" + join(cwd, "testdata/bar.js"), 49 | "file://" + join(cwd, "testdata/baz.js"), 50 | "file://" + join(cwd, "testdata/foo.js"), 51 | ].map(normalize), 52 | ); 53 | }); 54 | 55 | Deno.test("getLocalDependencyPaths - returns local dependency paths", async () => { 56 | const cwd = Deno.cwd(); 57 | assertEquals( 58 | (await getLocalDependencyPaths("testdata/foo.js")).map(normalize), 59 | [ 60 | join(cwd, "testdata/bar.js"), 61 | join(cwd, "testdata/baz.js"), 62 | join(cwd, "testdata/foo.js"), 63 | ].map(normalize), 64 | ); 65 | }); 66 | 67 | Deno.test("byteSize", () => { 68 | assertEquals(byteSize(345), `345B`); 69 | assertEquals(byteSize(1700), `1.66KB`); 70 | assertEquals(byteSize(1300000), `1.24MB`); 71 | }); 72 | 73 | Deno.test("checkUniqueEntrypoints", () => { 74 | assertThrows(() => { 75 | checkUniqueEntrypoints(["index.html", "bar/index.html"]); 76 | }); 77 | assertThrows(() => { 78 | checkUniqueEntrypoints(["foo/index.html", "bar/index.html"]); 79 | }); 80 | checkUniqueEntrypoints(["index.html", "foo.html", "bar.html"]); // doesn't throw 81 | }); 82 | --------------------------------------------------------------------------------