@justeattakeaway/pie-webc 0.0.0-snapshot-release-20250313112810 → 0.0.0-snapshot-release-20250314134647

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-select-option';
@@ -0,0 +1 @@
1
+ export * from '@justeattakeaway/pie-select/dist/pie-select-option';
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.0.0-snapshot-release-20250313112810",
4
+ "version": "0.0.0-snapshot-release-20250314134647",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/justeattakeaway/pie",
@@ -184,6 +184,16 @@
184
184
  "require": "./react/select.js",
185
185
  "types": "./react/select.d.ts"
186
186
  },
187
+ "./components/select-option.js": {
188
+ "import": "./components/select-option.js",
189
+ "require": "./components/select-option.js",
190
+ "types": "./components/select-option.d.ts"
191
+ },
192
+ "./react/select-option.js": {
193
+ "import": "./react/select-option.js",
194
+ "require": "./react/select-option.js",
195
+ "types": "./react/select-option.d.ts"
196
+ },
187
197
  "./components/spinner.js": {
188
198
  "import": "./components/spinner.js",
189
199
  "require": "./components/spinner.js",
@@ -287,7 +297,7 @@
287
297
  "@justeattakeaway/pie-checkbox": "0.14.3",
288
298
  "@justeattakeaway/pie-checkbox-group": "0.7.12",
289
299
  "@justeattakeaway/pie-chip": "0.10.2",
290
- "@justeattakeaway/pie-cookie-banner": "1.4.0",
300
+ "@justeattakeaway/pie-cookie-banner": "1.4.1",
291
301
  "@justeattakeaway/pie-divider": "1.2.1",
292
302
  "@justeattakeaway/pie-form-label": "0.14.5",
293
303
  "@justeattakeaway/pie-icon-button": "1.3.2",
@@ -297,7 +307,7 @@
297
307
  "@justeattakeaway/pie-notification": "0.12.15",
298
308
  "@justeattakeaway/pie-radio": "0.9.1",
299
309
  "@justeattakeaway/pie-radio-group": "0.7.3",
300
- "@justeattakeaway/pie-select": "0.0.0-snapshot-release-20250313112810",
310
+ "@justeattakeaway/pie-select": "0.0.0-snapshot-release-20250314134647",
301
311
  "@justeattakeaway/pie-spinner": "1.0.1",
302
312
  "@justeattakeaway/pie-switch": "1.2.2",
303
313
  "@justeattakeaway/pie-tag": "0.15.0",
@@ -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}`,
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),