Skip to content

Commit

Permalink
Merge pull request #162 from OpenAlly/update-tsconfig
Browse files Browse the repository at this point in the history
refactor: use @openally/config.typescript and cleanup configs & types
  • Loading branch information
fraxken authored Aug 13, 2024
2 parents 4ce5a88 + bbbc335 commit 7e47753
Show file tree
Hide file tree
Showing 26 changed files with 71 additions and 112 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x]
fail-fast: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

Expand All @@ -50,7 +50,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/init@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -60,7 +60,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/autobuild@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -73,6 +73,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/analyze@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ephemeral-map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [20.x]
fail-fast: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mutex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [20.x]
fail-fast: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

Expand Down Expand Up @@ -63,14 +63,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/upload-sarif@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions .github/workflows/timestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [20.x]
fail-fast: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit

Expand Down
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": "1.0.0",
"description": "OpenAlly NPM packages",
"scripts": {
"build": "tsc -b"
"build": "tsc -b",
"test": "npm run test --ws --if-present",
"lint": "npx eslint workspaces"
},
"repository": {
"type": "git",
Expand All @@ -27,6 +29,7 @@
"devDependencies": {
"@faker-js/faker": "^8.1.0",
"@nodesecure/eslint-config": "^1.8.0",
"@openally/config.typescript": "^1.0.3",
"@types/node": "^22.0.0",
"c8": "^10.1.2",
"cross-env": "^7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/auto-url/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>

## Requirements
- [Node.js](https://nodejs.org/en/) v18 or higher
- [Node.js](https://nodejs.org/en/) v20 or higher

## Getting Started

Expand Down
15 changes: 2 additions & 13 deletions src/auto-url/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"strictNullChecks": true,
"target": "ES2022",
"outDir": "dist",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": false,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"rootDir": "./src",
"types": ["node"]
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
Expand Down
4 changes: 2 additions & 2 deletions src/config/src/AsynchronousConfig.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class AsynchronousConfig<T extends Record<string, any> = Record<string, a
}
JSONConfig = this.#isTOML ? TOML.parse(configFileContent) : JSON.parse(configFileContent);
}
catch (err) {
catch (err: any) {
const isSyntaxError = err.name === "SyntaxError" || err.name === "TomlError";

// If NodeJS Code is different from "ENOENTRY", then throw Error (only if createOnNoEntry is equal to false)
Expand All @@ -187,7 +187,7 @@ export class AsynchronousConfig<T extends Record<string, any> = Record<string, a
const schemaFileContent = await this.#fs.promises.readFile(this.#configSchemaFilePath, "utf-8");
JSONSchema = JSON.parse(schemaFileContent);
}
catch (err) {
catch (err: any) {
if (Reflect.has(err, "code") && err.code !== "ENOENT") {
throw err;
}
Expand Down
15 changes: 2 additions & 13 deletions src/config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"strictNullChecks": true,
"target": "ES2022",
"outDir": "dist",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": false,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"rootDir": "./src",
"types": ["node"]
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
Expand Down
2 changes: 1 addition & 1 deletion src/ephemeral-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>

## Requirements
- [Node.js](https://nodejs.org/en/) v16 or higher
- [Node.js](https://nodejs.org/en/) v20 or higher

## Getting Started

Expand Down
15 changes: 2 additions & 13 deletions src/ephemeral-map/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"strictNullChecks": true,
"target": "ES2022",
"outDir": "dist",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": false,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"rootDir": "./src",
"types": ["node"]
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
Expand Down
2 changes: 1 addition & 1 deletion src/mutex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</p>

## Requirements
- [Node.js](https://nodejs.org/en/) v16 or higher
- [Node.js](https://nodejs.org/en/) v20 or higher

## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions src/mutex/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Import Node.js Dependencies
import EventEmitter from "node:events";
import crypto from "node:crypto";
import { EventEmitter } from "node:events";
import * as crypto from "node:crypto";
import { clearTimeout } from "node:timers";

export interface IMutexOptions {
Expand Down
15 changes: 2 additions & 13 deletions src/mutex/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"strictNullChecks": true,
"target": "ES2022",
"outDir": "dist",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": false,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"rootDir": "./src",
"types": ["node"]
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
Expand Down
2 changes: 1 addition & 1 deletion src/result/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</p>

## Requirements
- [Node.js](https://nodejs.org/en/) v16 or higher
- [Node.js](https://nodejs.org/en/) v20 or higher

## Getting Started

Expand Down
6 changes: 3 additions & 3 deletions src/result/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Ok, OkImpl } from "./class/Ok.class.js";
import { Err, ErrImpl } from "./class/Err.class.js";

export { Option, Some } from "./class/Some.class.js";
export { type Option, Some } from "./class/Some.class.js";
export { None } from "./class/None.class.js";
export { Ok, Err };

Expand Down Expand Up @@ -35,8 +35,8 @@ export namespace Result {

return new OkImpl(val);
}
catch (e) {
return new ErrImpl(e);
catch (e: any) {
return new ErrImpl<E>(e);
}
}

Expand Down
15 changes: 2 additions & 13 deletions src/result/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"strictNullChecks": true,
"target": "ES2022",
"outDir": "dist",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": false,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"rootDir": "./src",
"types": ["node"]
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
Expand Down
2 changes: 1 addition & 1 deletion src/timestore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
> Internally it uses a Node.js timer. This library does not guarantee that the timers doesn't drift.
## Requirements
- [Node.js](https://nodejs.org/en/) v16 or higher
- [Node.js](https://nodejs.org/en/) v20 or higher

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion src/timestore/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,4 @@ export class TimeStore extends EventEmitter {
}
}

export { tSv, tSvResponse, TSV_SYMBOL };
export { tSv, type tSvResponse, TSV_SYMBOL };
Loading

0 comments on commit 7e47753

Please sign in to comment.