-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update to pnpm8 * Update workflows * Fix engines / volta specification * Re-roll lockfile * Bump ember-async-data * Upgrade QUnit + related types * Ember concurrency is not compatible with the preview types so the test-app can't use them * Success? * '@ember/owner' isn't available yet * Remove ember-export-application-global * Get typedoc working and try to fix util output * Fixup the docs a bit * Give up on @ember/owner for now -- will fix in separate PR
- Loading branch information
1 parent
3bea077
commit 370976b
Showing
16 changed files
with
4,645 additions
and
5,040 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
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,109 @@ | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import url from 'node:url'; | ||
|
||
import { execa } from 'execa'; | ||
import fse from 'fs-extra'; | ||
|
||
|
||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
const packagePath = path.resolve(__dirname, '../ember-resources/package.json'); | ||
|
||
async function main() { | ||
|
||
let pkg = await fse.readJson(packagePath); | ||
let config = await fse.readJson(path.resolve(__dirname, './typedoc.config.json')); | ||
|
||
let packageExports = pkg.exports; | ||
|
||
let relevant = Object.keys(packageExports).filter((importPath) => { | ||
if (importPath === '.') return; | ||
if (importPath.startsWith('./core')) return; | ||
if (importPath === './util') return; | ||
if (importPath === './addon-main.js') return; | ||
if (importPath.includes('cell')) return; | ||
|
||
return true; | ||
}); | ||
|
||
let expectedOutputPath = {}; | ||
|
||
// Clear links | ||
config.sidebarLinks = {}; | ||
|
||
// Update links | ||
for (let importPath of relevant) { | ||
let normalized = importPath.replace('./util/', '').replace('./', '').replaceAll(/-/g, ' '); | ||
let split = normalized.split(' '); | ||
let camelCase = split.map((word, i) => i === 0 ? word : word[0].toUpperCase() + word.slice(1)).join(''); | ||
let outputPath = `/utils/${camelCase}`; | ||
|
||
expectedOutputPath[importPath] = outputPath; | ||
|
||
let link = `${outputPath}/index.html`; | ||
|
||
|
||
config.sidebarLinks[camelCase] = link; | ||
} | ||
|
||
// manual overrides because reasons | ||
// Default is an index.html for all exports, which may not be ideal | ||
config.sidebarLinks['link'] = '/utils/link/functions/link.html'; | ||
config.sidebarLinks['service'] = '/utils/service/functions/service.html'; | ||
config.sidebarLinks['map'] = '/utils/map/functions/map.html'; | ||
config.sidebarLinks['helper'] = '/utils/helper/functions/helper.html'; | ||
delete config.sidebarLinks['function']; | ||
config.sidebarLinks['trackedFunction'] = '/utils/function/functions/trackedFunction.html'; | ||
config.sidebarLinks['emberConcurrency'] = '/utils/emberConcurrency/functions/trackedTask.html'; | ||
config.sidebarLinks['debounce'] = '/utils/debounce/functions/debounce.html'; | ||
config.sidebarLinks['keepLatest'] = '/utils/keepLatest/functions/keepLatest.html'; | ||
config.sidebarLinks['remoteData'] = '/utils/remoteData/functions/RemoteData.html'; | ||
|
||
await fse.writeJson(path.resolve(__dirname, './typedoc.config.json'), config, { spaces: 2 }); | ||
|
||
await buildDefault(); | ||
|
||
// Generate type-doc outputs with | ||
for (let [importPath, outputPath] of Object.entries(expectedOutputPath)) { | ||
let configCopy = { ...config }; | ||
|
||
configCopy.entryPoints = [ | ||
path.resolve('../ember-resources/src', importPath + '.ts'), | ||
]; | ||
configCopy.tsconfig = path.resolve(path.join(__dirname, '../ember-resources/tsconfig.json')); | ||
configCopy.navigationLinks = {}; | ||
configCopy.navigationLinks['Back to ember-resources'] = '/index.html'; | ||
configCopy.navigationLinks['GitHub'] = 'https://github.com/NullVoxPopuli/ember-resources'; | ||
configCopy.sidebarLinks = {}; | ||
configCopy.sidebarLinks['Back to ember-resources'] = '/index.html'; | ||
configCopy.readme = 'none'; | ||
configCopy.customCss = path.resolve(path.join(__dirname, './custom.css')); | ||
delete configCopy.json; | ||
configCopy.out = path.join(__dirname, `dist/${outputPath}`); | ||
configCopy.cleanOutputDir = false; | ||
|
||
let configLocation = `/tmp/ember-resources-docs/${outputPath}/`; | ||
|
||
await fse.ensureDir(configLocation); | ||
await fse.writeJson(path.join(configLocation, 'typedoc.config.json'), configCopy, { spaces: 2 }); | ||
|
||
await build(configLocation); | ||
} | ||
} | ||
|
||
main(); | ||
|
||
async function buildDefault() { | ||
await execa('pnpm', ['typedoc', '--options', './typedoc.config.json'], { | ||
cwd: __dirname, | ||
stdio: 'inherit', | ||
}); | ||
} | ||
|
||
async function build(configLocation) { | ||
await execa('pnpm', ['typedoc', '--options', path.join(configLocation, './typedoc.config.json')], { | ||
cwd: __dirname, | ||
stdio: 'inherit', | ||
}); | ||
} |
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,39 @@ | ||
.col-menu.menu-sticky-wrap { | ||
display: flex; | ||
flex-direction: column-reverse; | ||
justify-content: start; | ||
} | ||
|
||
.tsd-navigation.settings { | ||
display: none; | ||
} | ||
|
||
.tsd-navigation.primary { | ||
display: none; | ||
} | ||
|
||
#tsd-sidebar-links::before { | ||
content: 'Utils'; | ||
font-weight: bold; | ||
margin-bottom: 0.4rem; | ||
display: block; | ||
margin-top: 0.5rem; | ||
margin-left: -0.25rem; | ||
} | ||
|
||
#tsd-sidebar-links a::after, | ||
#tsd-toolbar-links a::after { | ||
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="currentColor" d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"/></svg>'); | ||
width: 0.75rem; | ||
height: 0.75rem; | ||
display: inline-block; | ||
margin-left: 0.5rem; | ||
color: currentColor; | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
#tsd-sidebar-links a::after, | ||
#tsd-toolbar-links a::after { | ||
filter: invert(1); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,21 +1,41 @@ | ||
{ | ||
"tsconfig": "../ember-resources/tsconfig.json", | ||
"customCss": "./custom.css", | ||
"compilerOptions": { | ||
"noEmitOnError": false | ||
}, | ||
"entryPoints": [ | ||
"../ember-resources/src/index.ts", | ||
"../ember-resources/src/util/" | ||
"../ember-resources/src" | ||
], | ||
"entryPointStrategy": "expand", | ||
"navigationLinks": { | ||
"Tutorial": "https://tutorial.glimdown.com", | ||
"GitHub": "https://github.com/NullVoxPopuli/ember-resources" | ||
}, | ||
"sidebarLinks": { | ||
"link": "/utils/link/functions/link.html", | ||
"service": "/utils/service/functions/service.html", | ||
"keepLatest": "/utils/keepLatest/functions/keepLatest.html", | ||
"fps": "/utils/fps/index.html", | ||
"map": "/utils/map/functions/map.html", | ||
"helper": "/utils/helper/functions/helper.html", | ||
"remoteData": "/utils/remoteData/functions/RemoteData.html", | ||
"debounce": "/utils/debounce/functions/debounce.html", | ||
"emberConcurrency": "/utils/emberConcurrency/functions/trackedTask.html", | ||
"trackedFunction": "/utils/function/functions/trackedFunction.html" | ||
}, | ||
"entryPointStrategy": "resolve", | ||
"readme": "../README.md", | ||
"exclude": [], | ||
"json": "./docs.json", | ||
"out": "dist", | ||
"emit": "docs", | ||
"pretty": true, | ||
"skipErrorChecking": true, | ||
"excludePrivate": true, | ||
"excludeProtected": false, | ||
"excludeExternals": true, | ||
"disableSources": true, | ||
"searchInComments": true, | ||
"disableSources": false, | ||
"categorizeByGroup": false, | ||
"plugin": [ | ||
] | ||
"plugin": [] | ||
} |
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
Oops, something went wrong.