create-outsystems-astro 0.5.0 → 0.7.0

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.
Files changed (61) hide show
  1. package/README.md +50 -11
  2. package/bin/cli.js +71 -5
  3. package/package.json +1 -1
  4. package/template/.prettierignore +2 -0
  5. package/template/.prettierrc +4 -0
  6. package/template/AGENTS.md +145 -22
  7. package/template/astro.config.mjs +15 -2
  8. package/template/bun.lock +529 -716
  9. package/template/deno.json +14 -7
  10. package/template/deno.lock +1100 -688
  11. package/template/eslint.config.mjs +43 -0
  12. package/template/output.ts +14 -2
  13. package/template/package-lock.json +3404 -3080
  14. package/template/package.json +59 -85
  15. package/template/patches/{@angular+build+21.2.0.patch → @angular+build+21.2.1.patch} +1 -10
  16. package/template/patches-deno/playwright+1.58.2.patch +26 -0
  17. package/template/playwright.config.ts +1 -1
  18. package/template/pnpm-lock.yaml +2041 -1584
  19. package/template/pnpm-workspace.yaml +6 -0
  20. package/template/src/framework/angular/{Counter.component.ts → Demo.component.ts} +12 -5
  21. package/template/src/framework/angular/Store.component.ts +24 -0
  22. package/template/src/framework/preact/Demo.tsx +86 -0
  23. package/template/src/framework/preact/Store.tsx +31 -0
  24. package/template/src/framework/react/{Counter.tsx → Demo.tsx} +23 -17
  25. package/template/src/framework/react/Store.tsx +31 -0
  26. package/template/src/framework/svelte/Demo.svelte +74 -0
  27. package/template/src/framework/svelte/Store.svelte +22 -0
  28. package/template/src/framework/vue/{Counter.vue → Demo.vue} +7 -9
  29. package/template/src/framework/vue/Store.vue +28 -0
  30. package/template/src/images/angular.png +0 -0
  31. package/template/src/images/preact.png +0 -0
  32. package/template/src/images/react.png +0 -0
  33. package/template/src/images/svelte.png +0 -0
  34. package/template/src/images/vue.png +0 -0
  35. package/template/src/pages/angular/angular-demo.astro +42 -0
  36. package/template/src/pages/multi/store.astro +22 -0
  37. package/template/src/pages/preact/preact-demo.astro +66 -0
  38. package/template/src/pages/react/react-demo.astro +66 -0
  39. package/template/src/pages/svelte/svelte-demo.astro +63 -0
  40. package/template/src/pages/vue/vue-demo.astro +61 -0
  41. package/template/src/stores/framework.ts +10 -0
  42. package/template/src/styles/index.css +4 -0
  43. package/template/svelte.config.js +5 -0
  44. package/template/test/e2e/angular/angular-counter.spec.ts +7 -1
  45. package/template/test/e2e/preact/preact-counter.spec.ts +42 -0
  46. package/template/test/e2e/react/react-counter.spec.ts +2 -2
  47. package/template/test/e2e/svelte/svelte-counter.spec.ts +42 -0
  48. package/template/test/e2e/vue/vue-counter.spec.ts +2 -2
  49. package/template/test/integration/angular/{Counter.component.spec.ts → Demo.component.spec.ts} +6 -6
  50. package/template/test/integration/preact/Demo.test.tsx +84 -0
  51. package/template/test/integration/react/{Counter.test.tsx → Demo.test.tsx} +10 -9
  52. package/template/test/integration/svelte/Demo.test.ts +81 -0
  53. package/template/test/integration/svelte/Demo.wrapper.svelte +27 -0
  54. package/template/test/integration/vue/{Counter.test.ts → Demo.test.ts} +9 -9
  55. package/template/tsconfig.json +0 -1
  56. package/template/vitest.config.ts +29 -2
  57. package/template/yarn.lock +2311 -2251
  58. package/template/src/pages/angular/angular-counter.astro +0 -31
  59. package/template/src/pages/react/react-counter.astro +0 -58
  60. package/template/src/pages/vue/vue-counter.astro +0 -62
  61. /package/template/patches/{@analogjs+astro-angular+2.3.0.patch → @analogjs+astro-angular+2.3.1.patch} +0 -0
@@ -2,6 +2,7 @@ import { fixupPluginRules } from "@eslint/compat";
2
2
  import pluginJs from "@eslint/js";
3
3
  import markdown from "@eslint/markdown";
4
4
  import angular from "angular-eslint";
5
+ import preactConfig from "eslint-config-preact";
5
6
  import eslintConfigPrettier from "eslint-config-prettier";
6
7
  import eslintPluginAstro from "eslint-plugin-astro";
7
8
  import importPlugin from "eslint-plugin-import";
@@ -11,11 +12,17 @@ import perfectionist from "eslint-plugin-perfectionist";
11
12
  import playwright from "eslint-plugin-playwright";
12
13
  import pluginReact from "eslint-plugin-react";
13
14
  import pluginReactHooks from "eslint-plugin-react-hooks";
15
+ import svelte from "eslint-plugin-svelte";
14
16
  import testingLibrary from "eslint-plugin-testing-library";
15
17
  import pluginVue from "eslint-plugin-vue";
16
18
  import globals from "globals";
19
+ import svelteParser from "svelte-eslint-parser";
17
20
  import tseslint from "typescript-eslint";
18
21
 
22
+ // 1. Import the Preact config normally
23
+
24
+ import svelteConfig from "./svelte.config.js";
25
+
19
26
  // Fix for Bun and eslint-plugin-perfectionist.
20
27
  if (!Array.prototype.toSorted) {
21
28
  Array.prototype.toSorted = function (compareFn) {
@@ -58,6 +65,7 @@ export default [
58
65
  },
59
66
  },
60
67
  },
68
+ // ... rest of your config remains identical
61
69
  {
62
70
  files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
63
71
  plugins: {
@@ -169,4 +177,39 @@ export default [
169
177
  "@angular-eslint/no-input-rename": "off",
170
178
  },
171
179
  })),
180
+ ...svelte.configs["flat/recommended"].map((config) => ({
181
+ ...config,
182
+ files: ["**/*.svelte"],
183
+ languageOptions: {
184
+ ...config.languageOptions,
185
+ parser: svelteParser,
186
+ parserOptions: {
187
+ ...config.languageOptions?.parserOptions,
188
+ extraFileExtensions: [".svelte"],
189
+ parser: tseslint.parser,
190
+ svelteConfig,
191
+ },
192
+ },
193
+ })),
194
+ {
195
+ files: ["src/framework/preact/**/*.{js,ts,jsx,tsx}"],
196
+ languageOptions: {
197
+ globals: {
198
+ ...globals.browser,
199
+ },
200
+ parserOptions: {
201
+ ecmaFeatures: {
202
+ jsx: true,
203
+ },
204
+ },
205
+ },
206
+ rules: {
207
+ ...preactConfig.rules,
208
+ },
209
+ settings: {
210
+ react: {
211
+ version: "19.0",
212
+ },
213
+ },
214
+ },
172
215
  ];
@@ -100,14 +100,26 @@ function formatAstroIslandAttributes(html: string): string {
100
100
  function getAllFilesWithExtension(dir: string, ext: string): string[] {
101
101
  let results: string[] = [];
102
102
 
103
+ if (!fs.existsSync(dir)) return results;
104
+
103
105
  for (const file of fs.readdirSync(dir)) {
104
106
  const filePath = path.join(dir, file);
105
107
  const stat = fs.statSync(filePath);
106
108
 
107
109
  if (stat.isDirectory()) {
108
110
  results = results.concat(getAllFilesWithExtension(filePath, ext));
109
- } else if (filePath.endsWith(ext)) {
110
- results.push(filePath);
111
+ } else {
112
+ // Check if it ends with the extension (e.g., .js)
113
+ // AND does not contain the string ".astro"
114
+ const isTargetExtension = filePath.endsWith(ext);
115
+ const isAstroInternal = file.includes(".astro");
116
+
117
+ if (isTargetExtension && !isAstroInternal) {
118
+ results.push(filePath);
119
+ } else if (isTargetExtension && isAstroInternal) {
120
+ // Optional: Log what we are filtering out for peace of mind
121
+ console.log(`🚫 Filtering out internal Astro script: ${file}`);
122
+ }
111
123
  }
112
124
  }
113
125