create-outsystems-astro 0.4.2 → 0.5.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 +5 -0
- package/package.json +1 -1
- package/template/.prettierignore +2 -1
- package/template/AGENTS.md +58 -5
- package/template/bun.lock +590 -332
- package/template/deno.json +8 -4
- package/template/deno.lock +893 -717
- package/template/eslint.config.mjs +1 -0
- package/template/package-lock.json +1961 -1876
- package/template/package.json +77 -38
- package/template/pnpm-lock.yaml +1607 -1175
- package/template/src/framework/angular/Counter.component.ts +25 -13
- package/template/src/framework/react/Counter.tsx +41 -9
- package/template/src/framework/vue/Counter.vue +49 -14
- package/template/src/pages/angular/angular-counter.astro +21 -5
- package/template/src/pages/react/react-counter.astro +45 -8
- package/template/src/pages/vue/vue-counter.astro +45 -4
- package/template/src/stores/.gitkeep +0 -0
- package/template/src/styles/index.css +65 -0
- package/template/test/e2e/react/react-counter.spec.ts +12 -2
- package/template/test/e2e/vue/vue-counter.spec.ts +12 -2
- package/template/test/integration/angular/Counter.component.spec.ts +1 -1
- package/template/test/integration/react/Counter.test.tsx +35 -10
- package/template/test/integration/vue/Counter.test.ts +42 -4
- package/template/yarn.lock +2597 -722
- /package/template/patches/{@analogjs+astro-angular+2.2.2.patch → @analogjs+astro-angular+2.3.0.patch} +0 -0
- /package/template/patches/{@angular+build+21.1.0.patch → @angular+build+21.2.0.patch} +0 -0
package/README.md
CHANGED
|
@@ -93,6 +93,7 @@ All commands are run from the root of the project, from a terminal:
|
|
|
93
93
|
| `npm run preview` | Preview build locally, before creating output |
|
|
94
94
|
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
95
95
|
| `npm run astro -- --help` | Get help using the Astro CLI |
|
|
96
|
+
| `npm run audit:npm` | Run audit of modules |
|
|
96
97
|
|
|
97
98
|
### Yarn
|
|
98
99
|
|
|
@@ -105,6 +106,7 @@ All commands are run from the root of the project, from a terminal:
|
|
|
105
106
|
| `yarn run preview` | Preview build locally, before creating output |
|
|
106
107
|
| `yarn run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
107
108
|
| `yarn run astro -- --help` | Get help using the Astro CLI |
|
|
109
|
+
| `yarn run audit:yarn` | Run audit of modules |
|
|
108
110
|
|
|
109
111
|
### pnpm
|
|
110
112
|
|
|
@@ -117,6 +119,7 @@ All commands are run from the root of the project, from a terminal:
|
|
|
117
119
|
| `pnpm run preview` | Preview build locally, before creating output |
|
|
118
120
|
| `pnpm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
119
121
|
| `pnpm run astro -- --help` | Get help using the Astro CLI |
|
|
122
|
+
| `pnpm run audit:pnpm` | Run audit of modules |
|
|
120
123
|
|
|
121
124
|
### Bun
|
|
122
125
|
|
|
@@ -129,6 +132,7 @@ All commands are run from the root of the project, from a terminal:
|
|
|
129
132
|
| `bun run preview` | Preview build locally, before creating output |
|
|
130
133
|
| `bun run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
131
134
|
| `bun run astro -- --help` | Get help using the Astro CLI |
|
|
135
|
+
| `bun run audit:bun` | Run audit of modules |
|
|
132
136
|
|
|
133
137
|
### Deno
|
|
134
138
|
|
|
@@ -141,6 +145,7 @@ All commands are run from the root of the project, from a terminal:
|
|
|
141
145
|
| `deno run preview` | Preview build locally, before creating output |
|
|
142
146
|
| `deno run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
143
147
|
| `deno run astro -- --help` | Get help using the Astro CLI |
|
|
148
|
+
| `deno run audit:deno` | Run audit of modules |
|
|
144
149
|
|
|
145
150
|
## Getting Started
|
|
146
151
|
Delete the demo application under the ```src``` folder and being to build your own application.
|
package/package.json
CHANGED
package/template/.prettierignore
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
- The project can intialized from the Create OutSystems Astro package (https://www.npmjs.com/package/create-outsystems-astro).
|
|
25
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.
|
|
26
26
|
|
|
27
|
+
In OutSystems 11, the Islands library is available at https://www.outsystems.com/forge/component-overview/22857/islands-o11.
|
|
28
|
+
|
|
29
|
+
In OutSystems Developer Cloud, the Islands library is available at https://www.outsystems.com/forge/component-overview/22960/islands-odc.
|
|
30
|
+
|
|
27
31
|
### Pages
|
|
28
32
|
|
|
29
33
|
- 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.
|
|
@@ -34,12 +38,12 @@
|
|
|
34
38
|
|
|
35
39
|
### Components
|
|
36
40
|
|
|
37
|
-
- The components live in the folder framework/
|
|
41
|
+
- 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.
|
|
38
42
|
|
|
39
43
|
### Parameters
|
|
40
44
|
|
|
41
45
|
- Parameters are assigned as attributes on the component. Each framework will then handle them as incoming parameters.
|
|
42
|
-
- OutSystems will pass in parameters already prepared for the
|
|
46
|
+
- 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.
|
|
43
47
|
|
|
44
48
|
#### Slots
|
|
45
49
|
|
|
@@ -126,12 +130,61 @@ the slots can be used as:
|
|
|
126
130
|
|
|
127
131
|
Angular does not support the use of slots. Any use of slots with Angular should be discouraged.
|
|
128
132
|
|
|
133
|
+
### Nano Stores
|
|
134
|
+
|
|
135
|
+
The Nano Stores library - https://github.com/nanostores/nanostores - is supported for both sharing state between different Islands or from OutSystems to an Island. This could be used in place of a parameter, but parameters should be the default method.
|
|
136
|
+
|
|
137
|
+
The current supported OutSystems Nano Stores module only suports Atoms and Maps. It can either subscribe to an Atom or Map. It can also listen to Keys of a Map.
|
|
138
|
+
|
|
139
|
+
The OutSystems 11 library is called Lightweight State Manager - https://www.outsystems.com/forge/component-overview/23528/lightweight-state-manager-o11 is available in the O11 Forge.
|
|
140
|
+
|
|
141
|
+
The OutSystems Developer Cloud library is called Lightweight State Manager and is available in the ODC Forge.
|
|
142
|
+
|
|
143
|
+
Nano Stores are currently supported for only React - https://github.com/nanostores/react and Vue - https://github.com/nanostores/vue. The Angular 21 library does not yet support them.
|
|
144
|
+
|
|
145
|
+
In OutSystems, the store will be on the Window object. The Islands component will then have to access it from there.
|
|
146
|
+
|
|
147
|
+
#### React
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
import { useStore } from "@nanostores/react";
|
|
151
|
+
import { useState } from "react";
|
|
152
|
+
|
|
153
|
+
export default function Counter({}) {
|
|
154
|
+
const nanoStoreValue = useStore(window.Stores["MyGreatStore"]);
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<>
|
|
158
|
+
<div>
|
|
159
|
+
<strong>Nano Store value:</strong>
|
|
160
|
+
<div>{nanoStoreValue}</div>
|
|
161
|
+
</div>
|
|
162
|
+
</>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### Vue
|
|
168
|
+
|
|
169
|
+
```vue
|
|
170
|
+
<script setup lang="ts">
|
|
171
|
+
import { useStore } from "@nanostores/vue";
|
|
172
|
+
const nanoStoreValue = useStore(window.Stores["MyGreatStore"]);
|
|
173
|
+
</script>
|
|
174
|
+
|
|
175
|
+
<template>
|
|
176
|
+
<div>
|
|
177
|
+
<div>{{ nanoStoreValue }}</div>
|
|
178
|
+
</div>
|
|
179
|
+
</template>
|
|
180
|
+
```
|
|
181
|
+
|
|
129
182
|
### Testing
|
|
130
183
|
|
|
131
184
|
- There is a preset set of testing tools, but can be changed after generation.
|
|
132
185
|
- 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/
|
|
134
|
-
- The end-to-end testing library is Playwright. Each framework is in its own folder in `test/e2e/
|
|
186
|
+
- The integration testing library is Testing Library with an equivalent library per framework. Each framework is in its own folder in `test/integration/{FRAMEWORK}`.
|
|
187
|
+
- The end-to-end testing library is Playwright. Each framework is in its own folder in `test/e2e/{FRAMEWORK}`.
|
|
135
188
|
|
|
136
189
|
### Linting and formatting
|
|
137
190
|
|
|
@@ -143,7 +196,7 @@ Angular does not support the use of slots. Any use of slots with Angular should
|
|
|
143
196
|
|
|
144
197
|
### Handlers
|
|
145
198
|
|
|
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 `
|
|
199
|
+
- 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 `window` 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 `window[ShowMessage]`.
|
|
147
200
|
- 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.
|
|
148
201
|
|
|
149
202
|
## Generating output
|