Skip to content

Commit

Permalink
📜Update guides and latest API changes (#127)
Browse files Browse the repository at this point in the history
* Start work for issue #126

* config: set next version and enabled by default

* docs: update to latest version of API v1.0.0-preview.30

* docs: update rendering text guide

* docs: update rendering textures guide

* docs: update rendering atlas textures guide

* docs: update sound guide

* docs: remove duplicate load content section and improve it

* ide: improve markdown snippets

* docs: make additional improvements to rendering text guide

* docs: make additional improvements to rendering text guide
ide: create task to create docs version

ide: create launch config to create docs version

config: create npm script to clean node modules directory

ci,config: create script to generation new version of docs

ide: add labels to all launch configs

docs: create version 1.0.0-preview.30 of docs
  • Loading branch information
CalvinWilkinson committed Nov 6, 2023
1 parent 8fe5d70 commit b886bf6
Show file tree
Hide file tree
Showing 165 changed files with 17,936 additions and 954 deletions.
44 changes: 44 additions & 0 deletions .github/cicd/scripts/create-docusaurus-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Input } from "cliffy/prompt/input.ts";

console.clear();

const nodeJSDirPath = (Deno.env.get("PATH")?.split(";")
.find((path) => path.includes("nodejs")) ?? "").replace(/\\/g, "/");

const version = await Input.prompt({
message: "Enter the name of the version you want to generate.",
hint: "Example: 1.2.3 or 1.2.3-preview.4",
minLength: 100,
validate: (input: string) => {
input = input.trim();
return /^(|v)[0-9]+\.[0-9]+\.[0-9]+(|-preview\.[0-9]+)$/.test(input);
},
transform: (input: string) => {
input = input.trim();

return input.startsWith("v") ? input.substring(1) : input;
}
});

console.log(`Chosen Version: ${version}`);

const isWindows = Deno.build.os === "windows";
const fullNPMPath = isWindows ? `${nodeJSDirPath}npm.cmd` : `${nodeJSDirPath}npm`;

console.log(`OS NPM Path: ${fullNPMPath}`);

const args = ["run", "docusaurus", "docs:version", version];

console.log(`Executing the command: ${args.join(" ")}`);
console.log(`Create API Docs Version '${version}'...`);

const command = new Deno.Command(fullNPMPath, {
args: args,
});

const { code, stdout, stderr } = command.outputSync();
console.assert(code === 0);
console.log(new TextDecoder().decode(stdout));
console.log(new TextDecoder().decode(stderr));

console.log(`API Docs Version '${version}' Created Successfully!`);
33 changes: 24 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
{ // PLAYGROUND
"name": "Playground (DEBUG)",
"request": "launch",
"type": "node",
Expand All @@ -24,7 +24,7 @@
"runtimeExecutable": "${userHome}/.deno/bin/deno"
}
},
{
{ // RESET DOCS
"request": "launch",
"name": "Reset Docs",
"type": "node",
Expand All @@ -38,7 +38,7 @@
],
"attachSimplePort": 9229
},
{
{ // DELETE API DOCS
"request": "launch",
"name": "Delete API Docs (DEBUG)",
"type": "node",
Expand All @@ -53,7 +53,7 @@
"attachSimplePort": 9229,
"console": "integratedTerminal"
},
{
{ // DELETE OLDEST API DOCS
"request": "launch",
"name": "Delete Oldest API Docs (DEBUG)",
"type": "node",
Expand All @@ -69,7 +69,7 @@
"attachSimplePort": 9229,
"console": "integratedTerminal"
},
{
{ // ENABLE TESTING ENVIRONMENT
"request": "launch",
"name": "Enable Testing Env",
"type": "node",
Expand All @@ -86,7 +86,7 @@
],
"attachSimplePort": 9229
},
{
{ // UPDATE WEBSITE VERSION
"request": "launch",
"name": "Update Website Version",
"type": "node",
Expand All @@ -100,7 +100,7 @@
],
"attachSimplePort": 9229
},
{
{ // GENERATE NEW API DOCS
"request": "launch",
"name": "Generate New API Docs",
"type": "node",
Expand All @@ -120,7 +120,7 @@
"console": "integratedTerminal",
"attachSimplePort": 9229
},
{
{ // VELAPTOR VERSION EXISTS
"request": "launch",
"name": "Velaptor Tag Exists",
"type": "node",
Expand All @@ -137,6 +137,21 @@
"${env:CICD_TOKEN}",
],
"attachSimplePort": 9229
}
},
{ // GENERATE DOCUSAURUS API DOCS VERSION
"request": "launch",
"name": "Genererate Docusaurus API Version",
"type": "node",
"program": "${workspaceFolder}/.github/cicd/scripts/create-docusaurus-version.ts",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "${userHome}/.deno/bin/deno.EXE",
"runtimeArgs": [
"run",
"--inspect-wait",
"--allow-all",
],
"attachSimplePort": 9229,
"console": "integratedTerminal"
},
]
}
10 changes: 5 additions & 5 deletions .vscode/mdx.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"scope": "mdx",
"prefix": "note-admonition",
"body": [
":::note ${1: Note Title}",
":::note ${1:Note Title}",
"${2: Note Content}",
":::\n"
],
Expand All @@ -70,7 +70,7 @@
"scope": "mdx",
"prefix": "tip-admonition",
"body": [
":::tip ${1: Note Title}",
":::tip ${1:Note Title}",
"${2: Note Content}",
":::\n"
],
Expand All @@ -80,7 +80,7 @@
"scope": "mdx",
"prefix": "info-admonition",
"body": [
":::info ${1: Note Title}",
":::info ${1:Note Title}",
"${2: Note Content}",
":::\n"
],
Expand All @@ -90,7 +90,7 @@
"scope": "mdx",
"prefix": "caution-admonition",
"body": [
":::caution ${1: Note Title}",
":::caution ${1:Note Title}",
"${2: Note Content}",
":::\n"
],
Expand All @@ -100,7 +100,7 @@
"scope": "mdx",
"prefix": "danger-admonition",
"body": [
":::danger ${1: Note Title}",
":::danger ${1:Note Title}",
"${2: Note Content}",
":::\n"
],
Expand Down
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
{ // ENABLE NEXT VERSION
"label": "Enable Next Version",
"type": "shell",
"detail": "Enables the next version feature of docusaurus.",
"windows": {
"command": "deno",
"args": [
Expand All @@ -90,6 +91,19 @@
]
}
},
{ // CREATE DOCUSAURUS VERSION
"label": "Create Docusaurus Version",
"type": "shell",
"detail": "Creates a new docusaurus API version.",
"windows": {
"command": "deno",
"args": [
"run",
"-A",
"${workspaceFolder}/.github/cicd/scripts/create-docusaurus-version.ts",
]
}
},
{ // BUILD
"label": "build",
"dependsOn": [ "Disable Testing Environment" ],
Expand All @@ -102,6 +116,7 @@
{ // DELETE API DOCS
"label": "Delete API Docs",
"dependsOn": [ "Disable Testing Environment" ],
"detail": "Deletes a version of the API docs.",
"type": "shell",
"windows": {
"command": "deno",
Expand Down
Loading

0 comments on commit b886bf6

Please sign in to comment.