create-outsystems-astro 0.4.2 → 0.6.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 (39) hide show
  1. package/README.md +5 -0
  2. package/bin/cli.js +6 -1
  3. package/package.json +1 -1
  4. package/template/.prettierignore +4 -1
  5. package/template/.prettierrc +4 -0
  6. package/template/AGENTS.md +104 -15
  7. package/template/astro.config.mjs +2 -0
  8. package/template/bun.lock +621 -656
  9. package/template/deno.json +1 -5
  10. package/template/deno.lock +1303 -977
  11. package/template/eslint.config.mjs +19 -0
  12. package/template/output.ts +14 -2
  13. package/template/package-lock.json +3949 -4042
  14. package/template/package.json +62 -58
  15. package/template/pnpm-lock.yaml +2431 -1927
  16. package/template/pnpm-workspace.yaml +6 -0
  17. package/template/src/framework/angular/Counter.component.ts +25 -13
  18. package/template/src/framework/react/Counter.tsx +41 -9
  19. package/template/src/framework/svelte/Counter.svelte +77 -0
  20. package/template/src/framework/vue/Counter.vue +49 -14
  21. package/template/src/pages/angular/angular-counter.astro +30 -10
  22. package/template/src/pages/react/react-counter.astro +58 -16
  23. package/template/src/pages/svelte/svelte-counter.astro +63 -0
  24. package/template/src/pages/vue/vue-counter.astro +61 -15
  25. package/template/src/stores/.gitkeep +0 -0
  26. package/template/src/styles/index.css +65 -0
  27. package/template/svelte.config.js +5 -0
  28. package/template/test/e2e/react/react-counter.spec.ts +12 -2
  29. package/template/test/e2e/svelte/svelte-counter.spec.ts +42 -0
  30. package/template/test/e2e/vue/vue-counter.spec.ts +12 -2
  31. package/template/test/integration/angular/Counter.component.spec.ts +1 -1
  32. package/template/test/integration/react/Counter.test.tsx +35 -10
  33. package/template/test/integration/svelte/Counter.test.ts +81 -0
  34. package/template/test/integration/svelte/SlotCounter.wrapper.svelte +27 -0
  35. package/template/test/integration/vue/Counter.test.ts +42 -4
  36. package/template/vitest.config.ts +17 -2
  37. package/template/yarn.lock +3656 -2059
  38. /package/template/patches/{@analogjs+astro-angular+2.2.2.patch → @analogjs+astro-angular+2.3.0.patch} +0 -0
  39. /package/template/patches/{@angular+build+21.1.0.patch → @angular+build+21.2.0.patch} +0 -0
@@ -11,11 +11,15 @@ import perfectionist from "eslint-plugin-perfectionist";
11
11
  import playwright from "eslint-plugin-playwright";
12
12
  import pluginReact from "eslint-plugin-react";
13
13
  import pluginReactHooks from "eslint-plugin-react-hooks";
14
+ import svelte from "eslint-plugin-svelte";
14
15
  import testingLibrary from "eslint-plugin-testing-library";
15
16
  import pluginVue from "eslint-plugin-vue";
16
17
  import globals from "globals";
18
+ import svelteParser from "svelte-eslint-parser";
17
19
  import tseslint from "typescript-eslint";
18
20
 
21
+ import svelteConfig from "./svelte.config.js";
22
+
19
23
  // Fix for Bun and eslint-plugin-perfectionist.
20
24
  if (!Array.prototype.toSorted) {
21
25
  Array.prototype.toSorted = function (compareFn) {
@@ -59,6 +63,7 @@ export default [
59
63
  },
60
64
  },
61
65
  {
66
+ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
62
67
  plugins: {
63
68
  "react-hooks": pluginReactHooks,
64
69
  },
@@ -168,4 +173,18 @@ export default [
168
173
  "@angular-eslint/no-input-rename": "off",
169
174
  },
170
175
  })),
176
+ ...svelte.configs["flat/recommended"].map((config) => ({
177
+ ...config,
178
+ files: ["**/*.svelte"],
179
+ languageOptions: {
180
+ ...config.languageOptions,
181
+ parser: svelteParser, // 2. Explicitly set the Svelte parser
182
+ parserOptions: {
183
+ ...config.languageOptions?.parserOptions,
184
+ extraFileExtensions: [".svelte"],
185
+ parser: tseslint.parser, // 3. Use TS parser for the <script> block
186
+ svelteConfig,
187
+ },
188
+ },
189
+ })),
171
190
  ];
@@ -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