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 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-outsystems-astro",
3
3
  "type": "module",
4
- "version": "0.4.2",
4
+ "version": "0.5.0",
5
5
  "description": "Create an OutSystems Astro Island project to import as a component into your OutSystems application",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,5 +1,6 @@
1
1
  .github/
2
2
  bun.lock
3
+ deno.json
3
4
  deno.lock
4
5
  dist/
5
6
  node_modules/
@@ -8,4 +9,4 @@ package-lock.json
8
9
  package.json
9
10
  patches/
10
11
  pnpm-lock.yaml
11
- yarn.lock
12
+ yarn.lock
@@ -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/[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.
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 ``<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.
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/[FRAMEWORK]`.
134
- - The end-to-end testing library is Playwright. Each framework is in its own folder in `test/e2e/[FRAMEWORK]`.
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 `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]`.
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