Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove __dirname from production code #7345

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

AlCalzone
Copy link
Member

@AlCalzone AlCalzone commented Oct 30, 2024

This PR removes a few instances where we were relying on the CommonJS builtin __dirname to determine the location of the current source file on disk.

This changes two paths:

  1. The default logfile location is now in the cwd of the current process, rather than the main entry point
  2. The cache files of the flasher utility are now in a subdirectory of the cwd of the current process.
  3. The cache files of the driver itself have been changed by fix: compile zwave-js version into source #7344 already

@AlCalzone AlCalzone added the breaking This is a breaking change label Oct 30, 2024
@AlCalzone AlCalzone changed the title refactor: remove __dirname from production code refactor: remove __dirname from production code Oct 30, 2024
@AlCalzone
Copy link
Member Author

@zwave-js-bot automerge

@zwave-js-bot zwave-js-bot enabled auto-merge (squash) October 30, 2024 12:43
@zwave-js-bot zwave-js-bot merged commit a20df05 into master Oct 30, 2024
15 checks passed
@zwave-js-bot zwave-js-bot deleted the no-dirname branch October 30, 2024 12:50
AlCalzone added a commit that referenced this pull request Oct 30, 2024
### Breaking changes · [Migration guide](https://zwave-js.github.io/node-zwave-js/#/getting-started/migrating/v14)
* Replace Node.js Buffer with `Uint8Array` portable replacement class `Bytes` (#7332)
* `zwave-js` no longer loops up the package version at runtime (#7344)
* Changed some paths to be relative to `process.cwd()` instead of source location (#7345)

### Config file changes
* Add Aeotec TriSensor 8 (#7342)

### Changes under the hood
* Removed dependency on `fs-extra` in favor of `node:fs/promises` (#7335)
* `@zwave-js/config` no longer loops up the package version at runtime (#7343)
AlCalzone added a commit that referenced this pull request Oct 30, 2024
### Breaking changes · [Migration guide](https://zwave-js.github.io/node-zwave-js/#/getting-started/migrating/v14)
* Replace Node.js Buffer with `Uint8Array` portable replacement class `Bytes` (#7332)
* `zwave-js` no longer loops up the package version at runtime (#7344)
* Changed some paths to be relative to `process.cwd()` instead of source location (#7345)

### Config file changes
* Add Aeotec TriSensor 8 (#7342)

### Changes under the hood
* Removed dependency on `fs-extra` in favor of `node:fs/promises` (#7335)
* `@zwave-js/config` no longer loops up the package version at runtime (#7343)
AlCalzone added a commit that referenced this pull request Nov 5, 2024
In this release, a lot of the internal API was refactored to decrease interdependencies. Technically this results in a huge list of breaking changes, but most of those should not affect any application, unless very low-level APIs are frequently used. For example, Z-Wave JS UI and Z-Wave JS Server had just two small breaks. In addition, Z-Wave JS is now released as hybrid ESM/CJS packages.

### Breaking changes · [Migration guide](https://zwave-js.github.io/node-zwave-js/#/getting-started/migrating/v14)
* `Driver.installConfigUpdates()` now requires the external config directory to be configured (#7365)
* Replace Node.js Buffer with `Uint8Array` portable replacement class `Bytes` (#7332)
* `zwave-js` no longer loops up the package version at runtime (#7344)
* Changed some paths to be relative to `process.cwd()` instead of source location (#7345)
* Decouple CCs and messages from host, split parsing and creation, split ZWaveNode class (#7305)

### Config file changes
* Add Aeotec TriSensor 8 (#7342)

### Changes under the hood
* Decorators have been migrated from the legacy specification to the accepted proposal (#7360)
* Transition modules to hybrid ESM/CJS, switch to vitest for testing (#7349)
* Removed dependency on `fs-extra` in favor of `node:fs/promises` (#7335)
* `@zwave-js/config` no longer loops up the package version at runtime (#7343)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This is a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants