@autometa/app 0.4.2 → 1.0.0-rc.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/CHANGELOG.md DELETED
@@ -1,234 +0,0 @@
1
- # @autometa/app
2
-
3
- ## 0.4.2
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [8df323c]
8
- - @autometa/injection@0.1.5
9
-
10
- ## 0.4.1
11
-
12
- ### Patch Changes
13
-
14
- - da669a3: feat: disposable injectables
15
- - Updated dependencies [da669a3]
16
- - @autometa/injection@0.1.4
17
-
18
- ## 0.4.0
19
-
20
- ### Minor Changes
21
-
22
- - 7440e9f: feat: new group based hooks for feature, rule, outline and examples
23
-
24
- ## 0.3.5
25
-
26
- ### Patch Changes
27
-
28
- - 1d3f84e: fix: getApp returned app without di container reference
29
-
30
- ## 0.3.4
31
-
32
- ### Patch Changes
33
-
34
- - Updated dependencies [2aee2a4]
35
- - @autometa/injection@0.1.3
36
-
37
- ## 0.3.3
38
-
39
- ### Patch Changes
40
-
41
- - 536004e: fix: injection errors and http client hooks
42
-
43
- - The new dependency injection library sometimes returned class prototypes instead of class instances due to inconsistent caching of decorated types.
44
- - HTTP client hooks were not executing when certain builder methods were called.
45
-
46
- - bac2661: fix: world not defined on app
47
- - Updated dependencies [536004e]
48
- - @autometa/injection@0.1.2
49
-
50
- ## 0.3.2
51
-
52
- ### Patch Changes
53
-
54
- - Updated dependencies [d563916]
55
- - @autometa/injection@0.1.1
56
-
57
- ## 0.3.1
58
-
59
- ### Patch Changes
60
-
61
- - 6c4bb8d: fix: getApp function not defined
62
-
63
- ## 0.3.0
64
-
65
- ### Minor Changes
66
-
67
- - 98d911f: feat: replace tsyringe with custom DI solution
68
-
69
- ### Patch Changes
70
-
71
- - Updated dependencies [98d911f]
72
- - @autometa/injection@0.1.0
73
-
74
- ## 0.2.4
75
-
76
- ### Patch Changes
77
-
78
- - Updated dependencies [3fe2ad4]
79
- - @autometa/errors@0.2.2
80
- - @autometa/asserters@0.1.8
81
- - @autometa/fixture-proxies@0.1.3
82
- - @autometa/phrases@0.1.12
83
-
84
- ## 0.2.3
85
-
86
- ### Patch Changes
87
-
88
- - Updated dependencies [3493bb6]
89
- - @autometa/errors@0.2.1
90
- - @autometa/asserters@0.1.7
91
- - @autometa/fixture-proxies@0.1.2
92
- - @autometa/phrases@0.1.11
93
-
94
- ## 0.2.2
95
-
96
- ### Patch Changes
97
-
98
- - 8ec0cdc: fix: allow whitelist for tracked types, don't auto-track World
99
- - Updated dependencies [8ec0cdc]
100
- - @autometa/fixture-proxies@0.1.1
101
-
102
- ## 0.2.1
103
-
104
- ### Patch Changes
105
-
106
- - Updated dependencies [0c070cb]
107
- - @autometa/asserters@0.1.6
108
- - @autometa/phrases@0.1.10
109
-
110
- ## 0.2.0
111
-
112
- ### Minor Changes
113
-
114
- - 8f116d9: feat: access tracker and error catching proxies on fixtures
115
-
116
- ### Patch Changes
117
-
118
- - Updated dependencies [b5ce008]
119
- - Updated dependencies [8f116d9]
120
- - @autometa/errors@0.2.0
121
- - @autometa/fixture-proxies@0.1.0
122
- - @autometa/asserters@0.1.5
123
- - @autometa/phrases@0.1.9
124
-
125
- ## 0.1.13
126
-
127
- ### Patch Changes
128
-
129
- - 04ed85d: feat: added HTP client based on axios
130
- - Updated dependencies [04ed85d]
131
- - @autometa/asserters@0.1.4
132
- - @autometa/phrases@0.1.8
133
- - @autometa/errors@0.1.4
134
-
135
- ## 0.1.12
136
-
137
- ### Patch Changes
138
-
139
- - 4ee4e99: Fixes strings like 'abc2bd' being parsed as NaN in `primitive` expression type. Not supports comma and decimal delimters (EU, US respectively
140
-
141
- ## 0.1.11
142
-
143
- ### Patch Changes
144
-
145
- - Release Bump
146
- - Updated dependencies
147
- - @autometa/phrases@0.1.7
148
-
149
- ## 0.1.10
150
-
151
- ### Patch Changes
152
-
153
- - Updated dependencies [85050386]
154
- - @autometa/phrases@0.1.6
155
-
156
- ## 0.1.9
157
-
158
- ### Patch Changes
159
-
160
- - ddbdb401: Fix: World object not resolving correctly with DI
161
-
162
- ## 0.1.8
163
-
164
- ### Patch Changes
165
-
166
- - 53f958e1: Fix: steps not executing onStepEnded event when an error was thrown
167
- - Updated dependencies [53f958e1]
168
- - @autometa/asserters@0.1.3
169
- - @autometa/errors@0.1.3
170
- - @autometa/phrases@0.1.5
171
-
172
- ## 0.1.7
173
-
174
- ### Patch Changes
175
-
176
- - Fix: bad dist published
177
-
178
- ## 0.1.6
179
-
180
- ### Patch Changes
181
-
182
- - f167963f: Fix: typo in AutometaWorld 'dfromPhrase' -> 'fromPhrase'
183
-
184
- ## 0.1.5
185
-
186
- ### Patch Changes
187
-
188
- - Updated dependencies [12bd4b1e]
189
- - @autometa/errors@0.1.2
190
- - @autometa/asserters@0.1.2
191
- - @autometa/phrases@0.1.4
192
-
193
- ## 0.1.4
194
-
195
- ### Patch Changes
196
-
197
- - 4a16497d: fix(scopes): hooks not executing without tag expressions
198
-
199
- ## 0.1.3
200
-
201
- ### Patch Changes
202
-
203
- - Updated dependencies [0cc7f6aa]
204
- - @autometa/phrases@0.1.3
205
-
206
- ## 0.1.2
207
-
208
- ### Patch Changes
209
-
210
- - e8f02f3a: Small bug fixes, unit test coverage, tag expressions
211
- - Updated dependencies [e8f02f3a]
212
- - @autometa/phrases@0.1.2
213
- - @autometa/errors@0.1.1
214
- - @autometa/asserters@0.1.1
215
-
216
- ## 0.1.1
217
-
218
- ### Patch Changes
219
-
220
- - Updated dependencies [bf23fc4]
221
- - @autometa/phrases@0.1.1
222
-
223
- ## 0.1.0
224
-
225
- ### Minor Changes
226
-
227
- - 554b77e: Releasing packages
228
-
229
- ### Patch Changes
230
-
231
- - Updated dependencies [554b77e]
232
- - @autometa/asserters@0.1.0
233
- - @autometa/errors@0.1.0
234
- - @autometa/phrases@0.1.0
package/dist/esm/index.js DELETED
@@ -1,41 +0,0 @@
1
- // src/autometa-app.ts
2
- var AutometaApp = class {
3
- };
4
-
5
- // src/autometa-world.ts
6
- var AutometaWorld = class {
7
- };
8
-
9
- // src/get-app.ts
10
- import { v4 } from "uuid";
11
- import { Container, defineContainerContext } from "@autometa/injection";
12
- function getApp(appType, containerName = v4()) {
13
- const context = defineContainerContext(containerName);
14
- const container = new Container(context);
15
- const app = container.get(appType);
16
- app.di = container;
17
- return app;
18
- }
19
-
20
- // src/decorators/app-type.ts
21
- import { metadata } from "@autometa/injection";
22
- function AppType(container, world, environment = "default") {
23
- const env = environment ?? "default";
24
- return (target) => {
25
- metadata(target).set({
26
- key: "world",
27
- class: world
28
- });
29
- container[env] = {
30
- app: target,
31
- world
32
- };
33
- };
34
- }
35
- export {
36
- AppType,
37
- AutometaApp,
38
- AutometaWorld,
39
- getApp
40
- };
41
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/autometa-app.ts","../../src/autometa-world.ts","../../src/get-app.ts","../../src/decorators/app-type.ts"],"sourcesContent":["import { World } from \"./fixtures.typings\";\nexport abstract class AutometaApp {\n id: string;\n [key: string]: unknown;\n world: World;\n}\n","export class AutometaWorld {}\n","import { AutometaApp } from \"./autometa-app\";\nimport { Class } from \"@autometa/types\";\nimport { v4 } from \"uuid\";\nimport { Container, defineContainerContext } from \"@autometa/injection\";\nimport { App } from \"./fixtures.typings\";\n\nexport function getApp<T extends AutometaApp>(\n appType: Class<T>,\n containerName = v4()\n): App {\n const context = defineContainerContext(containerName);\n const container = new Container(context);\n const app = container.get<App>(appType);\n app.di = container;\n return app;\n}\n","import { Class } from \"@autometa/types\";\nimport { App, World, AutometaWorld } from \"..\";\nimport { metadata } from \"@autometa/injection\";\nexport function AppType(\n container: Record<string, { app: Class<App>; world: Class<World> }>,\n world: Class<AutometaWorld>,\n environment = \"default\"\n) {\n const env = environment ?? \"default\";\n return (target: Class<unknown>) => {\n metadata(target).set({\n key: \"world\",\n class: world,\n });\n container[env] = {\n app: target as Class<App>,\n world: world as Class<World>,\n };\n };\n}\n"],"mappings":";AACO,IAAe,cAAf,MAA2B;AAIlC;;;ACLO,IAAM,gBAAN,MAAoB;AAAC;;;ACE5B,SAAS,UAAU;AACnB,SAAS,WAAW,8BAA8B;AAG3C,SAAS,OACd,SACA,gBAAgB,GAAG,GACd;AACL,QAAM,UAAU,uBAAuB,aAAa;AACpD,QAAM,YAAY,IAAI,UAAU,OAAO;AACvC,QAAM,MAAM,UAAU,IAAS,OAAO;AACtC,MAAI,KAAK;AACT,SAAO;AACT;;;ACbA,SAAS,gBAAgB;AAClB,SAAS,QACd,WACA,OACA,cAAc,WACd;AACA,QAAM,MAAM,eAAe;AAC3B,SAAO,CAAC,WAA2B;AACjC,aAAS,MAAM,EAAE,IAAI;AAAA,MACnB,KAAK;AAAA,MACL,OAAO;AAAA,IACT,CAAC;AACD,cAAU,GAAG,IAAI;AAAA,MACf,KAAK;AAAA,MACL;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
package/dist/index.d.cts DELETED
@@ -1,110 +0,0 @@
1
- import { Container } from '@autometa/injection';
2
- import { Class } from '@autometa/types';
3
-
4
- /**
5
- * Basic Key Value store for managing state across Step Definitions. A unique copy of this object
6
- * is shared between all steps and hooks in a given running Scenario, however it is not possible
7
- * to interact with state outside of that Scenarios life cycle. That is to say, while the World
8
- * is shared between steps, it is unique across tests.
9
- *
10
- * To extend the worlds vocabulary, you can declare properties on the World. These do not need
11
- * to be defined at run time. Instead they will be filled in as they are produced by steps.
12
- *
13
- * To declare World properties, you can simply declare an uninitialized property. Depending
14
- * on your `tsconfig.json` settings you can do so with one of the three following syntaxes:
15
- *
16
- * ```typescript
17
- * @Fixture
18
- * export class World {
19
- * [key: string]: unknown;
20
- *
21
- * declare foo: number
22
- *
23
- * foo: number
24
- *
25
- * foo!: number
26
- * }
27
- *
28
- * The World is automatically injected into the {@link App} object, and can be accessed via
29
- * the last (or only) argument of a step definition callback.
30
- *
31
- * ```ts
32
- * Given('I have {int} cats', (cats: number, app: App) => {
33
- * app.world.cats = cats
34
- * })
35
- *
36
- * // using destructuring
37
- * Given('I have {int} cats', ({world}: App) => {
38
- * world.cats = cats
39
- * })
40
- * ```
41
- */
42
- interface World {
43
- [key: string]: unknown;
44
- }
45
- /**
46
- * The App object is the primary interface for interacting with the running application. It is
47
- * composed of `Fixtures` which are classes decorated with the `@Fixture` decorator. Fixtures
48
- * are automatically instantiated and injected into the App object. The App object is then
49
- * injected into the last (or only) argument of a step definition callback.
50
- *
51
- * i.e.
52
- *
53
- * ```ts
54
- * // single argument
55
- * Given('I have 5 cats', (app: App) => {})
56
- * // Cucumber Expression
57
- * Given('I have {int} cats', (cats: number, app: App) => {})
58
- * // Data table
59
- * Given('I have {int} cats', (cats: number, table: HTable app: App) => {}, HTable)
60
- * ```
61
- *
62
- * **Note**: The type annotations here are optional. Non-custom Cucumber Expression types
63
- * will be automatically inferred by their expression template. Custom types will need to
64
- * be added via declaration file (see docs)
65
- *
66
- * The App is unique across all tests, and is shared between all steps and hooks within a test.
67
- * If you have any Fixture classes defined, you can add them as constructor parameters of the App
68
- * to make them available to step Definitions (Fixtures can also be accessed as properties from other Fixtures if not defined here);
69
- *
70
- * ```ts
71
- * \@\Fixture
72
- * export class World {}
73
- *
74
- *
75
- * \@\Fixture
76
- * export class Fixture1 {}
77
- *
78
- * \@\Fixture
79
- * export class Fixture2 {
80
- * constructor(readonly fixture1: Fixture1, readonly world: World) {}
81
- * }
82
- *
83
- * \@\AppType(World)
84
- * export class App {
85
- * constructor(readonly fixture1: Fixture1, readonly fixture2: Fixture2) {}
86
- * }
87
- * ```
88
- */
89
- interface App {
90
- world: World;
91
- di: Container;
92
- }
93
-
94
- declare abstract class AutometaApp {
95
- id: string;
96
- [key: string]: unknown;
97
- world: World;
98
- }
99
-
100
- declare class AutometaWorld {
101
- }
102
-
103
- declare function getApp<T extends AutometaApp>(appType: Class<T>, containerName?: string): App;
104
-
105
- declare function AppType(container: Record<string, {
106
- app: Class<App>;
107
- world: Class<World>;
108
- }>, world: Class<AutometaWorld>, environment?: string): (target: Class<unknown>) => void;
109
-
110
- export { App, AppType, AutometaApp, AutometaWorld, World, getApp };
package/tsup.config.ts DELETED
@@ -1,14 +0,0 @@
1
- import { defineConfig } from "tsup";
2
-
3
- export default defineConfig({
4
- clean: true, // clean up the dist folder
5
- format: ["cjs", "esm"], // generate cjs and esm files
6
- dts: true,
7
- sourcemap: true, // generate sourcemaps
8
- skipNodeModulesBundle: true,
9
- entryPoints: ["src/index.ts"],
10
- target: "es2020",
11
- outDir: "dist",
12
- legacyOutput: true,
13
- external: ["dist"],
14
- });
package/vite.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
-
3
- export default defineConfig({
4
- test: {
5
- coverage: {
6
- provider: "v8", // or 'v8'
7
- reporter: ["json-summary", "json"],
8
- },
9
- },
10
- });