Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict = true
fetch-timeout = 1000000
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ This repository contains the **ThingsBoard Extension** codebase. Follow the inst
## Prerequisites

- [Node.js](https://nodejs.org/) >= 20.20.0
- [Yarn](https://classic.yarnpkg.com/) >= 1.22.22 (Yarn Classic)
- [pnpm](https://pnpm.io/) >= 9

## Getting Started

Install dependencies and start the development server:

```bash
yarn install
yarn start
pnpm install
pnpm start
```

### Configure the Widget
Expand All @@ -30,7 +30,7 @@ yarn start
To compile the project for production, run:

```bash
yarn build
pnpm build
```

The compiled file will be generated at: `target/generated-resources/thingsboard-extension-widgets.js`
Expand Down Expand Up @@ -92,19 +92,19 @@ import { WidgetConfig } from '@shared/public-api';

## External Dependencies

To use third-party packages from the npm registry, add them using the Yarn package manager:
To use third-party packages from the npm registry, add them using the pnpm package manager:

```bash
yarn add <package-name>
pnpm add <package-name>
```

**Example:**

```bash
yarn add lodash
pnpm add lodash
```

For non-standard registries or alternative installation methods, please refer to the [Yarn Documentation](https://classic.yarnpkg.com/en/docs/cli/add).
For non-standard registries or alternative installation methods, please refer to the [pnpm Documentation](https://pnpm.io/cli/add).

## Examples

Expand Down
12 changes: 6 additions & 6 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ This migration updates the codebase from Angular 18 to Angular 20.

1. **Pull the latest changes** from the corresponding `release/*` branch and install dependencies:
```bash
yarn install
pnpm install
```

2. **Migrate all components to standalone** (converts modules to standalone components):
```bash
yarn ng update @angular/core --migrate-only --from=18.0.0 --to=20.3.20
pnpm ng update @angular/core --migrate-only --from=18.0.0 --to=20.3.20
```

3. **Update Angular Material component styles**:
```bash
yarn ng update @angular/material --migrate-only --from=18.0.0 --to=20.2.14
pnpm ng update @angular/material --migrate-only --from=18.0.0 --to=20.2.14
```

4. **Optional — Update control flow syntax** (converts to the new `@if`, `@for`, and `@switch` block syntax):
```bash
yarn ng generate @angular/core:control-flow
pnpm ng generate @angular/core:control-flow
```

### Verify

After completing the migration, make sure the project builds and runs correctly:

```bash
yarn build
yarn start
pnpm build
pnpm start
```
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}
},
"cli": {
"packageManager": "yarn",
"packageManager": "pnpm",
"analytics": false,
"schematicCollections": [
"@angular-eslint/schematics"
Expand Down
7 changes: 2 additions & 5 deletions builders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
},
"dependencies": {
"@angular-devkit/architect": "0.2003.20",
"chokidar": "^4.0.3",
"express": "^5.2.1",
"rxjs": "~7.8.2",
"typescript": "~5.9.3"
},
Expand All @@ -24,12 +26,7 @@
"ng-packagr": "20.3.2",
"tslib": "^2.7.0",
"tsickle": "^0.46.3",
"express": "^5.2.1",
"http": "^0.0.0",
"typescript": "~5.9.3"
},
"resolutions": {
"express": "5.2.1",
"@types/express": "5.0.3"
}
}
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
"description": "ThingsBoard Extension Widgets",
"scripts": {
"ng": "ng",
"start": "yarn run build:scss && node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve",
"build": "yarn run build:scss && node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng build && node install.js",
"start": "pnpm run build:scss && node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve",
"build": "pnpm run build:scss && node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng build && node install.js",
"build:scss": "npx postcss ./src/app/scss/style.scss -o ./src/app/scss/style.comp.scss",
"prepare": "patch-package",
"lint": "ng lint"
},
"engines": {
"node": ">=20.20.0",
"yarn": ">=1.22.22 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
"pnpm": ">=9"
},
"dependencies": {
"chart.js": "3.3.2",
"echarts": "https://github.com/thingsboard/echarts/archive/5.5.2-TB.tar.gz",
"echarts": "github:thingsboard/echarts#5.5.2-TB",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm rejects GitHub /archive/*.tar.gz URLs because they lack a reproducible integrity hash — the tarball content can change without the URL changing. The github: shorthand points to a specific git ref, which pnpm can lock by commit SHA in pnpm-lock.yaml, giving both integrity and reproducibility

"flot": "https://github.com/thingsboard/flot.git#0.9-work",
"flot.curvedlines": "https://github.com/MichaelZinsmaier/CurvedLines.git#master",
"moment": "^2.30.1",
Expand Down Expand Up @@ -50,7 +49,7 @@
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-replace": "6.0.3",
"@rollup/plugin-terser": "1.0.0",
"@tb/custom-builder": "file:./builders",
"@tb/custom-builder": "workspace:*",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@tb/custom-builder": "workspace:*" is the pnpm-native way to reference a local workspace package (declared in pnpm-workspace.yaml). The file:./builders form still works, but workspace: is the correct pnpm primitive.

The * here is not a semver wildcard — it does not mean "any version from the registry." It is part of the workspace: protocol and means "use whatever version this package is at in the local workspace." pnpm will refuse to resolve it from the registry entirely; if the package is missing from the workspace, the install fails hard.

For an internal package like @tb/custom-builder that is never published to npm, workspace:* vs workspace:^ vs workspace:~ are all equivalent — the difference only matters at publish time (pnpm rewrites workspace: to the exact pinned
version in the published package.json*), which never happens here.

If anything, workspace:* is safer than file:: pnpm actively enforces the workspace contract, whereas file: is a plain path reference with no such guarantee.

"angular-eslint": "20.7.0",
"autoprefixer": "^10.4.23",
"eslint": "9.39.4",
Expand All @@ -75,9 +74,5 @@
"typescript": "~5.9.3",
"typescript-eslint": "8.54.0",
"zone.js": "~0.15.1"
},
"resolutions": {
"tinymce": "6.8.6",
"rxjs": "7.8.2"
}
}
2 changes: 1 addition & 1 deletion patches/ng-packagr+20.3.2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ index 81d96de..1f4fa79 100644
+ plugins = [(0, plugin_node_resolve_1.default)(), (0, file_loader_plugin_1.fileLoaderPlugin)(opts.fileCache, ['.js', '/index.js']), (0, plugin_json_1.default)(), replace({preventAssignment: true, 'process.env.NODE_ENV': '"production"'}), commonJs(), terser()];
}
// Create the bundle
+ const data = fs.readFileSync(path.join(__dirname, '../../../../thingsboard/src/app/modules/common/modules-map.ts'), 'utf8');
+ const data = fs.readFileSync(path.resolve(process.cwd(), 'node_modules/thingsboard/src/app/modules/common/modules-map.ts'), 'utf8');
+ const reg = /private modulesMap: {\[key: string\]: any} = {([^;]*)};/gsm;
+ const regMatch = reg.exec(data);
+ const modulesStr = regMatch[1];
Expand Down
Loading