diff --git a/.gitignore b/.gitignore index c7d550f32..59f96803e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ node_modules/ .nyc_output/ coverage/ docs/_data/coverage.json -jsdoc/ # Ignore API documentation api-docs/ diff --git a/.npmignore b/.npmignore index 73d4d3fd3..474c5f0a3 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,3 @@ -jsdoc docs docs-src test diff --git a/package.json b/package.json index 502a549aa..0f510a8cf 100755 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "test": "npm run test:node && npm run test:ava", "test:ava": "ava --verbose --timeout 20s", "test:node": "node --test test_node/tests.js", - "jsdoc": "rm -rf jsdoc && npx jsdoc src/* -r -d jsdoc", "format": "prettier . --write", "check": "npm run check:eslint && npm run check:typescript", "check:typescript": "tsc", @@ -99,7 +98,6 @@ "eslint-config-prettier": "^9.1.0", "globals": "^15.8.0", "husky": "^9.0.11", - "jsdoc": "^4.0.3", "lint-staged": "^15.2.7", "markdown-it-emoji": "^3.0.0", "marked": "^13.0.2", diff --git a/src/Eleventy.js b/src/Eleventy.js index 7b81cf028..cdad90be0 100644 --- a/src/Eleventy.js +++ b/src/Eleventy.js @@ -96,69 +96,90 @@ class Eleventy { * @param {TemplateConfig} [eleventyConfig] */ constructor(input, output, options = {}, eleventyConfig = null) { - /** @type {string|undefined} - Holds the path to the input (might be a file or folder) */ + /** + * @type {string|undefined} + * @description Holds the path to the input (might be a file or folder) + */ this.rawInput = input || undefined; - /** @type {string|undefined} - Holds the path to the output directory */ + /** + * @type {string|undefined} + * @description holds the path to the output directory + */ this.rawOutput = output || undefined; - /** @type {module:11ty/eleventy/TemplateConfig} - Override the config instance (for centralized config re-use) */ + /** + * @type {module:11ty/eleventy/TemplateConfig} + * @description Override the config instance (for centralized config re-use) + */ this.eleventyConfig = eleventyConfig; /** - * @type {EleventyOptions} - Options object passed to the Eleventy constructor + * @type {EleventyOptions} + * @description Options object passed to the Eleventy constructor * @default {} */ this.options = options; /** - * @type {'cli'|'script'} - Called via CLI (`cli`) or Programmatically (`script`) + * @type {'cli'|'script'} + * @description Called via CLI (`cli`) or Programmatically (`script`) * @default "script" */ this.source = options.source || "script"; /** - * @type {string} - One of build, serve, or watch + * @type {string} + * @description One of build, serve, or watch * @default "build" */ this.runMode = options.runMode || "build"; /** - * @type {boolean} - Is Eleventy running in dry mode? + * @type {boolean} + * @description Is Eleventy running in dry mode? * @default false */ this.isDryRun = options.dryRun ?? false; /** - * @type {boolean} - Is this an incremental build? (only operates on a subset of input files) + * @type {boolean} + * @description Is this an incremental build? (only operates on a subset of input files) * @default false */ this.isIncremental = false; /** - * @type {string|undefined} - If an incremental build, this is the file we’re operating on. + * @type {string|undefined} + * @description If an incremental build, this is the file we’re operating on. * @default null */ this.programmaticApiIncrementalFile = undefined; /** - * @type {boolean} - Should we process files on first run? (The --ignore-initial feature) + * @type {boolean} + * @description Should we process files on first run? (The --ignore-initial feature) * @default true */ this.isRunInitialBuild = true; /** - * @type {Number} - Number of builds run on this instance. + * @type {Number} + * @description Number of builds run on this instance. * @default 0 */ this.buildCount = 0; - /** @type {Number} - The timestamp of Eleventy start. */ + /** + * @type {Number} + * @description The timestamp of Eleventy start. + */ this.start = this.getNewTimestamp(); } /** - * @type {string|undefined} - An override of Eleventy's default config file paths + * @type {string|undefined} + * @description An override of Eleventy's default config file paths * @default undefined */ get configPath() { @@ -166,7 +187,8 @@ class Eleventy { } /** - * @type {string} - The top level directory the site pretends to reside in + * @type {string} + * @description The top level directory the site pretends to reside in * @default "/" */ get pathPrefix() { @@ -212,7 +234,8 @@ class Eleventy { } /** - * @type {object} - Initialize Eleventy environment variables + * @type {object} + * @description Initialize Eleventy environment variables * @default null */ // this.runMode need to be set before this @@ -223,13 +246,15 @@ class Eleventy { await this.eleventyConfig.init(initOverrides); /** - * @type {object} - Initialize Eleventy’s configuration, including the user config file + * @type {object} + * @description Initialize Eleventy’s configuration, including the user config file */ this.config = this.eleventyConfig.getConfig(); // this.directories. /** - * @type {object} - Singleton BenchmarkManager instance + * @type {object} + * @description Singleton BenchmarkManager instance */ this.bench = this.config.benchmarkManager; @@ -237,18 +262,18 @@ class Eleventy { debug("Eleventy warm up time: %o (ms)", performance.now()); } - /** @type {object} - tbd. */ + /** @type {object} */ this.eleventyServe = new EleventyServe(); this.eleventyServe.eleventyConfig = this.eleventyConfig; - /** @type {object} - tbd. */ + /** @type {object} */ this.watchManager = new EleventyWatch(); - /** @type {object} - tbd. */ + /** @type {object} */ this.watchTargets = new EleventyWatchTargets(this.eleventyConfig); this.watchTargets.addAndMakeGlob(this.config.additionalWatchTargets); - /** @type {object} - tbd. */ + /** @type {object} */ this.fileSystemSearch = new FileSystemSearch(); this.#hasConfigInitialized = true; diff --git a/src/TemplateConfig.js b/src/TemplateConfig.js index ea3d0e545..b0d21aa42 100644 --- a/src/TemplateConfig.js +++ b/src/TemplateConfig.js @@ -50,11 +50,12 @@ class TemplateConfig { #userConfig = new UserConfig(); constructor(customRootConfig, projectConfigPath) { - /** @type {object} - tbd. */ + /** @type {object} */ this.overrides = {}; /** - * @type {String} - Path to local project config. + * @type {String} + * @description Path to local project config. * @default .eleventy.js */ if (projectConfigPath !== undefined) { @@ -77,7 +78,8 @@ class TemplateConfig { if (customRootConfig) { /** - * @type {object} - Custom root config. + * @type {object} + * @description Custom root config. */ this.customRootConfig = customRootConfig; debug("Warning: Using custom root config!");