Skip to content

Commit

Permalink
feat(docs): update tsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
crherman7 committed Jan 2, 2025
1 parent cdac0ac commit 30ae534
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/plugin-fsapp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function isPackage(str: string): boolean {
* Asynchronously bundles and requires a package or file.
*
* @param {string} packageOrFilePath - The name of the package or the file path to bundle and require.
* @param {('cjs'|'esm')} format - The module format to use when bundling.
* @returns {Promise<any>} A Promise that resolves to the required module.
*/
export async function bundleRequire(
Expand Down Expand Up @@ -81,6 +82,13 @@ export async function bundleRequire(
return mod;
}

/**
* Validates environment files for proper structure and exports.
*
* @param {string} baseDir - The base directory to search for environment files.
* @returns {Promise<string[]>} A promise that resolves to an array of valid environment file paths.
* @throws {Error} If environment files don't meet the required structure.
*/
async function validateEnvFiles(baseDir: string): Promise<string[]> {
const pattern = path.join(baseDir, '**', 'env.*.ts');
const files = glob.sync(pattern, {ignore: '**/node_modules/**'});
Expand Down Expand Up @@ -261,6 +269,7 @@ async function processEnvironmentFiles(
* Helper function to resolve the project environment index path.
* @param {string} version - The version of @brandingbrand/fsapp.
* @returns {string} Resolved path to the project environment index file.
* @throws {Error} When version cannot be parsed or is unsupported.
*/
function resolveProjectEnvIndexPath(version: string): string {
const coercedVersion = semver.coerce(version);
Expand Down Expand Up @@ -290,7 +299,8 @@ function resolveProjectEnvIndexPath(version: string): string {

/**
* Processes environment files and links them to the appropriate project environment index.
* @param {PrebuildOptions} options - The prebuild options.
* @param {PrebuildOptions & Record<string, string>} options - The prebuild options including environment settings.
* @returns {Promise<void>} A promise that resolves when environment processing is complete.
*/
async function processAndLinkEnvs(
options: PrebuildOptions & Record<string, string>,
Expand Down Expand Up @@ -329,6 +339,7 @@ export default definePlugin({
* iOS-specific logic for the plugin.
* @param {BuildConfig & CodePluginTargetExtension} build - The build configuration for iOS.
* @param {PrebuildOptions} options - The options object for iOS.
* @returns {Promise<void>} A promise that resolves when iOS processing is complete.
*/
ios: async function (
build: BuildConfig,
Expand Down Expand Up @@ -382,6 +393,7 @@ export default definePlugin({
* Android-specific logic for the plugin.
* @param {BuildConfig & CodePluginTargetExtension} build - The build configuration for Android.
* @param {PrebuildOptions} options - The options object for Android.
* @returns {Promise<void>} A promise that resolves when Android processing is complete.
*/
android: async function (
build: BuildConfig,
Expand Down

0 comments on commit 30ae534

Please sign in to comment.