create-outsystems-astro 0.3.0 → 0.4.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.
- package/README.md +8 -5
- package/bin/cli.js +31 -7
- package/package.json +7 -2
- package/template/.github/workflows/test.yml +113 -0
- package/template/.gitignore +7 -0
- package/template/.prettierignore +11 -0
- package/template/.prettierrc +0 -0
- package/template/AGENTS.md +84 -30
- package/template/CLAUDE.md +1 -1
- package/template/GEMINI.md +2 -1
- package/template/astro.config.mjs +36 -12
- package/template/bun.lock +2346 -531
- package/template/deno.json +9 -0
- package/template/deno.lock +5316 -326
- package/template/eslint.config.mjs +171 -0
- package/template/output.ts +139 -136
- package/template/package-lock.json +15898 -3981
- package/template/package.json +92 -7
- package/template/patches/@analogjs+astro-angular+2.2.2.patch +13 -0
- package/template/patches/@angular+build+21.1.0.patch +55 -0
- package/template/playwright.config.ts +94 -0
- package/template/pnpm-lock.yaml +9111 -1860
- package/template/src/framework/angular/Counter.component.ts +62 -0
- package/template/src/framework/react/Counter.tsx +36 -35
- package/template/src/framework/vue/Counter.vue +11 -10
- package/template/src/lib/setCounterCount.ts +18 -0
- package/template/src/pages/angular/angular-counter.astro +15 -0
- package/template/src/pages/index.astro +3 -0
- package/template/src/pages/react/react-counter.astro +2 -2
- package/template/src/pages/vue/vue-counter.astro +2 -2
- package/template/src/styles/index.css +17 -16
- package/template/test/e2e/angular/angular-counter.spec.ts +25 -0
- package/template/test/e2e/react/react-counter.spec.ts +32 -0
- package/template/test/e2e/vue/vue-counter.spec.ts +32 -0
- package/template/test/integration/angular/Counter.component.spec.ts +50 -0
- package/template/test/integration/react/Counter.test.tsx +58 -0
- package/template/test/integration/vue/Counter.test.ts +93 -0
- package/template/test/setup-test-env-angular.ts +6 -0
- package/template/test/setup-test-env.ts +1 -0
- package/template/test/unit/lib/setCounterCount.test.ts +21 -0
- package/template/tsconfig.app.json +34 -0
- package/template/tsconfig.json +5 -9
- package/template/tsconfig.spec.json +12 -0
- package/template/types.d.ts +8 -0
- package/template/vitest.config.ts +56 -0
- package/template/yarn.lock +4602 -516
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ Generates [Astro Islands](https://docs.astro.build/en/concepts/islands/) for use
|
|
|
12
12
|
- Loading performance of component must be instant. The Astro Island will load after the page/screen has loaded since the initializer and tag will be loaded after.
|
|
13
13
|
|
|
14
14
|
## Current supported frameworks
|
|
15
|
+
- [Angular](https://analogjs.org/docs/packages/astro-angular/overview)
|
|
15
16
|
- [React](https://docs.astro.build/en/guides/integrations-guide/react/)
|
|
16
17
|
- [Vue](https://docs.astro.build/en/guides/integrations-guide/vue/)
|
|
17
18
|
|
|
@@ -46,6 +47,8 @@ dx create-outsystems-astro
|
|
|
46
47
|
|
|
47
48
|
This will create the generated files as well as an example component.
|
|
48
49
|
|
|
50
|
+
[View the full documentation](https://hs2323.github.io/create-outsystems-astro/guides/getting-started/).
|
|
51
|
+
|
|
49
52
|
## 🚀 Project Structure
|
|
50
53
|
|
|
51
54
|
```text
|
|
@@ -122,7 +125,7 @@ All commands are run from the root of the project, from a terminal:
|
|
|
122
125
|
| `bun install` | Installs dependencies |
|
|
123
126
|
| `bun run dev` | Starts local dev server at `localhost:4321` |
|
|
124
127
|
| `bun run build` | Build distribution to `./dist/` |
|
|
125
|
-
| `bun run output`
|
|
128
|
+
| `bun run output:bun` | Build OutSystems production site to `./output/` |
|
|
126
129
|
| `bun run preview` | Preview build locally, before creating output |
|
|
127
130
|
| `bun run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
128
131
|
| `bun run astro -- --help` | Get help using the Astro CLI |
|
|
@@ -131,10 +134,10 @@ All commands are run from the root of the project, from a terminal:
|
|
|
131
134
|
|
|
132
135
|
| Command | Action |
|
|
133
136
|
| :------------------------ | :----------------------------------------------- |
|
|
134
|
-
| `deno install` | Installs dependencies |
|
|
137
|
+
| `deno install && deno run postinstall` | Installs dependencies |
|
|
135
138
|
| `deno run dev` | Starts local dev server at `localhost:4321` |
|
|
136
139
|
| `deno run build` | Build distribution to `./dist/` |
|
|
137
|
-
| `deno run output`
|
|
140
|
+
| `deno run output:deno` | Build OutSystems production site to `./output/` |
|
|
138
141
|
| `deno run preview` | Preview build locally, before creating output |
|
|
139
142
|
| `deno run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
140
143
|
| `deno run astro -- --help` | Get help using the Astro CLI |
|
|
@@ -163,12 +166,12 @@ pnpm run output
|
|
|
163
166
|
|
|
164
167
|
### Bun
|
|
165
168
|
```bash
|
|
166
|
-
bun run output
|
|
169
|
+
bun run output:bun
|
|
167
170
|
```
|
|
168
171
|
|
|
169
172
|
### Deno
|
|
170
173
|
```bash
|
|
171
|
-
deno run output
|
|
174
|
+
deno run output:deno
|
|
172
175
|
```
|
|
173
176
|
|
|
174
177
|
This will create a set of files that will then need to be coverted to OutSystems components.
|
package/bin/cli.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
5
|
import prompts from "prompts";
|
|
6
|
-
import
|
|
6
|
+
import yargs from "yargs";
|
|
7
|
+
import { hideBin } from 'yargs/helpers';
|
|
8
|
+
import { execSync } from "node:child_process";
|
|
9
|
+
|
|
10
|
+
prompts.override(
|
|
11
|
+
yargs(hideBin(process.argv)).parse()
|
|
12
|
+
);
|
|
7
13
|
|
|
8
14
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
15
|
const __dirname = path.dirname(__filename);
|
|
10
16
|
|
|
11
17
|
const FRAMEWORKS = [
|
|
18
|
+
{ title: "Angular", value: "angular" },
|
|
12
19
|
{ title: "React", value: "react" },
|
|
13
20
|
{ title: "Vue", value: "vue" }
|
|
14
21
|
];
|
|
@@ -18,7 +25,7 @@ const LOCKFILES = {
|
|
|
18
25
|
yarn: ["yarn.lock"],
|
|
19
26
|
pnpm: ["pnpm-lock.yaml"],
|
|
20
27
|
bun: ["bun.lock"],
|
|
21
|
-
deno: ["deno.lock"]
|
|
28
|
+
deno: ["deno.lock", "deno.json"]
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
async function main() {
|
|
@@ -104,7 +111,9 @@ function deleteUnselectedFrameworkFolders(projectDir, selectedFrameworks) {
|
|
|
104
111
|
for (const framework of frameworksToDelete) {
|
|
105
112
|
const pageDir = path.join(projectDir, "src", "pages", framework);
|
|
106
113
|
const componentDir = path.join(projectDir, "src", "framework", framework);
|
|
107
|
-
|
|
114
|
+
const testDir = path.join(projectDir, "test", "integration", framework);
|
|
115
|
+
const testE2EDir = path.join(projectDir, "test", "e2e", framework);
|
|
116
|
+
|
|
108
117
|
if (fs.existsSync(pageDir)) {
|
|
109
118
|
console.log(`🗑️ Removing ${path.relative(projectDir, pageDir)}`);
|
|
110
119
|
fs.rmSync(pageDir, { recursive: true, force: true });
|
|
@@ -114,6 +123,17 @@ function deleteUnselectedFrameworkFolders(projectDir, selectedFrameworks) {
|
|
|
114
123
|
console.log(`🗑️ Removing ${path.relative(projectDir, componentDir)}`);
|
|
115
124
|
fs.rmSync(componentDir, { recursive: true, force: true });
|
|
116
125
|
}
|
|
126
|
+
|
|
127
|
+
if (fs.existsSync(testDir)) {
|
|
128
|
+
console.log(`🗑️ Removing ${path.relative(projectDir, testDir)}`);
|
|
129
|
+
fs.rmSync(testDir, { recursive: true, force: true });
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (fs.existsSync(testE2EDir)) {
|
|
133
|
+
console.log(`🗑️ Removing ${path.relative(projectDir, testE2EDir)}`);
|
|
134
|
+
fs.rmSync(testE2EDir, { recursive: true, force: true });
|
|
135
|
+
}
|
|
136
|
+
|
|
117
137
|
}
|
|
118
138
|
}
|
|
119
139
|
|
|
@@ -128,6 +148,10 @@ function updateAstroConfig(projectDir, selectedFrameworks) {
|
|
|
128
148
|
let content = fs.readFileSync(configPath, "utf-8");
|
|
129
149
|
|
|
130
150
|
const allFrameworks = {
|
|
151
|
+
angular: {
|
|
152
|
+
import: /import\s+angular\s+from\s+['"]@analogjs\/astro-angular['"];\s*\n?/,
|
|
153
|
+
integration: /angular\s*\(\s*\{[\s\S]*?\}\s*\)\s*,?\s*/
|
|
154
|
+
},
|
|
131
155
|
react: {
|
|
132
156
|
import: /import\s+react\s+from\s+['"]@astrojs\/react['"];\s*\n?/,
|
|
133
157
|
integration: /react\(\)\s*,?\s*/
|
|
@@ -202,7 +226,7 @@ function packageInstall(targetDir) {
|
|
|
202
226
|
yarn: "yarn",
|
|
203
227
|
pnpm: "pnpm install",
|
|
204
228
|
bun: "bun install",
|
|
205
|
-
deno: "deno install",
|
|
229
|
+
deno: "deno install && deno run postinsall",
|
|
206
230
|
unknown: "npm install"
|
|
207
231
|
}[packageManager];
|
|
208
232
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-outsystems-astro",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"description": "Create an OutSystems Astro Island project to import as a component into your OutSystems application",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/hs2323/create-outsystems-astro.git"
|
|
9
|
+
},
|
|
6
10
|
"bin": {
|
|
7
11
|
"create-outsystems-astro": "bin/cli.js"
|
|
8
12
|
},
|
|
@@ -23,6 +27,7 @@
|
|
|
23
27
|
],
|
|
24
28
|
"license": "MIT",
|
|
25
29
|
"dependencies": {
|
|
26
|
-
"prompts": "^2.4.2"
|
|
30
|
+
"prompts": "^2.4.2",
|
|
31
|
+
"yargs": "^18.0.0"
|
|
27
32
|
}
|
|
28
33
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [ main ]
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
NODE_VERSION: '24.13.0'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
|
|
13
|
+
format:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v6.0.1
|
|
19
|
+
|
|
20
|
+
- name: Use Node.js
|
|
21
|
+
uses: actions/setup-node@v6.2.0
|
|
22
|
+
with:
|
|
23
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
24
|
+
|
|
25
|
+
- name: Run format
|
|
26
|
+
run: npm run format
|
|
27
|
+
|
|
28
|
+
lint:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout code
|
|
33
|
+
uses: actions/checkout@v6.0.1
|
|
34
|
+
|
|
35
|
+
- name: Use Node.js
|
|
36
|
+
uses: actions/setup-node@v6.2.0
|
|
37
|
+
with:
|
|
38
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
39
|
+
|
|
40
|
+
- name: Run lint
|
|
41
|
+
run: npm run lint
|
|
42
|
+
|
|
43
|
+
security:
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
|
|
46
|
+
steps:
|
|
47
|
+
- name: Checkout code
|
|
48
|
+
uses: actions/checkout@v6.0.1
|
|
49
|
+
|
|
50
|
+
- name: Use Node.js
|
|
51
|
+
uses: actions/setup-node@v6.2.0
|
|
52
|
+
with:
|
|
53
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
54
|
+
|
|
55
|
+
- name: Run security check
|
|
56
|
+
run: npm audit
|
|
57
|
+
|
|
58
|
+
test:
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- name: Checkout code
|
|
63
|
+
uses: actions/checkout@v6.0.1
|
|
64
|
+
|
|
65
|
+
- name: Use Node.js
|
|
66
|
+
uses: actions/setup-node@v6.2.0
|
|
67
|
+
with:
|
|
68
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
69
|
+
|
|
70
|
+
- name: Install dependencies
|
|
71
|
+
run: npm ci
|
|
72
|
+
|
|
73
|
+
- name: Run tests
|
|
74
|
+
run: npm run test
|
|
75
|
+
|
|
76
|
+
teste2e:
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
|
|
79
|
+
steps:
|
|
80
|
+
- name: Checkout code
|
|
81
|
+
uses: actions/checkout@v6.0.1
|
|
82
|
+
|
|
83
|
+
- name: Use Node.js
|
|
84
|
+
uses: actions/setup-node@v6.2.0
|
|
85
|
+
with:
|
|
86
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
87
|
+
|
|
88
|
+
- name: Install dependencies
|
|
89
|
+
run: npm ci
|
|
90
|
+
|
|
91
|
+
- name: Install Playwright
|
|
92
|
+
run: npm run test:e2e:install
|
|
93
|
+
|
|
94
|
+
- name: Run tests
|
|
95
|
+
run: npm run test:e2e
|
|
96
|
+
|
|
97
|
+
typecheck:
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
|
|
100
|
+
steps:
|
|
101
|
+
- name: Checkout code
|
|
102
|
+
uses: actions/checkout@v6.0.1
|
|
103
|
+
|
|
104
|
+
- name: Use Node.js
|
|
105
|
+
uses: actions/setup-node@v6.2.0
|
|
106
|
+
with:
|
|
107
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
108
|
+
|
|
109
|
+
- name: Install dependencies
|
|
110
|
+
run: npm ci
|
|
111
|
+
|
|
112
|
+
- name: Run type check
|
|
113
|
+
run: npm run typecheck
|
package/template/.gitignore
CHANGED
|
File without changes
|
package/template/AGENTS.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
# OutSystems Astro Islands Development Instructions
|
|
2
2
|
|
|
3
3
|
## Project Context
|
|
4
|
+
|
|
4
5
|
- This is not an Astro project that will be deployed on its own. It is only used for the output generation.
|
|
5
6
|
- The output generation will be only client side. No server side rendering or server side components will be used.
|
|
6
7
|
- The Astro Islands can be used generated with the following frameworks:
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
- Angular - Documentation available at https://analogjs.org/docs/packages/astro-angular/overview
|
|
9
|
+
- React - Documentation available at https://docs.astro.build/en/guides/integrations-guide/react/
|
|
10
|
+
- Vue - https://docs.astro.build/en/guides/integrations-guide/vue/
|
|
9
11
|
- Prefer to use TypeScript when possible.
|
|
10
12
|
|
|
11
13
|
## OutSystems
|
|
14
|
+
|
|
12
15
|
- This project works for OutSystems 11 (O11) Reactive and OutSystems Developer Cloud (ODC). It does not work with OutSystems 11 Traditional projects.
|
|
13
16
|
- The documentation for importing a component into OutSystems 11 is availabe at https://hs2323.github.io/create-outsystems-astro/guides/outsystems/o11/.
|
|
14
17
|
- The documentation for importing a component into OutSystems 11 is availabe at https://hs2323.github.io/create-outsystems-astro/guides/outsystems/o11/.
|
|
@@ -16,32 +19,44 @@
|
|
|
16
19
|
## Development
|
|
17
20
|
|
|
18
21
|
### Starting project
|
|
22
|
+
|
|
23
|
+
- Documentation about usage of the generator is located at: https://hs2323.github.io/create-outsystems-astro/guides/astro/.
|
|
19
24
|
- The project can intialized from the Create OutSystems Astro package (https://www.npmjs.com/package/create-outsystems-astro).
|
|
20
|
-
- In this document, for any reference to running package manager script, the
|
|
25
|
+
- In this document, for any reference to running package manager script, the `PM` attribute should be replaced with whatever package manager the user is using.
|
|
21
26
|
|
|
22
27
|
### Pages
|
|
23
|
-
|
|
28
|
+
|
|
29
|
+
- The files in src/pages/\*.astro are used as a starting point and holds the components for generation. They can be tested by running `npm run dev`. That will show what the component looks like as rendered. The sample example pages are broken out by framework name (src/pages/react, src/pages/vue, etc). This page will house the component(s) entry points.
|
|
24
30
|
- When importing a component, the component must have the attribute of the client:only= + the framework name.
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
- React: `client:only="react"`.
|
|
32
|
+
- Vue: `client:only="vue"`.
|
|
33
|
+
- Angular: `client:visible`.
|
|
27
34
|
|
|
28
35
|
### Components
|
|
29
|
-
|
|
36
|
+
|
|
37
|
+
- The components live in the folder framework/[NAME]/ (src/framework/angular, src/framework/react and src/framework/vue ) with each framework having its own folder. The framework folder should stay in place as the components will be rendered from there. The Angular components will only be transformed by Astro if they are in the framework/angular folder.
|
|
30
38
|
|
|
31
39
|
### Parameters
|
|
40
|
+
|
|
32
41
|
- Parameters are assigned as attributes on the component. Each framework will then handle them as incoming parameters.
|
|
33
|
-
- OutSystems will pass in parameters already prepared for the
|
|
42
|
+
- OutSystems will pass in parameters already prepared for the ``<astro-island>`. It already has copied the Astro method of serialization in https://github.com/withastro/astro/blob/main/packages/astro/src/runtime/server/serialize.ts.
|
|
34
43
|
|
|
35
44
|
#### Slots
|
|
36
|
-
|
|
45
|
+
|
|
46
|
+
Astro slots can be sent in. A slot can be either the default one or the named one. Each framework handles slots differently. Slots can only be HTML elements and cannot be components of a framework.
|
|
37
47
|
|
|
38
48
|
##### React
|
|
39
|
-
|
|
49
|
+
|
|
50
|
+
- In React, slots are handled as props. The default slot is the `children` prop. A named slot will have the name of its slot as the parameter. For example, a slot with the following:
|
|
51
|
+
|
|
40
52
|
```js
|
|
41
|
-
<div slot="header">
|
|
53
|
+
<div slot="header">Header content</div>
|
|
42
54
|
```
|
|
43
|
-
|
|
44
|
-
|
|
55
|
+
|
|
56
|
+
will have the parameter named header.
|
|
57
|
+
|
|
58
|
+
- The slots are then rendered using the regular React rendering parameter method. With the following Astro component:
|
|
59
|
+
|
|
45
60
|
```js
|
|
46
61
|
---
|
|
47
62
|
import CounterComponent from '../../framework/react/Counter';
|
|
@@ -55,7 +70,9 @@ import CounterComponent from '../../framework/react/Counter';
|
|
|
55
70
|
</div>
|
|
56
71
|
</CounterComponent>
|
|
57
72
|
```
|
|
58
|
-
|
|
73
|
+
|
|
74
|
+
the slots can be used as:
|
|
75
|
+
|
|
59
76
|
```js
|
|
60
77
|
export default function Counter({
|
|
61
78
|
children,
|
|
@@ -67,41 +84,78 @@ export default function Counter({
|
|
|
67
84
|
|
|
68
85
|
return (
|
|
69
86
|
<>
|
|
70
|
-
|
|
87
|
+
{header}
|
|
71
88
|
<div>
|
|
72
89
|
{children}
|
|
73
90
|
</div>
|
|
74
91
|
</>
|
|
75
92
|
);
|
|
76
93
|
}
|
|
77
|
-
|
|
78
94
|
```
|
|
79
95
|
|
|
80
96
|
##### Vue
|
|
81
|
-
|
|
97
|
+
|
|
98
|
+
- In Vue, slots are handled as by using the <slot /> tag. The default slot is the is just <slot />. A named slot will have the name of its slot as an attribute such as <slot name="header" />. Placement of the slot will determine where the slot will render.
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
---
|
|
102
|
+
import CounterComponent from '../../framework/react/Counter';
|
|
103
|
+
---
|
|
104
|
+
<CounterComponent client:only="vue">
|
|
105
|
+
<div slot="header">
|
|
106
|
+
Counter
|
|
107
|
+
</div>
|
|
108
|
+
<div style="text-align: center;">
|
|
109
|
+
<p>Slot content!</p>
|
|
110
|
+
</div>
|
|
111
|
+
</CounterComponent>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
the slots can be used as:
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
<template>
|
|
118
|
+
<div>
|
|
119
|
+
<slot name="header" />
|
|
120
|
+
<slot />
|
|
121
|
+
</div>
|
|
122
|
+
</template>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
##### Angular
|
|
126
|
+
|
|
127
|
+
Angular does not support the use of slots. Any use of slots with Angular should be discouraged.
|
|
82
128
|
|
|
83
129
|
### Testing
|
|
84
|
-
|
|
130
|
+
|
|
131
|
+
- There is a preset set of testing tools, but can be changed after generation.
|
|
132
|
+
- The unit testing library setup is Vitest. The unit tests are located in `test/unit` folder.
|
|
133
|
+
- The integration testing library is Testing Library with an equivalent library per framework. Each framework is in its own folder in `test/integration/[FRAMEWORK]`.
|
|
134
|
+
- The end-to-end testing library is Playwright. Each framework is in its own folder in `test/e2e/[FRAMEWORK]`.
|
|
85
135
|
|
|
86
136
|
### Linting and formatting
|
|
87
|
-
|
|
137
|
+
|
|
138
|
+
- Prettier is currently added for formatting. ESLint is used for linting.
|
|
88
139
|
|
|
89
140
|
### TypeScript
|
|
141
|
+
|
|
90
142
|
- If using TypeScript, it is recommended to do a TypeScript check.
|
|
91
143
|
|
|
92
144
|
### Handlers
|
|
93
|
-
|
|
145
|
+
|
|
146
|
+
- Incoming functions from OutSystems cannot be passed as function handlers. The way that OutSystems will invoke them is by binding the function with the name to the `document` object of the page. Then it will pass in that name as a parameter. For example, if you need a function handler of `ShowMessage`, it will need to be called as `document[ShowMessage]`.
|
|
94
147
|
- Passing in basic text, number and boolean should be fine to the handler. Any array or object must be JSON stringified prior to being passed into the handler.
|
|
95
148
|
|
|
96
149
|
## Generating output
|
|
97
|
-
|
|
98
|
-
- The
|
|
99
|
-
-
|
|
150
|
+
|
|
151
|
+
- The `.env.template` must be copied over to `.env`.
|
|
152
|
+
- The name of the module/library/application where the component will live must be set in the `ASSET_URL` variable of the `.env` file.
|
|
153
|
+
- Run the command `PM run output`. This will run the Astro build and then run an additional step to generate the output necessary for importing into OutSystems.
|
|
100
154
|
- The output will be in the output/ folder. The contents are:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
155
|
+
- HTML file(s) \*.html:
|
|
156
|
+
- This will contain only the `<astro-island>` component. It will be necessary for the users to copy over the `component-url`, `renderer-url` and `opts`. The rest will either be custom built in OutSystems or not needed. The `uid` will be generated by OutSystems. The `component-export`, `client`, `ssr` and `await-children` will be automatically added in the OutSystems Islands module.
|
|
157
|
+
- The slot content will be converted and parsed in a way that can be then dropped in as text directly into the OutSystem parameter.
|
|
158
|
+
- JavaScript files \*.js:
|
|
159
|
+
- The JavaScript files will be imported as resources and then mapped as parameters when importing the Islands module.
|
|
160
|
+
- Asset files:
|
|
161
|
+
The `/assets` folder may contain images, stylesheets and other assets. For images, they should be copied in as resources into the module/library/component/application. Any CSS must be manually copied from the `.css` files and manually imported into the project or the block level CSS.
|
package/template/CLAUDE.md
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## Relationship to AGENTS.md
|
|
4
4
|
|
|
5
|
-
This document extends and specializes the general agent behaviors defined in [AGENTS.md](./AGENTS.md).
|
|
5
|
+
This document extends and specializes the general agent behaviors defined in [AGENTS.md](./AGENTS.md).
|
|
6
6
|
|
|
7
7
|
**Precedence Rule**: When there are conflicts or overlapping guidance between these documents, **CLAUDE.md takes precedence** for all interactions with Claude models. AGENTS.md provides the foundational agent patterns, while this document contains Claude-specific overrides and optimizations.
|
package/template/GEMINI.md
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Relationship to AGENTS.md
|
|
4
4
|
|
|
5
|
-
This document extends and specializes the general agent behaviors defined in [AGENTS.md](./AGENTS.md).
|
|
5
|
+
This document extends and specializes the general agent behaviors defined in [AGENTS.md](./AGENTS.md).
|
|
6
6
|
|
|
7
7
|
**Precedence Rule**: When there are conflicts or overlapping guidance between these documents, **GEMINI.md takes precedence** for all interactions with Gemini models. AGENTS.md provides the foundational agent patterns, while this document contains Gemini-specific overrides and optimizations.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
## Imported Context
|
|
12
|
+
|
|
12
13
|
@./AGENTS.md
|
|
@@ -1,29 +1,53 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import angular from "@analogjs/astro-angular";
|
|
3
|
+
import react from "@astrojs/react";
|
|
4
|
+
import vue from "@astrojs/vue";
|
|
5
|
+
import { defineConfig } from "astro/config";
|
|
5
6
|
|
|
6
7
|
// https://astro.build/config
|
|
7
8
|
export default defineConfig({
|
|
8
|
-
integrations: [react(), vue()],
|
|
9
9
|
build: {
|
|
10
|
-
|
|
10
|
+
inlineStylesheets: "always",
|
|
11
|
+
},
|
|
12
|
+
integrations: [
|
|
13
|
+
angular({
|
|
14
|
+
vite: {
|
|
15
|
+
transformFilter: (_code, id) => {
|
|
16
|
+
return id.includes("src/framework/angular");
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
react(),
|
|
21
|
+
vue(),
|
|
22
|
+
],
|
|
23
|
+
server: {
|
|
24
|
+
host: true,
|
|
25
|
+
port: 4321,
|
|
11
26
|
},
|
|
12
27
|
vite: {
|
|
13
28
|
build: {
|
|
14
29
|
rollupOptions: {
|
|
15
30
|
output: {
|
|
31
|
+
assetFileNames: `assets/[name]_[hash].[ext]`,
|
|
32
|
+
chunkFileNames: `[name]_[hash].js`,
|
|
33
|
+
entryFileNames: `[name]_[hash].js`,
|
|
16
34
|
manualChunks: (id) => {
|
|
17
|
-
if (id.includes(
|
|
18
|
-
return
|
|
35
|
+
if (id.includes("node_modules")) {
|
|
36
|
+
return "app.js";
|
|
19
37
|
}
|
|
20
|
-
return 'app.js';
|
|
21
38
|
},
|
|
22
|
-
entryFileNames: `[name]_[hash].js`,
|
|
23
|
-
chunkFileNames: `[name]_[hash].js`,
|
|
24
|
-
assetFileNames: `assets/[name]_[hash].[ext]`,
|
|
25
39
|
},
|
|
26
40
|
},
|
|
27
41
|
},
|
|
42
|
+
resolve: {
|
|
43
|
+
alias: {
|
|
44
|
+
fs: "node:fs",
|
|
45
|
+
http: "node:http",
|
|
46
|
+
https: "node:https",
|
|
47
|
+
os: "node:os",
|
|
48
|
+
path: "node:path",
|
|
49
|
+
url: "node:url",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
28
52
|
},
|
|
29
|
-
});
|
|
53
|
+
});
|