@justeattakeaway/pie-webc 0.6.21 → 0.6.23

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-select/dist/pie-option-group/index.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-option-group/index.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-option/index.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-option/index.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-select-option/index.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-select-option/index.js';
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.21",
4
+ "version": "0.6.23",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -154,6 +154,26 @@
154
154
  "require": "./react/notification.js",
155
155
  "types": "./react/notification.d.ts"
156
156
  },
157
+ "./components/option.js": {
158
+ "import": "./components/option.js",
159
+ "require": "./components/option.js",
160
+ "types": "./components/option.d.ts"
161
+ },
162
+ "./react/option.js": {
163
+ "import": "./react/option.js",
164
+ "require": "./react/option.js",
165
+ "types": "./react/option.d.ts"
166
+ },
167
+ "./components/option-group.js": {
168
+ "import": "./components/option-group.js",
169
+ "require": "./components/option-group.js",
170
+ "types": "./components/option-group.d.ts"
171
+ },
172
+ "./react/option-group.js": {
173
+ "import": "./react/option-group.js",
174
+ "require": "./react/option-group.js",
175
+ "types": "./react/option-group.d.ts"
176
+ },
157
177
  "./components/radio.js": {
158
178
  "import": "./components/radio.js",
159
179
  "require": "./components/radio.js",
@@ -277,7 +297,7 @@
277
297
  "author": "Just Eat Takeaway.com - Design System Team",
278
298
  "license": "Apache-2.0",
279
299
  "devDependencies": {
280
- "@justeattakeaway/pie-components-config": "0.18.0",
300
+ "@justeattakeaway/pie-components-config": "0.18.1",
281
301
  "chalk": "5.3.0"
282
302
  },
283
303
  "dependencies": {
@@ -287,7 +307,7 @@
287
307
  "@justeattakeaway/pie-checkbox": "0.14.3",
288
308
  "@justeattakeaway/pie-checkbox-group": "0.7.12",
289
309
  "@justeattakeaway/pie-chip": "0.10.2",
290
- "@justeattakeaway/pie-cookie-banner": "1.4.0",
310
+ "@justeattakeaway/pie-cookie-banner": "1.4.1",
291
311
  "@justeattakeaway/pie-divider": "1.2.1",
292
312
  "@justeattakeaway/pie-form-label": "0.14.5",
293
313
  "@justeattakeaway/pie-icon-button": "1.3.2",
@@ -297,7 +317,7 @@
297
317
  "@justeattakeaway/pie-notification": "0.12.15",
298
318
  "@justeattakeaway/pie-radio": "0.9.1",
299
319
  "@justeattakeaway/pie-radio-group": "0.7.3",
300
- "@justeattakeaway/pie-select": "0.1.0",
320
+ "@justeattakeaway/pie-select": "0.2.0",
301
321
  "@justeattakeaway/pie-spinner": "1.0.1",
302
322
  "@justeattakeaway/pie-switch": "1.2.2",
303
323
  "@justeattakeaway/pie-tag": "0.15.0",
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-option-group/react.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-option-group/react.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-option/react.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-option/react.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-select-option/react.js';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-select-option/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),