coh-content-db 1.4.1 → 2.0.0-rc.10
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/.editorconfig +24 -0
- package/.github/workflows/build.yml +38 -0
- package/.github/workflows/pull-request.yml +32 -0
- package/.github/workflows/release.yml +52 -0
- package/CHANGELOG.md +42 -0
- package/LICENSE +24 -674
- package/README.md +101 -16
- package/dist/coh-content-db.d.ts +988 -22
- package/dist/coh-content-db.js +1044 -2
- package/dist/coh-content-db.js.map +1 -0
- package/dist/coh-content-db.mjs +1009 -0
- package/dist/coh-content-db.mjs.map +1 -0
- package/eslint.config.mjs +31 -0
- package/jest.config.mjs +7 -0
- package/package.json +31 -23
- package/rollup.config.mjs +27 -0
- package/src/main/api/alignment.ts +19 -0
- package/src/main/api/alternate-data.ts +22 -0
- package/src/main/api/archetype-data.ts +5 -0
- package/src/main/api/badge-data.ts +81 -0
- package/src/main/api/badge-requirement-data.ts +64 -0
- package/src/main/api/badge-requirement-type.ts +32 -0
- package/src/main/api/badge-type.ts +19 -0
- package/src/main/api/bundle-data.ts +47 -0
- package/src/main/api/bundle-header-data.ts +37 -0
- package/src/main/api/contact-data.ts +48 -0
- package/src/main/api/enhancement-category.ts +30 -0
- package/src/main/api/link.ts +4 -0
- package/src/main/api/location-data.ts +28 -0
- package/src/main/api/markdown-string.ts +4 -0
- package/src/main/api/mission-data.ts +83 -0
- package/src/main/api/mission-type.ts +2 -0
- package/src/main/api/morality.ts +31 -0
- package/src/main/api/sex.ts +10 -0
- package/src/main/api/zone-data.ts +20 -0
- package/src/main/db/abstract-index.ts +37 -0
- package/src/main/db/alignment-list.ts +54 -0
- package/src/main/db/alternates.ts +67 -0
- package/src/main/db/archetype.ts +14 -0
- package/src/main/db/badge-index.ts +57 -0
- package/src/main/db/badge-requirement.ts +81 -0
- package/src/main/db/badge-search-options.ts +51 -0
- package/src/main/db/badge.ts +147 -0
- package/src/main/db/bundle-header.ts +44 -0
- package/src/main/db/coh-content-database.ts +138 -0
- package/src/main/db/contact.ts +62 -0
- package/src/main/db/key.ts +18 -0
- package/src/main/db/location.ts +30 -0
- package/src/main/db/mission.ts +107 -0
- package/src/main/db/morality-list.ts +99 -0
- package/src/main/db/paged.ts +7 -0
- package/src/main/db/zone.ts +28 -0
- package/src/main/index.ts +41 -0
- package/src/main/util.ts +118 -0
- package/src/test/api/alignment.test.ts +65 -0
- package/src/test/api/archetype-data.fixture.ts +8 -0
- package/src/test/api/badge-data.fixture.ts +8 -0
- package/src/test/api/badge-data.test.ts +15 -0
- package/src/test/api/badge-requirement-data.fixture.ts +7 -0
- package/src/test/api/badge-requirement-type.test.ts +31 -0
- package/src/test/api/badge-type.test.ts +35 -0
- package/src/test/api/bundle-data.fixture.ts +6 -0
- package/src/test/api/bundle-header-data.fixture.ts +6 -0
- package/src/test/api/contact-data.fixture.ts +7 -0
- package/src/test/api/enhancement-category.test.ts +35 -0
- package/src/test/api/mission-data.fixture.ts +12 -0
- package/src/test/api/sex.test.ts +63 -0
- package/src/test/api/zone-data.fixture.ts +8 -0
- package/src/test/db/abstract-index.test.ts +55 -0
- package/src/test/db/alignment-list.test.ts +200 -0
- package/src/test/db/alternates.test.ts +188 -0
- package/src/test/db/archetype.test.ts +38 -0
- package/src/test/db/badge-index.test.ts +519 -0
- package/src/test/db/badge-requirement.test.ts +145 -0
- package/src/test/db/badge.test.ts +337 -0
- package/src/test/db/bundle-header.test.ts +76 -0
- package/src/test/db/coh-content-database.test.ts +282 -0
- package/src/test/db/contact.test.ts +97 -0
- package/src/test/db/key.test.ts +22 -0
- package/src/test/db/location.test.ts +51 -0
- package/src/test/db/mission.test.ts +171 -0
- package/src/test/db/morality-list.test.ts +457 -0
- package/src/test/db/zone.test.ts +36 -0
- package/src/test/integration.test.ts +16 -0
- package/src/test/util.test.ts +165 -0
- package/tsconfig.json +117 -0
- package/dist/_changelog.d.ts +0 -3
- package/dist/coh-content-db.nomin.js +0 -635
- package/dist/content-refence-utils.d.ts +0 -4
- package/dist/index.d.ts +0 -8
- package/dist/internal/_common.d.ts +0 -4
- package/dist/internal/archetype.d.ts +0 -10
- package/dist/internal/badge.d.ts +0 -44
- package/dist/internal/game-map.d.ts +0 -33
- package/dist/internal/server-group.d.ts +0 -24
- package/dist/types/archetype.d.ts +0 -9
- package/dist/types/badge.d.ts +0 -192
- package/dist/types/enhancement.d.ts +0 -28
- package/dist/types/game-map.d.ts +0 -47
- package/dist/types/link.d.ts +0 -4
- package/dist/types/server-group.d.ts +0 -75
package/.editorconfig
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
end_of_line = lf
|
|
5
|
+
insert_final_newline = true
|
|
6
|
+
|
|
7
|
+
[*.{ts,js,mjs,cj,md}]
|
|
8
|
+
indent_style = space
|
|
9
|
+
indent_size = 2
|
|
10
|
+
ij_javascript_force_quote_style = true
|
|
11
|
+
ij_javascript_force_semicolon_style = true
|
|
12
|
+
ij_javascript_spaces_within_imports = true
|
|
13
|
+
ij_javascript_spaces_within_object_literal_braces = true
|
|
14
|
+
ij_javascript_use_double_quotes = false
|
|
15
|
+
ij_javascript_use_semicolon_after_statement = false
|
|
16
|
+
ij_typescript_force_quote_style = true
|
|
17
|
+
ij_typescript_force_semicolon_style = true
|
|
18
|
+
ij_typescript_spaces_within_imports = true
|
|
19
|
+
ij_typescript_spaces_within_object_literal_braces = true
|
|
20
|
+
ij_typescript_use_double_quotes = false
|
|
21
|
+
ij_typescript_use_semicolon_after_statement = false
|
|
22
|
+
|
|
23
|
+
[*.md]
|
|
24
|
+
indent_size = 4
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
on: push
|
|
3
|
+
jobs:
|
|
4
|
+
build:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
steps:
|
|
7
|
+
- name: Checkout
|
|
8
|
+
uses: actions/checkout@v4
|
|
9
|
+
|
|
10
|
+
- name: Setup Node
|
|
11
|
+
uses: actions/setup-node@v4
|
|
12
|
+
with:
|
|
13
|
+
node-version: lts/jod
|
|
14
|
+
cache: 'npm'
|
|
15
|
+
|
|
16
|
+
- name: Install
|
|
17
|
+
run: npm install
|
|
18
|
+
|
|
19
|
+
- name: Lint
|
|
20
|
+
run: npm run lint
|
|
21
|
+
|
|
22
|
+
- name: Test
|
|
23
|
+
run: npm run test
|
|
24
|
+
|
|
25
|
+
- name: Upload coverage reports to Codecov
|
|
26
|
+
if: github.event.repository.fork != true
|
|
27
|
+
uses: codecov/codecov-action@v5
|
|
28
|
+
with:
|
|
29
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
30
|
+
|
|
31
|
+
- name: Build
|
|
32
|
+
run: npm run build
|
|
33
|
+
|
|
34
|
+
- name: Upload Artifact
|
|
35
|
+
uses: actions/upload-artifact@v4
|
|
36
|
+
with:
|
|
37
|
+
name: 'dist'
|
|
38
|
+
path: 'dist'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
on: pull_request
|
|
3
|
+
jobs:
|
|
4
|
+
build:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
steps:
|
|
7
|
+
- name: Checkout
|
|
8
|
+
uses: actions/checkout@v4
|
|
9
|
+
|
|
10
|
+
- name: Setup Node
|
|
11
|
+
uses: actions/setup-node@v4
|
|
12
|
+
with:
|
|
13
|
+
node-version: lts/jod
|
|
14
|
+
cache: 'npm'
|
|
15
|
+
|
|
16
|
+
- name: Install
|
|
17
|
+
run: npm install
|
|
18
|
+
|
|
19
|
+
- name: Lint
|
|
20
|
+
run: npm run lint
|
|
21
|
+
|
|
22
|
+
- name: Test
|
|
23
|
+
run: npm run test
|
|
24
|
+
|
|
25
|
+
- name: Build
|
|
26
|
+
run: npm run build
|
|
27
|
+
|
|
28
|
+
- name: Upload Artifact
|
|
29
|
+
uses: actions/upload-artifact@v4
|
|
30
|
+
with:
|
|
31
|
+
name: 'dist'
|
|
32
|
+
path: 'dist'
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags:
|
|
5
|
+
- "v*.*.*"
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Setup Node
|
|
18
|
+
uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: lts/jod
|
|
21
|
+
cache: 'npm'
|
|
22
|
+
registry-url: 'https://registry.npmjs.org'
|
|
23
|
+
|
|
24
|
+
- name: Install
|
|
25
|
+
run: npm install
|
|
26
|
+
|
|
27
|
+
- name: Lint
|
|
28
|
+
run: npm run lint
|
|
29
|
+
|
|
30
|
+
- name: Test
|
|
31
|
+
run: npm run test
|
|
32
|
+
|
|
33
|
+
- name: Build
|
|
34
|
+
run: npm run build
|
|
35
|
+
|
|
36
|
+
- name: Upload Artifact
|
|
37
|
+
uses: actions/upload-artifact@v4
|
|
38
|
+
with:
|
|
39
|
+
name: 'dist'
|
|
40
|
+
path: 'dist'
|
|
41
|
+
|
|
42
|
+
- name: Release
|
|
43
|
+
uses: softprops/action-gh-release@v2
|
|
44
|
+
with:
|
|
45
|
+
draft: true
|
|
46
|
+
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
|
47
|
+
files: 'dist/*'
|
|
48
|
+
|
|
49
|
+
- name: Publish
|
|
50
|
+
run: npm publish --provenance --access public
|
|
51
|
+
env:
|
|
52
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.0.0-rc.10] - 2025-04-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Introduced a simple indexing and search function for badge names, text, and acquisition info.
|
|
13
|
+
- Enabled formal support for Missions and Contacts in badge requirements.
|
|
14
|
+
- Added GitHub Actions for continuous integration (CI).
|
|
15
|
+
- Included `eslint` for linting.
|
|
16
|
+
- Added `jest` for unit testing.
|
|
17
|
+
- CHANGELOG.md
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Server groups are now referred to as "forks".
|
|
22
|
+
- Enum types were replaced with union types, and values now use `kebab-case`.
|
|
23
|
+
- The `IServerGroupData` interface was renamed to `BundleData`, and databases are now scoped to a single bundle.
|
|
24
|
+
- Database instance is now immutable and bundle data is loaded in the constructor.
|
|
25
|
+
- `GameMap` was renamed to `Zone`.
|
|
26
|
+
- Badge partials are now referred to as badge requirements.
|
|
27
|
+
- Exploration badge locations were moved into the badge requirements list.
|
|
28
|
+
- References to zones and badges now use a standard Markdown link format (`badge://`, `map://`).
|
|
29
|
+
- Some field names were updated for consistent pluralization (e.g., `name`, `icon`).
|
|
30
|
+
- `VidiotMap` data was folded into `Location` data.
|
|
31
|
+
- `settitle` IDs were consolidated into a single tuple field.
|
|
32
|
+
- Bundle metadata is now found in the `BundleData.header` field.
|
|
33
|
+
- Redundant interfaces have been replaced with their concrete equivalents.
|
|
34
|
+
- The project license was changed from GNU to [The Unlicense](https://unlicense.org/).
|
|
35
|
+
- Switched the build system from Webpack to Rollup.
|
|
36
|
+
|
|
37
|
+
### Removed
|
|
38
|
+
|
|
39
|
+
- The `serverGroup` property was removed from entities to simplify the object model, since only one context is allowed per database.
|
|
40
|
+
- All third-party dependencies were removed.
|
|
41
|
+
- VidiotMap data was removed from the Zone API.
|
|
42
|
+
- Changelog API is removed in favor of the CHANGELOG.md file in the repository.
|