Skip to content

Commit

Permalink
Feat: added docs framework (#15)
Browse files Browse the repository at this point in the history
* Proof of concept for codegenerating docs into the bundle
* formatted rollup file
* moved to basic markdown & added first iteration of rendering
* formatted tsconfig
* cleaned up Docs & micro-optimized
* moved asset to correct directory
* moved build script to js & fixed rendering problem
* Removed nested docs & finished with a placeholder doc
* updated github actioning & versioning script
* Fixed up comment & updated version
* moved rollup config to module
* Moved everything from markdown to mdx
* changed from path to name & added sorting
* stole the styling from TabMaster
* changed the version back. to stop people from getting version conflicts. will be updated together with a tabmaster patch
  • Loading branch information
CEbbinghaus authored Feb 15, 2024
1 parent 1e1c315 commit f8a1e8f
Show file tree
Hide file tree
Showing 27 changed files with 1,349 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ charset = utf-8
insert_final_newline = true
end_of_line = lf

[*.{json,js,ts,tsx,rs}]
[*.{json,js,ts,tsx,rs,codegen}]
indent_size = 4
indent_style = tab
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Update Version
run: |
echo -n "-$(git rev-parse --short HEAD)" >> backend/version && \
node util/updateVersion.js package.json lib/package.json
node util/versioning.mjs update package.json lib/package.json
- name: Download Decky CLI
run: |
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Update Version
run: |
echo -n "-$(git rev-parse --short HEAD)" >> backend/version && \
node util/updateVersion.js package.json lib/package.json
node util/versioning.mjs update package.json lib/package.json
- uses: actions/setup-node@v3
with:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ yalc.lock
*.zip

#ignore output directory
/build
/build

#ignore deploy config
deploy.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![image](Logo.png)
![image](./assets/Logo.png)

# MicroSDeck
Manage your MicroSD Cards and view which card each game is on.
Expand Down
File renamed without changes
Binary file removed assets/logo.png
Binary file not shown.
6 changes: 0 additions & 6 deletions backend/build.sh

This file was deleted.

48 changes: 1 addition & 47 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,3 @@
#!/bin/bash
exec node "--no-warnings=ExperimentalWarning" "util/build.mjs" "$@"

has_sudo() {
prompt=$(sudo -nv 2>&1)
if [ $? -eq 0 ]; then
# exit code of sudo-command is 0
echo "has_sudo__pass_set"
elif echo $prompt | grep -q '^sudo:'; then
echo "has_sudo__needs_pass"
else
echo "no_sudo"
fi
}

PluginName=$(basename "$PWD")

node util/updateVersion.js package.json lib/package.json

echo "Building plugin $PluginName..."

mkdir -p build

if [[ "$*" != *"--skip-backend"* ]]; then
echo "Building backend..."
cd backend && ./build.sh && cd ..
fi

if [[ "$*" != *"--skip-frontend"* ]]; then
echo "Building frontend..."
pnpm install && pnpm run build
fi

echo "Collecting outputs into /build folder"
cp -r dist build/
cp -r bin build/
cp main.py build/
cp plugin.json build/
cp README.md build/
cp package.json build/

if [[ "$*" != *"--skip-copy"* ]]; then
echo "Copying build folder to local plugin directory"

sudo rm -rf /home/deck/homebrew/plugins/$PluginName
sudo cp -r build/ /home/deck/homebrew/plugins/$PluginName
sudo chmod 555 /home/deck/homebrew/plugins/$PluginName
fi

node util/resetVersion.js package.json lib/package.json
5 changes: 5 additions & 0 deletions deploy.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"host": "steamdeck",
"user": "deck",
"keyfile": "~/.ssh/id_rsa"
}
9 changes: 9 additions & 0 deletions docs/Credits.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Credits

Massive shout outs to:

- [@jeiza]()
- [@rainbyte]()
- [@nabelo]()

without whom this plugin just simply wouldn't exist as it does today.
3 changes: 3 additions & 0 deletions docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hello, World!

This is the beginning of the docs, Unfortunately they are still under construction ⚠️🚧👷
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,23 @@
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-replace": "^4.0.0",
"@rollup/plugin-typescript": "^8.5.0",
"@types/markdown-it": "^13.0.7",
"@types/react": "16.14.0",
"@types/webpack": "^5.28.5",
"rollup": "^2.79.1",
"rollup-plugin-codegen": "^1.0.0",
"rollup-plugin-import-assets": "^1.1.1",
"shx": "^0.3.4",
"tslib": "^2.6.2",
"typescript": "^4.9.5"
},
"dependencies": {
"@cebbinghaus/microsdeck": "link:lib",
"@mdx-js/react": "^3.0.1",
"@mdx-js/rollup": "^3.0.1",
"decky-frontend-lib": "^3.24.5",
"lipe": "^0.3.3",
"react": "^18.2.0",
"react-icons": "^4.12.0"
},
"pnpm": {
Expand Down
Loading

0 comments on commit f8a1e8f

Please sign in to comment.