Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(logger): replace internal capturing with read/write streams #698

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const handler: Handler<Args> = async function handler(argv, { getWorkspac

for (const workspace of workspaces) {
if (workspace.private) {
buildableStep.warn(`Not building \`${workspace.name}\` because it is private`);
buildableStep.info(`Skipping "${workspace.name}" because it is private`);
continue;
}

Expand Down Expand Up @@ -154,11 +154,11 @@ export const handler: Handler<Args> = async function handler(argv, { getWorkspac
}
}

await buildableStep.end();
buildableStep.end();

const removeStep = logger.createStep('Clean previous build directories');
await Promise.all(removals.map((dir) => file.remove(dir, { step: removeStep })));
await removeStep.end();
removeStep.end();

await batch([...buildProcs, ...typesProcs]);
await Promise.all(postCopy.map((fn) => fn()));
Expand Down
1 change: 1 addition & 0 deletions docs/commands/typedoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const handler: Handler<Argv> = async (argv, { graph, logger }) => {
'typedoc-plugin-markdown',
'--useCodeBlocks',
'true',
'--excludeExternals',
'--entryFileName',
'index.md',
'--options',
Expand Down
504 changes: 346 additions & 158 deletions docs/src/content/docs/api/index.md

Large diffs are not rendered by default.

78 changes: 38 additions & 40 deletions docs/src/content/docs/plugins/docgen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,44 @@ Check out our very own source level [example](example/) generated directly from

## Configuration

{/* start-auto-generated-from-cli-docgen */}
{/* @generated SignedSource<<eae31dc5c19ef17bf4fe8e4d9ee63db2>> */}

### `one docgen`

Generate documentation for the oneRepo cli.

```sh
one docgen [options...]
```

Help documentation should always be easy to find. This command will help automate the creation of docs for this command-line interface. If you are reading this somewhere that is not your terminal, there is a very good chance that this command was already run for you!

Add this command to your one Repo tasks on pre-commit to ensure that your documentation is always up-to-date.

| Option | Type | Description |
| ----------------- | --------------------------------------------- | -------------------------------------------------------------------------- |
| `--add` | `boolean` | Add the output file to the git stage |
| `--format` | `"markdown"`, `"json"`, default: `"markdown"` | Output format for documentation |
| `--heading-level` | `number` | Heading level to start at for Markdown output |
| `--out-file` | `string` | File to write output to. If not provided, stdout will be used |
| `--out-workspace` | `string` | Workspace name to write the --out-file to |
| `--safe-write` | `boolean` | Write documentation to a portion of the file with start and end sentinels. |

<details>

<summary>Advanced options</summary>

| Option | Type | Description |
| ----------------- | --------- | ------------------------------------------------------------------------------------ |
| `--command` | `string` | Start at the given command, skip the root and any others |
| `--show-advanced` | `boolean` | Pair with `--help` to show advanced options. |
| `--use-defaults` | `boolean` | Use the oneRepo default configuration. Helpful for generating default documentation. |

</details>

{/* end-auto-generated-from-cli-docgen */}

{/* start-install-typedoc */}
{/* @generated SignedSource<<9b847ec5a1fb60fd74a1bd5a66f31900>> */}

Expand Down Expand Up @@ -142,43 +180,3 @@ optional safeWrite: boolean;
Set to true to amend content to the given file using the file.writeSafe \| \`file.writeSafe\` method.

{/* end-install-typedoc */}

## Commands

{/* start-auto-generated-from-cli-docgen */}
{/* @generated SignedSource<<eae31dc5c19ef17bf4fe8e4d9ee63db2>> */}

### `one docgen`

Generate documentation for the oneRepo cli.

```sh
one docgen [options...]
```

Help documentation should always be easy to find. This command will help automate the creation of docs for this command-line interface. If you are reading this somewhere that is not your terminal, there is a very good chance that this command was already run for you!

Add this command to your one Repo tasks on pre-commit to ensure that your documentation is always up-to-date.

| Option | Type | Description |
| ----------------- | --------------------------------------------- | -------------------------------------------------------------------------- |
| `--add` | `boolean` | Add the output file to the git stage |
| `--format` | `"markdown"`, `"json"`, default: `"markdown"` | Output format for documentation |
| `--heading-level` | `number` | Heading level to start at for Markdown output |
| `--out-file` | `string` | File to write output to. If not provided, stdout will be used |
| `--out-workspace` | `string` | Workspace name to write the --out-file to |
| `--safe-write` | `boolean` | Write documentation to a portion of the file with start and end sentinels. |

<details>

<summary>Advanced options</summary>

| Option | Type | Description |
| ----------------- | --------- | ------------------------------------------------------------------------------------ |
| `--command` | `string` | Start at the given command, skip the root and any others |
| `--show-advanced` | `boolean` | Pair with `--help` to show advanced options. |
| `--use-defaults` | `boolean` | Use the oneRepo default configuration. Helpful for generating default documentation. |

</details>

{/* end-auto-generated-from-cli-docgen */}
6 changes: 3 additions & 3 deletions modules/builders/src/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function getAffected(graph: Graph, { from, ignore, staged, step, through
return graph.workspaces;
}

return await graph.affected(Array.from(workspaces));
return graph.affected(Array.from(workspaces));
});
}

Expand Down Expand Up @@ -144,7 +144,7 @@ export async function getWorkspaces(
} else {
const names = workspaces.map((ws) => ws.name);
step.log(() => `\`affected\` requested from • ${names.join('\n • ')}`);
workspaces = await graph.affected(names);
workspaces = graph.affected(names);
}
}

Expand Down Expand Up @@ -237,7 +237,7 @@ export async function getFilepaths(
}
} else {
step.log('`affected` requested from Workspaces');
const affected = await graph.affected(argv.workspaces!);
const affected = graph.affected(argv.workspaces!);
paths.push(...affected.map((ws) => ws.location));
}
}
Expand Down
60 changes: 30 additions & 30 deletions modules/github-action/dist/get-tasks.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ var require_command = __commonJS({
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/rng.js
// node_modules/uuid/dist/esm-node/rng.js
function rng() {
if (poolPtr > rnds8Pool.length - 16) {
import_crypto.default.randomFillSync(rnds8Pool);
Expand All @@ -162,34 +162,34 @@ function rng() {
}
var import_crypto, rnds8Pool, poolPtr;
var init_rng = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/rng.js"() {
"node_modules/uuid/dist/esm-node/rng.js"() {
import_crypto = __toESM(require("crypto"));
rnds8Pool = new Uint8Array(256);
poolPtr = rnds8Pool.length;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/regex.js
// node_modules/uuid/dist/esm-node/regex.js
var regex_default;
var init_regex = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/regex.js"() {
"node_modules/uuid/dist/esm-node/regex.js"() {
regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/validate.js
// node_modules/uuid/dist/esm-node/validate.js
function validate(uuid) {
return typeof uuid === "string" && regex_default.test(uuid);
}
var validate_default;
var init_validate = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/validate.js"() {
"node_modules/uuid/dist/esm-node/validate.js"() {
init_regex();
validate_default = validate;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/stringify.js
// node_modules/uuid/dist/esm-node/stringify.js
function stringify(arr, offset = 0) {
const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
if (!validate_default(uuid)) {
Expand All @@ -199,7 +199,7 @@ function stringify(arr, offset = 0) {
}
var byteToHex, stringify_default;
var init_stringify = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/stringify.js"() {
"node_modules/uuid/dist/esm-node/stringify.js"() {
init_validate();
byteToHex = [];
for (let i = 0; i < 256; ++i) {
Expand All @@ -209,7 +209,7 @@ var init_stringify = __esm({
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v1.js
// node_modules/uuid/dist/esm-node/v1.js
function v1(options, buf, offset) {
let i = buf && offset || 0;
const b = buf || new Array(16);
Expand Down Expand Up @@ -260,7 +260,7 @@ function v1(options, buf, offset) {
}
var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default;
var init_v1 = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/v1.js"() {
"node_modules/uuid/dist/esm-node/v1.js"() {
init_rng();
init_stringify();
_lastMSecs = 0;
Expand All @@ -269,7 +269,7 @@ var init_v1 = __esm({
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/parse.js
// node_modules/uuid/dist/esm-node/parse.js
function parse(uuid) {
if (!validate_default(uuid)) {
throw TypeError("Invalid UUID");
Expand All @@ -296,13 +296,13 @@ function parse(uuid) {
}
var parse_default;
var init_parse = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/parse.js"() {
"node_modules/uuid/dist/esm-node/parse.js"() {
init_validate();
parse_default = parse;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v35.js
// node_modules/uuid/dist/esm-node/v35.js
function stringToBytes(str) {
str = unescape(encodeURIComponent(str));
const bytes = [];
Expand Down Expand Up @@ -347,15 +347,15 @@ function v35_default(name, version2, hashfunc) {
}
var DNS, URL2;
var init_v35 = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/v35.js"() {
"node_modules/uuid/dist/esm-node/v35.js"() {
init_stringify();
init_parse();
DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/md5.js
// node_modules/uuid/dist/esm-node/md5.js
function md5(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
Expand All @@ -366,24 +366,24 @@ function md5(bytes) {
}
var import_crypto2, md5_default;
var init_md5 = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/md5.js"() {
"node_modules/uuid/dist/esm-node/md5.js"() {
import_crypto2 = __toESM(require("crypto"));
md5_default = md5;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v3.js
// node_modules/uuid/dist/esm-node/v3.js
var v3, v3_default;
var init_v3 = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/v3.js"() {
"node_modules/uuid/dist/esm-node/v3.js"() {
init_v35();
init_md5();
v3 = v35_default("v3", 48, md5_default);
v3_default = v3;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v4.js
// node_modules/uuid/dist/esm-node/v4.js
function v4(options, buf, offset) {
options = options || {};
const rnds = options.random || (options.rng || rng)();
Expand All @@ -400,14 +400,14 @@ function v4(options, buf, offset) {
}
var v4_default;
var init_v4 = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/v4.js"() {
"node_modules/uuid/dist/esm-node/v4.js"() {
init_rng();
init_stringify();
v4_default = v4;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/sha1.js
// node_modules/uuid/dist/esm-node/sha1.js
function sha1(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
Expand All @@ -418,32 +418,32 @@ function sha1(bytes) {
}
var import_crypto3, sha1_default;
var init_sha1 = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/sha1.js"() {
"node_modules/uuid/dist/esm-node/sha1.js"() {
import_crypto3 = __toESM(require("crypto"));
sha1_default = sha1;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/v5.js
// node_modules/uuid/dist/esm-node/v5.js
var v5, v5_default;
var init_v5 = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/v5.js"() {
"node_modules/uuid/dist/esm-node/v5.js"() {
init_v35();
init_sha1();
v5 = v35_default("v5", 80, sha1_default);
v5_default = v5;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/nil.js
// node_modules/uuid/dist/esm-node/nil.js
var nil_default;
var init_nil = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/nil.js"() {
"node_modules/uuid/dist/esm-node/nil.js"() {
nil_default = "00000000-0000-0000-0000-000000000000";
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/version.js
// node_modules/uuid/dist/esm-node/version.js
function version(uuid) {
if (!validate_default(uuid)) {
throw TypeError("Invalid UUID");
Expand All @@ -452,13 +452,13 @@ function version(uuid) {
}
var version_default;
var init_version = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/version.js"() {
"node_modules/uuid/dist/esm-node/version.js"() {
init_validate();
version_default = version;
}
});

// node_modules/@actions/core/node_modules/uuid/dist/esm-node/index.js
// node_modules/uuid/dist/esm-node/index.js
var esm_node_exports = {};
__export(esm_node_exports, {
NIL: () => nil_default,
Expand All @@ -472,7 +472,7 @@ __export(esm_node_exports, {
version: () => version_default
});
var init_esm_node = __esm({
"node_modules/@actions/core/node_modules/uuid/dist/esm-node/index.js"() {
"node_modules/uuid/dist/esm-node/index.js"() {
init_v1();
init_v3();
init_v4();
Expand Down
Loading
Loading