@autometa/app 0.4.1 → 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,227 +0,0 @@
1
- # @autometa/app
2
-
3
- ## 0.4.1
4
-
5
- ### Patch Changes
6
-
7
- - da669a3: feat: disposable injectables
8
- - Updated dependencies [da669a3]
9
- - @autometa/injection@0.1.4
10
-
11
- ## 0.4.0
12
-
13
- ### Minor Changes
14
-
15
- - 7440e9f: feat: new group based hooks for feature, rule, outline and examples
16
-
17
- ## 0.3.5
18
-
19
- ### Patch Changes
20
-
21
- - 1d3f84e: fix: getApp returned app without di container reference
22
-
23
- ## 0.3.4
24
-
25
- ### Patch Changes
26
-
27
- - Updated dependencies [2aee2a4]
28
- - @autometa/injection@0.1.3
29
-
30
- ## 0.3.3
31
-
32
- ### Patch Changes
33
-
34
- - 536004e: fix: injection errors and http client hooks
35
-
36
- - The new dependency injection library sometimes returned class prototypes instead of class instances due to inconsistent caching of decorated types.
37
- - HTTP client hooks were not executing when certain builder methods were called.
38
-
39
- - bac2661: fix: world not defined on app
40
- - Updated dependencies [536004e]
41
- - @autometa/injection@0.1.2
42
-
43
- ## 0.3.2
44
-
45
- ### Patch Changes
46
-
47
- - Updated dependencies [d563916]
48
- - @autometa/injection@0.1.1
49
-
50
- ## 0.3.1
51
-
52
- ### Patch Changes
53
-
54
- - 6c4bb8d: fix: getApp function not defined
55
-
56
- ## 0.3.0
57
-
58
- ### Minor Changes
59
-
60
- - 98d911f: feat: replace tsyringe with custom DI solution
61
-
62
- ### Patch Changes
63
-
64
- - Updated dependencies [98d911f]
65
- - @autometa/injection@0.1.0
66
-
67
- ## 0.2.4
68
-
69
- ### Patch Changes
70
-
71
- - Updated dependencies [3fe2ad4]
72
- - @autometa/errors@0.2.2
73
- - @autometa/asserters@0.1.8
74
- - @autometa/fixture-proxies@0.1.3
75
- - @autometa/phrases@0.1.12
76
-
77
- ## 0.2.3
78
-
79
- ### Patch Changes
80
-
81
- - Updated dependencies [3493bb6]
82
- - @autometa/errors@0.2.1
83
- - @autometa/asserters@0.1.7
84
- - @autometa/fixture-proxies@0.1.2
85
- - @autometa/phrases@0.1.11
86
-
87
- ## 0.2.2
88
-
89
- ### Patch Changes
90
-
91
- - 8ec0cdc: fix: allow whitelist for tracked types, don't auto-track World
92
- - Updated dependencies [8ec0cdc]
93
- - @autometa/fixture-proxies@0.1.1
94
-
95
- ## 0.2.1
96
-
97
- ### Patch Changes
98
-
99
- - Updated dependencies [0c070cb]
100
- - @autometa/asserters@0.1.6
101
- - @autometa/phrases@0.1.10
102
-
103
- ## 0.2.0
104
-
105
- ### Minor Changes
106
-
107
- - 8f116d9: feat: access tracker and error catching proxies on fixtures
108
-
109
- ### Patch Changes
110
-
111
- - Updated dependencies [b5ce008]
112
- - Updated dependencies [8f116d9]
113
- - @autometa/errors@0.2.0
114
- - @autometa/fixture-proxies@0.1.0
115
- - @autometa/asserters@0.1.5
116
- - @autometa/phrases@0.1.9
117
-
118
- ## 0.1.13
119
-
120
- ### Patch Changes
121
-
122
- - 04ed85d: feat: added HTP client based on axios
123
- - Updated dependencies [04ed85d]
124
- - @autometa/asserters@0.1.4
125
- - @autometa/phrases@0.1.8
126
- - @autometa/errors@0.1.4
127
-
128
- ## 0.1.12
129
-
130
- ### Patch Changes
131
-
132
- - 4ee4e99: Fixes strings like 'abc2bd' being parsed as NaN in `primitive` expression type. Not supports comma and decimal delimters (EU, US respectively
133
-
134
- ## 0.1.11
135
-
136
- ### Patch Changes
137
-
138
- - Release Bump
139
- - Updated dependencies
140
- - @autometa/phrases@0.1.7
141
-
142
- ## 0.1.10
143
-
144
- ### Patch Changes
145
-
146
- - Updated dependencies [85050386]
147
- - @autometa/phrases@0.1.6
148
-
149
- ## 0.1.9
150
-
151
- ### Patch Changes
152
-
153
- - ddbdb401: Fix: World object not resolving correctly with DI
154
-
155
- ## 0.1.8
156
-
157
- ### Patch Changes
158
-
159
- - 53f958e1: Fix: steps not executing onStepEnded event when an error was thrown
160
- - Updated dependencies [53f958e1]
161
- - @autometa/asserters@0.1.3
162
- - @autometa/errors@0.1.3
163
- - @autometa/phrases@0.1.5
164
-
165
- ## 0.1.7
166
-
167
- ### Patch Changes
168
-
169
- - Fix: bad dist published
170
-
171
- ## 0.1.6
172
-
173
- ### Patch Changes
174
-
175
- - f167963f: Fix: typo in AutometaWorld 'dfromPhrase' -> 'fromPhrase'
176
-
177
- ## 0.1.5
178
-
179
- ### Patch Changes
180
-
181
- - Updated dependencies [12bd4b1e]
182
- - @autometa/errors@0.1.2
183
- - @autometa/asserters@0.1.2
184
- - @autometa/phrases@0.1.4
185
-
186
- ## 0.1.4
187
-
188
- ### Patch Changes
189
-
190
- - 4a16497d: fix(scopes): hooks not executing without tag expressions
191
-
192
- ## 0.1.3
193
-
194
- ### Patch Changes
195
-
196
- - Updated dependencies [0cc7f6aa]
197
- - @autometa/phrases@0.1.3
198
-
199
- ## 0.1.2
200
-
201
- ### Patch Changes
202
-
203
- - e8f02f3a: Small bug fixes, unit test coverage, tag expressions
204
- - Updated dependencies [e8f02f3a]
205
- - @autometa/phrases@0.1.2
206
- - @autometa/errors@0.1.1
207
- - @autometa/asserters@0.1.1
208
-
209
- ## 0.1.1
210
-
211
- ### Patch Changes
212
-
213
- - Updated dependencies [bf23fc4]
214
- - @autometa/phrases@0.1.1
215
-
216
- ## 0.1.0
217
-
218
- ### Minor Changes
219
-
220
- - 554b77e: Releasing packages
221
-
222
- ### Patch Changes
223
-
224
- - Updated dependencies [554b77e]
225
- - @autometa/asserters@0.1.0
226
- - @autometa/errors@0.1.0
227
- - @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
- });