@wtasnorg/node-lib 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.txt +14 -0
- package/dev_checklist.txt +56 -0
- package/docs/README.md +8 -35
- package/docs/docs.json +448 -205
- package/docs/functions/createFindDirectories.md +2 -2
- package/docs/functions/hello.md +2 -2
- package/docs/functions/parseUserAgent.md +42 -0
- package/docs/functions/pojo.md +2 -2
- package/docs/interfaces/FileSystemDependencies.md +9 -9
- package/docs/interfaces/FindDirectoriesOptions.md +8 -8
- package/docs/interfaces/UserAgentInfo.md +61 -0
- package/eslint.config.js +7 -2
- package/gen-docs/001_commands.txt +44 -0
- package/gen-docs/001_coverage.txt +43 -0
- package/gen-docs/001_env.txt +33 -0
- package/gen-docs/001_lint.txt +40 -0
- package/gen-docs/001_state.txt +58 -0
- package/gen-docs/002_api.txt +34 -0
- package/gen-docs/002_deps.txt +46 -0
- package/gen-docs/002_errors.txt +34 -0
- package/gen-docs/002_naming.txt +36 -0
- package/gen-docs/002_notes.txt +20 -0
- package/gen-docs/002_purity.txt +36 -0
- package/gen-docs/002_scope.txt +28 -0
- package/gen-docs/002_srp.txt +34 -0
- package/gen-sec/001_commands.txt +65 -0
- package/gen-sec/001_env.txt +28 -0
- package/gen-sec/001_findings.txt +63 -0
- package/gen-sec/001_inventory.txt +41 -0
- package/gen-sec/001_owasp.txt +78 -0
- package/gen-sec/001_scope.txt +44 -0
- package/package.json +3 -2
- package/{README.md → readme.txt} +2 -1
- package/src/find.d.ts +4 -4
- package/src/find.js +12 -6
- package/src/find.ts +10 -10
- package/src/index.d.ts +4 -2
- package/src/index.js +2 -1
- package/src/index.ts +5 -1
- package/src/pojo.js +1 -1
- package/src/pojo.test.js +1 -3
- package/src/pojo.test.ts +2 -1
- package/src/pojo.ts +1 -1
- package/src/user-agent.d.ts +48 -0
- package/src/user-agent.js +189 -0
- package/src/user-agent.test.d.ts +2 -0
- package/src/user-agent.test.js +54 -0
- package/src/user-agent.test.ts +60 -0
- package/src/user-agent.ts +199 -0
- package/DEV_CHECKLIST.md +0 -15
- package/docs/_media/LICENSE +0 -21
- package/docs/globals.md +0 -16
package/changelog.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.0.8] - 2026-01-19
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- User-agent parsing functionality in `src/user-agent.ts`.
|
|
7
|
+
- Comprehensive unit tests for user-agent parsing in `src/user-agent.test.ts`.
|
|
8
|
+
- `parseUserAgent` function to extract browser, OS, device, and engine info.
|
|
9
|
+
- `npm run lint` script to `package.json`.
|
|
10
|
+
- ESLint and EditorConfig compliance for new files.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Exported `parseUserAgent` function and `UserAgentInfo` type from `index.ts`.
|
|
14
|
+
- Fixed `detectEngine` logic: "Blink" was never returned because "AppleWebKit" check ran first. Reordered checks so Chrome-based browsers correctly return "Blink".
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Development Checklist
|
|
2
|
+
|
|
3
|
+
## Constraints
|
|
4
|
+
|
|
5
|
+
- [ ] Do not delete failing tests. Explain first. Ask second. No delete.
|
|
6
|
+
- [ ] Do not turn off eslint warnings to avoid linting errors.
|
|
7
|
+
|
|
8
|
+
## Code Quality Guidelines
|
|
9
|
+
|
|
10
|
+
### Structure & Style
|
|
11
|
+
|
|
12
|
+
- [ ] Imports/Exports: Imports at the top, exports at the bottom.
|
|
13
|
+
- [ ] Visibility: All primary functions should be exported.
|
|
14
|
+
- [ ] Mutability: Prefer `const` over `let` (`prefer-const`).
|
|
15
|
+
- [ ] Control Blocks: Always use braces `{}` for `if`, `for`, etc. (`curly`).
|
|
16
|
+
- [ ] AI Agent Protocol: AI agents MUST honor the project's ESLint and EditorConfig settings for all modifications. Run `npm run lint` to verify compliance.
|
|
17
|
+
|
|
18
|
+
### Documentation & Examples
|
|
19
|
+
|
|
20
|
+
- [ ] JSDoc: Comprehensive JSDoc for all exported functions and types.
|
|
21
|
+
- [ ] Examples:
|
|
22
|
+
- At least 3 success examples showing different use cases.
|
|
23
|
+
- At least 1 error/fallback example showing edge cases.
|
|
24
|
+
|
|
25
|
+
### Consistency
|
|
26
|
+
|
|
27
|
+
- [ ] Default States: For complex types, provide a factory/function that returns default values.
|
|
28
|
+
- [ ] Cross-Lang Parity: Match default values with Golang zero-value conventions where applicable.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Pre-flight Checklist
|
|
33
|
+
|
|
34
|
+
- [ ] Linting: Code passes npm run lint without warnings.
|
|
35
|
+
- [ ] Testing:
|
|
36
|
+
- [ ] Unit tests written for all new functionality.
|
|
37
|
+
- [ ] All tests pass: npm run test.
|
|
38
|
+
- [ ] Build: Project builds successfully: npm run build.
|
|
39
|
+
- [ ] Documentation:
|
|
40
|
+
- [ ] readme.txt updated with new features/changes.
|
|
41
|
+
- [ ] Generated docs refreshed: npm run docs && npm run docs:json.
|
|
42
|
+
- [ ] Version Control:
|
|
43
|
+
- [ ] changelog.txt updated for the current version.
|
|
44
|
+
- [ ] Identity verified (git log -n1) to protect PII.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Useful Commands
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Full verification suite
|
|
52
|
+
npm run lint \
|
|
53
|
+
&& npm run build \
|
|
54
|
+
&& npm run test \
|
|
55
|
+
&& npm run docs
|
|
56
|
+
```
|
package/docs/README.md
CHANGED
|
@@ -4,42 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
# @wtasnorg/node-lib
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Interfaces
|
|
8
8
|
|
|
9
|
-
- [
|
|
10
|
-
- [
|
|
9
|
+
- [FileSystemDependencies](interfaces/FileSystemDependencies.md)
|
|
10
|
+
- [FindDirectoriesOptions](interfaces/FindDirectoriesOptions.md)
|
|
11
|
+
- [UserAgentInfo](interfaces/UserAgentInfo.md)
|
|
11
12
|
|
|
12
13
|
## Functions
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## Develop
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
git clone git@github.com:wtasg/node-lib.git
|
|
22
|
-
npm run build
|
|
23
|
-
npm run test
|
|
24
|
-
# make changes...
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
We are using `node --test` for testing.
|
|
28
|
-
|
|
29
|
-
## Install and Usage
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install @wtasnorg/node-lib
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
# check if you can run code
|
|
37
|
-
import {hello} from "@wtasnorg/node-lib";
|
|
38
|
-
|
|
39
|
-
await hello();
|
|
40
|
-
// "hello from @wtasnorg/node-lib"
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## License: MIT
|
|
44
|
-
|
|
45
|
-
[MIT License file](_media/LICENSE)
|
|
15
|
+
- [createFindDirectories](functions/createFindDirectories.md)
|
|
16
|
+
- [hello](functions/hello.md)
|
|
17
|
+
- [parseUserAgent](functions/parseUserAgent.md)
|
|
18
|
+
- [pojo](functions/pojo.md)
|