Skip to content

Commit

Permalink
chore: live monorepo, fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Jun 21, 2024
1 parent 6de5cd3 commit f47a5f2
Show file tree
Hide file tree
Showing 50 changed files with 161 additions and 228 deletions.
52 changes: 16 additions & 36 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"type": "node",
"request": "launch",
"name": "Debug locally",
"port": 9229,
"runtimeExecutable": "yarn",
"runtimeArgs": [
"node",
"--async-stack-traces",
"-r",
"./maintenance/esbuild-register.js",
"--conditions=@@dev",
"${workspaceFolder}/test/run.ts"
],
"env": {
Expand All @@ -43,64 +43,46 @@
},
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
"preLaunchTask": "npm: build"
"sourceMaps": true
// "preLaunchTask": "npm: build"
},
{
"type": "node",
"request": "launch",
"name": "Test network mock",
"port": 9229,
"name": "Generate typed docs",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"node",
"--async-stack-traces",
"--inspect-brk=9229",
"-r",
"./maintenance/esbuild-register.js",
"${workspaceFolder}/test/mock.ts"
"${workspaceFolder}/packages/maintenance/src/generateTypedDocs.ts"
],
"env": {
"NO_CACHE": "true"
},
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
// This needs the compiled sources (I think)
"preLaunchTask": "npm: build"
},
{
"type": "node",
"request": "launch",
"name": "Generate typed docs",
"port": 9229,
"name": "Decode message",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"node",
"--async-stack-traces",
"--inspect-brk=9229",
"-r",
"./maintenance/esbuild-register.js",
"${workspaceFolder}/packages/maintenance/src/generateTypedDocs.ts"
"--conditions=@@dev",
"${workspaceFolder}/test/decodeMessage.ts"
],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true
},
{
"type": "node",
"request": "launch",
"name": "Decode message",
"port": 9229,
"runtimeExecutable": "yarn",
"runtimeArgs": [
"node",
"--async-stack-traces",
"--inspect-brk=9229",
"${workspaceFolder}/test/debug.js"
],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
"preLaunchTask": "npm: build"
// "preLaunchTask": "npm: build"
},
{
"type": "node",
Expand All @@ -114,34 +96,32 @@
"--inspect=9229",
"-r",
"./maintenance/esbuild-register.js",
"--conditions=@@dev",
"${workspaceFolder}/packages/config/maintenance/importConfig.ts",
"-dm -s zwa"
],
"console": "integratedTerminal",
"disableOptimisticBPs": true
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "Run Zniffer",
"port": 9229,
"runtimeExecutable": "yarn",
"runtimeArgs": [
"node",
"--async-stack-traces",
"-r",
"./maintenance/esbuild-register.js",
"--conditions=@@dev",
"${workspaceFolder}/test/run_zniffer.ts"
],
"env": {
"NODE_ENV": "development"
// "NO_CACHE": "true"
// "LOGLEVEL": "info"
},
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
"preLaunchTask": "npm: build"
"sourceMaps": true
// "preLaunchTask": "npm: build"
}
]
}
3 changes: 3 additions & 0 deletions ava.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ module.exports = {
extensions: ["ts"],
files: ["test/**", "**/*.test.ts", "!build/**"],
require: [path.join(__dirname, "./maintenance/esbuild-register.js")],
nodeArguments: [
"--conditions=@@dev",
],
};
24 changes: 20 additions & 4 deletions docs/api/CCs/Meter.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@
### `get`

```ts
async get(options?: MeterCCGetOptions): Promise<{ rateType: RateType; value: number; previousValue: MaybeNotKnown<number>; deltaTime: MaybeUnknown<number>; type: number; scale: MeterScale; } | undefined>;
async get(options?: MeterCCGetOptions): Promise<{ rateType: RateType; value: number; previousValue: MaybeNotKnown<number>; deltaTime: MaybeUnknown<number>; type: number; scale: import("/home/dominic/Repositories/node-zwave-js/packages/core/build/index").MeterScale; } | undefined>;
```

### `sendReport`

```ts
async sendReport(
options: MeterCCReportOptions,
): Promise<SupervisionResult | undefined>;
```

### `getAll`

```ts
async getAll(): Promise<{ rateType: RateType; value: number; previousValue: MaybeNotKnown<number>; deltaTime: MaybeUnknown<number>; type: number; scale: MeterScale; }[]>;
async getAll(accumulatedOnly: boolean = false): Promise<{ rateType: RateType; value: number; previousValue: MaybeNotKnown<number>; deltaTime: MaybeUnknown<number>; type: number; scale: import("/home/dominic/Repositories/node-zwave-js/packages/core/build/index").MeterScale; }[]>;
```

### `getSupported`
Expand All @@ -22,6 +30,14 @@ async getAll(): Promise<{ rateType: RateType; value: number; previousValue: Mayb
async getSupported(): Promise<Pick<MeterCCSupportedReport, "type" | "supportsReset" | "supportedScales" | "supportedRateTypes"> | undefined>;
```

### `sendSupportedReport`

```ts
async sendSupportedReport(
options: MeterCCSupportedReportOptions,
): Promise<void>;
```

### `reset`

```ts
Expand Down Expand Up @@ -50,7 +66,7 @@ async reset(
- **secret:** false
- **value type:** `"boolean"`

### `resetSingle(meterType: number)`
### `resetSingle(meterType: number, rateType: RateType, scale: number)`

```ts
{
Expand All @@ -61,7 +77,7 @@ async reset(
}
```

- **label:** `Reset (${string})`
- **label:** `Reset (${string})` | `Reset (Consumption, ${string})` | `Reset (Production, ${string})`
- **min. CC version:** 1
- **readable:** false
- **writeable:** true
Expand Down
1 change: 1 addition & 0 deletions docs/api/driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ interface ZWaveOptions extends ZWaveHostOptions {
*/
unresponsiveControllerRecovery?: boolean;
};
preferences: {
/**
* The preferred scales to use when querying sensors. The key is either:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
"extract-api": "FORCE_COLOR=1 yarn turbo run extract-api",
"accept-api": "yarn extract-api -- --local",
"monopack": "yarn exec monopack",
"check-references": "workspaces-to-typescript-project-references --check && workspaces-to-typescript-project-references --check --tsconfigPath tsconfig.build.json",
"sync-references": "workspaces-to-typescript-project-references && workspaces-to-typescript-project-references --tsconfigPath tsconfig.build.json && yarn fmt > /dev/null"
"check-references": "workspaces-to-typescript-project-references --check --tsconfigPath tsconfig.build.json",
"sync-references": "workspaces-to-typescript-project-references --tsconfigPath tsconfig.build.json && yarn fmt > /dev/null"
},
"readme": "README.md",
"config": {
Expand Down
7 changes: 5 additions & 2 deletions packages/cc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@
"publishConfig": {
"access": "public"
},
"main": "build/index.js",
"types": "build/index.d.ts",
"type": "commonjs",
"exports": {
".": {
"@@dev": "./src/index.ts",
"types": "./build/index.d.ts",
"default": "./build/index.js"
},
"./safe": {
"@@dev": "./src/index_safe.ts",
"types": "./build/index_safe.d.ts",
"default": "./build/index_safe.js"
},
"./cc": {
"@@dev": "./src/cc/index.ts",
"types": "./build/cc/index.d.ts",
"default": "./build/cc/index.js"
},
"./package.json": "./package.json",
"./*": {
"@@dev": "./src/cc/*.ts",
"types": "./build/cc/*.d.ts",
"default": "./build/cc/*.js"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/cc/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
"outDir": "build",
// Do not use the @@dev export for compiling
"customConditions": []
},
"references": [
{
Expand Down
23 changes: 0 additions & 23 deletions packages/cc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,6 @@
}
]
},
"references": [
{
"path": "../core"
},
{
"path": "../host"
},
{
"path": "../serial"
},
{
"path": "../shared"
},
{
"path": "../maintenance"
},
{
"path": "../testing"
},
{
"path": "../transformers"
}
],
"include": ["maintenance/**/*.ts", "src/**/*.ts"],
"exclude": ["build/**", "node_modules/**"]
}
5 changes: 3 additions & 2 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"publishConfig": {
"access": "public"
},
"main": "build/index.js",
"types": "build/index.d.ts",
"type": "commonjs",
"exports": {
".": {
"@@dev": "./src/index.ts",
"types": "./build/index.d.ts",
"default": "./build/index.js"
},
"./safe": {
"@@dev": "./src/index_safe.ts",
"types": "./build/index_safe.d.ts",
"default": "./build/index_safe.js"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/config/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
"outDir": "build",
// Do not use the @@dev export for compiling
"customConditions": []
},
"references": [
{
Expand Down
11 changes: 0 additions & 11 deletions packages/config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {},
"references": [
{
"path": "../core"
},
{
"path": "../shared"
},
{
"path": "../maintenance"
}
],
"include": ["maintenance/**/*.ts", "src/**/*.ts"],
"exclude": ["build/**", "node_modules/**"]
}
6 changes: 4 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
"publishConfig": {
"access": "public"
},
"main": "build/index.js",
"types": "build/index.d.ts",
"type": "commonjs",
"exports": {
".": {
"@@dev": "./src/index.ts",
"types": "./build/index.d.ts",
"default": "./build/index.js"
},
"./safe": {
"@@dev": "./src/index_safe.ts",
"types": "./build/index_safe.d.ts",
"default": "./build/index_safe.js"
},
"./test": {
"@@dev": "./src/index_test.ts",
"types": "./build/index_test.d.ts",
"default": "./build/index_test.js"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"rootDir": "src",
"outDir": "build",
// Some @internal members need to be accessed from other modules in this monorepo
"stripInternal": false
"stripInternal": false,
// Do not use the @@dev export for compiling
"customConditions": []
},
"references": [
{
Expand Down
5 changes: 0 additions & 5 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {},
"references": [
{
"path": "../shared"
}
],
"include": ["src/**/*.ts"],
"exclude": ["build/**", "node_modules/**"]
}
4 changes: 3 additions & 1 deletion packages/eslint-plugin/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
"outDir": "build",
// Do not use the @@dev export for compiling
"customConditions": []
},
"references": [
{
Expand Down
5 changes: 0 additions & 5 deletions packages/eslint-plugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
"compilerOptions": {
"types": ["node", "@typescript-eslint/utils"]
},
"references": [
{
"path": "../core"
}
],
"include": [
"src/**/*.ts"
],
Expand Down
Loading

0 comments on commit f47a5f2

Please sign in to comment.