Skip to content
Open
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
1 change: 1 addition & 0 deletions .agents/skills/js-npm-matrixai-errors
1 change: 1 addition & 0 deletions .agents/skills/js-npm-matrixai-lint
1 change: 1 addition & 0 deletions .agents/skills/js-npm-matrixai-logger
1 change: 1 addition & 0 deletions .agents/skills/nix-flake-local-dev
Empty file removed .env.example
Empty file.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
24 changes: 18 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
/.aider*
/.direnv
/tmp
/dist
.env*
!.env.example
/.env*
!/.env.example
!/.envrc
# nix
/result*
/builds
# node-gyp
/build
# prebuildify
/prebuilds
# docusaurus
/public
.docusaurus
.cache-loader
# wrangler
.wrangler
.dev.vars
# git worktrees
/.worktrees

# Logs
logs
Expand Down Expand Up @@ -80,10 +92,6 @@ web_modules/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
Expand Down Expand Up @@ -119,10 +127,14 @@ dist

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
.vscode

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

.DS_Store
.idea
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule ".matrixai/matrixai-standards"]
path = .matrixai/matrixai-standards
url = git@github.com:MatrixAI/matrixai-standards.git
branch = master
1 change: 1 addition & 0 deletions .matrixai/matrixai-standards
Submodule matrixai-standards added at 684090
1 change: 1 addition & 0 deletions .matrixai/repo-profile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
profile: library-js
64 changes: 64 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# AGENTS

- Read the repo profile selector at
[`.matrixai/repo-profile.yml`](.matrixai/repo-profile.yml).
- Standards are expected at `./.matrixai/matrixai-standards/` from private
submodule sync; if access is unavailable, standards and skill updates cannot
be refreshed.
- Enforce the universal hotset
[`.matrixai/matrixai-standards/standards/HOTSET.md`](.matrixai/matrixai-standards/standards/HOTSET.md).
- When editing Markdown/prose artifacts, enforce
[`.matrixai/matrixai-standards/standards/prose-markdown.md`](.matrixai/matrixai-standards/standards/prose-markdown.md).
- Enforce the profile doc under
[`.matrixai/matrixai-standards/standards/profiles/`](.matrixai/matrixai-standards/standards/profiles)
matching `profile:` in `.matrixai/repo-profile.yml` (e.g., `library-js`,
`application-js`, `worker-js-cloudflare`, `docusaurus-js-cloudflare`).
- Profile index (for discovery):
[`.matrixai/matrixai-standards/standards/profiles/README.md`](.matrixai/matrixai-standards/standards/profiles/README.md)
- Tooling contract reference:
[`.matrixai/matrixai-standards/standards/coding/tooling/tooling-contract.md`](.matrixai/matrixai-standards/standards/coding/tooling/tooling-contract.md)
(commands, artifacts, expectations per profile).
- Materialize skills from canonical `./.matrixai/matrixai-standards/skills/**`
using collection defaults from
`./.matrixai/matrixai-standards/skills-collections/**` into
`./.agents/skills/**` for runtime discovery, and rematerialize after standards
submodule updates.
- When using `nix run` with a flake ref, quote the full flake ref argument (for
example, `'./.matrixai/matrixai-standards#skills-materializer'`).
- Profile-driven materialization is the default fast path: run
`nix run './.matrixai/matrixai-standards#skills-materializer' -- --standards-root ./.matrixai/matrixai-standards`
and it resolves profile+ecosystem collection defaults into
`./.agents/skills/**`.
- Explicit selectors remain optional additive overrides: use `--collection ...`
and/or `--root-skill ...` only when narrowing or extending selection behavior.
- Content under `./.matrixai/matrixai-standards/standards/**` and
`./.matrixai/matrixai-standards/skills/**` MUST NOT reference raw
`exhibits/...` intake paths; use stable standards paths (for example
`./.matrixai/matrixai-standards/standards/exhibits/...`) or source-repo
identifiers instead.
- Prefer ASCII punctuation/symbols when an equivalent exists (see
[`.matrixai/matrixai-standards/standards/HOTSET.md`](.matrixai/matrixai-standards/standards/HOTSET.md)
[MXS-GEN-006]).
- Ensure edits comply with [`.editorconfig`](.editorconfig) (LF line endings,
2-space indent, final newline, trim trailing whitespace).
- Line-reference policy (applies to all agent-generated repository content:
Markdown, docs, templates, and code comments):
- Never emit `path:line` (e.g. `foo.ts:1`, `README.md:126`) into repository
files.
- Do NOT put `:number` inside Markdown link destinations: `[x](path:123)` is
banned.
- If a line reference is needed, use either:
- `[x](path#heading-anchor)` (if possible), or
- `[x](path) (line 123)` (preferred, portable), or
- `[x](path#L123)` only when explicitly targeting a renderer that supports
`#L` anchors.
- If you would have emitted `:1`, drop it entirely: use `path` with no line
info.
- Apply repo-local golden commands and overrides here (use `npm run lintfix`
during active development; use `npm run lint` for non-mutating CI checks):
- build: npm run build
- test: npm test
- lintfix: npm run lintfix
- lint: npm run lint
- docs: npm run docs
- bench: (not defined in this repo)
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# js-async-init

Asynchronous initialization and deinitialization decorators for JavaScript/TypeScript applications.
Asynchronous initialization and deinitialization decorators for
JavaScript/TypeScript applications.

Because decorators are experimental, you must enable: `"experimentalDecorators": true` in your `tsconfig.json` to use this library.
Because decorators are experimental, you must enable:
`"experimentalDecorators": true` in your `tsconfig.json` to use this library.

TypeScript does not allow decorator properties that are protected or private.

Expand Down Expand Up @@ -88,9 +90,13 @@ async function main() {
main();
```

The `start`, `stop`, and `destroy` calls are all concurrent-controlled with `RWLockWriter`. They are idempotent and they are mutually exclusive between each other and any blocking `ready` decorated methods. Decorated methods can block `start`, `stop`, and `destroy`, but share a read lock between each other.
The `start`, `stop`, and `destroy` calls are all concurrent-controlled with
`RWLockWriter`. They are idempotent and they are mutually exclusive between each
other and any blocking `ready` decorated methods. Decorated methods can block
`start`, `stop`, and `destroy`, but share a read lock between each other.

Refer to https://gist.github.com/CMCDragonkai/1dbf5069d9efc11585c27cc774271584 for further the motivation of this library.
Refer to https://gist.github.com/CMCDragonkai/1dbf5069d9efc11585c27cc774271584
for further the motivation of this library.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/functions/createDestroyStartStop.ready.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h5><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type
<h5><span class="tsd-kind-parameter">descriptor</span>: <span class="tsd-signature-type ">PropertyDescriptor</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">PropertyDescriptor</span></h4></li></ul></li></ul><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/MatrixAI/js-async-init/blob/master/src/CreateDestroyStartStop.ts#L229">src/CreateDestroyStartStop.ts:229</a></li></ul></aside></li></ul></section></div>
<li>Defined in <a href="https://github.com/MatrixAI/js-async-init/blob/master/src/CreateDestroyStartStop.ts#L227">src/CreateDestroyStartStop.ts:227</a></li></ul></aside></li></ul></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
Loading
Loading