Skip to content

Commit

Permalink
Remove jsdoc again. It was fighting with typescript, specifically aro…
Browse files Browse the repository at this point in the history
…und module use: jsdoc/jsdoc#1645
  • Loading branch information
zachleat committed Jul 27, 2024
1 parent 0fda4bf commit 7c3509d
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 28 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ node_modules/
.nyc_output/
coverage/
docs/_data/coverage.json
jsdoc/

# Ignore API documentation
api-docs/
Expand Down
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
jsdoc
docs
docs-src
test
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
67 changes: 46 additions & 21 deletions src/Eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,77 +96,99 @@ 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() {
return this.options.configPath;
}

/**
* @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() {
Expand Down Expand Up @@ -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
Expand All @@ -223,32 +246,34 @@ 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;

if (performance) {
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;
Expand Down
8 changes: 5 additions & 3 deletions src/TemplateConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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!");
Expand Down

0 comments on commit 7c3509d

Please sign in to comment.