Skip to content

Commit

Permalink
Merge branch 'master' of github.com:TiendaNube/nimbus-design-system i…
Browse files Browse the repository at this point in the history
…nto fix-sidebar
  • Loading branch information
nachozullo committed Apr 15, 2024
2 parents ed3b10b + 5c60baa commit 77c42e0
Show file tree
Hide file tree
Showing 12 changed files with 4,665 additions and 2,791 deletions.
3 changes: 3 additions & 0 deletions .scripts/build-components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { ComponentsBuilder } from "@nimbus-ds/scripts/src";

new ComponentsBuilder().exec();
2 changes: 1 addition & 1 deletion .scripts/build-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ try {
"@nimbus-ds/webpack",
];

const command = packageBuilder.getCommmandBuildNPM(
const command = packageBuilder.getCommandBuildNPM(
packagesToBuild,
removePackages
);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
},
"scripts": {
"build": "yarn build:packages",
"build:packages": "yarn build:tokens && yarn build:icons && babel-node -x .ts ./.scripts/build-packages",
"build:packages": "yarn build:tokens && yarn build:icons && yarn build:components && babel-node -x .ts ./.scripts/build-packages",
"build:components": "babel-node -x .ts ./.scripts/build-components",
"build:docs": "babel-node -x .ts ./.scripts/json-documentation",
"build:icons": "turbo run build --filter=@nimbus-ds/icons",
"build:tokens": "turbo run build --filter=@nimbus-ds/tokens",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nimbus-ds/scripts",
"version": "1.4.0",
"version": "1.5.0",
"license": "MIT",
"main": "dist/index.js",
"files": [
Expand Down
32 changes: 32 additions & 0 deletions packages/core/scripts/src/componentsBuilder/ComponentsBuilder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import fs from "fs";
import { PackageBuilder } from "../packageBuilder";

export class ComponentsBuilder {
private PATH = "./packages/react/src/";

private getComponentsFrom(path: string): string[] {
const components = [];
const atomicComponents = fs.readdirSync(`${this.PATH}/${path}`);
for (const atomicComponent of atomicComponents) {
const packageJsonContent = fs.readFileSync(
`${this.PATH}/${path}/${atomicComponent}/package.json`,
"utf-8"
);
const json = JSON.parse(packageJsonContent);
const componentName = json.name;
components.push(componentName);
}
return components;
}

public exec() {
const atomicComponents = this.getComponentsFrom("atomic");
const compositeComponents = this.getComponentsFrom("composite");

const componentsCommand = [...atomicComponents, ...compositeComponents]
.map((component) => `--filter=${component}`)
.join(" ");

new PackageBuilder().execCommand(`turbo run build ${componentsCommand}`);
}
}
1 change: 1 addition & 0 deletions packages/core/scripts/src/componentsBuilder/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./ComponentsBuilder";
1 change: 1 addition & 0 deletions packages/core/scripts/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./docgen";
export * from "./packageBuilder";
export * from "./componentsBuilder";
2 changes: 1 addition & 1 deletion packages/core/scripts/src/packageBuilder/PackageBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class PackageBuilder {
);
}

public getCommmandBuildNPM(
public getCommandBuildNPM(
packages: string[],
removePackages: string[] = []
): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nimbus-ds/components",
"version": "5.5.2-rc.7",
"version": "5.5.2",
"license": "MIT",
"main": "dist/index.js",
"files": [
Expand Down
6 changes: 2 additions & 4 deletions packages/react/src/atomic/Popover/src/popover.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ describe("GIVEN <Popover />", () => {
false,
expect.objectContaining({
isTrusted: false,
}),
"click"
})
);
});

Expand All @@ -169,8 +168,7 @@ describe("GIVEN <Popover />", () => {
true,
expect.objectContaining({
isTrusted: false,
}),
"click"
})
);
});
});
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export * from "@nimbus-ds/title";
export * from "@nimbus-ds/toast";
export * from "@nimbus-ds/toggle";
export * from "@nimbus-ds/tooltip";

// composite
export * from "@nimbus-ds/accordion";
export * from "@nimbus-ds/alert";
Expand Down
Loading

0 comments on commit 77c42e0

Please sign in to comment.