Skip to content

Commit 60a16c0

Browse files
committed
Consolidate all the individual packages into one library
1 parent cb745e6 commit 60a16c0

74 files changed

Lines changed: 2619 additions & 19442 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
name: Deploy package
44

55
on:
6-
workflow_call:
7-
inputs:
8-
package-name:
9-
required: true
10-
type: string
6+
workflow_dispatch:
7+
push:
8+
tags:
9+
- '[0-9].[0-9].[0-9]'
1110

1211
permissions:
1312
id-token: write # Required for OIDC
@@ -16,9 +15,6 @@ permissions:
1615
jobs:
1716
deploy:
1817
runs-on: ubuntu-latest
19-
defaults:
20-
run:
21-
working-directory: ./packages/${{ inputs.package-name }}
2218
environment: Deploy
2319

2420
steps:
@@ -38,9 +34,6 @@ jobs:
3834
echo "Run Number: ${{ github.run_number }} " >> $GITHUB_STEP_SUMMARY
3935
echo "Run Attempt: ${{ github.run_attempt }} " >> $GITHUB_STEP_SUMMARY
4036
echo "Node Version: $(node --version) - NPM Version: $(npm --version) " >> $GITHUB_STEP_SUMMARY
41-
echo "" >> $GITHUB_STEP_SUMMARY
42-
echo "---" >> $GITHUB_STEP_SUMMARY
43-
echo "Package Name: **${{ inputs.package-name }}** " >> $GITHUB_STEP_SUMMARY
4437
4538
- name: Read package.json
4639
id: package-json
@@ -73,7 +66,7 @@ jobs:
7366
run: |
7467
npm publish
7568
echo "" >> $GITHUB_STEP_SUMMARY
76-
echo "Successfully published to the [NPM registry](https://www.npmjs.com/package/@sourcelib/${{inputs.package-name}}/v/$VERSION)" >> $GITHUB_STEP_SUMMARY
69+
echo "Successfully published to the [NPM registry](https://www.npmjs.com/package/sourcelib/v/$VERSION)" >> $GITHUB_STEP_SUMMARY
7770
7871
- name: Get Changelog
7972
id: changelog
@@ -98,15 +91,14 @@ jobs:
9891
uses: softprops/action-gh-release@v1
9992
with:
10093
body: "${{env.CL_UNESCAPED}}"
101-
tag_name: "${{inputs.package-name}}-${{env.VERSION}}"
94+
tag_name: "${{env.VERSION}}"
10295

10396
- name: Prepare Discord Message
10497
id: discord-msg
10598
working-directory: ./
10699
run: |
107100
awk '{
108101
gsub("#VERSION#","${{env.VERSION}}",$0);
109-
gsub("#PACKAGE#","${{inputs.package-name}}",$0);
110102
gsub("#DESCRIPTION#","${{env.CL_DOUBLEESCAPED}}",$0);
111103
print $0;
112104
}' ./.github/workflows/deploy_discord_message.json > ./.github/workflows/deploy_discord_message2.json
@@ -120,5 +112,5 @@ jobs:
120112

121113
- name: Summary Footer
122114
run: |
123-
echo "Created GitHub [Release](https://github.com/source-lib/sourcelib/releases/tag/${{inputs.package-name}}-$VERSION)" >> $GITHUB_STEP_SUMMARY
115+
echo "Created GitHub [Release](https://github.com/SecondFaceSoftware/sourcelib/releases/tag/${{env.VERSION}})" >> $GITHUB_STEP_SUMMARY
124116
echo "Discord Message sent successfully" >> $GITHUB_STEP_SUMMARY

.github/workflows/deploy_discord_message.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"embeds": [
33
{
44
"type": "rich",
5-
"title": "Update available [#VERSION#] for @sourcelib/#PACKAGE#",
5+
"title": "Update available [#VERSION#] for sourcelib",
66
"description": "#DESCRIPTION#",
77
"color": "4238322",
88
"footer": {
99
"text": "@sourcelib/#PACKAGE#",
1010
"icon_url": "https://avatars.githubusercontent.com/u/113333678"
1111
},
12-
"url": "https://www.npmjs.com/package/@sourcelib/#PACKAGE#/v/#VERSION#"
12+
"url": "https://www.npmjs.com/package/sourcelib/v/#VERSION#"
1313
}
1414
]
1515
}

.github/workflows/deploy_kv.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/deploy_vmt.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
- uses: actions/checkout@v2
1414

1515
- name: Install
16-
run: npm ci --workspaces
16+
run: npm ci
1717

1818
- name: Lint
19-
run: npm run lint --workspaces
19+
run: npm run lint
2020

2121
- name: Test
22-
run: npm test --workspaces
22+
run: npm test

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11

22
# compiled output
3-
packages/*/lib
4-
packages/*/node_modules
5-
6-
# Test coverage output
7-
packages/*/coverage
8-
packages/*/benchmarks
3+
lib
94

105
# dependencies
116
node_modules

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.vscode
2+
.github
3+
.idea
4+
*.test.ts
5+
*.bench.ts
6+
eslint.config.js
7+
tsconfig.json
8+
src
9+
!out

README.md

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,4 @@
11
# Sourcelib
2-
[![CI Test](https://github.com/source-lib/sourcelib/actions/workflows/test.yml/badge.svg)](https://github.com/source-lib/sourcelib/actions/workflows/test.yml)
3-
![MAINTAINED](https://img.shields.io/badge/Maintained%3F-yes-green.svg)
4-
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)
2+
[![CI Test](https://github.com/SecondFaceSoftware/sourcelib/actions/workflows/test.yml/badge.svg)](https://github.com/source-lib/sourcelib/actions/workflows/test.yml)
53

6-
![ESLINT](https://img.shields.io/badge/eslint-3A33D1?style=flat&logo=eslint&logoColor=white)
7-
![TYPESCRIPT](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)
8-
![NODE.JS](https://img.shields.io/badge/Node.js-43853D?style=flat&logo=node.js&logoColor=white)
9-
![JEST](https://img.shields.io/badge/Jest-323330?style=flat&logo=Jest&logoColor=white)
10-
11-
A set of TypeScript libraries to work with the Source Engine.
12-
13-
This code used to be part of the [Source Engine Support extension for Visual Studio Code](https://github.com/StefanH-AT/Source-Engine-VSCode-Extension).
14-
15-
## Packages
16-
17-
This repository containy several packages.
18-
19-
| Name | Description | Install |
20-
| ---- | ----------- | ------- |
21-
| [kv](https://www.npmjs.com/package/@sourcelib/kv) | Keyvalue file parsing and tokenizer for reading, writing and inspecting keyvalue files | `npm install @sourcelib/kv`
22-
| [fs](https://www.npmjs.com/package/@sourcelib/fs) | Source Engine virtual filesystem tools to read and write to a game's files | `npm install @sourcelib/fs`
23-
| [vmt](https://www.npmjs.com/package/@sourcelib/vmt) | Material file (.vmt) tools | `npm install @sourcelib/vmt`
24-
| [captions](https://www.npmjs.com/package/@sourcelib/captions) | Caption file parsing tools | `npm install @sourcelib/captions`
25-
26-
## Projects using sourcelib
27-
28-
- [Source Engine Support Vscode extension](https://github.com/StefanH-AT/Source-Engine-VSCode-Extension).
29-
30-
## Development
31-
32-
sourcelib is built using npm workspaces to manage multiple npm packages at once.
33-
34-
**Install**
35-
```shell
36-
git clone https://github.com/source-lib/sourcelib.git
37-
cd sourcelib
38-
npm install --workspaces
39-
```
40-
41-
**Compile everything**
42-
```shell
43-
npm run compile --workspaces
44-
```
45-
46-
**Test everything**
47-
```shell
48-
npm run test --workspaces
49-
npm run benchmark --workspaces
50-
```
51-
52-
**Lint everything**
53-
```shell
54-
npm run lint --workspaces
55-
```
56-
57-
Individual packages are located in the `packages` directory. They can be developed independently just like normal. For example:
58-
```shell
59-
cd packages/kv
60-
npm run test
61-
```
62-
63-
## Contributing
64-
If you wish to contribute, please fork the repository and create a pull request!
65-
66-
## License
67-
This project is licensed under the MIT License: [License](LICENSE)
68-
69-
No code owned by Valve Software has been copied or used as reference. All this code has been written from scratch.
4+
A TypeScript library to work with the Source Engine. Runs in browsers and NodeJS.

config/.eslintrc.json

Lines changed: 0 additions & 39 deletions
This file was deleted.

config/bench.config.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)