Skip to content

Commit

Permalink
chore: reword to use "package" (#4612)
Browse files Browse the repository at this point in the history
* chore: reword to use "package"

* tweak
  • Loading branch information
iuioiua authored Apr 22, 2024
1 parent 879c81f commit 762a7c2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and [architecture guide](./ARCHITECTURE.md) before contributing.
1. Create a new branch for your changes.
1. Make your changes and ensure `deno task ok` passes successfully.
1. Commit your changes with clear messages.
1. Submit a pull request with the sub-module in question, and a clear title and
1. Submit a pull request with the package in question, and a clear title and
description, as follows:
- fix(http): fix race condition in server
- docs(fmt): update docstrings
Expand All @@ -44,7 +44,7 @@ and [architecture guide](./ARCHITECTURE.md) before contributing.
1. Submit a pull request starting with the following format:

```
deprecation(sub): `foo()`
deprecation(<package>): <symbol>
```

## Tests
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ requirements:
example, issues that suggest new non-breaking features are fine to exist at
stabilization.

| Sub-module | Status |
| Package | Status |
| --------------- | ---------- |
| archive | Unstable |
| assert | Stable |
Expand Down Expand Up @@ -135,7 +135,7 @@ requirements:
| yaml | Stable |

> For background and discussions regarding the stability of the following
> sub-modules, see [#3489](https://github.com/denoland/deno_std/issues/3489).
> packages, see [#3489](https://github.com/denoland/deno_std/issues/3489).
## Architecture

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import {
} from "@deno/graph";

/**
* Checks for circular dependencies in the std submodules.
* Checks for circular dependencies in the std packages.
*
* Usage: deno run -A _tools/check_circular_submodule_dependencies.ts
* Usage: deno run -A _tools/check_circular_package_dependencies.ts
*
* `--graph` option outputs graphviz diagram. You can convert the output to
* a visual graph using tools like https://dreampuf.github.io/GraphvizOnline/
*
* $ deno run -A _tools/check_circular_submodule_dependencies.ts --graph
* $ deno run -A _tools/check_circular_package_dependencies.ts --graph
*
* `--table` option outputs a table of submodules and their status.
* `--table` option outputs a table of packages and their status.
*
* $ deno run -A _tools/check_circular_submodule_dependencies.ts --table
* $ deno run -A _tools/check_circular_package_dependencies.ts --table
*
* `--all-imports` option outputs script to import all submodules.
* `--all-imports` option outputs script to import all packages.
*
* $ deno run -A _tools/check_circular_submodule_dependencies.ts --all-imports
* $ deno run -A _tools/check_circular_package_dependencies.ts --all-imports
*/

type DepState = "Stable" | "Unstable" | "Deprecated";
Expand Down Expand Up @@ -173,7 +173,7 @@ const STABILITY: Record<Mod, DepState> = {
const root = new URL("../", import.meta.url).href;
const deps: Record<string, Dep> = {};

function getSubmoduleNameFromUrl(url: string): string {
function getPackageNameFromUrl(url: string): string {
return url.replace(root, "").split("/")[0]!;
}

Expand All @@ -188,7 +188,7 @@ async function check(
const graph = await createGraph(entrypoint);

for (
const dep of new Set(getSubmoduleDepsFromSpecifier(graph, entrypoint))
const dep of new Set(getPackageDepsFromSpecifier(graph, entrypoint))
) {
deps.add(dep);
}
Expand All @@ -198,24 +198,24 @@ async function check(
return { name: submod, set: deps, state };
}

/** Returns submodule dependencies */
function getSubmoduleDepsFromSpecifier(
/** Returns package dependencies */
function getPackageDepsFromSpecifier(
graph: ModuleGraphJson,
specifier: string,
seen: Set<string> = new Set(),
): Set<string> {
const { dependencies } = graph.modules.find((item: ModuleJson) =>
item.specifier === specifier
)!;
const deps = new Set([getSubmoduleNameFromUrl(specifier)]);
const deps = new Set([getPackageNameFromUrl(specifier)]);
seen.add(specifier);
if (dependencies) {
for (const { code, type } of dependencies) {
const specifier = code?.specifier ?? type?.specifier!;
if (seen.has(specifier)) {
continue;
}
const res = getSubmoduleDepsFromSpecifier(
const res = getPackageDepsFromSpecifier(
graph,
specifier,
seen,
Expand Down Expand Up @@ -282,7 +282,7 @@ if (Deno.args.includes("--graph")) {
}
console.log("}");
} else if (Deno.args.includes("--table")) {
console.log("| Sub-module | Status |");
console.log("| Package | Status |");
console.log("| --------------- | ---------- |");
for (const [mod, info] of Object.entries(deps)) {
console.log(`| ${mod.padEnd(15)} | ${info.state.padEnd(10)} |`);
Expand All @@ -294,7 +294,7 @@ if (Deno.args.includes("--graph")) {
}
}
} else {
console.log(`${Object.keys(deps).length} submodules checked.`);
console.log(`${Object.keys(deps).length} packages checked.`);
for (const mod of Object.keys(deps)) {
const res = checkCircularDeps(mod);
if (res) {
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"fmt:licence-headers": "deno run --allow-read --allow-write ./_tools/check_licence.ts",
"lint:deprecations": "deno run --allow-read --allow-net --allow-env ./_tools/check_deprecation.ts",
"lint:doc-imports": "deno run --allow-env --allow-read ./_tools/check_doc_imports.ts",
"lint:circular": "deno run --allow-env --allow-read --allow-net=deno.land,jsr.io ./_tools/check_circular_submodule_dependencies.ts",
"lint:circular": "deno run --allow-env --allow-read --allow-net=deno.land,jsr.io ./_tools/check_circular_package_dependencies.ts",
"lint:mod-exports": "deno run --allow-env --allow-read ./_tools/check_mod_exports.ts",
"lint:tools-types": "deno check _tools/*.ts",
"lint:docs": "deno doc --lint bytes/mod.ts datetime/mod.ts url/mod.ts",
Expand Down

0 comments on commit 762a7c2

Please sign in to comment.