-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3db5da
commit 17a9c88
Showing
4 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Deploy Documentation to Pages | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Generate Documentation | ||
run: npx generate-docs | ||
|
||
- name: Build Documentation | ||
run: cd docs/codexMaker && npm install && npm run build && npm run export | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: docs/codexMaker/out | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
name: Deploy | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ dist/ | |
*.log | ||
.DS_Store | ||
.vscode | ||
codex-tests/ | ||
codex-tests/ | ||
out/ | ||
.next/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { parentPort, workerData } from 'worker_threads'; | ||
import { availableParsers } from '../parsers'; | ||
|
||
async function processWorkerFile() { | ||
if (!parentPort) throw new Error('This file must be run as a worker'); | ||
|
||
try { | ||
const { filePath, content } = workerData; | ||
|
||
// find correct parser | ||
const parser = availableParsers.find(p => p.canParse(filePath)); | ||
if (!parser) { | ||
parentPort.postMessage({ | ||
functions: [], | ||
errors: [`No parser available for file: ${filePath}`] | ||
}); | ||
return; | ||
} | ||
|
||
// parse file | ||
const result = await parser.parseFile(filePath, content); | ||
parentPort.postMessage(result); | ||
} catch (error) { | ||
parentPort.postMessage({ | ||
functions: [], | ||
errors: [`Worker error processing ${workerData.filePath}: ${(error as Error).message}`] | ||
}); | ||
} | ||
} | ||
|
||
processWorkerFile().catch(error => { | ||
console.error('Worker error:', error); | ||
process.exit(1); | ||
}); |