@justeattakeaway/pie-webc 0.6.22 → 0.6.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-breadcrumb';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-breadcrumb';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-webc",
3
3
  "description": "Component bundle containing all PIE web components",
4
- "version": "0.6.22",
4
+ "version": "0.6.24",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -24,6 +24,16 @@
24
24
  "require": "./react/assistive-text.js",
25
25
  "types": "./react/assistive-text.d.ts"
26
26
  },
27
+ "./components/breadcrumb.js": {
28
+ "import": "./components/breadcrumb.js",
29
+ "require": "./components/breadcrumb.js",
30
+ "types": "./components/breadcrumb.d.ts"
31
+ },
32
+ "./react/breadcrumb.js": {
33
+ "import": "./react/breadcrumb.js",
34
+ "require": "./react/breadcrumb.js",
35
+ "types": "./react/breadcrumb.d.ts"
36
+ },
27
37
  "./components/button.js": {
28
38
  "import": "./components/button.js",
29
39
  "require": "./components/button.js",
@@ -277,11 +287,12 @@
277
287
  "author": "Just Eat Takeaway.com - Design System Team",
278
288
  "license": "Apache-2.0",
279
289
  "devDependencies": {
280
- "@justeattakeaway/pie-components-config": "0.18.0",
290
+ "@justeattakeaway/pie-components-config": "0.18.1",
281
291
  "chalk": "5.3.0"
282
292
  },
283
293
  "dependencies": {
284
294
  "@justeattakeaway/pie-assistive-text": "0.8.5",
295
+ "@justeattakeaway/pie-breadcrumb": "0.0.1",
285
296
  "@justeattakeaway/pie-button": "1.4.0",
286
297
  "@justeattakeaway/pie-card": "0.23.1",
287
298
  "@justeattakeaway/pie-checkbox": "0.14.3",
@@ -297,7 +308,7 @@
297
308
  "@justeattakeaway/pie-notification": "0.12.15",
298
309
  "@justeattakeaway/pie-radio": "0.9.1",
299
310
  "@justeattakeaway/pie-radio-group": "0.7.3",
300
- "@justeattakeaway/pie-select": "0.1.0",
311
+ "@justeattakeaway/pie-select": "0.3.0",
301
312
  "@justeattakeaway/pie-spinner": "1.0.1",
302
313
  "@justeattakeaway/pie-switch": "1.2.2",
303
314
  "@justeattakeaway/pie-tag": "0.15.0",
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-breadcrumb/dist/react.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-breadcrumb/dist/react.js';
@@ -121,6 +121,25 @@ export class ComponentService {
121
121
  this.fs.writeFileSync(path, `${JSON.stringify(content, null, 2)}\n`);
122
122
  }
123
123
 
124
+ /**
125
+ * Finds sub components in a component directory.
126
+ * @param {string} componentPath - The path to the component directory.
127
+ * @returns {Array} - An array of sub component names found in the component's src directory.
128
+ */
129
+ findSubComponents (componentPath) {
130
+ const srcPath = this.path.join(componentPath, 'src');
131
+
132
+ if (!this.fs.existsSync(srcPath)) {
133
+ return [];
134
+ }
135
+
136
+ return this.fs.readdirSync(srcPath)
137
+ .filter((item) => {
138
+ const itemPath = this.path.join(srcPath, item);
139
+ return this.fs.statSync(itemPath).isDirectory() && item.startsWith('pie-');
140
+ });
141
+ }
142
+
124
143
  /**
125
144
  * Processes all components in the components directory, adding them to the pie-webc package.
126
145
  * @param {*} workingDir - The working directory from which the script is run.
@@ -171,6 +190,37 @@ export class ComponentService {
171
190
  this.writeFilesForComponent(componentName, target);
172
191
  });
173
192
 
193
+ const subComponents = this.findSubComponents(fullFolderPath);
194
+
195
+ if (subComponents.length > 0) {
196
+ subComponents.forEach((subComponent) => {
197
+ const subComponentName = subComponent.replace('pie-', '');
198
+
199
+ console.info(chalk.gray(`Adding sub-component: ${chalk.white(subComponent)}`));
200
+
201
+ const subComponentTargets = [
202
+ {
203
+ dir: componentsTargetDir,
204
+ exportPath: `${packageName}/dist/${subComponent}/index.js`,
205
+ },
206
+ {
207
+ dir: reactTargetDir,
208
+ exportPath: `${packageName}/dist/${subComponent}/react.js`,
209
+ }
210
+ ];
211
+
212
+ subComponentTargets.forEach((target) => {
213
+ this.writeFilesForComponent(subComponentName, target);
214
+ });
215
+
216
+ const subComponentExports = this.createPackageJsonExports(subComponentName);
217
+ newPackageJson.exports = {
218
+ ...newPackageJson.exports,
219
+ ...subComponentExports,
220
+ };
221
+ });
222
+ }
223
+
174
224
  const exportsObj = {
175
225
  ...newPackageJson.exports,
176
226
  ...this.createPackageJsonExports(componentName),