Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 25 additions & 31 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,35 @@ name: Heroku build and deploy

on:
push:
branches: ['master']
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]
workflow_dispatch:
branches:
- master

jobs:
build_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: build
run: |
cd webapp/
yarn
yarn build
- name: stage static deploy artifact
run: |
cd webapp/
rm -rf deploy && mkdir deploy
cp -r dist deploy/dist
cp server.js deploy/server.js
cp Procfile deploy/Procfile
cp deploy.package.json deploy/package.json
- name: deploy to heroku
run: |
cd webapp/deploy/
git init
git config user.email "morteza@mcneel.com"
git config user.name "Morteza Karimi"
git remote add heroku https://heroku:${{ secrets.HEROKU_API_KEY }}@git.heroku.com/mcneel-apidocs.git
git add .
git commit -m "CI build"
git push heroku HEAD:master --force
- uses: actions/checkout@v3
- name: build
run: |
cd quasar_site/
yarn
yarn ssrbuild
- name: deploy
run: |
cd quasar_site/dist/ssr/
git init
git config user.email "morteza@mcneel.com"
git config user.name "Morteza Karimi"
git remote add heroku https://heroku:${{ secrets.HEROKU_API_KEY }}@git.heroku.com/mcneel-apidocs.git
git add .
git commit -m "CI build"
git push heroku master --force

- name: invalidate cache
run: |
curl --location 'https://api.mcneel.com/cloudfront/invalidate' --header 'Authorization: Basic ${{ secrets.BOZO_API_KEY }}' --header 'Content-Type: application/json' --data '{"url":"https://developer.rhino3d.com/api/*"}'

- name: invalidate cache
run: |
curl --location 'https://api.mcneel.com/cloudfront/invalidate' --header 'Authorization: Basic ${{ secrets.BOZO_API_KEY }}' --header 'Content-Type: application/json' --data '{"url":"https://developer.rhino3d.com/api/*"}'
14 changes: 7 additions & 7 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"init",
"RhinoCommon",
"--force",
"--target=${workspaceFolder}/webapp/src",
"--target=${workspaceFolder}/quasar_site/src",
"--source=${input:rhinoSource}/src4/DotNetSDK/rhinocommon/dotnet",
"--examples=${input:rhinoSource}/src4/DotNetSDK/rhinocommon"
],
Expand All @@ -48,21 +48,21 @@
"problemMatcher": []
},
{
"label": "run webapp",
"command": "yarn",
"label": "run quasar",
"command": "quasar",
"type": "process",
"args": ["dev"],
"options": {
"cwd": "${workspaceFolder}/webapp"
"cwd": "${workspaceFolder}/quasar_site"
},
"problemMatcher": "$msCompile"
},
{
"label": "initial setup",
"label": "initial setup (npm)",
"type": "shell",
"command": "yarn",
"command": "npm install && npm run lint",
"options": {
"cwd": "${workspaceFolder}/webapp"
"cwd": "${workspaceFolder}/quasar_site"
},
"problemMatcher": []
}
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Project for generating Rhino/Grasshopper API documentation. This repo is split i

# src
src contains a Visual Studio project (api_docify) that parses source code and generates markdown and json files that represent the public facing API for a project
# webapp
a Vue 3 + Vite + Tailwind + Pinia SPA that creates a web site based on the json files created. This site currently gets published to heroku and can be viewed at
# quasar_site
a quasar project that creates a web site based on the json files created. This site currently gets published to heroku and can be viewed at

https://mcneel-apidocs.herokuapp.com/api/rhinocommon/

Instructions for building and testing the web app can be found at
[web app readme](webapp/README.md)
Instructions for building and testing the quasar site can be found at
[quasar site readme](quasar_site/readme.md)


## Usage
Expand All @@ -22,16 +22,17 @@ $ api_docify --name=<proj_name> <proj_path> <proj_output_js> <examples_path> <ex
**Example**

```shell
$ api_docify.exe --name="RhinoCommon" "%RHINO4SRC%/rhinocommon/dotnet" "src/modules/docify/webapp/src/RhinoCommonApi.js"
$ api_docify.exe --name="RhinoCommon" "%RHINO4SRC%/rhinocommon/dotnet" "src/modules/docify/quasar_site/src/RhinoCommonApi.js"
```

# VS Code (Mac) setup instructions

1. Ensure node and yarn are installed
1. Ensure node, npm, and quasar are installed
2. Open this folder in VS Code
3. Run `cd webapp && yarn` to install dependencies
4. Run `CMD+Shift+P > Run Task > docify build` (or run the generator) to produce the JSON
5. Run `cd webapp && yarn dev` to start the site
3. Run `CMD+Shift+P > Run Task > initial setup (npm)`
4. Run `CMD+Shift+P > Run Task > docify init`, then enter the path where the Rhino source code is located and press enter.
5. Run `CMD+Shift+P > Run Task > docify build`
5. Run `CMD+Shift+P > Run Task > run quasar`

## Troubleshooting

Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions quasar_site/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/dist
/src-bex/www
/src-capacitor
/src-cordova
/.quasar
/node_modules
.eslintrc.js
babel.config.js
67 changes: 67 additions & 0 deletions quasar_site/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
module.exports = {
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
// This option interrupts the configuration hierarchy at this file
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
root: true,

parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
},

env: {
browser: true,
'vue/setup-compiler-macros': true
},

// Rules order is important, please avoid shuffling them
extends: [
// Base ESLint recommended rules
// 'eslint:recommended',

// Uncomment any of the lines below to choose desired strictness,
// but leave only one uncommented!
// See https://eslint.vuejs.org/rules/#available-rules
'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
// 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
// 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)

// https://github.com/prettier/eslint-config-prettier#installation
// usage with Prettier, provided by 'eslint-config-prettier'.
'prettier'
],

plugins: [
// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
// required to lint *.vue files
'vue',

// https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
// Prettier has not been included as plugin to avoid performance impact
// add it as an extension for your IDE

],

globals: {
ga: 'readonly', // Google Analytics
cordova: 'readonly',
__statics: 'readonly',
__QUASAR_SSR__: 'readonly',
__QUASAR_SSR_SERVER__: 'readonly',
__QUASAR_SSR_CLIENT__: 'readonly',
__QUASAR_SSR_PWA__: 'readonly',
process: 'readonly',
Capacitor: 'readonly',
chrome: 'readonly'
},

// add your custom rules here
rules: {

'prefer-promise-reject-errors': 'off',

// allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
33 changes: 33 additions & 0 deletions quasar_site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.DS_Store
.thumbs.db
node_modules

# Quasar core related directories
.quasar
/dist

# Cordova related directories and files
/src-cordova/node_modules
/src-cordova/platforms
/src-cordova/plugins
/src-cordova/www

# Capacitor related directories and files
/src-capacitor/www
/src-capacitor/node_modules

# BEX related directories and files
/src-bex/www
/src-bex/js/core

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
File renamed without changes.
9 changes: 9 additions & 0 deletions quasar_site/.postcssrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable */
// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {
plugins: [
// to edit target browsers: use "browserslist" field in package.json
require('autoprefixer')
]
}
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions quasar_site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Quasar App (quasar-site-v2)

Documentation site for RhinoCommon

## Install the dependencies
```bash
yarn
# or
npm install
```

### Start the app in development mode (hot-code reloading, error reporting, etc.)
```bash
quasar dev
```


### Lint the files
```bash
yarn lint
# or
npm run lint
```


### Format the files
```bash
yarn format
# or
npm run format
```



### Build the app for production
```bash
quasar build
```

### Customize the configuration
See [Configuring quasar.config.js](https://v2.quasar.dev/quasar-cli-vite/quasar-config-js).
14 changes: 14 additions & 0 deletions quasar_site/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-disable */

module.exports = api => {
return {
presets: [
[
'@quasar/babel-preset-app',
api.caller(caller => caller && caller.target === 'node')
? { targets: { node: 'current' } }
: {}
]
]
}
}
39 changes: 39 additions & 0 deletions quasar_site/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"src/*": [
"src/*"
],
"app/*": [
"*"
],
"components/*": [
"src/components/*"
],
"layouts/*": [
"src/layouts/*"
],
"pages/*": [
"src/pages/*"
],
"assets/*": [
"src/assets/*"
],
"boot/*": [
"src/boot/*"
],
"stores/*": [
"src/stores/*"
],
"vue$": [
"node_modules/vue/dist/vue.runtime.esm-bundler.js"
]
}
},
"exclude": [
"dist",
".quasar",
"node_modules"
]
}
Loading
Loading