Skip to content

Commit

Permalink
chore: update packages scope from @bee-q to @beeq (#863)
Browse files Browse the repository at this point in the history
This PR aligns the package scope name with the current Design System name. Projects using the old package scope should update their dependencies accordingly, depending on the package used, e.g: `npm i @beeq/{core,react}`

Since this only changes the NPM scope of each package, we decided to target it as a path version rather than release a new major version only because of that. We are human, and sometimes mistakes happen, so we apologize for any trouble and inconvenience this could cause you.
  • Loading branch information
dgonzalezr authored Feb 21, 2024
1 parent 584c786 commit f74ac29
Show file tree
Hide file tree
Showing 35 changed files with 127 additions and 119 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CHANGELOG
# Changelog

All notable changes to this project will be documented in this file.

Expand Down
67 changes: 36 additions & 31 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/beeq-angular/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@nx/dependency-checks": [
"error",
{
"ignoredDependencies": ["@bee-q/core", "tslib"],
"ignoredDependencies": ["@beeq/core", "tslib"],
"ignoredFiles": ["{projectRoot}/esbuild.config.{js,ts,mjs,mts}"]
}
]
Expand Down
26 changes: 13 additions & 13 deletions packages/beeq-angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ An Angular-specific wrapper on top of BEEQ web components that enables NG_VALUE_
- install the package

```
npm install @bee-q/angular
npm install @beeq/angular
```

- update the package

```
npm install @bee-q/angular@latest
npm install @beeq/angular@latest
```

if the `@bee-q/core` package is added to your `package.json` should update both
if the `@beeq/core` package is added to your `package.json` should update both

```
npm install @bee-q/{core,angular}
npm install @beeq/{core,angular}
```

## Setup

### Call `defineCustomElements`

The BEEQ core package includes the main function that is used to load the components in the collection and makes Angular aware of the custom tags of the web components. That function is called `defineCustomElements()` and it is handled by the `@bee-q/angular` wrapper itself. Yet, **if you need to support older versions of Microsoft Edge and Internet Explorer, you can apply the polyfills as follow**:
The BEEQ core package includes the main function that is used to load the components in the collection and makes Angular aware of the custom tags of the web components. That function is called `defineCustomElements()` and it is handled by the `@beeq/angular` wrapper itself. Yet, **if you need to support older versions of Microsoft Edge and Internet Explorer, you can apply the polyfills as follow**:

```ts
// main.ts

import { applyPolyfills, defineCustomElements } from '@bee-q/core/dist/loader';
import { applyPolyfills, defineCustomElements } from '@beeq/core/dist/loader';

...

Expand All @@ -43,7 +43,7 @@ applyPolyfills().then(() => {

### Add BEEQ styles and assets

> ❗️The icons SVG are shipped in a separate folder. Projects will need to include `node_modules/@bee-q/core/dist/bee-q/svg` in their build and try to make it in a certain way that it respond to: `http://<domain>/svg`
> ❗️The icons SVG are shipped in a separate folder. Projects will need to include `node_modules/@beeq/core/dist/beeq/svg` in their build and try to make it in a certain way that it respond to: `http://<domain>/svg`
```json
/** angular.json */
Expand All @@ -64,13 +64,13 @@ applyPolyfills().then(() => {
"src/assets",
{
"glob": "**/*",
"input": "node_modules/@bee-q/core/dist/bee-q/svg",
"input": "node_modules/@beeq/core/dist/beeq/svg",
"output": "/svg/"
}
],
"styles": [
"src/styles.scss",
"node_modules/@bee-q/core/dist/bee-q/bee-q.css"
"node_modules/@beeq/core/dist/beeq/beeq.css"
],
...
}
Expand All @@ -84,17 +84,17 @@ applyPolyfills().then(() => {
BEEQ styles can be also imported into your application's main style file:

```css
@import '~@bee-q/core/dist/bee-q/bee-q.css';
@import '~@beeq/core/dist/beeq/beeq.css';
```

### Add the BEEQ Angular module to your application module

You will be able to add BEEQ web components to your app by adding the `BeeQModule` exported by `@bee-q/angular`:
You will be able to add BEEQ web components to your app by adding the `BeeQModule` exported by `@beeq/angular`:

```ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BeeQModule } from '@bee-q/angular';
import { BeeQModule } from '@beeq/angular';

import { AppComponent } from './app.component';

Expand All @@ -118,7 +118,7 @@ To enable two-way binding and the use of [ngModel] within BEEQ form components,
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BeeQModule, BooleanValueAccessor, TextValueAccessor } from '@bee-q/angular';
import { BeeQModule, BooleanValueAccessor, TextValueAccessor } from '@beeq/angular';

import { AppComponent } from './app.component';

Expand Down
2 changes: 1 addition & 1 deletion packages/beeq-angular/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"lib": {
"entryFile": "src/index.ts"
},
"allowedNonPeerDependencies": ["@bee-q/core", "jsonc-parser"]
"allowedNonPeerDependencies": ["@beeq/core", "jsonc-parser"]
}
4 changes: 2 additions & 2 deletions packages/beeq-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@bee-q/angular",
"name": "@beeq/angular",
"version": "1.0.0",
"license": "Apache-2.0",
"description": "Angular specific wrapper for BEEQ Design System components",
"main": "dist/esm2015/index.js",
"module": "dist/esm2015/index.js",
"types": "index.d.ts",
"dependencies": {
"@bee-q/core": "*",
"@beeq/core": "*",
"tslib": "^2.6.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/beeq-angular/src/beeq.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CommonModule } from '@angular/common';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { defineCustomElements } from '@bee-q/core/dist/loader';
import { defineCustomElements } from '@beeq/core/dist/loader';

import { DIRECTIVES } from './directives';

Expand Down
2 changes: 1 addition & 1 deletion packages/beeq-react/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@nx/dependency-checks": [
"error",
{
"ignoredDependencies": ["@bee-q/core", "react", "react-dom"],
"ignoredDependencies": ["@beeq/core", "react", "react-dom"],
"ignoredFiles": ["{projectRoot}/esbuild.config.{js,ts,mjs,mts}"]
}
]
Expand Down
14 changes: 7 additions & 7 deletions packages/beeq-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ A lightweight utility that wraps BEEQ custom elements ("web components") so they
- install the package

```
npm install @bee-q/react
npm install @beeq/react
```

- update the package

```
npm install @bee-q/react@latest
npm install @beeq/react@latest
```

if `@bee-q/core` package is installed you should update both
if `@beeq/core` package is installed you should update both

```
npm install @bee-q/{core,react}
npm install @beeq/{core,react}
```

### Add BEEQ styles and assets

Make sure that BEEQ main style is imported into your application's main style file:

```css
@import "@bee-q/core/dist/bee-q/bee-q";
@import "@beeq/core/dist/beeq/beeq";
```

> ❗️The icons SVG are shipped in a separate folder. Depending on your React stack, your project will need to include `node_modules/@bee-q/core/dist/bee-q/svg` in the build in such a way that it respond to: `http://<domain>/svg`
> ❗️The icons SVG are shipped in a separate folder. Depending on your React stack, your project will need to include `node_modules/@beeq/core/dist/beeq/svg` in the build in such a way that it respond to: `http://<domain>/svg`
## Usage

```jsx
import React from 'react';
import { BqButton } from '@bee-q/react';
import { BqButton } from '@beeq/react';

function App() {
const handleButtonClick = (ev: CustomEvent) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/beeq-react/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */
export default {
displayName: 'bee-q-react',
displayName: 'beeq-react',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
Expand All @@ -11,5 +11,5 @@ export default {
'^.+\\.[tj]sx?$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/packages/bee-q-react',
coverageDirectory: '../../coverage/packages/beeq-react',
};
4 changes: 2 additions & 2 deletions packages/beeq-react/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@bee-q/react",
"name": "@beeq/react",
"version": "1.0.0",
"license": "Apache-2.0",
"description": "React specific wrapper for BEEQ Design System components",
"main": "./src/index.js",
"module": "./src/index.js",
"types": "./src/index.d.ts",
"dependencies": {
"@bee-q/core": "*"
"@beeq/core": "*"
},
"peerDependencies": {
"react": ">=18.0.0",
Expand Down
Loading

0 comments on commit f74ac29

Please sign in to comment.