diff --git a/.gitattributes b/.gitattributes index 9a0642d09..6501a79bc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Ignore changes in generated files -src/generated/resources/data/** linguist-generated +src/generated/** linguist-generated src/testMod/server-files/structures linguist-generated * text=auto diff --git a/.github/workflows/make-doc.sh b/.github/workflows/make-doc.sh index f22851bee..e7aca0e61 100755 --- a/.github/workflows/make-doc.sh +++ b/.github/workflows/make-doc.sh @@ -12,7 +12,7 @@ chmod 600 "$HOME/.ssh/key" # And upload rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \ - "$GITHUB_WORKSPACE/build/docs/lua/" \ + "$GITHUB_WORKSPACE/build/docs/site/" \ "$SSH_USER@$SSH_HOST:/$DEST" rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \ "$GITHUB_WORKSPACE/build/docs/javadoc/" \ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9afbdb4c..bae4f7b4f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,7 +65,7 @@ Gradle should be your entrypoint to building most documentation. There's two tas - `./gradlew luaJavadoc` - Generate documentation stubs for Java methods. - `./gradlew docWebsite` - Generate the whole website (including Javascript pages). The resulting HTML is stored at - `./build/docs/lua/`. + `./build/docs/site/`. #### Writing documentation illuaminate's documentation system is not currently documented (somewhat ironic), but is _largely_ the same as diff --git a/build.gradle b/build.gradle index e0d7077bf..84f464b6e 100644 --- a/build.gradle +++ b/build.gradle @@ -176,7 +176,7 @@ dependencies { exclude group: "org.jetbrains", module: "annotations" } - cctJavadoc 'cc.tweaked:cct-javadoc:1.4.5' + cctJavadoc 'cc.tweaked:cct-javadoc:1.4.6' } // Compile tasks @@ -317,7 +317,7 @@ task rollup(type: Exec) { task illuaminateDocs(type: Exec, dependsOn: [rollup, luaJavadoc]) { group = "build" - description = "Bundles JS into rollup" + description = "Generates docs using Illuaminate" inputs.files(fileTree("doc")).withPropertyName("docs") inputs.files(fileTree("src/main/resources/data/computercraft/lua/rom")).withPropertyName("lua rom") @@ -330,7 +330,21 @@ task illuaminateDocs(type: Exec, dependsOn: [rollup, luaJavadoc]) { commandLine mkCommand('"bin/illuaminate" doc-gen') } -task docWebsite(type: Copy, dependsOn: [illuaminateDocs]) { +task jsxDocs(type: Exec, dependsOn: [illuaminateDocs]) { + group = "build" + description = "Post-processes documentation to statically render some dynamic content." + + inputs.files(fileTree("src/web")).withPropertyName("sources") + inputs.file("src/generated/export/index.json").withPropertyName("export") + inputs.file("package-lock.json").withPropertyName("package-lock.json") + inputs.file("tsconfig.json").withPropertyName("Typescript config") + inputs.files(fileTree("$buildDir/docs/lua")) + outputs.dir("$buildDir/docs/site") + + commandLine mkCommand('"node_modules/.bin/ts-node" --esm src/web/transform.tsx') +} + +task docWebsite(type: Copy, dependsOn: [jsxDocs]) { from('doc') { include 'logo.png' include 'images/**' @@ -338,7 +352,14 @@ task docWebsite(type: Copy, dependsOn: [illuaminateDocs]) { from("$buildDir/rollup") { exclude 'index.js' } - into "${project.docsDir}/lua" + from("$buildDir/docs/lua") { + exclude '**/*.html' + } + from("src/generated/export/items") { + into("images/items") + } + + into "${project.docsDir}/site" } // Check tasks diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 580780514..cee659d46 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -83,7 +83,9 @@ - + + + diff --git a/gradle.properties b/gradle.properties index c769a3e3b..658970cf4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx3G # Mod properties -mod_version=1.100.5 +mod_version=1.100.6 # Minecraft properties (update mods.toml when changing) mc_version=1.19 diff --git a/package-lock.json b/package-lock.json index ec3137ce0..2cfb30386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,9 +15,18 @@ "devDependencies": { "@rollup/plugin-typescript": "^8.2.5", "@rollup/plugin-url": "^6.1.0", + "@types/glob": "^7.2.0", + "@types/react-dom": "^18.0.5", + "glob": "^8.0.3", + "react": "^18.1.0", + "react-dom": "^18.1.0", + "rehype": "^12.0.1", + "rehype-highlight": "^5.0.2", + "rehype-react": "^7.1.1", "requirejs": "^2.3.6", "rollup": "^2.33.1", "rollup-plugin-terser": "^7.0.2", + "ts-node": "^10.8.0", "typescript": "^4.0.5" } }, @@ -56,6 +65,79 @@ "node": ">=6.9.0" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@mapbox/hast-util-table-cell-style": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@mapbox/hast-util-table-cell-style/-/hast-util-table-cell-style-0.2.0.tgz", + "integrity": "sha512-gqaTIGC8My3LVSnU38IwjHVKJC94HSonjvFHDk8/aSrApL8v4uWgm8zJkK7MJIIbHuNOr/+Mv2KkQKcxs6LEZA==", + "dev": true, + "dependencies": { + "unist-util-visit": "^1.4.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@mapbox/hast-util-table-cell-style/node_modules/unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "node_modules/@mapbox/hast-util-table-cell-style/node_modules/unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "dependencies": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "node_modules/@mapbox/hast-util-table-cell-style/node_modules/unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "dependencies": { + "unist-util-is": "^3.0.0" + } + }, "node_modules/@rollup/plugin-typescript": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.0.tgz", @@ -108,18 +190,132 @@ "rollup": "^1.20.0||^2.0.0" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, "node_modules/@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/hast": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.4.tgz", + "integrity": "sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "dev": true + }, "node_modules/@types/node": { "version": "16.11.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz", "integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==", "dev": true }, + "node_modules/@types/parse5": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz", + "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==", + "dev": true + }, + "node_modules/@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==", + "dev": true + }, + "node_modules/@types/react": { + "version": "18.0.9", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.9.tgz", + "integrity": "sha512-9bjbg1hJHUm4De19L1cHiW0Jvx3geel6Qczhjd0qY5VKVE2X5+x77YxAepuCwVh4vrgZJdgEJw48zrhRIeF4Nw==", + "dev": true, + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.0.5", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.5.tgz", + "integrity": "sha512-OWPWTUrY/NIrjsAPkAk1wW9LZeIjSvkXRhclsFO8CZcZGCOg2G0YZy4ft+rOyYxy8B7ui5iZzi9OkDebZ7/QSA==", + "dev": true, + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", + "dev": true + }, + "node_modules/@types/unist": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", + "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -132,12 +328,53 @@ "node": ">=4" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -152,6 +389,26 @@ "node": ">=4" } }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -167,12 +424,43 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "node_modules/comma-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.2.tgz", + "integrity": "sha512-G5yTt3KQN4Yn7Yk4ed73hlZ1evrFKXeUW3086p3PRFNp7m2vIjI6Pg+Kgb+oyzhd9F2qdcoj67+y3SdxL5XWsg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/csstype": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", + "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==", + "dev": true + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -188,6 +476,40 @@ "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", "dev": true }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/fault": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", + "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", + "dev": true, + "dependencies": { + "format": "^0.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/format": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", + "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -208,6 +530,25 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "node_modules/glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -229,6 +570,200 @@ "node": ">=4" } }, + "node_modules/hast-to-hyperscript": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-10.0.1.tgz", + "integrity": "sha512-dhIVGoKCQVewFi+vz3Vt567E4ejMppS1haBRL6TEmeLeJVB1i/FJIIg/e6s1Bwn0g5qtYojHEKvyGA+OZuyifw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-object": "^0.3.0", + "unist-util-is": "^5.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.0.tgz", + "integrity": "sha512-m8yhANIAccpU4K6+121KpPP55sSl9/samzQSQGpb0mTExcNh2WlvjtMwSWFhg6uqD4Rr6Nfa8N6TMypQM51rzQ==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "@types/parse5": "^6.0.0", + "@types/unist": "^2.0.0", + "hastscript": "^7.0.0", + "property-information": "^6.0.0", + "vfile": "^5.0.0", + "vfile-location": "^4.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-is-element": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-2.1.2.tgz", + "integrity": "sha512-thjnlGAnwP8ef/GSO1Q8BfVk2gundnc2peGQqEg2kUt/IqesiGg/5mSwN2fE7nLzy61pg88NG6xV+UrGOrx9EA==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-parse-selector": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.0.tgz", + "integrity": "sha512-AyjlI2pTAZEOeu7GeBPZhROx0RHBnydkQIXlhnFzDi0qfXTmGUWoCYZtomHbrdrheV4VFUlPcfJ6LMF5T6sQzg==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-html": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-8.0.3.tgz", + "integrity": "sha512-/D/E5ymdPYhHpPkuTHOUkSatxr4w1ZKrZsG0Zv/3C2SRVT0JFJG53VS45AMrBtYk0wp5A7ksEhiC8QaOZM95+A==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-is-element": "^2.0.0", + "hast-util-whitespace": "^2.0.0", + "html-void-elements": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.2", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-text": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-3.1.1.tgz", + "integrity": "sha512-7S3mOBxACy8syL45hCn3J7rHqYaXkxRfsX6LXEU5Shz4nt4GxdjtMUtG+T6G/ZLUHd7kslFAf14kAN71bz30xA==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "hast-util-is-element": "^2.0.0", + "unist-util-find-after": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.0.tgz", + "integrity": "sha512-Pkw+xBHuV6xFeJprJe2BBEoDV+AvQySaz3pPDRUs5PNZEMQjpXJJueqrpcHIXxnWTcAGi/UOCgVShlkY6kLoqg==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.0.2.tgz", + "integrity": "sha512-uA8ooUY4ipaBvKcMuPehTAB/YfFLSSzCwFSwT6ltJbocFUKH/GDHLN+tflq7lSRf9H86uOuxOFkh1KgIy3Gg2g==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^3.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/highlight.js": { + "version": "11.5.1", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.5.1.tgz", + "integrity": "sha512-LKzHqnxr4CrD2YsNoIf/o5nJ09j4yi/GcH5BnYz9UnVpZdS4ucMgvP61TDty5xJcFGRjnH4DpujkS9bHT3hq0Q==", + "dev": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/html-void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz", + "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/inline-style-parser": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", + "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==", + "dev": true + }, + "node_modules/is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "engines": { + "node": ">=4" + } + }, "node_modules/is-core-module": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", @@ -241,6 +776,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -282,6 +829,33 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lowlight": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-2.6.1.tgz", + "integrity": "sha512-t0ueDL6SIn9FKHipm78CNjWcJQv0xi6WCjYAICyO6GyPzoT7E58yom1mNwvI7AMwVe3pLwwFT0Bt2gml7uaUeQ==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "fault": "^2.0.0", + "highlight.js": "~11.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -297,6 +871,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -315,6 +895,33 @@ "node": ">=4.0.0" } }, + "node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -342,6 +949,16 @@ "url": "https://opencollective.com/preact" } }, + "node_modules/property-information": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.1.1.tgz", + "integrity": "sha512-hrzC564QIl0r0vy4l6MvRLhafmUowhO/O3KgVSoXIbbA2Sz4j8HGpJc6T2cubRVwMwpdiG/vKGfhT4IixmKN9w==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -351,6 +968,115 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/react": { + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.1.0.tgz", + "integrity": "sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.1.0.tgz", + "integrity": "sha512-fU1Txz7Budmvamp7bshe4Zi32d0ll7ect+ccxNu9FlObT605GOEB8BfO4tmRJ39R5Zj831VCpvQ05QPBW5yb+w==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.22.0" + }, + "peerDependencies": { + "react": "^18.1.0" + } + }, + "node_modules/rehype": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-12.0.1.tgz", + "integrity": "sha512-ey6kAqwLM3X6QnMDILJthGvG1m1ULROS9NT4uG9IDCuv08SFyLlreSuvOa//DgEvbXx62DS6elGVqusWhRUbgw==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "rehype-parse": "^8.0.0", + "rehype-stringify": "^9.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-highlight": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/rehype-highlight/-/rehype-highlight-5.0.2.tgz", + "integrity": "sha512-ZNm8V8BQUDn05cJPzAu/PjiloaFFrh+Pt3bY+NCcdCggI7Uyl5mW0FGR7RATeIz5/ECUd1D8Kvjt4HaLPmnOMw==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "hast-util-to-text": "^3.0.0", + "lowlight": "^2.0.0", + "unified": "^10.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-parse": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-8.0.4.tgz", + "integrity": "sha512-MJJKONunHjoTh4kc3dsM1v3C9kGrrxvA3U8PxZlP2SjH8RNUSrb+lF7Y0KVaUDnGH2QZ5vAn7ulkiajM9ifuqg==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "hast-util-from-parse5": "^7.0.0", + "parse5": "^6.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-react": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/rehype-react/-/rehype-react-7.1.1.tgz", + "integrity": "sha512-6yaitxM95JFsuTA74OH54OyvTAeRqR4/A6f45S2sEk2FEG04iGgsObcmEIFQRsjK9pfAhc74lR4iGf/W2G/sBw==", + "dev": true, + "dependencies": { + "@mapbox/hast-util-table-cell-style": "^0.2.0", + "@types/hast": "^2.0.0", + "hast-to-hyperscript": "^10.0.0", + "hast-util-whitespace": "^2.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=17" + } + }, + "node_modules/rehype-stringify": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.3.tgz", + "integrity": "sha512-kWiZ1bgyWlgOxpqD5HnxShKAdXtb2IUljn3hQAhySeak6IOQPPt6DeGnsIh4ixm7yKJWzm8TXFuC/lPfcWHJqw==", + "dev": true, + "dependencies": { + "@types/hast": "^2.0.0", + "hast-util-to-html": "^8.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/requirejs": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", @@ -427,6 +1153,15 @@ } ] }, + "node_modules/scheduler": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.22.0.tgz", + "integrity": "sha512-6QAm1BgQI88NPYymgGQLCZgvep4FyePDWFpXVK+zNSUgHwlqpJy8VEh8Et0KxTACS4VWwMousBElAZOH9nkkoQ==", + "dev": true, + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -473,6 +1208,39 @@ "node": ">=0.10.0" } }, + "node_modules/space-separated-tokens": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.1.tgz", + "integrity": "sha512-ekwEbFp5aqSPKaqeY1PGrlGQxPNaq+Cnx4+bE2D8sciBQrHpbwoBbawqTN2+6jPs9IdWxxiUcN0K2pkczD3zmw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.2.tgz", + "integrity": "sha512-MTxTVcEkorNtBbNpoFJPEh0kKdM6+QbMjLbaxmvaPMmayOXdr/AIVIIJX7FReUVweRBFJfZepK4A4AKgwuFpMQ==", + "dev": true, + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/style-to-object": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz", + "integrity": "sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==", + "dev": true, + "dependencies": { + "inline-style-parser": "0.1.1" + } + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -510,6 +1278,59 @@ } } }, + "node_modules/trough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", + "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/ts-node": { + "version": "10.8.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.0.tgz", + "integrity": "sha512-/fNd5Qh+zTt8Vt1KbYZjRHCE9sI5i7nqfD/dzBBRDeVXZXS6kToW6R7tTU6Nd4XavFs0mAVCg29Q//ML7WsZYA==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, "node_modules/tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -527,6 +1348,166 @@ "engines": { "node": ">=4.2.0" } + }, + "node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-find-after": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-4.0.0.tgz", + "integrity": "sha512-gfpsxKQde7atVF30n5Gff2fQhAc4/HTOV4CvkXpTg9wRfQhZWdXitpyXHWB6YcYgnsxLx+4gGHeVjCTAAp9sjw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", + "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.2.tgz", + "integrity": "sha512-7A6eiDCs9UtjcwZOcCpM4aPII3bAAGv13E96IkawkOAW0OhH+yRxtY0lzo8KiHpzEMfH7Q+FizUmwp8Iqy5EWg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.0.tgz", + "integrity": "sha512-n7lyhFKJfVZ9MnKtqbsqkQEk5P1KShj0+//V7mAcoI6bpbUjh3C/OG8HVD+pBihfh6Ovl01m8dkcv9HNqYajmQ==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.0.tgz", + "integrity": "sha512-y+QVLcY5eR/YVpqDsLf/xh9R3Q2Y4HxkZTp7ViLDU6WtJCEcPmRzW1gpdWDCDIqIlhuPDXOgttqPlykrHYDekg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/vfile": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.2.tgz", + "integrity": "sha512-w0PLIugRY3Crkgw89TeMvHCzqCs/zpreR31hl4D92y6SOE07+bfJe+dK5Q2akwS+i/c801kzjoOr9gMcTe6IAA==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", + "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "vfile": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.2.tgz", + "integrity": "sha512-QjSNP6Yxzyycd4SVOtmKKyTsSvClqBPJcd00Z0zuPj3hOIjg0rUPG6DbFGPvUKRgYyaIWLPKpuEclcuvb3H8qA==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } } }, "dependencies": { @@ -556,6 +1537,72 @@ "js-tokens": "^4.0.0" } }, + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@mapbox/hast-util-table-cell-style": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@mapbox/hast-util-table-cell-style/-/hast-util-table-cell-style-0.2.0.tgz", + "integrity": "sha512-gqaTIGC8My3LVSnU38IwjHVKJC94HSonjvFHDk8/aSrApL8v4uWgm8zJkK7MJIIbHuNOr/+Mv2KkQKcxs6LEZA==", + "dev": true, + "requires": { + "unist-util-visit": "^1.4.1" + }, + "dependencies": { + "unist-util-is": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz", + "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==", + "dev": true + }, + "unist-util-visit": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz", + "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==", + "dev": true, + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "unist-util-visit-parents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz", + "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==", + "dev": true, + "requires": { + "unist-util-is": "^3.0.0" + } + } + } + }, "@rollup/plugin-typescript": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.0.tgz", @@ -588,18 +1635,123 @@ "picomatch": "^2.2.2" } }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, + "@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/hast": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.4.tgz", + "integrity": "sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==", + "dev": true, + "requires": { + "@types/unist": "*" + } + }, + "@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "dev": true + }, "@types/node": { "version": "16.11.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz", "integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==", "dev": true }, + "@types/parse5": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/parse5/-/parse5-6.0.3.tgz", + "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==", + "dev": true + }, + "@types/prop-types": { + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==", + "dev": true + }, + "@types/react": { + "version": "18.0.9", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.9.tgz", + "integrity": "sha512-9bjbg1hJHUm4De19L1cHiW0Jvx3geel6Qczhjd0qY5VKVE2X5+x77YxAepuCwVh4vrgZJdgEJw48zrhRIeF4Nw==", + "dev": true, + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "@types/react-dom": { + "version": "18.0.5", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.5.tgz", + "integrity": "sha512-OWPWTUrY/NIrjsAPkAk1wW9LZeIjSvkXRhclsFO8CZcZGCOg2G0YZy4ft+rOyYxy8B7ui5iZzi9OkDebZ7/QSA==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, + "@types/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", + "dev": true + }, + "@types/unist": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz", + "integrity": "sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==", + "dev": true + }, + "acorn": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -609,12 +1761,45 @@ "color-convert": "^1.9.0" } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "dev": true + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -626,6 +1811,18 @@ "supports-color": "^5.3.0" } }, + "character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "dev": true + }, + "character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "dev": true + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -641,12 +1838,36 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "comma-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.2.tgz", + "integrity": "sha512-G5yTt3KQN4Yn7Yk4ed73hlZ1evrFKXeUW3086p3PRFNp7m2vIjI6Pg+Kgb+oyzhd9F2qdcoj67+y3SdxL5XWsg==", + "dev": true + }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "csstype": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", + "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -659,6 +1880,33 @@ "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", "dev": true }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "fault": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", + "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", + "dev": true, + "requires": { + "format": "^0.2.0" + } + }, + "format": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", + "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -672,6 +1920,19 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -687,6 +1948,144 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "hast-to-hyperscript": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-10.0.1.tgz", + "integrity": "sha512-dhIVGoKCQVewFi+vz3Vt567E4ejMppS1haBRL6TEmeLeJVB1i/FJIIg/e6s1Bwn0g5qtYojHEKvyGA+OZuyifw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-object": "^0.3.0", + "unist-util-is": "^5.0.0", + "web-namespaces": "^2.0.0" + } + }, + "hast-util-from-parse5": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.0.tgz", + "integrity": "sha512-m8yhANIAccpU4K6+121KpPP55sSl9/samzQSQGpb0mTExcNh2WlvjtMwSWFhg6uqD4Rr6Nfa8N6TMypQM51rzQ==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "@types/parse5": "^6.0.0", + "@types/unist": "^2.0.0", + "hastscript": "^7.0.0", + "property-information": "^6.0.0", + "vfile": "^5.0.0", + "vfile-location": "^4.0.0", + "web-namespaces": "^2.0.0" + } + }, + "hast-util-is-element": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-2.1.2.tgz", + "integrity": "sha512-thjnlGAnwP8ef/GSO1Q8BfVk2gundnc2peGQqEg2kUt/IqesiGg/5mSwN2fE7nLzy61pg88NG6xV+UrGOrx9EA==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "@types/unist": "^2.0.0" + } + }, + "hast-util-parse-selector": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.0.tgz", + "integrity": "sha512-AyjlI2pTAZEOeu7GeBPZhROx0RHBnydkQIXlhnFzDi0qfXTmGUWoCYZtomHbrdrheV4VFUlPcfJ6LMF5T6sQzg==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0" + } + }, + "hast-util-to-html": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-8.0.3.tgz", + "integrity": "sha512-/D/E5ymdPYhHpPkuTHOUkSatxr4w1ZKrZsG0Zv/3C2SRVT0JFJG53VS45AMrBtYk0wp5A7ksEhiC8QaOZM95+A==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-is-element": "^2.0.0", + "hast-util-whitespace": "^2.0.0", + "html-void-elements": "^2.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.2", + "unist-util-is": "^5.0.0" + } + }, + "hast-util-to-text": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-3.1.1.tgz", + "integrity": "sha512-7S3mOBxACy8syL45hCn3J7rHqYaXkxRfsX6LXEU5Shz4nt4GxdjtMUtG+T6G/ZLUHd7kslFAf14kAN71bz30xA==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "hast-util-is-element": "^2.0.0", + "unist-util-find-after": "^4.0.0" + } + }, + "hast-util-whitespace": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.0.tgz", + "integrity": "sha512-Pkw+xBHuV6xFeJprJe2BBEoDV+AvQySaz3pPDRUs5PNZEMQjpXJJueqrpcHIXxnWTcAGi/UOCgVShlkY6kLoqg==", + "dev": true + }, + "hastscript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-7.0.2.tgz", + "integrity": "sha512-uA8ooUY4ipaBvKcMuPehTAB/YfFLSSzCwFSwT6ltJbocFUKH/GDHLN+tflq7lSRf9H86uOuxOFkh1KgIy3Gg2g==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^3.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + } + }, + "highlight.js": { + "version": "11.5.1", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.5.1.tgz", + "integrity": "sha512-LKzHqnxr4CrD2YsNoIf/o5nJ09j4yi/GcH5BnYz9UnVpZdS4ucMgvP61TDty5xJcFGRjnH4DpujkS9bHT3hq0Q==", + "dev": true + }, + "html-void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz", + "integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "inline-style-parser": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", + "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==", + "dev": true + }, + "is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "dev": true + }, "is-core-module": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", @@ -696,6 +2095,12 @@ "has": "^1.0.3" } }, + "is-plain-obj": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.0.0.tgz", + "integrity": "sha512-NXRbBtUdBioI73y/HmOhogw/U5msYPC9DAtGkJXeFcFWSFZw0mCUsPxk/snTuJHzNKA8kLBK4rH97RMB1BfCXw==", + "dev": true + }, "jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -730,6 +2135,26 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lowlight": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-2.6.1.tgz", + "integrity": "sha512-t0ueDL6SIn9FKHipm78CNjWcJQv0xi6WCjYAICyO6GyPzoT7E58yom1mNwvI7AMwVe3pLwwFT0Bt2gml7uaUeQ==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "fault": "^2.0.0", + "highlight.js": "~11.5.0" + } + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -739,6 +2164,12 @@ "semver": "^6.0.0" } }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -751,6 +2182,30 @@ "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", "dev": true }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -768,6 +2223,12 @@ "resolved": "https://registry.npmjs.org/preact/-/preact-10.6.1.tgz", "integrity": "sha512-ydCg+ISIq70vqiThvNWStZWLRjR9U2awP/JAmGdWUKm9+Tyuy+MqVdAIyEByeIspAVtD4GWC/SJtxO8XD4knVA==" }, + "property-information": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.1.1.tgz", + "integrity": "sha512-hrzC564QIl0r0vy4l6MvRLhafmUowhO/O3KgVSoXIbbA2Sz4j8HGpJc6T2cubRVwMwpdiG/vKGfhT4IixmKN9w==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -777,6 +2238,86 @@ "safe-buffer": "^5.1.0" } }, + "react": { + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.1.0.tgz", + "integrity": "sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ==", + "dev": true, + "requires": { + "loose-envify": "^1.1.0" + } + }, + "react-dom": { + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.1.0.tgz", + "integrity": "sha512-fU1Txz7Budmvamp7bshe4Zi32d0ll7ect+ccxNu9FlObT605GOEB8BfO4tmRJ39R5Zj831VCpvQ05QPBW5yb+w==", + "dev": true, + "requires": { + "loose-envify": "^1.1.0", + "scheduler": "^0.22.0" + } + }, + "rehype": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-12.0.1.tgz", + "integrity": "sha512-ey6kAqwLM3X6QnMDILJthGvG1m1ULROS9NT4uG9IDCuv08SFyLlreSuvOa//DgEvbXx62DS6elGVqusWhRUbgw==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "rehype-parse": "^8.0.0", + "rehype-stringify": "^9.0.0", + "unified": "^10.0.0" + } + }, + "rehype-highlight": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/rehype-highlight/-/rehype-highlight-5.0.2.tgz", + "integrity": "sha512-ZNm8V8BQUDn05cJPzAu/PjiloaFFrh+Pt3bY+NCcdCggI7Uyl5mW0FGR7RATeIz5/ECUd1D8Kvjt4HaLPmnOMw==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "hast-util-to-text": "^3.0.0", + "lowlight": "^2.0.0", + "unified": "^10.0.0", + "unist-util-visit": "^4.0.0" + } + }, + "rehype-parse": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-8.0.4.tgz", + "integrity": "sha512-MJJKONunHjoTh4kc3dsM1v3C9kGrrxvA3U8PxZlP2SjH8RNUSrb+lF7Y0KVaUDnGH2QZ5vAn7ulkiajM9ifuqg==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "hast-util-from-parse5": "^7.0.0", + "parse5": "^6.0.0", + "unified": "^10.0.0" + } + }, + "rehype-react": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/rehype-react/-/rehype-react-7.1.1.tgz", + "integrity": "sha512-6yaitxM95JFsuTA74OH54OyvTAeRqR4/A6f45S2sEk2FEG04iGgsObcmEIFQRsjK9pfAhc74lR4iGf/W2G/sBw==", + "dev": true, + "requires": { + "@mapbox/hast-util-table-cell-style": "^0.2.0", + "@types/hast": "^2.0.0", + "hast-to-hyperscript": "^10.0.0", + "hast-util-whitespace": "^2.0.0", + "unified": "^10.0.0" + } + }, + "rehype-stringify": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.3.tgz", + "integrity": "sha512-kWiZ1bgyWlgOxpqD5HnxShKAdXtb2IUljn3hQAhySeak6IOQPPt6DeGnsIh4ixm7yKJWzm8TXFuC/lPfcWHJqw==", + "dev": true, + "requires": { + "@types/hast": "^2.0.0", + "hast-util-to-html": "^8.0.0", + "unified": "^10.0.0" + } + }, "requirejs": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", @@ -820,6 +2361,15 @@ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, + "scheduler": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.22.0.tgz", + "integrity": "sha512-6QAm1BgQI88NPYymgGQLCZgvep4FyePDWFpXVK+zNSUgHwlqpJy8VEh8Et0KxTACS4VWwMousBElAZOH9nkkoQ==", + "dev": true, + "requires": { + "loose-envify": "^1.1.0" + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -859,6 +2409,31 @@ } } }, + "space-separated-tokens": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.1.tgz", + "integrity": "sha512-ekwEbFp5aqSPKaqeY1PGrlGQxPNaq+Cnx4+bE2D8sciBQrHpbwoBbawqTN2+6jPs9IdWxxiUcN0K2pkczD3zmw==", + "dev": true + }, + "stringify-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.2.tgz", + "integrity": "sha512-MTxTVcEkorNtBbNpoFJPEh0kKdM6+QbMjLbaxmvaPMmayOXdr/AIVIIJX7FReUVweRBFJfZepK4A4AKgwuFpMQ==", + "dev": true, + "requires": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + } + }, + "style-to-object": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz", + "integrity": "sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==", + "dev": true, + "requires": { + "inline-style-parser": "0.1.1" + } + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -879,6 +2454,33 @@ "source-map-support": "~0.5.20" } }, + "trough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.1.0.tgz", + "integrity": "sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==", + "dev": true + }, + "ts-node": { + "version": "10.8.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.0.tgz", + "integrity": "sha512-/fNd5Qh+zTt8Vt1KbYZjRHCE9sI5i7nqfD/dzBBRDeVXZXS6kToW6R7tTU6Nd4XavFs0mAVCg29Q//ML7WsZYA==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + } + }, "tslib": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", @@ -889,6 +2491,123 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", "dev": true + }, + "unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" + } + }, + "unist-util-find-after": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-4.0.0.tgz", + "integrity": "sha512-gfpsxKQde7atVF30n5Gff2fQhAc4/HTOV4CvkXpTg9wRfQhZWdXitpyXHWB6YcYgnsxLx+4gGHeVjCTAAp9sjw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + } + }, + "unist-util-is": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.1.1.tgz", + "integrity": "sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ==", + "dev": true + }, + "unist-util-stringify-position": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.2.tgz", + "integrity": "sha512-7A6eiDCs9UtjcwZOcCpM4aPII3bAAGv13E96IkawkOAW0OhH+yRxtY0lzo8KiHpzEMfH7Q+FizUmwp8Iqy5EWg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0" + } + }, + "unist-util-visit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.0.tgz", + "integrity": "sha512-n7lyhFKJfVZ9MnKtqbsqkQEk5P1KShj0+//V7mAcoI6bpbUjh3C/OG8HVD+pBihfh6Ovl01m8dkcv9HNqYajmQ==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.0.0" + } + }, + "unist-util-visit-parents": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.0.tgz", + "integrity": "sha512-y+QVLcY5eR/YVpqDsLf/xh9R3Q2Y4HxkZTp7ViLDU6WtJCEcPmRzW1gpdWDCDIqIlhuPDXOgttqPlykrHYDekg==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" + } + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "vfile": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.2.tgz", + "integrity": "sha512-w0PLIugRY3Crkgw89TeMvHCzqCs/zpreR31hl4D92y6SOE07+bfJe+dK5Q2akwS+i/c801kzjoOr9gMcTe6IAA==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" + } + }, + "vfile-location": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-4.0.1.tgz", + "integrity": "sha512-JDxPlTbZrZCQXogGheBHjbRWjESSPEak770XwWPfw5mTc1v1nWGLB/apzZxsx8a0SJVfF8HK8ql8RD308vXRUw==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "vfile": "^5.0.0" + } + }, + "vfile-message": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.2.tgz", + "integrity": "sha512-QjSNP6Yxzyycd4SVOtmKKyTsSvClqBPJcd00Z0zuPj3hOIjg0rUPG6DbFGPvUKRgYyaIWLPKpuEclcuvb3H8qA==", + "dev": true, + "requires": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" + } + }, + "web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true } } } diff --git a/package.json b/package.json index 123f4dbd2..d9aab4b5f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Website additions for tweaked.cc", "author": "SquidDev", "license": "BSD-3-Clause", + "type": "module", "dependencies": { "preact": "^10.5.5", "tslib": "^2.0.3" @@ -11,9 +12,18 @@ "devDependencies": { "@rollup/plugin-typescript": "^8.2.5", "@rollup/plugin-url": "^6.1.0", + "@types/glob": "^7.2.0", + "@types/react-dom": "^18.0.5", + "glob": "^8.0.3", + "react": "^18.1.0", + "react-dom": "^18.1.0", + "rehype": "^12.0.1", + "rehype-highlight": "^5.0.2", + "rehype-react": "^7.1.1", "requirejs": "^2.3.6", "rollup": "^2.33.1", "rollup-plugin-terser": "^7.0.2", + "ts-node": "^10.8.0", "typescript": "^4.0.5" } } diff --git a/src/generated/export/index.json b/src/generated/export/index.json new file mode 100644 index 000000000..f4bfe9cac --- /dev/null +++ b/src/generated/export/index.json @@ -0,0 +1,760 @@ +{ + "itemNames": { + "computercraft:cable": "Networking Cable", + "computercraft:computer_advanced": "Advanced Computer", + "computercraft:computer_command": "Command Computer", + "computercraft:computer_normal": "Computer", + "computercraft:disk": "Floppy Disk", + "computercraft:disk_drive": "Disk Drive", + "computercraft:monitor_advanced": "Advanced Monitor", + "computercraft:monitor_normal": "Monitor", + "computercraft:pocket_computer_advanced": "Advanced Pocket Computer", + "computercraft:pocket_computer_normal": "Pocket Computer", + "computercraft:printed_book": "Printed Book", + "computercraft:printed_page": "Printed Page", + "computercraft:printed_pages": "Printed Pages", + "computercraft:printer": "Printer", + "computercraft:speaker": "Speaker", + "computercraft:treasure_disk": "Floppy Disk", + "computercraft:turtle_advanced": "Advanced Turtle", + "computercraft:turtle_normal": "Turtle", + "computercraft:wired_modem": "Wired Modem", + "computercraft:wired_modem_full": "Wired Modem", + "computercraft:wireless_modem_advanced": "Ender Modem", + "computercraft:wireless_modem_normal": "Wireless Modem", + "minecraft:black_dye": "Black Dye", + "minecraft:blue_dye": "Blue Dye", + "minecraft:brown_dye": "Brown Dye", + "minecraft:chest": "Chest", + "minecraft:command_block": "Command Block", + "minecraft:cyan_dye": "Cyan Dye", + "minecraft:ender_eye": "Eye of Ender", + "minecraft:ender_pearl": "Ender Pearl", + "minecraft:glass_pane": "Glass Pane", + "minecraft:gold_block": "Block of Gold", + "minecraft:gold_ingot": "Gold Ingot", + "minecraft:golden_apple": "Golden Apple", + "minecraft:gray_dye": "Gray Dye", + "minecraft:green_dye": "Green Dye", + "minecraft:iron_ingot": "Iron Ingot", + "minecraft:leather": "Leather", + "minecraft:light_blue_dye": "Light Blue Dye", + "minecraft:light_gray_dye": "Light Gray Dye", + "minecraft:lime_dye": "Lime Dye", + "minecraft:magenta_dye": "Magenta Dye", + "minecraft:note_block": "Note Block", + "minecraft:orange_dye": "Orange Dye", + "minecraft:pink_dye": "Pink Dye", + "minecraft:purple_dye": "Purple Dye", + "minecraft:red_dye": "Red Dye", + "minecraft:redstone": "Redstone Dust", + "minecraft:stone": "Stone", + "minecraft:string": "String", + "minecraft:white_dye": "White Dye", + "minecraft:yellow_dye": "Yellow Dye" + }, + "recipes": { + "computercraft:cable": { + "inputs": [ + null, + [ + "minecraft:stone" + ], + null, + [ + "minecraft:stone" + ], + [ + "minecraft:redstone" + ], + [ + "minecraft:stone" + ], + null, + [ + "minecraft:stone" + ], + null + ], + "output": "computercraft:cable", + "count": 6 + }, + "computercraft:computer_advanced": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:redstone" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:glass_pane" + ], + [ + "minecraft:gold_ingot" + ] + ], + "output": "computercraft:computer_advanced", + "count": 1 + }, + "computercraft:computer_advanced_upgrade": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "computercraft:computer_normal" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + null, + [ + "minecraft:gold_ingot" + ] + ], + "output": "computercraft:computer_advanced", + "count": 1 + }, + "computercraft:computer_command": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:command_block" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:glass_pane" + ], + [ + "minecraft:gold_ingot" + ] + ], + "output": "computercraft:computer_command", + "count": 1 + }, + "computercraft:computer_normal": { + "inputs": [ + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:redstone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:glass_pane" + ], + [ + "minecraft:stone" + ] + ], + "output": "computercraft:computer_normal", + "count": 1 + }, + "computercraft:disk_drive": { + "inputs": [ + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:redstone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:redstone" + ], + [ + "minecraft:stone" + ] + ], + "output": "computercraft:disk_drive", + "count": 1 + }, + "computercraft:monitor_advanced": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:glass_pane" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ] + ], + "output": "computercraft:monitor_advanced", + "count": 4 + }, + "computercraft:monitor_normal": { + "inputs": [ + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:glass_pane" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ] + ], + "output": "computercraft:monitor_normal", + "count": 1 + }, + "computercraft:pocket_computer_advanced": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:golden_apple" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:glass_pane" + ], + [ + "minecraft:gold_ingot" + ] + ], + "output": "computercraft:pocket_computer_advanced", + "count": 1 + }, + "computercraft:pocket_computer_advanced_upgrade": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "computercraft:pocket_computer_normal" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + null, + [ + "minecraft:gold_ingot" + ] + ], + "output": "computercraft:pocket_computer_advanced", + "count": 1 + }, + "computercraft:pocket_computer_normal": { + "inputs": [ + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:golden_apple" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:glass_pane" + ], + [ + "minecraft:stone" + ] + ], + "output": "computercraft:pocket_computer_normal", + "count": 1 + }, + "computercraft:printed_book": { + "inputs": [ + [ + "minecraft:leather" + ], + [ + "computercraft:printed_page" + ], + [ + "minecraft:string" + ], + null, + null, + null, + null, + null, + null + ], + "output": "computercraft:printed_book", + "count": 1 + }, + "computercraft:printed_pages": { + "inputs": [ + [ + "computercraft:printed_page" + ], + [ + "computercraft:printed_page" + ], + [ + "minecraft:string" + ], + null, + null, + null, + null, + null, + null + ], + "output": "computercraft:printed_pages", + "count": 1 + }, + "computercraft:printer": { + "inputs": [ + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:redstone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:black_dye", + "minecraft:blue_dye", + "minecraft:brown_dye", + "minecraft:cyan_dye", + "minecraft:gray_dye", + "minecraft:green_dye", + "minecraft:light_blue_dye", + "minecraft:light_gray_dye", + "minecraft:lime_dye", + "minecraft:magenta_dye", + "minecraft:orange_dye", + "minecraft:pink_dye", + "minecraft:purple_dye", + "minecraft:red_dye", + "minecraft:white_dye", + "minecraft:yellow_dye" + ], + [ + "minecraft:stone" + ] + ], + "output": "computercraft:printer", + "count": 1 + }, + "computercraft:speaker": { + "inputs": [ + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:note_block" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:redstone" + ], + [ + "minecraft:stone" + ] + ], + "output": "computercraft:speaker", + "count": 1 + }, + "computercraft:turtle_advanced": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "computercraft:computer_advanced" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:chest" + ], + [ + "minecraft:gold_ingot" + ] + ], + "output": "computercraft:turtle_advanced", + "count": 1 + }, + "computercraft:turtle_advanced_upgrade": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "computercraft:turtle_normal" + ], + [ + "minecraft:gold_ingot" + ], + null, + [ + "minecraft:gold_block" + ], + null + ], + "output": "computercraft:turtle_advanced", + "count": 1 + }, + "computercraft:turtle_normal": { + "inputs": [ + [ + "minecraft:iron_ingot" + ], + [ + "minecraft:iron_ingot" + ], + [ + "minecraft:iron_ingot" + ], + [ + "minecraft:iron_ingot" + ], + [ + "computercraft:computer_normal" + ], + [ + "minecraft:iron_ingot" + ], + [ + "minecraft:iron_ingot" + ], + [ + "minecraft:chest" + ], + [ + "minecraft:iron_ingot" + ] + ], + "output": "computercraft:turtle_normal", + "count": 1 + }, + "computercraft:wired_modem": { + "inputs": [ + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:redstone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ] + ], + "output": "computercraft:wired_modem", + "count": 1 + }, + "computercraft:wired_modem_full_from": { + "inputs": [ + [ + "computercraft:wired_modem" + ], + null, + null, + null, + null, + null, + null, + null, + null + ], + "output": "computercraft:wired_modem_full", + "count": 1 + }, + "computercraft:wired_modem_full_to": { + "inputs": [ + [ + "computercraft:wired_modem_full" + ], + null, + null, + null, + null, + null, + null, + null, + null + ], + "output": "computercraft:wired_modem", + "count": 1 + }, + "computercraft:wireless_modem_advanced": { + "inputs": [ + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:ender_eye" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ], + [ + "minecraft:gold_ingot" + ] + ], + "output": "computercraft:wireless_modem_advanced", + "count": 1 + }, + "computercraft:wireless_modem_normal": { + "inputs": [ + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:ender_pearl" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ], + [ + "minecraft:stone" + ] + ], + "output": "computercraft:wireless_modem_normal", + "count": 1 + } + } +} diff --git a/src/generated/export/items/computercraft/cable.png b/src/generated/export/items/computercraft/cable.png new file mode 100644 index 000000000..593ed2373 Binary files /dev/null and b/src/generated/export/items/computercraft/cable.png differ diff --git a/src/generated/export/items/computercraft/computer_advanced.png b/src/generated/export/items/computercraft/computer_advanced.png new file mode 100644 index 000000000..2b9f5f5a3 Binary files /dev/null and b/src/generated/export/items/computercraft/computer_advanced.png differ diff --git a/src/generated/export/items/computercraft/computer_command.png b/src/generated/export/items/computercraft/computer_command.png new file mode 100644 index 000000000..d8f65c75d Binary files /dev/null and b/src/generated/export/items/computercraft/computer_command.png differ diff --git a/src/generated/export/items/computercraft/computer_normal.png b/src/generated/export/items/computercraft/computer_normal.png new file mode 100644 index 000000000..fa1787e89 Binary files /dev/null and b/src/generated/export/items/computercraft/computer_normal.png differ diff --git a/src/generated/export/items/computercraft/disk.png b/src/generated/export/items/computercraft/disk.png new file mode 100644 index 000000000..0f11b0762 Binary files /dev/null and b/src/generated/export/items/computercraft/disk.png differ diff --git a/src/generated/export/items/computercraft/disk_drive.png b/src/generated/export/items/computercraft/disk_drive.png new file mode 100644 index 000000000..158aafddf Binary files /dev/null and b/src/generated/export/items/computercraft/disk_drive.png differ diff --git a/src/generated/export/items/computercraft/monitor_advanced.png b/src/generated/export/items/computercraft/monitor_advanced.png new file mode 100644 index 000000000..5e99f1a3f Binary files /dev/null and b/src/generated/export/items/computercraft/monitor_advanced.png differ diff --git a/src/generated/export/items/computercraft/monitor_normal.png b/src/generated/export/items/computercraft/monitor_normal.png new file mode 100644 index 000000000..b80d1f84f Binary files /dev/null and b/src/generated/export/items/computercraft/monitor_normal.png differ diff --git a/src/generated/export/items/computercraft/pocket_computer_advanced.png b/src/generated/export/items/computercraft/pocket_computer_advanced.png new file mode 100644 index 000000000..e3865e062 Binary files /dev/null and b/src/generated/export/items/computercraft/pocket_computer_advanced.png differ diff --git a/src/generated/export/items/computercraft/pocket_computer_normal.png b/src/generated/export/items/computercraft/pocket_computer_normal.png new file mode 100644 index 000000000..25f6ee700 Binary files /dev/null and b/src/generated/export/items/computercraft/pocket_computer_normal.png differ diff --git a/src/generated/export/items/computercraft/printed_book.png b/src/generated/export/items/computercraft/printed_book.png new file mode 100644 index 000000000..ee4b235f7 Binary files /dev/null and b/src/generated/export/items/computercraft/printed_book.png differ diff --git a/src/generated/export/items/computercraft/printed_page.png b/src/generated/export/items/computercraft/printed_page.png new file mode 100644 index 000000000..b27f175dd Binary files /dev/null and b/src/generated/export/items/computercraft/printed_page.png differ diff --git a/src/generated/export/items/computercraft/printed_pages.png b/src/generated/export/items/computercraft/printed_pages.png new file mode 100644 index 000000000..182902e96 Binary files /dev/null and b/src/generated/export/items/computercraft/printed_pages.png differ diff --git a/src/generated/export/items/computercraft/printer.png b/src/generated/export/items/computercraft/printer.png new file mode 100644 index 000000000..4fe8a80da Binary files /dev/null and b/src/generated/export/items/computercraft/printer.png differ diff --git a/src/generated/export/items/computercraft/speaker.png b/src/generated/export/items/computercraft/speaker.png new file mode 100644 index 000000000..c30e8355b Binary files /dev/null and b/src/generated/export/items/computercraft/speaker.png differ diff --git a/src/generated/export/items/computercraft/treasure_disk.png b/src/generated/export/items/computercraft/treasure_disk.png new file mode 100644 index 000000000..2aa8a62b7 Binary files /dev/null and b/src/generated/export/items/computercraft/treasure_disk.png differ diff --git a/src/generated/export/items/computercraft/turtle_advanced.png b/src/generated/export/items/computercraft/turtle_advanced.png new file mode 100644 index 000000000..6313e8462 Binary files /dev/null and b/src/generated/export/items/computercraft/turtle_advanced.png differ diff --git a/src/generated/export/items/computercraft/turtle_normal.png b/src/generated/export/items/computercraft/turtle_normal.png new file mode 100644 index 000000000..7ab1e0786 Binary files /dev/null and b/src/generated/export/items/computercraft/turtle_normal.png differ diff --git a/src/generated/export/items/computercraft/wired_modem.png b/src/generated/export/items/computercraft/wired_modem.png new file mode 100644 index 000000000..841d3dc73 Binary files /dev/null and b/src/generated/export/items/computercraft/wired_modem.png differ diff --git a/src/generated/export/items/computercraft/wired_modem_full.png b/src/generated/export/items/computercraft/wired_modem_full.png new file mode 100644 index 000000000..8d5a0ea5f Binary files /dev/null and b/src/generated/export/items/computercraft/wired_modem_full.png differ diff --git a/src/generated/export/items/computercraft/wireless_modem_advanced.png b/src/generated/export/items/computercraft/wireless_modem_advanced.png new file mode 100644 index 000000000..f9853d978 Binary files /dev/null and b/src/generated/export/items/computercraft/wireless_modem_advanced.png differ diff --git a/src/generated/export/items/computercraft/wireless_modem_normal.png b/src/generated/export/items/computercraft/wireless_modem_normal.png new file mode 100644 index 000000000..287a1738f Binary files /dev/null and b/src/generated/export/items/computercraft/wireless_modem_normal.png differ diff --git a/src/generated/export/items/minecraft/black_dye.png b/src/generated/export/items/minecraft/black_dye.png new file mode 100644 index 000000000..4b5e52560 Binary files /dev/null and b/src/generated/export/items/minecraft/black_dye.png differ diff --git a/src/generated/export/items/minecraft/blue_dye.png b/src/generated/export/items/minecraft/blue_dye.png new file mode 100644 index 000000000..0edf68729 Binary files /dev/null and b/src/generated/export/items/minecraft/blue_dye.png differ diff --git a/src/generated/export/items/minecraft/brown_dye.png b/src/generated/export/items/minecraft/brown_dye.png new file mode 100644 index 000000000..7263ee463 Binary files /dev/null and b/src/generated/export/items/minecraft/brown_dye.png differ diff --git a/src/generated/export/items/minecraft/chest.png b/src/generated/export/items/minecraft/chest.png new file mode 100644 index 000000000..19f6cab55 Binary files /dev/null and b/src/generated/export/items/minecraft/chest.png differ diff --git a/src/generated/export/items/minecraft/command_block.png b/src/generated/export/items/minecraft/command_block.png new file mode 100644 index 000000000..cef1cac2e Binary files /dev/null and b/src/generated/export/items/minecraft/command_block.png differ diff --git a/src/generated/export/items/minecraft/cyan_dye.png b/src/generated/export/items/minecraft/cyan_dye.png new file mode 100644 index 000000000..03d946dbb Binary files /dev/null and b/src/generated/export/items/minecraft/cyan_dye.png differ diff --git a/src/generated/export/items/minecraft/ender_eye.png b/src/generated/export/items/minecraft/ender_eye.png new file mode 100644 index 000000000..caae6f4d6 Binary files /dev/null and b/src/generated/export/items/minecraft/ender_eye.png differ diff --git a/src/generated/export/items/minecraft/ender_pearl.png b/src/generated/export/items/minecraft/ender_pearl.png new file mode 100644 index 000000000..539a50c68 Binary files /dev/null and b/src/generated/export/items/minecraft/ender_pearl.png differ diff --git a/src/generated/export/items/minecraft/glass_pane.png b/src/generated/export/items/minecraft/glass_pane.png new file mode 100644 index 000000000..64924e7fa Binary files /dev/null and b/src/generated/export/items/minecraft/glass_pane.png differ diff --git a/src/generated/export/items/minecraft/gold_block.png b/src/generated/export/items/minecraft/gold_block.png new file mode 100644 index 000000000..4331c0b18 Binary files /dev/null and b/src/generated/export/items/minecraft/gold_block.png differ diff --git a/src/generated/export/items/minecraft/gold_ingot.png b/src/generated/export/items/minecraft/gold_ingot.png new file mode 100644 index 000000000..ab4f787d6 Binary files /dev/null and b/src/generated/export/items/minecraft/gold_ingot.png differ diff --git a/src/generated/export/items/minecraft/golden_apple.png b/src/generated/export/items/minecraft/golden_apple.png new file mode 100644 index 000000000..88f462936 Binary files /dev/null and b/src/generated/export/items/minecraft/golden_apple.png differ diff --git a/src/generated/export/items/minecraft/gray_dye.png b/src/generated/export/items/minecraft/gray_dye.png new file mode 100644 index 000000000..6f5c3bda9 Binary files /dev/null and b/src/generated/export/items/minecraft/gray_dye.png differ diff --git a/src/generated/export/items/minecraft/green_dye.png b/src/generated/export/items/minecraft/green_dye.png new file mode 100644 index 000000000..46c6bb436 Binary files /dev/null and b/src/generated/export/items/minecraft/green_dye.png differ diff --git a/src/generated/export/items/minecraft/iron_ingot.png b/src/generated/export/items/minecraft/iron_ingot.png new file mode 100644 index 000000000..a9e1e21ed Binary files /dev/null and b/src/generated/export/items/minecraft/iron_ingot.png differ diff --git a/src/generated/export/items/minecraft/leather.png b/src/generated/export/items/minecraft/leather.png new file mode 100644 index 000000000..a7655ebb2 Binary files /dev/null and b/src/generated/export/items/minecraft/leather.png differ diff --git a/src/generated/export/items/minecraft/light_blue_dye.png b/src/generated/export/items/minecraft/light_blue_dye.png new file mode 100644 index 000000000..f41f3eb3e Binary files /dev/null and b/src/generated/export/items/minecraft/light_blue_dye.png differ diff --git a/src/generated/export/items/minecraft/light_gray_dye.png b/src/generated/export/items/minecraft/light_gray_dye.png new file mode 100644 index 000000000..a62673fea Binary files /dev/null and b/src/generated/export/items/minecraft/light_gray_dye.png differ diff --git a/src/generated/export/items/minecraft/lime_dye.png b/src/generated/export/items/minecraft/lime_dye.png new file mode 100644 index 000000000..c80489830 Binary files /dev/null and b/src/generated/export/items/minecraft/lime_dye.png differ diff --git a/src/generated/export/items/minecraft/magenta_dye.png b/src/generated/export/items/minecraft/magenta_dye.png new file mode 100644 index 000000000..628b15ab8 Binary files /dev/null and b/src/generated/export/items/minecraft/magenta_dye.png differ diff --git a/src/generated/export/items/minecraft/note_block.png b/src/generated/export/items/minecraft/note_block.png new file mode 100644 index 000000000..e41a8fc30 Binary files /dev/null and b/src/generated/export/items/minecraft/note_block.png differ diff --git a/src/generated/export/items/minecraft/orange_dye.png b/src/generated/export/items/minecraft/orange_dye.png new file mode 100644 index 000000000..ef0d8100f Binary files /dev/null and b/src/generated/export/items/minecraft/orange_dye.png differ diff --git a/src/generated/export/items/minecraft/pink_dye.png b/src/generated/export/items/minecraft/pink_dye.png new file mode 100644 index 000000000..992f90517 Binary files /dev/null and b/src/generated/export/items/minecraft/pink_dye.png differ diff --git a/src/generated/export/items/minecraft/purple_dye.png b/src/generated/export/items/minecraft/purple_dye.png new file mode 100644 index 000000000..318d73f5e Binary files /dev/null and b/src/generated/export/items/minecraft/purple_dye.png differ diff --git a/src/generated/export/items/minecraft/red_dye.png b/src/generated/export/items/minecraft/red_dye.png new file mode 100644 index 000000000..2b5f72bec Binary files /dev/null and b/src/generated/export/items/minecraft/red_dye.png differ diff --git a/src/generated/export/items/minecraft/redstone.png b/src/generated/export/items/minecraft/redstone.png new file mode 100644 index 000000000..0beaa512a Binary files /dev/null and b/src/generated/export/items/minecraft/redstone.png differ diff --git a/src/generated/export/items/minecraft/stone.png b/src/generated/export/items/minecraft/stone.png new file mode 100644 index 000000000..f5f74d1d1 Binary files /dev/null and b/src/generated/export/items/minecraft/stone.png differ diff --git a/src/generated/export/items/minecraft/string.png b/src/generated/export/items/minecraft/string.png new file mode 100644 index 000000000..6b82875cd Binary files /dev/null and b/src/generated/export/items/minecraft/string.png differ diff --git a/src/generated/export/items/minecraft/white_dye.png b/src/generated/export/items/minecraft/white_dye.png new file mode 100644 index 000000000..314ceaba9 Binary files /dev/null and b/src/generated/export/items/minecraft/white_dye.png differ diff --git a/src/generated/export/items/minecraft/yellow_dye.png b/src/generated/export/items/minecraft/yellow_dye.png new file mode 100644 index 000000000..6e1b056a3 Binary files /dev/null and b/src/generated/export/items/minecraft/yellow_dye.png differ diff --git a/src/main/java/dan200/computercraft/client/gui/GuiComputer.java b/src/main/java/dan200/computercraft/client/gui/GuiComputer.java index 4c24bf91c..329793a70 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiComputer.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiComputer.java @@ -77,7 +77,7 @@ public final class GuiComputer extends Computer { // Draw a border around the terminal ComputerBorderRenderer.render( - ComputerBorderRenderer.getTexture( family ), terminal.x, terminal.y, getBlitOffset(), + stack.last().pose(), ComputerBorderRenderer.getTexture( family ), terminal.x, terminal.y, getBlitOffset(), FULL_BRIGHT_LIGHTMAP, terminal.getWidth(), terminal.getHeight() ); ComputerSidebar.renderBackground( stack, leftPos, topPos + sidebarYOffset ); diff --git a/src/main/java/dan200/computercraft/client/render/ComputerBorderRenderer.java b/src/main/java/dan200/computercraft/client/render/ComputerBorderRenderer.java index 81dadc2d7..9675a44b4 100644 --- a/src/main/java/dan200/computercraft/client/render/ComputerBorderRenderer.java +++ b/src/main/java/dan200/computercraft/client/render/ComputerBorderRenderer.java @@ -23,13 +23,6 @@ public class ComputerBorderRenderer public static final ResourceLocation BACKGROUND_COMMAND = new ResourceLocation( ComputerCraft.MOD_ID, "textures/gui/corners_command.png" ); public static final ResourceLocation BACKGROUND_COLOUR = new ResourceLocation( ComputerCraft.MOD_ID, "textures/gui/corners_colour.png" ); - private static final Matrix4f IDENTITY = new Matrix4f(); - - static - { - IDENTITY.setIdentity(); - } - /** * The margin between the terminal and its border. */ @@ -91,10 +84,10 @@ public class ComputerBorderRenderer return RenderType.text( location ); } - public static void render( ResourceLocation location, int x, int y, int z, int light, int width, int height ) + public static void render( Matrix4f transform, ResourceLocation location, int x, int y, int z, int light, int width, int height ) { MultiBufferSource.BufferSource source = MultiBufferSource.immediate( Tesselator.getInstance().getBuilder() ); - render( IDENTITY, source.getBuffer( getRenderType( location ) ), x, y, z, light, width, height, false, 1, 1, 1 ); + render( transform, source.getBuffer( getRenderType( location ) ), x, y, z, light, width, height, false, 1, 1, 1 ); source.endBatch(); } diff --git a/src/main/java/dan200/computercraft/core/terminal/Terminal.java b/src/main/java/dan200/computercraft/core/terminal/Terminal.java index b8dd80f77..d5b2b62fa 100644 --- a/src/main/java/dan200/computercraft/core/terminal/Terminal.java +++ b/src/main/java/dan200/computercraft/core/terminal/Terminal.java @@ -324,9 +324,9 @@ public class Terminal TextBuffer textColour = this.textColour[y]; TextBuffer backColour = backgroundColour[y]; + for( int x = 0; x < width; x++ ) buffer.writeByte( text.charAt( x ) & 0xFF ); for( int x = 0; x < width; x++ ) { - buffer.writeByte( text.charAt( x ) & 0xFF ); buffer.writeByte( getColour( backColour.charAt( x ), Colour.BLACK ) << 4 | getColour( textColour.charAt( x ), Colour.WHITE ) @@ -353,10 +353,9 @@ public class Terminal TextBuffer textColour = this.textColour[y]; TextBuffer backColour = backgroundColour[y]; + for( int x = 0; x < width; x++ ) text.setChar( x, (char) (buffer.readByte() & 0xFF) ); for( int x = 0; x < width; x++ ) { - text.setChar( x, (char) (buffer.readByte() & 0xFF) ); - byte colour = buffer.readByte(); backColour.setChar( x, base16.charAt( (colour >> 4) & 0xF ) ); textColour.setChar( x, base16.charAt( colour & 0xF ) ); diff --git a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java index 61c27d7a8..dc8b3029d 100644 --- a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java @@ -19,9 +19,17 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import javax.annotation.Nonnull; +import java.util.concurrent.atomic.AtomicBoolean; public abstract class TileGeneric extends BlockEntity { + /** + * Is this block enqueued to be updated next tick? This should only be read/written by the tick scheduler. + * + * @see dan200.computercraft.shared.util.TickScheduler + */ + public final AtomicBoolean scheduled = new AtomicBoolean(); + public TileGeneric( BlockEntityType type, BlockPos pos, BlockState state ) { super( type, pos, state ); diff --git a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java index d7544ade5..27598631b 100644 --- a/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java +++ b/src/main/java/dan200/computercraft/shared/computer/blocks/TileComputerBase.java @@ -426,6 +426,7 @@ public abstract class TileComputerBase extends TileGeneric implements IComputerT label = copy.label; on = copy.on; startOn = copy.startOn; + lockCode = copy.lockCode; updateBlock(); } copy.instanceID = -1; diff --git a/src/main/java/dan200/computercraft/shared/network/NetworkHandler.java b/src/main/java/dan200/computercraft/shared/network/NetworkHandler.java index 227a44219..0472c3498 100644 --- a/src/main/java/dan200/computercraft/shared/network/NetworkHandler.java +++ b/src/main/java/dan200/computercraft/shared/network/NetworkHandler.java @@ -23,7 +23,6 @@ import net.minecraftforge.network.PacketDistributor; import net.minecraftforge.network.simple.SimpleChannel; import java.util.function.Function; -import java.util.function.Supplier; public final class NetworkHandler { @@ -112,10 +111,4 @@ public final class NetworkHandler } ) .add(); } - - @SuppressWarnings( "unchecked" ) - private static Class getType( Supplier supplier ) - { - return (Class) supplier.get().getClass(); - } } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java index 8da3e90cc..466def32a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDrivePeripheral.java @@ -30,6 +30,11 @@ import java.util.Optional; * When a disk is inserted, a {@code disk} event is fired, with the side peripheral is on. Likewise, when the disk is * detached, a {@code disk_eject} event is fired. * + * ## Recipe + *
+ * + *
+ * * @cc.module drive */ public class DiskDrivePeripheral implements IPeripheral diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java index a8602a909..5feefee9a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/ModemPeripheral.java @@ -75,6 +75,15 @@ import java.util.Set; * * print("Received a reply: " .. tostring(message)) * } + * + * ## Recipes + *
+ * + * + * + * + * + *
*/ public abstract class ModemPeripheral implements IPeripheral, IPacketSender, IPacketReceiver { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileCable.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileCable.java index 60d4bd538..76fbed865 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileCable.java @@ -257,7 +257,7 @@ public class TileCable extends TileGeneric @Override public InteractionResult onActivate( Player player, InteractionHand hand, BlockHitResult hit ) { - if( player.isCrouching() ) return InteractionResult.PASS; + if( player.isCrouching() || !player.mayBuild() ) return InteractionResult.PASS; if( !canAttachPeripheral() ) return InteractionResult.FAIL; if( getLevel().isClientSide ) return InteractionResult.SUCCESS; diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileWiredModemFull.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileWiredModemFull.java index ec6d2cf59..db9151a1b 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileWiredModemFull.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/TileWiredModemFull.java @@ -199,6 +199,7 @@ public class TileWiredModemFull extends TileGeneric @Override public InteractionResult onActivate( Player player, InteractionHand hand, BlockHitResult hit ) { + if( player.isCrouching() || !player.mayBuild() ) return InteractionResult.PASS; if( getLevel().isClientSide ) return InteractionResult.SUCCESS; // On server, we interacted if a peripheral was found diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java index bb83499ab..d574212b3 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorPeripheral.java @@ -25,6 +25,12 @@ import javax.annotation.Nullable; * * Like computers, monitors come in both normal (no colour) and advanced (colour) varieties. * + * ## Recipes + *
+ * + * + *
+ * * @cc.module monitor * @cc.usage Write "Hello, world!" to an adjacent monitor: * diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java index 6f81ae703..98f1a15ab 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java @@ -18,6 +18,11 @@ import java.util.Optional; /** * The printer peripheral allows pages and books to be printed. * + * ## Recipe + *
+ * + *
+ * * @cc.module printer */ public class PrinterPeripheral implements IPeripheral diff --git a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java index 1cbad912f..ad5a6efa6 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java @@ -42,6 +42,11 @@ import static dan200.computercraft.api.lua.LuaValues.checkFinite; * - {@link #playSound} plays any built-in Minecraft sound, such as block sounds or mob noises. * - {@link #playAudio} can play arbitrary audio. * + * ## Recipe + *
+ * + *
+ * * @cc.module speaker * @cc.since 1.80pr1 */ diff --git a/src/main/java/dan200/computercraft/shared/util/TickScheduler.java b/src/main/java/dan200/computercraft/shared/util/TickScheduler.java index 1092ad941..39a7e2a3f 100644 --- a/src/main/java/dan200/computercraft/shared/util/TickScheduler.java +++ b/src/main/java/dan200/computercraft/shared/util/TickScheduler.java @@ -5,21 +5,18 @@ */ package dan200.computercraft.shared.util; -import com.google.common.collect.MapMaker; import dan200.computercraft.ComputerCraft; import dan200.computercraft.shared.common.TileGeneric; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -import java.util.Collections; -import java.util.Iterator; -import java.util.Set; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedDeque; /** * A thread-safe version of {@link LevelAccessor#scheduleTick(BlockPos, Block, int)}. @@ -33,16 +30,12 @@ public final class TickScheduler { } - private static final Set toTick = Collections.newSetFromMap( - new MapMaker() - .weakKeys() - .makeMap() - ); + private static final Queue toTick = new ConcurrentLinkedDeque<>(); public static void schedule( TileGeneric tile ) { Level world = tile.getLevel(); - if( world != null && !world.isClientSide ) toTick.add( tile ); + if( world != null && !world.isClientSide && !tile.scheduled.getAndSet( true ) ) toTick.add( tile ); } @SubscribeEvent @@ -50,11 +43,11 @@ public final class TickScheduler { if( event.phase != TickEvent.Phase.START ) return; - Iterator iterator = toTick.iterator(); - while( iterator.hasNext() ) + TileGeneric tile; + while( (tile = toTick.poll()) != null ) { - BlockEntity tile = iterator.next(); - iterator.remove(); + tile.scheduled.set( false ); + if( tile.isRemoved() ) continue; Level world = tile.getLevel(); BlockPos pos = tile.getBlockPos(); diff --git a/src/main/resources/assets/computercraft/lang/da_dk.json b/src/main/resources/assets/computercraft/lang/da_dk.json index 5dc87bb01..78e069b22 100644 --- a/src/main/resources/assets/computercraft/lang/da_dk.json +++ b/src/main/resources/assets/computercraft/lang/da_dk.json @@ -1,4 +1,5 @@ { + "itemGroup.computercraft": "ComputerCraft", "block.computercraft.computer_normal": "Computer", "block.computercraft.computer_advanced": "Avanceret Computer", "block.computercraft.computer_command": "Kommandocomputer", @@ -41,23 +42,22 @@ "gui.computercraft.tooltip.computer_id": "Computer-ID: %s", "gui.computercraft.tooltip.disk_id": "Disk-ID: %s", "gui.computercraft.tooltip.turn_on": "Tænd denne computer", + "gui.computercraft.tooltip.turn_on.key": "Hold Ctrl+R nede", "gui.computercraft.tooltip.turn_off": "Sluk denne computer", - "gui.computercraft.tooltip.terminate.key": "Hold Ctrl+T nede", "gui.computercraft.tooltip.turn_off.key": "Hold Ctrl+S nede", "gui.computercraft.tooltip.terminate": "Stop den igangværende kode", - "gui.computercraft.tooltip.turn_on.key": "Hold Ctrl+R nede", - "gui.computercraft.upload.overwrite_button": "Overskriv", - "gui.computercraft.upload.overwrite.detail": "Følgende filer vil blive overskrevet ved upload. Fortsæt?%s", + "gui.computercraft.tooltip.terminate.key": "Hold Ctrl+T nede", "gui.computercraft.upload.success": "Upload Lykkedes", - "gui.computercraft.upload.overwrite": "Filer ville blive overskrevet", + "gui.computercraft.upload.success.msg": "%d filer uploadet.", + "gui.computercraft.upload.failed": "Upload Fejlede", "gui.computercraft.upload.failed.out_of_space": "Ikke nok plads på computeren til disse filer.", "gui.computercraft.upload.failed.computer_off": "Du skal tænde computeren, før du kan uploade filer.", "gui.computercraft.upload.failed.too_much": "Dine filer er for store til at blive uploadet.", - "gui.computercraft.upload.failed.overwrite_dir": "Kan ikke uploade %s, da der allerede er en mappe med det samme navn.", - "gui.computercraft.upload.success.msg": "%d filer uploadet.", - "gui.computercraft.upload.failed": "Upload Fejlede", "gui.computercraft.upload.failed.name_too_long": "Filnavne er for lange til at blive uploadet.", "gui.computercraft.upload.failed.too_many_files": "Kan ikke uploade så mange filer.", - "gui.computercraft.pocket_computer_overlay": "Lommecomputer åben. Tryk ESC for at lukke.", - "itemGroup.computercraft": "ComputerCraft" + "gui.computercraft.upload.failed.overwrite_dir": "Kan ikke uploade %s, da der allerede er en mappe med det samme navn.", + "gui.computercraft.upload.overwrite": "Filer ville blive overskrevet", + "gui.computercraft.upload.overwrite.detail": "Følgende filer vil blive overskrevet ved upload. Fortsæt?%s", + "gui.computercraft.upload.overwrite_button": "Overskriv", + "gui.computercraft.pocket_computer_overlay": "Lommecomputer åben. Tryk ESC for at lukke." } diff --git a/src/main/resources/assets/computercraft/lang/uk_ua.json b/src/main/resources/assets/computercraft/lang/uk_ua.json new file mode 100644 index 000000000..264c53ce9 --- /dev/null +++ b/src/main/resources/assets/computercraft/lang/uk_ua.json @@ -0,0 +1,135 @@ +{ + "itemGroup.computercraft": "ComputerCraft", + "block.computercraft.computer_normal": "Комп'ютер", + "block.computercraft.computer_advanced": "Просунутий комп'ютер", + "block.computercraft.computer_command": "Командний комп'ютер", + "block.computercraft.disk_drive": "Дисковод", + "block.computercraft.printer": "Принтер", + "block.computercraft.speaker": "Колонка", + "block.computercraft.monitor_normal": "Монітор", + "block.computercraft.monitor_advanced": "Просунутий Монітор", + "block.computercraft.wireless_modem_normal": "Бездротовий модем", + "block.computercraft.wireless_modem_advanced": "Ендер модем", + "block.computercraft.wired_modem": "Дротовий модем", + "block.computercraft.cable": "Мережевий кабель", + "block.computercraft.wired_modem_full": "Дротовий модем", + "block.computercraft.turtle_normal": "Черепашка", + "block.computercraft.turtle_normal.upgraded": "%s Черепашка", + "block.computercraft.turtle_normal.upgraded_twice": "%s %s Черепашка", + "block.computercraft.turtle_advanced": "Просунута Черепашка", + "block.computercraft.turtle_advanced.upgraded": "Просунута %s Черепашка", + "block.computercraft.turtle_advanced.upgraded_twice": "Просунута %s %s Черепашка", + "item.computercraft.disk": "Дискета", + "item.computercraft.treasure_disk": "Дискета", + "item.computercraft.printed_page": "Надрукована сторінка", + "item.computercraft.printed_pages": "Надруковані сторінки", + "item.computercraft.printed_book": "Надрукована книжка", + "item.computercraft.pocket_computer_normal": "Кишеньковий комп'ютер", + "item.computercraft.pocket_computer_normal.upgraded": "%s Кишеньковий комп'ютер", + "item.computercraft.pocket_computer_advanced": "Просунутий Кишеньковий комп'ютер", + "item.computercraft.pocket_computer_advanced.upgraded": "Просунутий %s Кишеньковий комп'ютер", + "upgrade.minecraft.diamond_sword.adjective": "Бойова", + "upgrade.minecraft.diamond_shovel.adjective": "Копаюча", + "upgrade.minecraft.diamond_pickaxe.adjective": "Добувна", + "upgrade.minecraft.diamond_axe.adjective": "Рубляча", + "upgrade.minecraft.diamond_hoe.adjective": "Обробна", + "upgrade.minecraft.crafting_table.adjective": "Вміла", + "upgrade.computercraft.wireless_modem_normal.adjective": "Бездротовий", + "upgrade.computercraft.wireless_modem_advanced.adjective": "Ендер", + "upgrade.computercraft.speaker.adjective": "Шумливий", + "chat.computercraft.wired_modem.peripheral_connected": "Периферійний пристрій \\\"%s\\\" підключено до мережі", + "chat.computercraft.wired_modem.peripheral_disconnected": "Периферійний пристрій \\\"%s\\\" відключено від мережі", + "commands.computercraft.synopsis": "Різні команди для керування комп'ютерами.", + "commands.computercraft.desc": "Команда /computercraft надає різні Налагоджувальні та Адміністративні інструменти для управління та взаємодії з комп'ютерами.", + "commands.computercraft.help.synopsis": "Надає допомогу для конкретних команд", + "commands.computercraft.help.desc": "Показує це повідомлення довідки", + "commands.computercraft.help.no_children": "%s не має підкоманд", + "commands.computercraft.help.no_command": "Немає такої команди '%s'", + "commands.computercraft.dump.synopsis": "Відобразити стан комп'ютерів.", + "commands.computercraft.dump.desc": "Відображає стан усіх комп'ютерів або конкретної інформації про один комп'ютер. Ви можете вказати ідентифікатор екземпляра комп'ютера (наприклад 123), ідентифікатор комп'ютера (наприклад #123) або позначку (наприклад, \"@My Computer\").", + "commands.computercraft.dump.action": "Переглянути інформацію про цей комп'ютер", + "commands.computercraft.dump.open_path": "Переглянути файли цього комп'ютера", + "commands.computercraft.shutdown.synopsis": "Віддалено завершити роботу комп'ютерів.", + "commands.computercraft.shutdown.desc": "Завершити роботу перерахованих комп'ютерів або всі, якщо жодного не вказано. Ви можете вказати ідентифікатор екземпляра комп'ютера (наприклад 123), ідентифікатор комп'ютера (наприклад #123) або позначку (наприклад, \"@My Computer\").", + "commands.computercraft.shutdown.done": "У %s/%s комп'ютерів завершено роботу", + "commands.computercraft.turn_on.synopsis": "Увімкнути комп'ютери віддалено.", + "commands.computercraft.turn_on.desc": "Увімкнути перелічені комп'ютери. Ви можете вказати ідентифікатор екземпляра комп'ютера (наприклад 123), ідентифікатор комп'ютера (наприклад #123) або позначку (наприклад, \"@My Computer\").", + "commands.computercraft.turn_on.done": "%s/%s комп'ютерів увімкнено", + "commands.computercraft.tp.synopsis": "Телепортувати до конкретного комп'ютера.", + "commands.computercraft.tp.desc": "Телепортувати до розташування комп'ютера. Ви можете вказати або ідентифікатор екземпляра комп'ютера (наприклад, 123) або ідентифікатор комп'ютера (наприклад, #123).", + "commands.computercraft.tp.action": "Телепортувати до цього комп'ютера", + "commands.computercraft.tp.not_player": "Не можна відкрити термінал для не-гравця", + "commands.computercraft.tp.not_there": "Не можна визначити у світі розташування комп'ютер", + "commands.computercraft.view.synopsis": "Переглянути термінал комп'ютера.", + "commands.computercraft.view.desc": "Відкрити термінал комп'ютера, який дозволяє віддалено керувати комп'ютером. Це не надає доступу до інвентарів черепашок. Ви можете вказати або ідентифікатор екземпляра комп'ютера (наприклад, 123) або ідентифікатор комп'ютера (наприклад, #123).", + "commands.computercraft.view.action": "Переглянути цей комп'ютер", + "commands.computercraft.view.not_player": "Не можна відкрити термінал для не-гравця", + "commands.computercraft.track.synopsis": "Відстеження середовища виконання комп'ютерів.", + "commands.computercraft.track.desc": "Відстежує, як довго комп'ютери виконують, а також те, як багато вони обробляють події. Ця інформація представляється аналогічно /forge track і може бути корисною для діагностики лага.", + "commands.computercraft.track.start.synopsis": "Почати відстеження всіх комп'ютерів", + "commands.computercraft.track.start.desc": "Почати відстеження всіх середовищ виконання комп'ютера та кількість подій. Це скасує результати та попередні запуски.", + "commands.computercraft.track.start.stop": "Запустити %s, щоб зупинити відстеження та переглянути результати", + "commands.computercraft.track.stop.synopsis": "Припинити відстеження всіх комп'ютерів", + "commands.computercraft.track.stop.desc": "Припинити відстеження всіх подій комп'ютера та середовищ виконання", + "commands.computercraft.track.stop.action": "Натисніть, щоб припинити відстеження", + "commands.computercraft.track.stop.not_enabled": "На даний момент немає комп'ютерів, що відстежують.", + "commands.computercraft.track.dump.synopsis": "Вивести останні результати відстеження", + "commands.computercraft.track.dump.desc": "Вивести останні результати відстеження комп'ютера.", + "commands.computercraft.track.dump.no_timings": "Немає доступних розкладів", + "commands.computercraft.track.dump.computer": "Комп'ютер", + "commands.computercraft.reload.synopsis": "Перезавантажити файл конфігурації ComputerCraft'a", + "commands.computercraft.reload.desc": "Перезавантажує файл конфігурації ComputerCraft'a", + "commands.computercraft.reload.done": "Конфігурація перезавантажена", + "commands.computercraft.queue.synopsis": "Надіслати подію computer_command до Командного комп'ютера", + "commands.computercraft.queue.desc": "Надіслати подію computer_command до Командного комп'ютера через додаткові аргументи. В основному це призначено для Картоделів, діє як зручніша для користувача комп'ютерна версія /trigger. Будь-який гравець зможе запустити команду, яка, ймовірно, буде зроблена через події клацання текстового компонента.", + "commands.computercraft.generic.no_position": "<немає позиції>", + "commands.computercraft.generic.position": "%s, %s, %s", + "commands.computercraft.generic.yes": "Y", + "commands.computercraft.generic.no": "N", + "commands.computercraft.generic.exception": "Необроблений виняток (%s)", + "commands.computercraft.generic.additional_rows": "%d додаткових рядків …", + "argument.computercraft.computer.no_matching": "Немає відповідних комп'ютерів з '%s'", + "argument.computercraft.computer.many_matching": "Декілька комп'ютерів відповідають з '%s' (екземпляри %s)", + "argument.computercraft.tracking_field.no_field": "Невідоме поле '%s'", + "argument.computercraft.argument_expected": "Очікується аргумент", + "tracking_field.computercraft.tasks.name": "Завдання", + "tracking_field.computercraft.total.name": "Загальний час", + "tracking_field.computercraft.average.name": "Середній час", + "tracking_field.computercraft.max.name": "Максимальний час", + "tracking_field.computercraft.server_count.name": "Число серверних завдань", + "tracking_field.computercraft.server_time.name": "Час серверних завдань", + "tracking_field.computercraft.peripheral.name": "Виклики периферійних пристроїв", + "tracking_field.computercraft.fs.name": "Операції з файловою системою", + "tracking_field.computercraft.turtle.name": "Операції з черепашкою", + "tracking_field.computercraft.http.name": "HTTP запити", + "tracking_field.computercraft.http_upload.name": "HTTP завантаження", + "tracking_field.computercraft.http_download.name": "HTTP завантаження", + "tracking_field.computercraft.websocket_incoming.name": "Вхідний Websocket", + "tracking_field.computercraft.websocket_outgoing.name": "Вихідний Websocket", + "tracking_field.computercraft.coroutines_created.name": "Співпрограма створена", + "tracking_field.computercraft.coroutines_dead.name": "Співпрограма видалена", + "gui.computercraft.tooltip.copy": "Скопійовано в Буфер обміну", + "gui.computercraft.tooltip.computer_id": "Ідентифікатор комп'ютера: %s", + "gui.computercraft.tooltip.disk_id": "Ідентифікатор диска: %s", + "gui.computercraft.tooltip.turn_on": "Увімкнути цей комп'ютер", + "gui.computercraft.tooltip.turn_on.key": "Утримуй Ctrl+R", + "gui.computercraft.tooltip.turn_off": "Вимкнути цей комп'ютер", + "gui.computercraft.tooltip.turn_off.key": "Утримуй Ctrl+S", + "gui.computercraft.tooltip.terminate": "Припинити поточний запущений код", + "gui.computercraft.tooltip.terminate.key": "Утримуй Ctrl+T", + "gui.computercraft.upload.success": "Завантаження успішне", + "gui.computercraft.upload.success.msg": "%d файлів завантажено.", + "gui.computercraft.upload.failed": "Завантаження не вдалося", + "gui.computercraft.upload.failed.out_of_space": "Недостатньо місця в комп'ютері для цих файлів.", + "gui.computercraft.upload.failed.computer_off": "Ви повинні увімкнути комп'ютер перед завантаженням файлів.", + "gui.computercraft.upload.failed.too_much": "Твої файли надто великі для завантаження.", + "gui.computercraft.upload.failed.name_too_long": "Назви файлів занадто довгі для завантаження.", + "gui.computercraft.upload.failed.too_many_files": "Неможливо завантажити стільки файлів.", + "gui.computercraft.upload.failed.overwrite_dir": "Не можна завантажити %s, оскільки папка з такою самою назвою вже існує.", + "gui.computercraft.upload.failed.generic": "Завантаження файлів не вдалося (%s)", + "gui.computercraft.upload.failed.corrupted": "Файли пошкоджені під час завантаження. Спробуй знову.", + "gui.computercraft.upload.overwrite": "Файли будуть перезаписані", + "gui.computercraft.upload.overwrite.detail": "При завантаженні файли будуть перезаписані. Продовжити?%s", + "gui.computercraft.upload.overwrite_button": "Перезаписати", + "gui.computercraft.pocket_computer_overlay": "Кишеньковий комп'ютер відкритий. Натисніть ESC, щоб закрити." +} diff --git a/src/main/resources/data/computercraft/lua/rom/help/changelog.md b/src/main/resources/data/computercraft/lua/rom/help/changelog.md index 1cc968164..7d21e3c27 100644 --- a/src/main/resources/data/computercraft/lua/rom/help/changelog.md +++ b/src/main/resources/data/computercraft/lua/rom/help/changelog.md @@ -1,3 +1,19 @@ +# New features in CC: Tweaked 1.100.6 + +* Various documentation improvements (MCJack123, FayneAldan). +* Allow CC's blocks to be rotated when used in structure blocks (Seniorendi). +* Several performance improvements to computer execution. +* Add parse_empty_array option to textutils.unserialiseJSON (@ChickChicky). +* Add an API to allow other mods to provide extra item/block details (Lemmmy). +* All blocks with GUIs can now be "locked" (via a command or NBT editing tools) like vanilla inventories. Players can only interact with them with a specific named item. + +Several bug fixes: +* Fix printouts being rendered with an offset in item frames (coolsa). +* Reduce position latency when playing audio with a noisy pocket computer. +* Fix total counts in /computercraft turn-on/shutdown commands. +* Fix "Run" command not working in the editor when run from a subdirectory (Wojbie). +* Pocket computers correctly preserve their on state. + # New features in CC: Tweaked 1.100.5 * Generic peripherals now use capabilities on the given side if one isn't provided on the internal side. diff --git a/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md b/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md index cf8a8280a..bb371ced3 100644 --- a/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md +++ b/src/main/resources/data/computercraft/lua/rom/help/whatsnew.md @@ -1,10 +1,17 @@ -New features in CC: Tweaked 1.100.5 +New features in CC: Tweaked 1.100.6 -* Generic peripherals now use capabilities on the given side if one isn't provided on the internal side. -* Improve performance of monitor rendering. +* Various documentation improvements (MCJack123, FayneAldan). +* Allow CC's blocks to be rotated when used in structure blocks (Seniorendi). +* Several performance improvements to computer execution. +* Add parse_empty_array option to textutils.unserialiseJSON (@ChickChicky). +* Add an API to allow other mods to provide extra item/block details (Lemmmy). +* All blocks with GUIs can now be "locked" (via a command or NBT editing tools) like vanilla inventories. Players can only interact with them with a specific named item. Several bug fixes: -* Various documentation fixes (bclindner, Hasaabitt) -* Speaker sounds are now correctly positioned on the centre of the speaker block. +* Fix printouts being rendered with an offset in item frames (coolsa). +* Reduce position latency when playing audio with a noisy pocket computer. +* Fix total counts in /computercraft turn-on/shutdown commands. +* Fix "Run" command not working in the editor when run from a subdirectory (Wojbie). +* Pocket computers correctly preserve their on state. Type "help changelog" to see the full version history. diff --git a/src/test/java/dan200/computercraft/client/sound/DfpwmStreamTest.java b/src/test/java/dan200/computercraft/client/sound/DfpwmStreamTest.java new file mode 100644 index 000000000..d117f1574 --- /dev/null +++ b/src/test/java/dan200/computercraft/client/sound/DfpwmStreamTest.java @@ -0,0 +1,38 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.sound; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import org.junit.jupiter.api.Test; + +import java.nio.ByteBuffer; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class DfpwmStreamTest +{ + @Test + public void testDecodesBytes() + { + DfpwmStream stream = new DfpwmStream(); + + ByteBuf input = ByteBufAllocator.DEFAULT.buffer(); + input.writeBytes( new byte[] { 43, -31, 33, 44, 30, -16, -85, 23, -3, -55, 46, -70, 68, -67, 74, -96, -68, 16, 94, -87, -5, 87, 11, -16, 19, 92, 85, -71, 126, 5, -84, 64, 17, -6, 85, -11, -1, -87, -12, 1, 85, -56, 33, -80, 82, 104, -93, 17, 126, 23, 91, -30, 37, -32, 117, -72, -58, 11, -76, 19, -108, 86, -65, -10, -1, -68, -25, 10, -46, 85, 124, -54, 15, -24, 43, -94, 117, 63, -36, 15, -6, 88, 87, -26, -83, 106, 41, 13, -28, -113, -10, -66, 119, -87, -113, 68, -55, 40, -107, 62, 20, 72, 3, -96, 114, -87, -2, 39, -104, 30, 20, 42, 84, 24, 47, 64, 43, 61, -35, 95, -65, 42, 61, 42, -50, 4, -9, 81 } ); + stream.push( input ); + + ByteBuffer buffer = stream.read( 1024 + 1 ); + assertEquals( 1024, buffer.remaining(), "Must have read 1024 bytes" ); + + byte[] decoded = new byte[] { 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 0, -1, -2, -2, -1, 0, 1, 0, -1, -3, -5, -5, -5, -7, -9, -11, -11, -9, -9, -9, -9, -10, -12, -12, -10, -8, -6, -6, -8, -10, -12, -14, -16, -18, -17, -15, -12, -9, -6, -3, -2, -2, -2, -2, -2, -2, 0, 3, 6, 7, 7, 7, 4, 1, 1, 1, 1, 3, 5, 7, 9, 12, 15, 15, 12, 12, 12, 9, 9, 11, 12, 12, 14, 16, 17, 17, 17, 14, 11, 11, 11, 10, 12, 14, 14, 13, 13, 10, 9, 9, 7, 5, 4, 4, 4, 4, 4, 6, 8, 10, 10, 10, 10, 10, 10, 10, 9, 8, 8, 8, 7, 6, 4, 2, 0, 0, 0, 0, 0, -1, -1, 0, 1, 3, 3, 3, 3, 2, 0, -2, -2, -2, -3, -5, -7, -7, -5, -3, -1, -1, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, 0, 1, 1, 1, 2, 3, 4, 5, 6, 7, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 9, 8, 7, 6, 4, 2, 0, 0, 2, 4, 6, 8, 10, 10, 8, 7, 7, 5, 3, 1, -1, 0, 2, 4, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 4, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 9, 9, 9, 9, 9, 8, 7, 6, 5, 3, 1, 1, 3, 3, 3, 3, 3, 3, 2, 1, 0, -1, -3, -3, -3, -3, -2, -3, -4, -4, -3, -4, -5, -6, -6, -5, -5, -4, -3, -2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 20, 17, 16, 16, 15, 15, 15, 15, 13, 13, 13, 13, 14, 15, 16, 18, 18, 16, 14, 12, 10, 8, 5, 5, 5, 4, 4, 4, 4, 4, 4, 2, 0, -2, -2, -2, -4, -4, -2, 0, 0, -2, -4, -6, -6, -6, -8, -10, -12, -14, -16, -15, -13, -12, -11, -11, -11, -11, -13, -13, -13, -13, -13, -14, -16, -18, -18, -18, -18, -16, -16, -16, -14, -13, -14, -15, -15, -14, -14, -12, -11, -12, -13, -13, -12, -13, -14, -15, -15, -13, -11, -9, -7, -5, -5, -5, -3, -1, -1, -1, -1, -3, -5, -5, -3, -3, -3, -1, -1, -1, -1, -3, -3, -3, -4, -6, -6, -4, -2, 0, 0, 0, 0, -2, -2, -2, -3, -5, -7, -9, -11, -13, -13, -11, -9, -7, -6, -6, -6, -6, -4, -2, -2, -4, -6, -8, -7, -5, -3, -2, -2, -2, -2, 0, 0, -2, -4, -4, -2, 0, 2, 2, 1, 1, -1, -3, -5, -7, -10, -10, -10, -10, -8, -7, -7, -5, -3, -2, -4, -4, -4, -6, -8, -10, -12, -12, -12, -12, -12, -14, -13, -13, -13, -11, -11, -11, -11, -11, -11, -11, -9, -7, -5, -3, -1, -1, -1, -1, -1, 1, 1, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 22, 19, 18, 20, 22, 24, 23, 22, 24, 26, 28, 27, 24, 23, 25, 28, 28, 28, 27, 26, 26, 23, 20, 17, 14, 14, 14, 11, 11, 11, 11, 13, 15, 16, 16, 16, 15, 15, 14, 14, 12, 10, 9, 11, 13, 15, 17, 17, 14, 13, 13, 12, 12, 10, 9, 11, 13, 15, 17, 19, 19, 16, 13, 10, 7, 4, 1, 1, 2, 2, 4, 7, 10, 13, 13, 13, 12, 12, 12, 9, 6, 6, 6, 3, 0, 0, 0, 0, 2, 3, 3, 3, 3, 5, 7, 7, 7, 9, 11, 13, 15, 18, 18, 15, 12, 9, 8, 10, 13, 13, 13, 15, 18, 21, 24, 27, 27, 23, 19, 15, 11, 10, 9, 9, 12, 16, 19, 22, 23, 19, 14, 13, 16, 16, 15, 15, 14, 17, 20, 20, 19, 19, 18, 17, 14, 13, 15, 15, 12, 11, 13, 16, 19, 19, 18, 20, 20, 19, 18, 18, 17, 17, 16, 16, 16, 15, 17, 17, 16, 16, 13, 12, 12, 11, 11, 9, 9, 9, 9, 11, 11, 9, 7, 5, 3, 1, 1, 1, -1, -1, 1, 3, 5, 7, 9, 11, 12, 9, 6, 6, 6, 6, 8, 8, 7, 9, 11, 13, 13, 12, 14, 16, 18, 20, 20, 20, 22, 24, 26, 25, 25, 27, 29, 28, 27, 26, 23, 22, 22, 21, 21, 20, 22, 24, 26, 28, 27, 24, 21, 21, 21, 18, 17, 17, 14, 11, 11, 11, 10, 10, 7, 6, 6, 4, 3, 5, 5, 3, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 0, 0, 1, 2, 3, 4, 3, 1, -1, -3, -3, -3, -3, -2, -3, -4, -6, -8, -10, -10, -10, -12, -12, -12, -12, -10, -10, -11, -12, -14, -16, -18, -20, -22, -24, -26, -28, -27, -27, -26, -26, -25, -25, -27, -26, -24, -22, -22, -22, -22, -24, -24, -24, -24, -23, -23, -22, -22, -21, -20, -19, -17, -15, -13, -11, -9, -7, -7, -9, -9, -9, -11, -13, -15, -17, -16, -14, -13, -15, -14, -14, -14, -12, -10, -8, -7, -9, -11, -13, -15, -14, -14, -13, -13, -15, -17, -19, -18, -18, -17, -17, -16, -16, -18, -20, -22, -21, -21, -21, -21, -21, -20, -21, -22, -24, -24, -22, -22, -24, -26, -25, -23, -21, -19, -18, -17, -17, -19, -21, -23, -25, -27, -29, -31, -30, -29, -28, -26, -25, -24, -24, -23, -23, -25, -24, -24, -24, -22, -20, -18, -18, -20, -20, -20, -20, -18, -16, -16, -16, -14, -12, -10, -8, -6, -4, -4, -4, -4, -4, -2, 0, 2, 4, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 4, 5, 6, 5, 3, 1, 1, 1, 1, 1, 1, 1, 0, -1, -1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, -1, -2, -3, -4, -4, -2, 0, 0, 0, 1, 3, 5, 7, 7, 5, 3, 3, 3, 3, 3 }; + for( int i = 0; i < 1024; i++ ) + { + assertEquals( (byte) (decoded[i] ^ 0x80), buffer.get(), "Bad element at " + i ); + } + + assertEquals( 0, buffer.remaining(), "Must have read all bytes" ); + } +} diff --git a/src/test/kotlin/dan200/computercraft/client/sound/DfpwmStreamTest.java b/src/test/kotlin/dan200/computercraft/client/sound/DfpwmStreamTest.java deleted file mode 100644 index 52a4958a9..000000000 --- a/src/test/kotlin/dan200/computercraft/client/sound/DfpwmStreamTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of ComputerCraft - http://www.computercraft.info - * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. - * Send enquiries to dratcliffe@gmail.com - */ -package dan200.computercraft.client.sound; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufAllocator; -import org.junit.jupiter.api.Test; - -import java.nio.ByteBuffer; - -import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class DfpwmStreamTest -{ - @Test - public void testDecodesBytes() - { - DfpwmStream stream = new DfpwmStream(); - - ByteBuf input = ByteBufAllocator.DEFAULT.buffer(); - input.writeBytes( new byte[] { 43, -31, 33, 44, 30, -16, -85, 23, -3, -55, 46, -70, 68, -67, 74, -96, -68, 16, 94, -87, -5, 87, 11, -16, 19, 92, 85, -71, 126, 5, -84, 64, 17, -6, 85, -11, -1, -87, -12, 1, 85, -56, 33, -80, 82, 104, -93, 17, 126, 23, 91, -30, 37, -32, 117, -72, -58, 11, -76, 19, -108, 86, -65, -10, -1, -68, -25, 10, -46, 85, 124, -54, 15, -24, 43, -94, 117, 63, -36, 15, -6, 88, 87, -26, -83, 106, 41, 13, -28, -113, -10, -66, 119, -87, -113, 68, -55, 40, -107, 62, 20, 72, 3, -96, 114, -87, -2, 39, -104, 30, 20, 42, 84, 24, 47, 64, 43, 61, -35, 95, -65, 42, 61, 42, -50, 4, -9, 81 } ); - stream.push( input ); - - byte[] values = new byte[1024]; - ByteBuffer buffer = stream.read( 2048 ); - assertEquals( 1024, buffer.remaining(), "Must have read 1024 bytes" ); - buffer.get( values ); - assertEquals( 0, buffer.remaining() ); - - assertArrayEquals( - new byte[] { -127, -126, -126, -126, -126, -126, -126, -127, -127, -127, -128, 127, 126, 126, 127, -128, -127, -128, 127, 125, 123, 123, 123, 121, 119, 117, 117, 119, 119, 119, 119, 118, 116, 116, 118, 120, 122, 122, 120, 118, 116, 114, 112, 110, 111, 113, 116, 119, 122, 125, 126, 126, 126, 126, 126, 126, -128, -125, -122, -121, -121, -121, -124, -127, -127, -127, -127, -125, -123, -121, -119, -116, -113, -113, -116, -116, -116, -119, -119, -117, -116, -116, -114, -112, -111, -111, -111, -114, -117, -117, -117, -118, -116, -114, -114, -115, -115, -118, -119, -119, -121, -123, -124, -124, -124, -124, -124, -122, -120, -118, -118, -118, -118, -118, -118, -118, -119, -120, -120, -120, -121, -122, -124, -126, -128, -128, -128, -128, -128, 127, 127, -128, -127, -125, -125, -125, -125, -126, -128, 126, 126, 126, 125, 123, 121, 121, 123, 125, 127, 127, 127, 127, 127, 127, 126, 126, 127, 127, 127, 127, -128, -127, -127, -127, -126, -125, -124, -123, -122, -121, -119, -119, -119, -119, -119, -119, -119, -118, -118, -118, -118, -119, -120, -121, -122, -124, -126, -128, -128, -126, -124, -122, -120, -118, -118, -120, -121, -121, -123, -125, -127, 127, -128, -126, -124, -123, -123, -123, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, -125, -125, -124, -123, -123, -123, -123, -123, -122, -121, -120, -119, -118, -119, -119, -119, -119, -119, -120, -121, -122, -123, -125, -127, -127, -125, -125, -125, -125, -125, -125, -126, -127, -128, 127, 125, 125, 125, 125, 126, 125, 124, 124, 125, 124, 123, 122, 122, 123, 123, 124, 125, 126, -128, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -125, -124, -123, -122, -121, -120, -118, -116, -114, -112, -110, -108, -108, -111, -112, -112, -113, -113, -113, -113, -115, -115, -115, -115, -114, -113, -112, -110, -110, -112, -114, -116, -118, -120, -123, -123, -123, -124, -124, -124, -124, -124, -124, -126, -128, 126, 126, 126, 124, 124, 126, -128, -128, 126, 124, 122, 122, 122, 120, 118, 116, 114, 112, 113, 115, 116, 117, 117, 117, 117, 115, 115, 115, 115, 115, 114, 112, 110, 110, 110, 110, 112, 112, 112, 114, 115, 114, 113, 113, 114, 114, 116, 117, 116, 115, 115, 116, 115, 114, 113, 113, 115, 117, 119, 121, 123, 123, 123, 125, 127, 127, 127, 127, 125, 123, 123, 125, 125, 125, 127, 127, 127, 127, 125, 125, 125, 124, 122, 122, 124, 126, -128, -128, -128, -128, 126, 126, 126, 125, 123, 121, 119, 117, 115, 115, 117, 119, 121, 122, 122, 122, 122, 124, 126, 126, 124, 122, 120, 121, 123, 125, 126, 126, 126, 126, -128, -128, 126, 124, 124, 126, -128, -126, -126, -127, -127, 127, 125, 123, 121, 118, 118, 118, 118, 120, 121, 121, 123, 125, 126, 124, 124, 124, 122, 120, 118, 116, 116, 116, 116, 116, 114, 115, 115, 115, 117, 117, 117, 117, 117, 117, 117, 119, 121, 123, 125, 127, 127, 127, 127, 127, -127, -127, -127, -126, -124, -122, -120, -118, -116, -114, -112, -110, -108, -106, -106, -109, -110, -108, -106, -104, -105, -106, -104, -102, -100, -101, -104, -105, -103, -100, -100, -100, -101, -102, -102, -105, -108, -111, -114, -114, -114, -117, -117, -117, -117, -115, -113, -112, -112, -112, -113, -113, -114, -114, -116, -118, -119, -117, -115, -113, -111, -111, -114, -115, -115, -116, -116, -118, -119, -117, -115, -113, -111, -109, -109, -112, -115, -118, -121, -124, -127, -127, -126, -126, -124, -121, -118, -115, -115, -115, -116, -116, -116, -119, -122, -122, -122, -125, -128, -128, -128, -128, -126, -125, -125, -125, -125, -123, -121, -121, -121, -119, -117, -115, -113, -110, -110, -113, -116, -119, -120, -118, -115, -115, -115, -113, -110, -107, -104, -101, -101, -105, -109, -113, -117, -118, -119, -119, -116, -112, -109, -106, -105, -109, -114, -115, -112, -112, -113, -113, -114, -111, -108, -108, -109, -109, -110, -111, -114, -115, -113, -113, -116, -117, -115, -112, -109, -109, -110, -108, -108, -109, -110, -110, -111, -111, -112, -112, -112, -113, -111, -111, -112, -112, -115, -116, -116, -117, -117, -119, -119, -119, -119, -117, -117, -119, -121, -123, -125, -127, -127, -127, 127, 127, -127, -125, -123, -121, -119, -117, -116, -119, -122, -122, -122, -122, -120, -120, -121, -119, -117, -115, -115, -116, -114, -112, -110, -108, -108, -108, -106, -104, -102, -103, -103, -101, -99, -100, -101, -102, -105, -106, -106, -107, -107, -108, -106, -104, -102, -100, -101, -104, -107, -107, -107, -110, -111, -111, -114, -117, -117, -117, -118, -118, -121, -122, -122, -124, -125, -123, -123, -125, -127, -127, -127, -127, -127, 127, 127, 127, 127, 127, 127, -128, 127, 127, -128, -128, -127, -126, -125, -124, -125, -127, 127, 125, 125, 125, 125, 126, 125, 124, 122, 120, 118, 118, 118, 116, 116, 116, 116, 118, 118, 117, 116, 114, 112, 110, 108, 106, 104, 102, 100, 101, 101, 102, 102, 103, 103, 101, 102, 104, 106, 106, 106, 106, 104, 104, 104, 104, 105, 105, 106, 106, 107, 108, 109, 111, 113, 115, 117, 119, 121, 121, 119, 119, 119, 117, 115, 113, 111, 112, 114, 115, 113, 114, 114, 114, 116, 118, 120, 121, 119, 117, 115, 113, 114, 114, 115, 115, 113, 111, 109, 110, 110, 111, 111, 112, 112, 110, 108, 106, 107, 107, 107, 107, 107, 108, 107, 106, 104, 104, 106, 106, 104, 102, 103, 105, 107, 109, 110, 111, 111, 109, 107, 105, 103, 101, 99, 97, 98, 99, 100, 102, 103, 104, 104, 105, 105, 103, 104, 104, 104, 106, 108, 110, 110, 108, 108, 108, 108, 110, 112, 112, 112, 114, 116, 118, 120, 122, 124, 124, 124, 124, 124, 126, -128, -126, -124, -122, -122, -123, -123, -123, -123, -123, -123, -123, -123, -125, -125, -125, -125, -124, -123, -122, -123, -125, -127, -127, -127, -127, -127, -127, -127, -128, 127, 127, -128, -127, -127, -128, -128, -127, -127, -128, -128, -128, 127, 126, 125, 124, 124, 126, -128, -128, -128, -127, -125, -123, -121, -121, -123, -125, -125, -125, -125, -125 }, - values, - "Decoded values must match." - ); - } -} diff --git a/src/testMod/java/dan200/computercraft/export/Exporter.java b/src/testMod/java/dan200/computercraft/export/Exporter.java new file mode 100644 index 000000000..7147a39f2 --- /dev/null +++ b/src/testMod/java/dan200/computercraft/export/Exporter.java @@ -0,0 +1,154 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.export; + +import com.google.common.io.MoreFiles; +import com.google.common.io.RecursiveDeleteOption; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.mojang.blaze3d.systems.RenderSystem; +import dan200.computercraft.ComputerCraft; +import dan200.computercraft.ingame.mod.TestMod; +import net.minecraft.client.Minecraft; +import net.minecraft.core.NonNullList; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.*; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.client.event.ClientChatEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.registries.ForgeRegistries; + +import java.io.File; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.io.Writer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashSet; +import java.util.Set; + +/** + * Provides a {@literal /ccexport } command which exports icons and recipes for all ComputerCraft items. + */ +@Mod.EventBusSubscriber( modid = TestMod.MOD_ID, value = Dist.CLIENT ) +public class Exporter +{ + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); + + @SubscribeEvent + public static void onClientCommands( ClientChatEvent event ) + { + String prefix = "/ccexport"; + if( !event.getMessage().startsWith( prefix ) ) return; + event.setCanceled( true ); + + Path output = new File( event.getMessage().substring( prefix.length() ).trim() ).getAbsoluteFile().toPath(); + if( !Files.isDirectory( output ) ) + { + Minecraft.getInstance().gui.getChat().addMessage( Component.literal( "Output path does not exist" ) ); + return; + } + + RenderSystem.assertOnRenderThread(); + try( ImageRenderer renderer = new ImageRenderer() ) + { + export( output, renderer ); + } + catch( IOException e ) + { + throw new UncheckedIOException( e ); + } + + Minecraft.getInstance().gui.getChat().addMessage( Component.literal( "Export finished!" ) ); + } + + private static void export( Path root, ImageRenderer renderer ) throws IOException + { + JsonDump dump = new JsonDump(); + + Set items = new HashSet<>(); + + // First find all CC items + for( Item item : ForgeRegistries.ITEMS ) + { + if( ForgeRegistries.ITEMS.getKey( item ).getNamespace().equals( ComputerCraft.MOD_ID ) ) items.add( item ); + } + + // Now find all CC recipes. + for( CraftingRecipe recipe : Minecraft.getInstance().level.getRecipeManager().getAllRecipesFor( RecipeType.CRAFTING ) ) + { + ItemStack result = recipe.getResultItem(); + if( !ForgeRegistries.ITEMS.getKey( result.getItem() ).getNamespace().equals( ComputerCraft.MOD_ID ) ) + { + continue; + } + if( result.hasTag() ) + { + ComputerCraft.log.warn( "Skipping recipe {} as it has NBT", recipe.getId() ); + continue; + } + + if( recipe instanceof ShapedRecipe shaped ) + { + JsonDump.Recipe converted = new JsonDump.Recipe( result ); + + for( int x = 0; x < shaped.getWidth(); x++ ) + { + for( int y = 0; y < shaped.getHeight(); y++ ) + { + Ingredient ingredient = shaped.getIngredients().get( x + y * shaped.getWidth() ); + if( ingredient.isEmpty() ) continue; + + converted.setInput( x + y * 3, ingredient, items ); + } + } + + dump.recipes.put( recipe.getId().toString(), converted ); + } + else if( recipe instanceof ShapelessRecipe shapeless ) + { + JsonDump.Recipe converted = new JsonDump.Recipe( result ); + + NonNullList ingredients = shapeless.getIngredients(); + for( int i = 0; i < ingredients.size(); i++ ) + { + converted.setInput( i, ingredients.get( i ), items ); + } + + dump.recipes.put( recipe.getId().toString(), converted ); + } + else + { + ComputerCraft.log.info( "Don't know how to handle recipe {}", recipe ); + } + } + + Path itemDir = root.resolve( "items" ); + if( Files.exists( itemDir ) ) MoreFiles.deleteRecursively( itemDir, RecursiveDeleteOption.ALLOW_INSECURE ); + + renderer.setupState(); + for( Item item : items ) + { + ItemStack stack = new ItemStack( item ); + ResourceLocation location = ForgeRegistries.ITEMS.getKey( item ); + + dump.itemNames.put( location.toString(), stack.getHoverName().getString() ); + renderer.captureRender( itemDir.resolve( location.getNamespace() ).resolve( location.getPath() + ".png" ), + () -> Minecraft.getInstance().getItemRenderer().renderAndDecorateFakeItem( stack, 0, 0 ) + ); + } + renderer.clearState(); + + try( Writer writer = Files.newBufferedWriter( root.resolve( "index.json" ) ) ) + { + GSON.toJson( dump, writer ); + } + } +} diff --git a/src/testMod/java/dan200/computercraft/export/ImageRenderer.java b/src/testMod/java/dan200/computercraft/export/ImageRenderer.java new file mode 100644 index 000000000..7d4c2955f --- /dev/null +++ b/src/testMod/java/dan200/computercraft/export/ImageRenderer.java @@ -0,0 +1,80 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.export; + +import com.mojang.blaze3d.pipeline.TextureTarget; +import com.mojang.blaze3d.platform.NativeImage; +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.math.Matrix4f; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.FogRenderer; +import org.lwjgl.opengl.GL12; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +/** + * Utilities for saving OpenGL output to an image rather than displaying it on the screen. + */ +public class ImageRenderer implements AutoCloseable +{ + public static final int WIDTH = 64; + public static final int HEIGHT = 64; + + private final TextureTarget framebuffer = new TextureTarget( WIDTH, HEIGHT, true, Minecraft.ON_OSX ); + private final NativeImage image = new NativeImage( WIDTH, HEIGHT, Minecraft.ON_OSX ); + + private Matrix4f projectionMatrix; + + public ImageRenderer() + { + framebuffer.setClearColor( 0, 0, 0, 0 ); + framebuffer.clear( Minecraft.ON_OSX ); + } + + public void setupState() + { + projectionMatrix = RenderSystem.getProjectionMatrix(); + RenderSystem.setProjectionMatrix( Matrix4f.orthographic( 0, 16, 0, 16, 1000, 3000 ) ); + + var transform = RenderSystem.getModelViewStack(); + transform.setIdentity(); + transform.translate( 0.0f, 0.0f, -2000.0f ); + + FogRenderer.setupNoFog(); + } + + public void clearState() + { + RenderSystem.setProjectionMatrix( projectionMatrix ); + RenderSystem.getModelViewStack().popPose(); + } + + public void captureRender( Path output, Runnable render ) throws IOException + { + Files.createDirectories( output.getParent() ); + + framebuffer.bindWrite( true ); + RenderSystem.clear( GL12.GL_COLOR_BUFFER_BIT | GL12.GL_DEPTH_BUFFER_BIT, Minecraft.ON_OSX ); + render.run(); + framebuffer.unbindWrite(); + + framebuffer.bindRead(); + image.downloadTexture( 0, false ); + image.flipY(); + framebuffer.unbindRead(); + + image.writeToFile( output ); + } + + @Override + public void close() + { + image.close(); + framebuffer.destroyBuffers(); + } +} diff --git a/src/testMod/java/dan200/computercraft/export/JsonDump.java b/src/testMod/java/dan200/computercraft/export/JsonDump.java new file mode 100644 index 000000000..bc26f145d --- /dev/null +++ b/src/testMod/java/dan200/computercraft/export/JsonDump.java @@ -0,0 +1,66 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.export; + +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraftforge.registries.ForgeRegistries; + +import java.util.*; + +public class JsonDump +{ + public Map itemNames = new TreeMap<>(); + public Map recipes = new TreeMap<>(); + + public static class Recipe + { + public final String[][] inputs = new String[9][]; + public String output; + public int count; + + public Recipe( ItemStack output ) + { + this.output = ForgeRegistries.ITEMS.getKey( output.getItem() ).toString(); + count = output.getCount(); + } + + public void setInput( int pos, Ingredient ingredient, Set trackedItems ) + { + if( ingredient.isEmpty() ) return; + + ItemStack[] items = ingredient.getItems(); + + // First try to simplify some tags to something easier. + for( ItemStack stack : items ) + { + Item item = stack.getItem(); + if( !canonicalItem.contains( item ) ) continue; + + trackedItems.add( item ); + inputs[pos] = new String[] { ForgeRegistries.ITEMS.getKey( item ).toString() }; + return; + } + + String[] itemIds = new String[items.length]; + for( int i = 0; i < items.length; i++ ) + { + Item item = items[i].getItem(); + trackedItems.add( item ); + itemIds[i] = ForgeRegistries.ITEMS.getKey( item ).toString(); + } + Arrays.sort( itemIds ); + + inputs[pos] = itemIds; + } + + private static final Set canonicalItem = new HashSet<>( Arrays.asList( + Items.GLASS_PANE, Items.STONE, Items.CHEST + ) ); + } +} diff --git a/src/web/components/Recipe.tsx b/src/web/components/Recipe.tsx new file mode 100644 index 000000000..40d402156 --- /dev/null +++ b/src/web/components/Recipe.tsx @@ -0,0 +1,46 @@ +import type { FunctionComponent } from "react"; +import { createElement as h } from "react"; +import useExport from "./WithExport.js"; + +const Item: FunctionComponent<{ item: string }> = ({ item }) => { + const data = useExport(); + const itemName = data.itemNames[item]; + + return {itemName} +}; + +const EmptyItem: FunctionComponent = () => ; + +const Arrow: FunctionComponent = (props) => + + + +; + +const Recipe: FunctionComponent<{ recipe: string }> = ({ recipe }) => { + const data = useExport(); + const recipeInfo = data.recipes[recipe]; + if (!recipeInfo) throw Error("Cannot find recipe for " + recipe); + + return
+ {data.itemNames[recipeInfo.output]} +
+ {recipeInfo.inputs.map((items, i) =>
{items ? : }
)} +
+ +
+ + {recipeInfo.count > 1 && {recipeInfo.count}} +
+
+}; + +export default Recipe; diff --git a/src/web/components/WithExport.tsx b/src/web/components/WithExport.tsx new file mode 100644 index 000000000..10cfcfb37 --- /dev/null +++ b/src/web/components/WithExport.tsx @@ -0,0 +1,23 @@ +import { createElement as h, useContext, createContext, FunctionComponent, ReactNode } from "react"; + +export type DataExport = { + readonly itemNames: Record, + readonly recipes: Record, +}; + +export type Recipe = { + readonly inputs: Array>, + readonly output: string, + readonly count: number, +}; + +const DataExport = createContext({ + itemNames: {}, + recipes: {}, +}); + +export const useExport = () => useContext(DataExport); +export default useExport; + +export const WithExport: FunctionComponent<{ data: DataExport, children: ReactNode }> = + ({ data, children }) => {children}; diff --git a/src/web/components/support.tsx b/src/web/components/support.tsx new file mode 100644 index 000000000..9cea4b321 --- /dev/null +++ b/src/web/components/support.tsx @@ -0,0 +1,25 @@ +import type { FunctionComponent } from "react"; + +/** + * Wrap a component and ensure that no children are passed to it. + * + * Our custom tags *must* be explicitly closed, as will be parsed as + * (rest of the document). This ensures you've not forgotten to do + * that. + * + * @param component The component to wrap + * @returns A new functional component identical to the previous one + */ +export const noChildren = function (component: FunctionComponent): FunctionComponent { + // I hope that our few remaining friends + // Give up on trying to save us + + const name = component.displayName ?? component.name; + const wrapped: FunctionComponent = props => { + if ((props as any).children) throw Error("Unexpected children in " + name); + + return component(props); + }; + wrapped.displayName = name; + return wrapped; +} diff --git a/src/web/index.tsx b/src/web/index.tsx index a9a4a8ceb..858d3658e 100644 --- a/src/web/index.tsx +++ b/src/web/index.tsx @@ -9,8 +9,6 @@ import exampleNft from "./mount/example.nft"; import exampleAudioLicense from "./mount/example.dfpwm.LICENSE"; import exampleAudioUrl from "./mount/example.dfpwm"; -import "./prism.js"; - const defaultFiles: { [filename: string]: string } = { ".settings": settingsFile, "startup.lua": startupFile, diff --git a/src/web/prism.js b/src/web/prism.js deleted file mode 100644 index c0a0be524..000000000 --- a/src/web/prism.js +++ /dev/null @@ -1,5 +0,0 @@ -/* PrismJS 1.28.0 -https://prismjs.com/download.html#themes=prism&languages=ini+toml */ -var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof i?new i(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(jg.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a"+i.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); -Prism.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}; -!function(e){function n(e){return e.replace(/__/g,(function(){return"(?:[\\w-]+|'[^'\n\r]*'|\"(?:\\\\.|[^\\\\\"\r\n])*\")"}))}e.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(n("(^[\t ]*\\[\\s*(?:\\[\\s*)?)__(?:\\s*\\.\\s*__)*(?=\\s*\\])"),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(n("(^[\t ]*|[{,]\\s*)__(?:\\s*\\.\\s*__)*(?=\\s*=)"),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:false|true)\b/,punctuation:/[.,=[\]{}]/}}(Prism); diff --git a/src/web/styles.css b/src/web/styles.css index a69dbe4a2..5ed6964aa 100644 --- a/src/web/styles.css +++ b/src/web/styles.css @@ -12,7 +12,8 @@ table { width: 100%; } -table td, table th { +table td, +table th { border: 1px solid #cccccc; padding: 2px 4px; } @@ -38,7 +39,7 @@ pre.highlight { position: fixed; z-index: 200; top: 0px; - top: 0px;; + top: 0px; } /* Behold, the most cursed CSS! copy-cat's resizing algorithm is a weird, in @@ -78,7 +79,9 @@ pre.highlight { font-size: 15px; } -.titlebar-close:hover { background: #cc4c4c; } +.titlebar-close:hover { + background: #cc4c4c; +} @media (max-width: 700px) { .computer-container { @@ -86,6 +89,89 @@ pre.highlight { height: calc(179px + 40px); } - .titlebar { height: 20px; } - .titlebar-close { font-size: 7px; } + .titlebar { + height: 20px; + } + + .titlebar-close { + font-size: 7px; + } +} + +:root { + --recipe-bg: #ddd; + --recipe-fg: #bbb; + --recipe-hover: #aaa; + + --recipe-padding: 4px; + --recipe-size: 32px; +} + +.recipe-container { + display: flex; + justify-content: center; + margin: 1em 0; + gap: 1em; + flex-wrap: wrap; +} + +.recipe { + display: inline-grid; + padding: var(--recipe-padding); + + background: var(--recipe-bg); + column-gap: var(--recipe-padding); + row-gap: var(--recipe-padding); + grid-template-rows: auto auto; + grid-template-columns: max-content 1fr max-content; +} + +.recipe-title { + color: #222; /* Same as --foreground in light theme. Ugly, but too lazy to style in dark for now. */ + grid-column-start: span 3; +} + +.recipe-inputs { + display: inline-grid; + column-gap: var(--recipe-padding); + row-gap: var(--recipe-padding); + align-items: center; + grid-template-rows: 1fr 1fr 1fr; + grid-template-columns: 1fr 1fr 1fr; +} + +.recipe-item { + padding: var(--recipe-padding); + background-color: var(--recipe-fg); +} + +.recipe-item:hover { + background-color: var(--recipe-hover); +} + +.recipe-icon { + display: block; + width: var(--recipe-size); + height: var(--recipe-size); + max-width: 10vw; + max-height: 10vw; +} + +.recipe-arrow { + width: var(--recipe-size); + max-width: 10vw; + align-self: center; +} + +.recipe-output { + align-self: center; + position: relative; +} + +.recipe-count { + position: absolute; + bottom: 0; + right: var(--recipe-padding); + color: #fff; + text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000 } diff --git a/src/web/transform.tsx b/src/web/transform.tsx new file mode 100644 index 000000000..521ee56b8 --- /dev/null +++ b/src/web/transform.tsx @@ -0,0 +1,53 @@ +/** + * Find all HTML files generated by illuaminate and pipe them through a remark. + * + * This performs compile-time syntax highlighting and expands our custom + * components using React SSR. + * + * Yes, this would be so much nicer with next.js. + */ +import * as fs from "fs/promises"; +import globModule from "glob"; +import * as path from "path"; +import { createElement, createElement as h, Fragment } from 'react'; +import { renderToStaticMarkup } from "react-dom/server"; +import rehypeHighlight from "rehype-highlight"; +import rehypeParse from 'rehype-parse'; +import rehypeReact from 'rehype-react'; +import { unified } from 'unified'; +import { promisify } from "util"; +// Our components +import Recipe from "./components/Recipe.js"; +import { noChildren } from "./components/support.js"; +import { DataExport, WithExport } from "./components/WithExport.js"; + +const glob = promisify(globModule); + +(async () => { + const base = "build/docs/lua"; + + const processor = unified() + .use(rehypeParse, { emitParseErrors: true }) + .use(rehypeHighlight, { prefix: "" }) + .use(rehypeReact, { + createElement, + Fragment, + passNode: false, + components: { + ['mc-recipe']: noChildren(Recipe), + ['mcrecipe']: noChildren(Recipe), + } as any + }); + + const dataExport = JSON.parse(await fs.readFile("src/generated/export/index.json", "utf-8")) as DataExport; + + for (const file of await glob(base + "/**/*.html")) { + const contents = await fs.readFile(file, "utf-8"); + + const { result } = await processor.process(contents); + + const outputPath = path.resolve("build/docs/site", path.relative(base, file)); + await fs.mkdir(path.dirname(outputPath), { recursive: true }); + await fs.writeFile(outputPath, "" + renderToStaticMarkup({result})); + } +})(); diff --git a/tsconfig.json b/tsconfig.json index a1a8a0ed1..2e161c2c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,9 @@ "noFallthroughCasesInSwitch": true, "importsNotUsedAsValues": "error", "forceConsistentCasingInFileNames": true, + + // Needed for some of our internal stuff. + "allowSyntheticDefaultImports": true, }, "include": [ "src/web",