feat(docs): typedoc api reference (#9378)

This commit is contained in:
Janos Hrubos
2021-05-06 16:49:07 +02:00
committed by GitHub
parent 342108c1af
commit 6d91c2a019
4 changed files with 374 additions and 398 deletions

View File

@ -66,6 +66,7 @@
"ts-node": "9.1.1", "ts-node": "9.1.1",
"ts-patch": "^1.3.0", "ts-patch": "^1.3.0",
"tslint": "6.1.3", "tslint": "6.1.3",
"typedoc": "^0.20.14",
"typescript": "4.1.4", "typescript": "4.1.4",
"webpack": "~4.44.1", "webpack": "~4.44.1",
"webpack-cli": "~3.3.12" "webpack-cli": "~3.3.12"

View File

@ -2,367 +2,364 @@
* Config file for API Extractor. For more info, please visit: https://api-extractor.com * Config file for API Extractor. For more info, please visit: https://api-extractor.com
*/ */
{ {
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
/** /**
* Optionally specifies another JSON config file that this file extends from. This provides a way for * Optionally specifies another JSON config file that this file extends from. This provides a way for
* standard settings to be shared across multiple projects. * standard settings to be shared across multiple projects.
* *
* If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains
* the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be
* resolved using NodeJS require(). * resolved using NodeJS require().
* *
* SUPPORTED TOKENS: none * SUPPORTED TOKENS: none
* DEFAULT VALUE: "" * DEFAULT VALUE: ""
*/ */
// "extends": "./shared/api-extractor-base.json" // "extends": "./shared/api-extractor-base.json"
// "extends": "my-package/include/api-extractor-base.json" // "extends": "my-package/include/api-extractor-base.json"
/** /**
* Determines the "<projectFolder>" token that can be used with other config file settings. The project folder * Determines the "<projectFolder>" token that can be used with other config file settings. The project folder
* typically contains the tsconfig.json and package.json config files, but the path is user-defined. * typically contains the tsconfig.json and package.json config files, but the path is user-defined.
* *
* The path is resolved relative to the folder of the config file that contains the setting. * The path is resolved relative to the folder of the config file that contains the setting.
* *
* The default value for "projectFolder" is the token "<lookup>", which means the folder is determined by traversing * The default value for "projectFolder" is the token "<lookup>", which means the folder is determined by traversing
* parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder
* that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error
* will be reported. * will be reported.
* *
* SUPPORTED TOKENS: <lookup> * SUPPORTED TOKENS: <lookup>
* DEFAULT VALUE: "<lookup>" * DEFAULT VALUE: "<lookup>"
*/ */
"projectFolder": "nativescript-core", "projectFolder": "../../packages/core",
/** /**
* (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
* analyzes the symbols exported by this module. * analyzes the symbols exported by this module.
* *
* The file extension must be ".d.ts" and not ".ts". * The file extension must be ".d.ts" and not ".ts".
* *
* The path is resolved relative to the folder of the config file that contains the setting; to change this, * The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>". * prepend a folder token such as "<projectFolder>".
* *
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName> * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
*/ */
"mainEntryPointFilePath": "<projectFolder>/index.d.ts", "mainEntryPointFilePath": "<projectFolder>/index.d.ts",
/** /**
* Determines how the TypeScript compiler engine will be invoked by API Extractor. * Determines how the TypeScript compiler engine will be invoked by API Extractor.
*/ */
"compiler": { "compiler": {
/** /**
* Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
* *
* The path is resolved relative to the folder of the config file that contains the setting; to change this, * The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>". * prepend a folder token such as "<projectFolder>".
* *
* Note: This setting will be ignored if "overrideTsconfig" is used. * Note: This setting will be ignored if "overrideTsconfig" is used.
* *
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName> * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/tsconfig.json" * DEFAULT VALUE: "<projectFolder>/tsconfig.json"
*/ */
"tsconfigFilePath": "<projectFolder>/tsconfig.json", "tsconfigFilePath": "<projectFolder>/tsconfig.json"
/** /**
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
* The object must conform to the TypeScript tsconfig schema: * The object must conform to the TypeScript tsconfig schema:
* *
* http://json.schemastore.org/tsconfig * http://json.schemastore.org/tsconfig
* *
* If omitted, then the tsconfig.json file will be read from the "projectFolder". * If omitted, then the tsconfig.json file will be read from the "projectFolder".
* *
* DEFAULT VALUE: no overrideTsconfig section * DEFAULT VALUE: no overrideTsconfig section
*/ */
// "overrideTsconfig": { // "overrideTsconfig": {
// . . . // . . .
// } // }
/** /**
* This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended
* and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when
* dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses
* for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck.
* *
* DEFAULT VALUE: false * DEFAULT VALUE: false
*/ */
// "skipLibCheck": true, // "skipLibCheck": true,
}, },
/** /**
* Configures how the API report file (*.api.md) will be generated. * Configures how the API report file (*.api.md) will be generated.
*/ */
"apiReport": { "apiReport": {
/** /**
* (REQUIRED) Whether to generate an API report. * (REQUIRED) Whether to generate an API report.
*/ */
"enabled": true, "enabled": true,
/** /**
* The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce
* a full file path. * a full file path.
* *
* The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/".
* *
* SUPPORTED TOKENS: <packageName>, <unscopedPackageName> * SUPPORTED TOKENS: <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<unscopedPackageName>.api.md" * DEFAULT VALUE: "<unscopedPackageName>.api.md"
*/ */
"reportFileName": "<unscopedPackageName>.api.md", "reportFileName": "<unscopedPackageName>.api.md",
/** /**
* Specifies the folder where the API report file is written. The file name portion is determined by * Specifies the folder where the API report file is written. The file name portion is determined by
* the "reportFileName" setting. * the "reportFileName" setting.
* *
* The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,
* e.g. for an API review. * e.g. for an API review.
* *
* The path is resolved relative to the folder of the config file that contains the setting; to change this, * The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>". * prepend a folder token such as "<projectFolder>".
* *
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName> * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/etc/" * DEFAULT VALUE: "<projectFolder>/etc/"
*/ */
"reportFolder": "api-reports/", "reportFolder": "api-reports/"
/** /**
* Specifies the folder where the temporary report file is written. The file name portion is determined by * Specifies the folder where the temporary report file is written. The file name portion is determined by
* the "reportFileName" setting. * the "reportFileName" setting.
* *
* After the temporary file is written to disk, it is compared with the file in the "reportFolder". * After the temporary file is written to disk, it is compared with the file in the "reportFolder".
* If they are different, a production build will fail. * If they are different, a production build will fail.
* *
* The path is resolved relative to the folder of the config file that contains the setting; to change this, * The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>". * prepend a folder token such as "<projectFolder>".
* *
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName> * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/temp/" * DEFAULT VALUE: "<projectFolder>/temp/"
*/ */
// "reportTempFolder": "<projectFolder>/temp/" // "reportTempFolder": "<projectFolder>/temp/"
}, },
/** /**
* Configures how the doc model file (*.api.json) will be generated. * Configures how the doc model file (*.api.json) will be generated.
*/ */
"docModel": { "docModel": {
/** /**
* (REQUIRED) Whether to generate a doc model file. * (REQUIRED) Whether to generate a doc model file.
*/ */
"enabled": true, "enabled": true
/** /**
* The output path for the doc model file. The file extension should be ".api.json". * The output path for the doc model file. The file extension should be ".api.json".
* *
* The path is resolved relative to the folder of the config file that contains the setting; to change this, * The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>". * prepend a folder token such as "<projectFolder>".
* *
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName> * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/temp/<unscopedPackageName>.api.json" * DEFAULT VALUE: "<projectFolder>/temp/<unscopedPackageName>.api.json"
*/ */
// "apiJsonFilePath": "<projectFolder>/temp/<unscopedPackageName>.api.json" // "apiJsonFilePath": "<projectFolder>/temp/<unscopedPackageName>.api.json"
}, },
/** /**
* Configures how the .d.ts rollup file will be generated. * Configures how the .d.ts rollup file will be generated.
*/ */
"dtsRollup": { "dtsRollup": {
/** /**
* (REQUIRED) Whether to generate the .d.ts rollup file. * (REQUIRED) Whether to generate the .d.ts rollup file.
*/ */
"enabled": true, "enabled": true,
/** /**
* Specifies the output path for a .d.ts rollup file to be generated without any trimming. * Specifies the output path for a .d.ts rollup file to be generated without any trimming.
* This file will include all declarations that are exported by the main entry point. * This file will include all declarations that are exported by the main entry point.
* *
* If the path is an empty string, then this file will not be written. * If the path is an empty string, then this file will not be written.
* *
* The path is resolved relative to the folder of the config file that contains the setting; to change this, * The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>". * prepend a folder token such as "<projectFolder>".
* *
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName> * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts" * DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
*/ */
"untrimmedFilePath": "<projectFolder>/nativescript-core.d.ts", "untrimmedFilePath": "<projectFolder>/nativescript-core.d.ts"
/** /**
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
* This file will include only declarations that are marked as "@public" or "@beta". * This file will include only declarations that are marked as "@public" or "@beta".
* *
* The path is resolved relative to the folder of the config file that contains the setting; to change this, * The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>". * prepend a folder token such as "<projectFolder>".
* *
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName> * SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "" * DEFAULT VALUE: ""
*/ */
// "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts", // "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",
/**
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
* This file will include only declarations that are marked as "@public".
*
* If the path is an empty string, then this file will not be written.
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: ""
*/
// "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",
/** /**
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. * When a declaration is trimmed, by default it will be replaced by a code comment such as
* This file will include only declarations that are marked as "@public". * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
* * declaration completely.
* If the path is an empty string, then this file will not be written. *
* * DEFAULT VALUE: false
* The path is resolved relative to the folder of the config file that contains the setting; to change this, */
* prepend a folder token such as "<projectFolder>". // "omitTrimmingComments": true
* },
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: ""
*/
// "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",
/** /**
* When a declaration is trimmed, by default it will be replaced by a code comment such as * Configures how the tsdoc-metadata.json file will be generated.
* "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the */
* declaration completely. "tsdocMetadata": {
* /**
* DEFAULT VALUE: false * Whether to generate the tsdoc-metadata.json file.
*/ *
// "omitTrimmingComments": true * DEFAULT VALUE: true
}, */
// "enabled": true,
/**
* Specifies where the TSDoc metadata file should be written.
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* The default value is "<lookup>", which causes the path to be automatically inferred from the "tsdocMetadata",
* "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup
* falls back to "tsdoc-metadata.json" in the package folder.
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<lookup>"
*/
// "tsdocMetadataFilePath": "<projectFolder>/dist/tsdoc-metadata.json"
},
/** /**
* Configures how the tsdoc-metadata.json file will be generated. * Configures how API Extractor reports error and warning messages produced during analysis.
*/ *
"tsdocMetadata": { * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages.
/** */
* Whether to generate the tsdoc-metadata.json file. "messages": {
* /**
* DEFAULT VALUE: true * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing
*/ * the input .d.ts files.
// "enabled": true, *
* TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551"
*
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
*/
"compilerMessageReporting": {
/**
* Configures the default routing for messages that don't match an explicit rule in this table.
*/
"default": {
/**
* Specifies whether the message should be written to the the tool's output log. Note that
* the "addToApiReportFile" property may supersede this option.
*
* Possible values: "error", "warning", "none"
*
* Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail
* and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes
* the "--local" option), the warning is displayed but the build will not fail.
*
* DEFAULT VALUE: "warning"
*/
"logLevel": "error" //"warning",
/** /**
* Specifies where the TSDoc metadata file should be written. * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
* * then the message will be written inside that file; otherwise, the message is instead logged according to
* The path is resolved relative to the folder of the config file that contains the setting; to change this, * the "logLevel" option.
* prepend a folder token such as "<projectFolder>". *
* * DEFAULT VALUE: false
* The default value is "<lookup>", which causes the path to be automatically inferred from the "tsdocMetadata", */
* "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup // "addToApiReportFile": false
* falls back to "tsdoc-metadata.json" in the package folder. }
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<lookup>"
*/
// "tsdocMetadataFilePath": "<projectFolder>/dist/tsdoc-metadata.json"
},
/** // "TS2551": {
* Configures how API Extractor reports error and warning messages produced during analysis. // "logLevel": "warning",
* // "addToApiReportFile": true
* There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. // },
*/ //
"messages": { // . . .
/** },
* Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing
* the input .d.ts files.
*
* TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551"
*
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
*/
"compilerMessageReporting": {
/**
* Configures the default routing for messages that don't match an explicit rule in this table.
*/
"default": {
/**
* Specifies whether the message should be written to the the tool's output log. Note that
* the "addToApiReportFile" property may supersede this option.
*
* Possible values: "error", "warning", "none"
*
* Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail
* and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes
* the "--local" option), the warning is displayed but the build will not fail.
*
* DEFAULT VALUE: "warning"
*/
"logLevel": "error", //"warning",
/** /**
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), * Configures handling of messages reported by API Extractor during its analysis.
* then the message will be written inside that file; otherwise, the message is instead logged according to *
* the "logLevel" option. * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag"
* *
* DEFAULT VALUE: false * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings
*/ */
// "addToApiReportFile": false "extractorMessageReporting": {
}, "default": {
"logLevel": "warning"
// "addToApiReportFile": false
},
"ae-missing-release-tag": {
"logLevel": "none",
"addToApiReportFile": false
}
// "ae-extra-release-tag": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
},
// "TS2551": { /**
// "logLevel": "warning", * Configures handling of messages reported by the TSDoc parser when analyzing code comments.
// "addToApiReportFile": true *
// }, * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text"
// *
// . . . * DEFAULT VALUE: A single "default" entry with logLevel=warning.
}, */
"tsdocMessageReporting": {
/** "default": {
* Configures handling of messages reported by API Extractor during its analysis. "logLevel": "warning"
* // "addToApiReportFile": false
* API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" },
* "tsdoc-param-tag-missing-hyphen": {
* DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings "logLevel": "none",
*/ "addToApiReportFile": false
"extractorMessageReporting": { },
"default": { "tsdoc-undefined-tag": {
"logLevel": "warning", "logLevel": "none",
// "addToApiReportFile": false "addToApiReportFile": false
}, },
"ae-missing-release-tag": { "tsdoc-unsupported-tag": {
"logLevel": "none", "logLevel": "none",
"addToApiReportFile": false "addToApiReportFile": false
}, },
// "ae-extra-release-tag": { "tsdoc-escape-greater-than": {
// "logLevel": "warning", "logLevel": "none",
// "addToApiReportFile": true "addToApiReportFile": false
// }, },
// "tsdoc-malformed-html-name": {
// . . . "logLevel": "none",
}, "addToApiReportFile": false
}
/**
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
*
* TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text"
*
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
*/
"tsdocMessageReporting": {
"default": {
"logLevel": "warning",
// "addToApiReportFile": false
},
"tsdoc-param-tag-missing-hyphen": {
"logLevel": "none",
"addToApiReportFile": false
},
"tsdoc-undefined-tag": {
"logLevel": "none",
"addToApiReportFile": false
},
"tsdoc-unsupported-tag": {
"logLevel": "none",
"addToApiReportFile": false
},
"tsdoc-escape-greater-than": {
"logLevel": "none",
"addToApiReportFile": false
},
"tsdoc-malformed-html-name": {
"logLevel": "none",
"addToApiReportFile": false
},
// "tsdoc-link-tag-unescaped-text": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
}
}
// "tsdoc-link-tag-unescaped-text": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
}
}
} }

View File

@ -3,7 +3,6 @@ set -e
ENV="${ENV:-dev}" ENV="${ENV:-dev}"
DIST_DIR="bin/dist" DIST_DIR="bin/dist"
TARGET_DIR="$DIST_DIR/snippets"
PACKAGE_VERSION="${PACKAGE_VERSION:-0.0.0}" PACKAGE_VERSION="${PACKAGE_VERSION:-0.0.0}"
archive_dist_dir() { archive_dist_dir() {
@ -13,44 +12,27 @@ archive_dist_dir() {
npm_install() { npm_install() {
# Don't install modules twice. # Don't install modules twice.
MARKER_FILE="./node_modules/installed" MARKER_FILE="./node_modules/installed"
if [ ! -f "$MARKER_FILE" ] ; then if [ ! -f "$MARKER_FILE" ] ; then
# Fixes perm issue while installing
npm i -g npm@^6.13.6
npm install npm install
npm install @types/handlebars@4.0.33 npm install @types/handlebars@4.0.33
touch "$MARKER_FILE" touch "$MARKER_FILE"
fi fi
} }
extract_snippets() {
BIN="./node_modules/markdown-snippet-injector/extract.js"
npm install markdown-snippet-injector
for SNIPPET_DIR in {tests/app,apps/app,nativescript-core} ; do
echo "Extracting snippets from: $SNIPPET_DIR"
node "$BIN" --root="$SNIPPET_DIR" --target="$TARGET_DIR" \
--sourceext=".js|.ts|.xml|.html|.css"
done
archive_dist_dir "snippets"
}
extract_apiref() { extract_apiref() {
APIREF_DIR="$DIST_DIR/api-reference" APIREF_DIR="$DIST_DIR/api-reference"
rm -rf "$APIREF_DIR" rm -rf "$APIREF_DIR"
npm_install # npm_install
npm run typedoc npx typedoc --tsconfig tools/scripts/tsconfig.typedoc.json
mv "$DIST_DIR/apiref" "$APIREF_DIR" mv "dist/apiref" "$APIREF_DIR"
archive_dist_dir "api-reference" archive_dist_dir "api-reference"
} }
rm -rf "$TARGET_DIR"
mkdir -p "$TARGET_DIR"
if [ "${BASH_SOURCE[0]}" == "$0" ] ; then if [ "${BASH_SOURCE[0]}" == "$0" ] ; then
extract_snippets
extract_apiref extract_apiref
fi fi

View File

@ -1,37 +1,33 @@
{ {
"compilerOptions": { "extends": "../../tsconfig.json",
"noEmitOnError": true, "compilerOptions": {
"noEmitHelpers": true, "outDir": "../../dist/packages/core",
"target": "es5", "target": "es5",
"module": "commonjs", "module": "commonjs",
"declaration": false, "declaration": false,
"noImplicitAny": false, "lib": ["es6", "dom"]
"noImplicitUseStrict": true, },
"experimentalDecorators": true, "include": ["../../packages/core/**/*.d.ts"],
"lib": [ "exclude": [
"es6", // "../../packages/core/index.d.ts",
"dom"
] "../../packages/core/ui/layouts/index.d.ts",
},
"include": [ // "../../packages/core/__tests__",
"nativescript-core/**/*.d.ts"
], "../../packages/core/references.d.ts",
"exclude": [ "../../packages/core/node_modules",
"nativescript-core/index.d.ts", "../../node_modules",
"nativescript-core/ui/index.d.ts", "../../packages/core/ui/frame/transition-definitions.android.d.ts",
"nativescript-core/ui/layouts/index.d.ts", "../../packages/core/platforms/*"
],
"nativescript-core/references.d.ts", "typedocOptions": {
"nativescript-core/node_modules", "entryPoints": ["../../packages/core/index.d.ts", "../../packages/core"],
"nativescript-core/ui/frame/transition-definitions.android.d.ts", "out": "dist/apiref",
"nativescript-core/platforms/*" "name": "NativeScript",
], "theme": "/Users/janoshrubosimac/Code/nativescript-typedoc-theme",
"typedocOptions": { "excludeExternals": true,
"out": "bin/dist/apiref", "externalPattern": "**/+(tns-core-modules|module).d.ts",
"includeDeclarations": true, "exclude": ["../../packages/core/__tests__", "../../packages/core/**/*.ts"]
"name": "NativeScript", }
"theme": "./node_modules/nativescript-typedoc-theme", }
"excludeExternals": true,
"externalPattern": "**/+(tns-core-modules|module).d.ts"
}
}