Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
17cfeb4
feat(docs): fix menu links
m1ga Sep 15, 2022
578abdd
feat(docs): show inherit elements
m1ga Sep 15, 2022
5f5409a
Merge pull request #222 from tidev/fixLinks
cb1kenobi Oct 25, 2022
f7052dc
Update package.json
cb1kenobi Oct 25, 2022
95a07aa
Merge pull request #223 from tidev/showInherit
cb1kenobi Oct 25, 2022
aae9bc4
fix: h3 copy&paste error
m1ga Oct 25, 2022
fa03906
Merge pull request #227 from tidev/bugfixH3
cb1kenobi Oct 25, 2022
ad71c4e
vuepress-plugin-apidocs@4.11.2
cb1kenobi Oct 25, 2022
418a479
feat: more search results
m1ga Feb 8, 2023
3087e13
Merge pull request #244 from tidev/230208_more_search_results
cb1kenobi Feb 8, 2023
8225683
vuepress-theme-titanium@4.11.1
cb1kenobi Feb 9, 2023
35a730d
fix: docgen interfaces
m1ga Mar 4, 2023
6cdb99d
feat: shhow constants again
m1ga Apr 1, 2023
f8f49c1
Merge pull request #254 from tidev/htmlLayout
cb1kenobi May 13, 2023
f522b7b
Update typescript_generator.js
drauggres Jul 31, 2023
8a76ff2
fix 'Empty string passed to getElementById()'
m1ga Sep 22, 2023
9900195
Merge pull request #255 from drauggres/patch-1
cb1kenobi Sep 23, 2023
047e09d
Merge pull request #253 from tidev/typescript_generator
cb1kenobi Sep 23, 2023
374cd10
Merge pull request #256 from tidev/fixWarning
cb1kenobi Sep 23, 2023
f3c4845
titanium-docgen@4.10.4
cb1kenobi Sep 23, 2023
8b2113c
chore: cla update
m1ga Mar 21, 2024
447428b
fix: properly handle promise generics
hansemannn Aug 19, 2025
2afeb59
fix: do not throw error regarding generic promises
hansemannn Aug 19, 2025
e42cf37
fix module edit link
m1ga Mar 17, 2026
c235822
regex update
m1ga Mar 17, 2026
2ce7fec
Merge pull request #259 from tidev/fixModuleLinks
m1ga Mar 17, 2026
9a0e863
Merge pull request #257 from tidev/cla
cb1kenobi Mar 17, 2026
7dea111
Merge pull request #258 from tidev/fix/promise-generics
cb1kenobi Mar 17, 2026
69ae6d9
vuepress-theme-titanium@4.11.2
cb1kenobi Sep 23, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
name: Verify contributor

steps:
- uses: tidev/tidev-cla-action@v1
- uses: tidev/tidev-cla-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
19 changes: 5 additions & 14 deletions packages/titanium-docgen/generators/jsduck_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,17 @@ function exportEditUrl(api) {
const file = api.__file;
const blackList = [ 'appcelerator.https', 'ti.geofence' ]; // Don't include Edit button for these modules
let rv = '';
let basePath = 'https://github.com/appcelerator/titanium_mobile/edit/master/';
let basePath = 'https://github.com/tidev/titanium-sdk/edit/master/';

// Determine edit URL by file's folder location
if (file.indexOf('titanium_mobile/apidoc') !== -1) {
if (file.indexOf('titanium-sdk/apidoc') !== -1) {
const startIndex = file.indexOf('apidoc/');
const path = file.substr(startIndex);
rv = basePath + path;
} else if (file.indexOf('titanium_modules') !== -1 || file.indexOf('appc_modules') !== -1) {
} else {
// URL template with placeholders for module name and path.
const urlTemplate = 'https://github.com/appcelerator-modules/%MODULE_NAME%/edit/master/%MODULE_PATH%';
const re = /titanium_modules|appc_modules\/(.+)\/apidoc/;
const urlTemplate = 'https://github.com/tidev/%MODULE_NAME%/edit/master/%MODULE_PATH%';
const re = /tidev\/(.+)\/apidoc/;
const match = file.match(re);
let modulename;
if (match) {
Expand All @@ -358,15 +358,6 @@ function exportEditUrl(api) {
rv = urlTemplate.replace(/%\w+%/g, function (all) {
return urlReplacements[all] || all;
});
} else if (file.indexOf('titanium_mobile_tizen/modules/tizen/apidoc') !== -1) {
const index = file.indexOf('modules/tizen/apidoc/');
basePath = 'https://github.com/appcelerator/titanium_mobile_tizen/edit/master/';
if (index !== -1) {
rv = basePath + file.substr(index);
} else {
common.log(common.LOG_WARN, 'Error creating edit URL for:', file, '. Couldn\'t find apidoc/ folder.');
return rv;
}
}

return rv;
Expand Down
28 changes: 24 additions & 4 deletions packages/titanium-docgen/generators/typescript_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ const skipApis = [
// List of modules that need to be generated as an interface instead of a namespace.
const forcedInterfaces = [
'Titanium.Android.R',
'Titanium.App.iOS.UserDefaults'
'Titanium.App.iOS.UserDefaults',
'Titanium.Media.Item',
'Titanium.Calendar.Attendee',
'Titanium.Calendar.Reminder',
'Titanium.Calendar.RecurrenceRule',
'Titanium.Platform.DisplayCaps',
'Titanium.XML.DocumentType'
];

const eventsMethods = [
Expand Down Expand Up @@ -169,7 +175,9 @@ class DocsParser {
// skip bundled documentation for modules and Node.js shims
return;
}
const namespaceParts = typeInfo.name.split('.');
// Handle generic types by extracting the base type name before the first '<'
const typeName = typeInfo.name.split('<')[0];
const namespaceParts = typeName.split('.');
namespaceParts.pop();
if (skipApis.includes(typeInfo.name)) {
return;
Expand Down Expand Up @@ -357,7 +365,6 @@ class GlobalTemplateWriter {
this.output += '// Project: https://github.com/appcelerator/titanium_mobile\n';
this.output += '// Definitions by: Axway Appcelerator <https://github.com/appcelerator>\n';
this.output += '// Jan Vennemann <https://github.com/janvennemann>\n';
this.output += '// Sergey Volkov <https://github.com/drauggres>\n';
this.output += '// Mathias Lorenzen <https://github.com/ffMathy>\n';
this.output += '// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n';
this.output += '// TypeScript Version: 3.0\n';
Expand Down Expand Up @@ -617,7 +624,17 @@ class GlobalTemplateWriter {

if (Array.isArray(docType)) {
const normalizedTypes = docType.map(typeName => this.normalizeType(typeName));
return normalizedTypes.includes('any') ? 'any' : normalizedTypes.join(' | ');
if (normalizedTypes.includes('any')) {
return 'any';
}
// Parenthesize function types in unions to avoid TypeScript syntax errors
const parenthesizedTypes = normalizedTypes.map(type => {
if (type.includes(') => ')) {
return `(${type})`;
}
return type;
});
return parenthesizedTypes.join(' | ');
}

const lessThanIndex = docType.indexOf('<');
Expand All @@ -644,6 +661,9 @@ class GlobalTemplateWriter {
}
} else if (baseType === 'Dictionary') {
return `Dictionary<${subType}>`;
} else if (baseType === 'Promise') {
// Use standard Promise<T> generic syntax
return `Promise<${subTypes.join(', ')}>`;
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/titanium-docgen/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "titanium-docgen",
"version": "4.10.3",
"version": "4.10.4",
"description": "Generates Titanium API documentation in different formats",
"main": "index.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions packages/titanium-docgen/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,12 @@ function validateDataType(type, fullTypeContext) {
// Should it have been written as a complex type?
if (common.COMPLEX_TYPES.has(type)) {
const argCount = common.COMPLEX_TYPES.get(type); // may be 0 if Function/Callback
// Enforce as ERROR if Promise/Set/Map doesn't have exact generic type count
const severity = [ 'Map', 'Set', 'Promise' ].includes(type) ? ERROR : WARNING;
// Skip validation for Promise to allow Promise without generics (Promise<T> not supported by build system)
if (type === 'Promise') {
return errors;
}
// Enforce as ERROR if Set/Map doesn't have exact generic type count
const severity = [ 'Map', 'Set' ].includes(type) ? ERROR : WARNING;
errors.push(new Problem(`${type} ${severity === ERROR ? 'must' : 'should'} have ${argCount || 'any number of'} generic type(s) specified, but had 0: ${fullTypeContext || type}`, severity));
} else if (type === 'Object') {
// Warn about generic Object types (Dictionary is handled above as a complex type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</h2>

<div v-for="(constant, index) in constants" :key="constant.name">
<div class="member-header">
<h4 :id="constant.name.toLowerCase()">
<div class="member-header" :id="`${constant.name.toLowerCase()}`">
<h4 :id="`constants_${constant.name.toLowerCase()}`">
<a :href="`#${constant.name.toLowerCase()}`" class="header-anchor">#</a> {{constant.name}} <Badge v-if="constant.deprecated" text="DEPRECATED" type="warn"/>
</h4>
<AvailabilityInfo :platforms="constant.platforms"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</h2>

<div v-for="(event, index) in events" :key="event.name">
<div class="member-header">
<h3 :id="event.name.toLowerCase()">
<div class="member-header" :id="`${event.name.toLowerCase()}`">
<h3 :id="`events_${event.name.toLowerCase()}`">
<a :href="`#${event.name.toLowerCase()}`" class="header-anchor">#</a> {{event.name}} <Badge v-if="event.deprecated" text="DEPRECATED" type="warn"/>
</h3>
<AvailabilityInfo :platforms="event.platforms"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</h2>

<div v-for="(method, index) in methods" :key="method.name">
<div class="member-header">
<h3 :id="method.name.toLowerCase()">
<div class="member-header" :id="`${method.name.toLowerCase()}`">
<h3 :id="`methods_${method.name.toLowerCase()}`">
<a :href="`#${method.name.toLowerCase()}`" class="header-anchor">#</a> {{method.name}} <Badge v-if="method.deprecated" text="DEPRECATED" type="warn"/>
</h3>
<AvailabilityInfo :platforms="method.platforms"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</h2>

<div v-for="(property, index) in properties" :key="property.name">
<div class="member-header">
<h3 :id="property.name.toLowerCase()">
<div class="member-header" :id="`${property.name.toLowerCase()}`">
<h3 :id="`properties_${property.name.toLowerCase()}`">
<a :href="`#${property.name.toLowerCase()}`" class="header-anchor">#</a> {{property.name}} <Badge v-if="property.permission === 'read-only'" text="READONLY" type="light"/><Badge v-if="property.availability === 'creation'" text="CREATION ONLY" type="info"/><Badge v-if="property.deprecated" text="DEPRECATED" type="warn"/>
</h3>
<AvailabilityInfo :platforms="property.platforms"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class MetadataProcessor {

filterInheritedMembers (metadata) {
const filterInherited = member => {
if (member.inherits && member.inherits !== metadata.name) {
return false
}
// if (member.inherits && member.inherits !== metadata.name) {
// return false
// }

return true
}
Expand Down Expand Up @@ -108,7 +108,7 @@ class MetadataProcessor {
headers.push({
level: 3,
title: memberMetadata.name,
slug: memberMetadata.name.toLowerCase()
slug: memberType + "_" + memberMetadata.name.toLowerCase()
})
})
if (headers.length) {
Expand All @@ -117,9 +117,7 @@ class MetadataProcessor {
title: memberType.charAt(0).toUpperCase() + memberType.slice(1),
slug: memberType
})
if (memberType !== 'constants') {
this.additionalHeaders = this.additionalHeaders.concat(headers)
}
this.additionalHeaders = this.additionalHeaders.concat(headers)
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vuepress/vuepress-plugin-apidocs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuepress-plugin-apidocs",
"version": "4.11.0",
"version": "4.11.2",
"description": "Plugin for VuePress to render API reference documentation",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vuepress/vuepress-theme-titanium/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = (options, ctx) => ({
}
},
plugins: [
['@vuepress/search', { searchMaxSuggestions: 10 }],
['@vuepress/search', { searchMaxSuggestions: 30 }],
'@vuepress/nprogress',
['container', { type: 'tip' }],
['container', { type: 'warning' }],
Expand Down
4 changes: 2 additions & 2 deletions packages/vuepress/vuepress-theme-titanium/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "vuepress-theme-titanium",
"version": "4.11.0",
"version": "4.11.2",
"description": "VuePress theme for Titanium projects",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Axway Appcelerator",
"author": "TiDev, Inc. <npm@tidev.io>",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ module.exports = ({ Vue, options, router }) => {
})
}
window.onload = () => {
const element = document.getElementById(location.hash.slice(1))
if (element) {
element.scrollIntoView()
if (location.hash.slice(1) != "") {
const element = document.getElementById(location.hash.slice(1))
if (element) {
element.scrollIntoView()
}
}
}
} else {
Expand All @@ -49,16 +51,20 @@ module.exports = ({ Vue, options, router }) => {

if (location.hash) {
setTimeout(function() {
const element = document.getElementById(location.hash.slice(1))
if (element) {
element.scrollIntoView()
if (location.hash.slice(1) != "") {
const element = document.getElementById(location.hash.slice(1))
if (element) {
element.scrollIntoView()
}
}
}, 250);
}
window.onload = () => {
const element = document.getElementById(location.hash.slice(1))
if (element) {
element.scrollIntoView()
if (location.hash.slice(1) != "") {
const element = document.getElementById(location.hash.slice(1))
if (element) {
element.scrollIntoView()
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion packages/vuepress/vuepress-theme-titanium/styles/theme.styl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ body
background-color $white
box-sizing border-box
border-bottom 1px solid $borderColor

.suggestions
max-height 400px
overflow-y auto

.sidebar-mask
position fixed
z-index 9
Expand Down
Loading