Skip to content

Commit bd96489

Browse files
committed
chore: fix all usages of @module tags
Per [TypeDoc's documentation](https://typedoc.org/documents/Tags._module.html), a string following a `@module` tag _renames_ the module. JSDoc has this same behavior. To that end, `@module`, if present, should _not_ be at the _top_ of a docstring (which is used at the description) unless we're in the business of renaming modules for documentation purposes (which we are welcome to do later, if we want). * * * There are many ways to do this, but I did it using [ripgrep](https://github.com/BurntSushi/ripgrep) and `sponge` from [moreutils](https://joeyh.name/code/moreutils/) (which—TIL—also contains a utility named `pee`): ```sh for file in packages/*/src/**/*.{t,j}s; do rg -P '(?<=\/\*\*\n\s\*)\s@module(\s[\s\S]+?)(?=\n\s\*\/)' -U \ --passthru -r '$1 * * @module' $file | sponge $file done ``` - `-P`: use PRCE2 (for the lookbehind) - `-U`: enable multiline regex - `--passthru`: dump the entire file - `-r`: replace
1 parent 84716b7 commit bd96489

39 files changed

+116
-39
lines changed

Diff for: packages/compartment-mapper/src/archive.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @module Provides mechanisms for creating archives (zip files with a
2+
* Provides mechanisms for creating archives (zip files with a
33
* `compartmeent-map.json` and a file for every static dependency of an entry
44
* module).
55
*
@@ -13,6 +13,8 @@
1313
* See `archive-lite.js` for a variation that does not depend on Babel
1414
* for cases like XS native Compartments where pre-compilation is not
1515
* necessary or where the dependency on Babel can be dererred to runtime.
16+
*
17+
* @module
1618
*/
1719

1820
/**

Diff for: packages/compartment-mapper/src/capture-lite.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @module
2+
*
33
* This module provides {@link captureFromMap}, which only "captures" the
44
* compartment map descriptors and sources from a partially completed
55
* compartment map--_without_ creating an archive. The resulting compartment map
@@ -25,6 +25,8 @@
2525
* contain original sources, so to import the archive with
2626
* `src/import-archive-lite.js`, you will need to provide the archive parsers
2727
* and entrain a runtime dependency on Babel.
28+
*
29+
* @module
2830
*/
2931

3032
/* eslint no-shadow: 0 */

Diff for: packages/compartment-mapper/src/import-archive-lite.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @module Provides functions for evaluating the modules in an archive (a zip
2+
* Provides functions for evaluating the modules in an archive (a zip
33
* file with a `compartment-map.json` and a file for each module it contains.)
44
*
55
* These functions do not have a bias for any particular mapping, so you will
@@ -10,6 +10,8 @@
1010
* You will need to provide the `defaultParserForLanguage` from
1111
* `@endo/compartment-mapper/import-parsers.js` or
1212
* `@endo/compartment-mapper/archive-parsers.js`.
13+
*
14+
* @module
1315
*/
1416

1517
/* eslint no-shadow: "off" */

Diff for: packages/compartment-mapper/src/import-archive.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @module Provides functions for evaluating modules in an archive (a zip file
2+
* Provides functions for evaluating modules in an archive (a zip file
33
* with a `compartment-map.json` and a file for a module and each of its
44
* transitive dependencies.)
55
*
@@ -12,6 +12,8 @@
1212
* See `import-archive-lite.js` for functions that are not coupled to these
1313
* parsers or the `node_modules` conventions without necessarily entraining a
1414
* dependency on Babel.
15+
*
16+
* @module
1517
*/
1618

1719
/**

Diff for: packages/compartment-mapper/src/import-hook.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/**
2-
* @module Provides the implementation of each compartment's `importHook` when
2+
* Provides the implementation of each compartment's `importHook` when
33
* using `import.js`, `import-lite.js`, `archive.js`, or `archive-lite.js`.
44
* However, `import-archive.js` and `import-archive-lite.js` use their own
55
* variant.
66
*
77
* For building archives, these import hooks create a table of all the modules
88
* in a "working set" of transitive dependencies.
9+
*
10+
* @module
911
*/
1012

1113
/**

Diff for: packages/compartment-mapper/src/import-lite.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @module Provides functions for evaluating a module and its transitive
2+
* Provides functions for evaluating a module and its transitive
33
* dependencies given a partially completed compartment map.
44
* The compartment map needs to describe every reachable compartment, where to
55
* find modules in that compartment, and how to link modules between
@@ -13,6 +13,8 @@
1313
* The default `parserForLanguage` mapping is empty.
1414
* You will need to provide the `defaultParserForLanguage` from
1515
* `@endo/compartment-mapper/import-parsers.js` or similar.
16+
*
17+
* @module
1618
*/
1719

1820
/* eslint no-shadow: "off" */

Diff for: packages/compartment-mapper/src/import.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @module Provides functions for evaluating a module and its transitive
2+
* Provides functions for evaluating a module and its transitive
33
* dependencies given the URL of the entry module and assuming packages laid
44
* out according to the `node_modules` conventions.
55
*
@@ -9,6 +9,8 @@
99
*
1010
* The default `parserForLanguage` is `import-parsers.js`, which is suitable
1111
* for most cases.
12+
*
13+
* @module
1214
*/
1315

1416
/**

Diff for: packages/compartment-mapper/src/infer-exports.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/**
2-
* @module Provides functions needed by `node-modules.js` for building
2+
* Provides functions needed by `node-modules.js` for building
33
* inter-compartment linkage according to the specifications in a
44
* `package.json` as laid out in the `node_modules` convention.
55
* These functions implement the behavior for a package's `"main"`,
66
* `"browser"`, `"imports"`, and `"exports"` properties in a `package.json`.
7+
*
8+
* @module
79
*/
810

911
/** @import {LanguageForExtension} from './types.js' */

Diff for: packages/compartment-mapper/src/link.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/**
2-
* @module Provides the linking behavior shared by all Compartment Mapper
2+
* Provides the linking behavior shared by all Compartment Mapper
33
* workflows.
44
* This involves creating and configuring compartments according to the
55
* specifications in a compartment map, and is suitable for compartment maps
66
* that just outline the locations of compartments and their inter-linkage and
77
* also compartment maps that include every module descriptor in the transitive
88
* dependencies of their entry module.
9+
*
10+
* @module
911
*/
1012

1113
/**

Diff for: packages/compartment-mapper/src/map-parser.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Exports {@link makeMapParsers}, which creates a function which matches a
2+
* Exports {@link makeMapParsers}, which creates a function which matches a
33
* module to a parser based on reasons.
4+
*
5+
* @module
46
*/
57

68
/**

Diff for: packages/compartment-mapper/src/node-module-specifier.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
2-
* @module Provides functions for interacting with Node.js module specifiers in
2+
* Provides functions for interacting with Node.js module specifiers in
33
* their canonical form.
44
* This is a kind of path math that is platform-agnostic.
5+
*
6+
* @module
57
*/
68

79
// q, as in quote, for error messages.

Diff for: packages/compartment-mapper/src/node-modules.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/**
2-
* @module Provides functions for constructing a compartment map that has a
2+
* Provides functions for constructing a compartment map that has a
33
* compartment descriptor corresponding to every reachable package from an
44
* entry module and how to create links between them.
55
* The resulting compartment map does not describe individual modules but does
66
* capture every usable route between packages including those generalized by
77
* wildcard expansion.
88
* See {@link link} to expand a compartment map to capture module descriptors
99
* for transitive dependencies.
10+
*
11+
* @module
1012
*/
1113

1214
/* eslint no-shadow: 0 */

Diff for: packages/compartment-mapper/src/node-powers.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/**
2-
* @module Provides adapters for Compartment Mapper I/O to the corresponding
2+
* Provides adapters for Compartment Mapper I/O to the corresponding
33
* Node.js implementations of those behaviors.
44
*
55
* The Compartment Mapper generalizes its I/O interface to allow for a wide
66
* variety of I/O providers, but especially for reading and writing from
77
* virtualized file systems like zip files.
8+
*
9+
* @module
810
*/
911

1012
/**

Diff for: packages/compartment-mapper/src/parse-archive-cjs.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Provides language behavior for analyzing, pre-compiling, and storing
2+
* Provides language behavior for analyzing, pre-compiling, and storing
33
* CommonJS modules for an archive.
4+
*
5+
* @module
46
*/
57

68
/** @import {ParseFn} from './types.js' */

Diff for: packages/compartment-mapper/src/parse-archive-mjs.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Provides language behavior for analyzing, pre-compiling, and storing ESM
2+
* Provides language behavior for analyzing, pre-compiling, and storing ESM
33
* modules for an archive.
4+
*
5+
* @module
46
*/
57

68
/** @import {ParseFn} from './types.js' */

Diff for: packages/compartment-mapper/src/parse-bytes.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Provides rudimentary support for treating an arbitrary file as a
2+
* Provides rudimentary support for treating an arbitrary file as a
33
* module that exports the bytes of that file.
4+
*
5+
* @module
46
*/
57

68
/** @import {Harden} from 'ses' */

Diff for: packages/compartment-mapper/src/parse-cjs-shared-export-wrapper.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
2-
* @module Provides shared functionality for {@link parse-cjs.js} and {@link
2+
* Provides shared functionality for {@link parse-cjs.js} and {@link
33
* parse-archive-cjs.js} toward importing or archiving CommonJS as a virtual
44
* module source.
5+
*
6+
* @module
57
*/
68

79
/** @import {ReadFn, ReadPowers} from './types.js' */

Diff for: packages/compartment-mapper/src/parse-cjs.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Provides language behavior (parser) for importing CommonJS as a
2+
* Provides language behavior (parser) for importing CommonJS as a
33
* virtual module source.
4+
*
5+
* @module
46
*/
57

68
/** @import {ParseFn} from './types.js' */

Diff for: packages/compartment-mapper/src/parse-pre-cjs.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/**
2-
* @module Provides language-specific behavior for importing pre-compiled
2+
* Provides language-specific behavior for importing pre-compiled
33
* CommonJS.
44
* Pre-compiled CommonJS is a module in JSON format that describes its imports,
55
* exports, and source to execute in the presence of `require`, `module`, and
66
* `exports`.
7+
*
8+
* @module
79
*/
810

911
/** @import {ParseFn} from './types.js' */

Diff for: packages/compartment-mapper/src/parse-pre-mjs.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/**
2-
* @module Provides language-specific behaviors for importing pre-compiled ESM.
2+
* Provides language-specific behaviors for importing pre-compiled ESM.
33
* Pre-compiling or translating ESM from a module to a script with a
44
* calling-convention is necessary to prepare an archive so that it can be
55
* imported by the SES shim without entraining a dependency on Babel.
6+
*
7+
* @module
68
*/
79

810
/** @import {ParseFn} from './types.js' */

Diff for: packages/compartment-mapper/src/parse-text.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
2-
* @module Provides language-behaviors for importing a module as a document
2+
* Provides language-behaviors for importing a module as a document
33
* that exports itself as a string based on a UTF-8 interpretation of the
44
* module's text.
5+
*
6+
* @module
57
*/
68

79
/** @import {ParseFn} from './types.js' */

Diff for: packages/compartment-mapper/src/policy-format.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Provides functions for enforcing compartment-map linkage and global
2+
* Provides functions for enforcing compartment-map linkage and global
33
* variable policies for each compartment.
4+
*
5+
* @module
46
*/
57

68
/** @import {SomePackagePolicy, SomePolicy} from './types.js' */

Diff for: packages/compartment-mapper/src/policy.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
2-
* @module Provides mechanisms for interacting with Compartment Map runtime policies.
2+
* Provides mechanisms for interacting with Compartment Map runtime policies.
3+
*
4+
* @module
35
*/
46

57
// @ts-check

Diff for: packages/compartment-mapper/src/powers.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/**
2-
* @module As the interface of the Compartment Mapper evolved, it became
2+
* As the interface of the Compartment Mapper evolved, it became
33
* necessary to expand some function signatures that accepted a single power to
44
* one that accepted a powers object.
55
* This module provides functions for safely unpacking I/O capabilities and
66
* maintaining backward-compatibility with older accepted usage patterns.
7+
*
8+
* @module
79
*/
810

911
/**

Diff for: packages/compartment-mapper/src/search.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Provides the behavior for `node-modules.js` to find modules and
2+
* Provides the behavior for `node-modules.js` to find modules and
33
* packages according to the Node.js `node_modules` convention.
4+
*
5+
* @module
46
*/
57

68
/**

Diff for: packages/compartment-mapper/src/types/compartment-map-schema.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
2-
* @module These types describe the schema of a `compartment-map.json`, which
2+
* These types describe the schema of a `compartment-map.json`, which
33
* in turn describes how to load and link an application from storage, like a
44
* file system, web host, or zip archive.
5+
*
6+
* @module
57
*/
68

79
/* eslint-disable no-use-before-define */

Diff for: packages/compartment-mapper/src/types/external.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
2-
* @module External types of the compartment mapper.
2+
* External types of the compartment mapper.
3+
*
4+
* @module
35
*/
46

57
/* eslint-disable no-use-before-define */

Diff for: packages/compartment-mapper/src/types/internal.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Internal types of the compartment mapper that need not be visible to
2+
* Internal types of the compartment mapper that need not be visible to
33
* consumers.
4+
*
5+
* @module
46
*/
57

68
/* eslint-disable no-use-before-define */

Diff for: packages/compartment-mapper/src/types/node-powers.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module These interfaces describe the powers needed in `node-powers.js` to
2+
* These interfaces describe the powers needed in `node-powers.js` to
33
* adapt host capabilities for the compartment mapper.
4+
*
5+
* @module
46
*/
57

68
/* eslint-disable no-use-before-define */

Diff for: packages/compartment-mapper/src/types/policy-schema.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/**
2-
* @module Describes the portion of a compartment map dedicated to narrowing
2+
* Describes the portion of a compartment map dedicated to narrowing
33
* or attenuating the powers available to each compartment.
4+
*
5+
* @module
46
*/
57

68
/* eslint-disable no-use-before-define */

Diff for: packages/compartment-mapper/src/types/policy.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
2-
* @module Types required for policy enforcement.
2+
* Types required for policy enforcement.
3+
*
4+
* @module
35
*/
46

57
/* eslint-disable no-use-before-define */

Diff for: packages/compartment-mapper/src/types/powers.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
/**
2-
* @module The compartment mapper requires certain host capabilities.
2+
* The compartment mapper requires certain host capabilities.
33
* These are the platform-neutral types for those capabilities.
44
* For example, {@file node-powers.js} adapts Node.js how modules
55
* to various subsets of these capabilities.
6+
*
7+
* @module
68
*/
79

810
/* eslint-disable no-use-before-define */

Diff for: packages/compartment-mapper/src/types/typescript.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
2-
* @module Helpers relevant to any TypeScript project.
2+
* Helpers relevant to any TypeScript project.
3+
*
4+
* @module
35
*/
46

57
/** Any object. All objects. Not `null`, though. */

0 commit comments

Comments
 (0)