Skip to content

Commit

Permalink
fix: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Apr 15, 2024
1 parent e2ac823 commit 85d69b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ export default class Package {
return runner.plan( options, true );
}

// XXX
async updateMetadata ( { force } = {} ) {
env.loadUserEnv();

Expand All @@ -420,8 +419,7 @@ export default class Package {
const config = readConfig( pkg.root + "/package.json" );

// homepage
// XXX
if ( !config.homepage || force ) config.homepage = ( pkg.docsConfig && upstream.docsUrl ) || upstream.homeUrl;
if ( !config.homepage || force ) config.homepage = ( pkg.docs.isExists && upstream.docsUrl ) || upstream.homeUrl;

// bugs
config.bugs = {
Expand Down
7 changes: 4 additions & 3 deletions lib/package/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ export default class Docs {
return this.#rootPackage;
}

// XXX isExists -> isEnabled
get isExists () {
return !!this.#rootPackage.docsConfig;
return !!this.#rootPackage.cliConfig.docs;
}

// public
// XXX// public
async init () {
process.stdout.write( `Initializing documentation ... ` );

Expand Down Expand Up @@ -60,7 +61,7 @@ export default class Docs {
// check docs config
if ( !this.isExists ) throw result( [ 404, `Documentation config wasn't found.` ] );

const options = await Options.new( this.#rootPackage, this.#rootPackage.docsConfig );
const options = await Options.new( this.#rootPackage, this.#rootPackage.cliConfig.docs );

// build API schemas
await this.#buildAppSchemas( options );
Expand Down

0 comments on commit 85d69b6

Please sign in to comment.