@arcpkg/initiator 0.0.1-beta.0.1 → 0.0.1-beta.0.2

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.
package/js/routing.js CHANGED
@@ -205,7 +205,9 @@ export class RouteGenerator {
205
205
  }
206
206
  });
207
207
  let fileNamePart = fileName;
208
- if (fileName.startsWith('{') && fileName.endsWith('}')) {
208
+ const dynamique = (fileName.startsWith('{') && fileName.endsWith('}'))
209
+ || (fileName.startsWith('[') && fileName.endsWith(']'));
210
+ if (dynamique) {
209
211
  const paramName = fileName.substring(1, fileName.length - 1);
210
212
  fileNamePart = this.toPascalCase(paramName) + 'Params';
211
213
  }
@@ -227,7 +229,8 @@ export class RouteGenerator {
227
229
  return str
228
230
  .split(/[-_]/)
229
231
  .map(part => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
230
- .join('');
232
+ .join('')
233
+ .replace(/[^A-Za-z0-9_$]/g, '');
231
234
  }
232
235
  findLayoutComponent(filePath, moduleName) {
233
236
  const dir = path.dirname(filePath);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.1-beta.0.1",
6
+ "version": "0.0.1-beta.0.2",
7
7
  "description": "INITIATOR est un plugin d'initialisation intelligent pour les applications React avec TypeScript/Javascript. Il génère automatiquement les fichiers de configuration, de routage et d'internationalisation basés sur la structure de votre projet.",
8
8
  "main": "index.ts",
9
9
  "keywords": [],
package/routing.ts CHANGED
@@ -278,7 +278,9 @@ export class RouteGenerator {
278
278
  });
279
279
 
280
280
  let fileNamePart = fileName;
281
- if (fileName.startsWith('{') && fileName.endsWith('}')) {
281
+ const dynamique = (fileName.startsWith('{') && fileName.endsWith('}'))
282
+ || (fileName.startsWith('[') && fileName.endsWith(']'));
283
+ if (dynamique) {
282
284
 
283
285
  const paramName = fileName.substring(1, fileName.length - 1);
284
286
  fileNamePart = this.toPascalCase(paramName) + 'Params';
@@ -303,7 +305,9 @@ export class RouteGenerator {
303
305
  return str
304
306
  .split(/[-_]/)
305
307
  .map(part => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
306
- .join('');
308
+ .join('')
309
+
310
+ .replace(/[^A-Za-z0-9_$]/g, '');
307
311
  }
308
312
 
309
313
  private findLayoutComponent(filePath: string, moduleName?: string): string | undefined {