-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:TiendaNube/nimbus-design-system i…
…nto fix-sidebar
- Loading branch information
Showing
12 changed files
with
4,665 additions
and
2,791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { ComponentsBuilder } from "@nimbus-ds/scripts/src"; | ||
|
||
new ComponentsBuilder().exec(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/core/scripts/src/componentsBuilder/ComponentsBuilder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./ComponentsBuilder"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./docgen"; | ||
export * from "./packageBuilder"; | ||
export * from "./componentsBuilder"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.