@tsparticles/ember 4.4.0 → 4.5.1
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 +11 -1
- package/package.dist.json +1 -1
- package/package.json +15 -11
- package/tests-vitest/init-particles-engine.test.ts +67 -0
- package/vitest.config.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.5.1](https://github.com/tsparticles/tsparticles/compare/v4.5.0...v4.5.1) (2026-11-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @tsparticles/ember
|
|
9
|
+
|
|
10
|
+
# [4.5.0](https://github.com/tsparticles/tsparticles/compare/v4.4.0...v4.5.0) (2026-10-25)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- fixed some issues in mcp server and some coderabbit reports ([4700d3e](https://github.com/tsparticles/tsparticles/commit/4700d3e953f3a3a1930db064a6b6b21d61233cdf))
|
|
15
|
+
|
|
6
16
|
# [4.4.0](https://github.com/tsparticles/tsparticles/compare/v4.3.3...v4.4.0) (2026-08-30)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
|
9
19
|
|
|
10
|
-
|
|
20
|
+
- various fixes for 4.4.0 ([475d06d](https://github.com/tsparticles/tsparticles/commit/475d06da27e1497bb097c0822fcfcb72d7142456))
|
|
11
21
|
|
|
12
22
|
## [4.3.3](https://github.com/tsparticles/tsparticles/compare/v4.3.2...v4.3.3) (2026-07-23)
|
|
13
23
|
|
package/package.dist.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/ember",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "Official tsParticles Ember.js Component - Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -39,15 +39,17 @@
|
|
|
39
39
|
"lint:js": "eslint . --cache",
|
|
40
40
|
"lint:js:fix": "eslint . --fix",
|
|
41
41
|
"start": "ember serve",
|
|
42
|
-
"test": "
|
|
42
|
+
"test": "pnpm run test:vitest",
|
|
43
43
|
"test:ember": "echo test",
|
|
44
44
|
"test:ember-compatibility": "echo ember try:each",
|
|
45
45
|
"prepack": "ember ts:precompile",
|
|
46
46
|
"postpack": "ember ts:clean",
|
|
47
|
-
"version": "node ../../scripts/resolve-dist-package.cjs && git add package.dist.json"
|
|
47
|
+
"version": "node ../../scripts/resolve-dist-package.cjs && git add package.dist.json",
|
|
48
|
+
"test:vitest": "vitest run --config vitest.config.ts",
|
|
49
|
+
"test:ci": "pnpm run test:vitest"
|
|
48
50
|
},
|
|
49
51
|
"dependencies": {
|
|
50
|
-
"@tsparticles/engine": "4.
|
|
52
|
+
"@tsparticles/engine": "4.5.1",
|
|
51
53
|
"ember-auto-import": "^2.13.1",
|
|
52
54
|
"ember-cli-babel": "^8.3.1",
|
|
53
55
|
"ember-cli-htmlbars": "^7.0.1",
|
|
@@ -63,7 +65,8 @@
|
|
|
63
65
|
"@embroider/test-setup": "^4.0.0",
|
|
64
66
|
"@glimmer/component": "^2.1.1",
|
|
65
67
|
"@glimmer/tracking": "^1.1.2",
|
|
66
|
-
"@
|
|
68
|
+
"@tsconfig/ember": "^3.0.12",
|
|
69
|
+
"@tsparticles/preset-snow": "4.5.1",
|
|
67
70
|
"@types/ember": "^4.0.11",
|
|
68
71
|
"@types/ember__application": "^4.0.11",
|
|
69
72
|
"@types/ember__array": "^4.0.10",
|
|
@@ -101,20 +104,21 @@
|
|
|
101
104
|
"ember-source-channel-url": "^3.0.0",
|
|
102
105
|
"ember-template-lint": "^7.9.3",
|
|
103
106
|
"ember-try": "^4.0.0",
|
|
104
|
-
"eslint": "^10.
|
|
107
|
+
"eslint": "^10.14.0",
|
|
105
108
|
"eslint-config-prettier": "^10.1.8",
|
|
106
109
|
"eslint-plugin-ember": "^13.5.0",
|
|
107
110
|
"eslint-plugin-n": "^18.3.0",
|
|
108
|
-
"eslint-plugin-prettier": "^5.5.
|
|
111
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
109
112
|
"eslint-plugin-qunit": "^8.2.6",
|
|
110
113
|
"loader.js": "^4.7.0",
|
|
111
114
|
"npm-run-all": "^4.1.5",
|
|
112
|
-
"prettier": "^3.9.
|
|
115
|
+
"prettier": "^3.9.10",
|
|
113
116
|
"qunit": "^2.26.0",
|
|
114
117
|
"qunit-dom": "^3.6.0",
|
|
115
|
-
"tsparticles": "4.
|
|
118
|
+
"tsparticles": "4.5.1",
|
|
116
119
|
"typescript": "^6.0.3",
|
|
117
|
-
"
|
|
120
|
+
"vitest": "^5.0.5",
|
|
121
|
+
"webpack": "^5.112.2"
|
|
118
122
|
},
|
|
119
123
|
"engines": {
|
|
120
124
|
"node": "14.* || 16.* || >= 18"
|
|
@@ -145,5 +149,5 @@
|
|
|
145
149
|
"peerDependencies": {
|
|
146
150
|
"@tsparticles/engine": "workspace:*"
|
|
147
151
|
},
|
|
148
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "433c560448e5020cb051e1b025e0f9914f23b147"
|
|
149
153
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
+
|
|
4
|
+
const { initMock } = vi.hoisted(() => ({
|
|
5
|
+
initMock: vi.fn(async () => Promise.resolve()),
|
|
6
|
+
}));
|
|
7
|
+
|
|
8
|
+
vi.mock('@tsparticles/engine', () => ({
|
|
9
|
+
tsParticles: {
|
|
10
|
+
init: initMock,
|
|
11
|
+
},
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
type EngineModule = typeof import('../addon/utils/init-particles-engine.js');
|
|
15
|
+
|
|
16
|
+
async function loadEngineModule(): Promise<EngineModule> {
|
|
17
|
+
vi.resetModules();
|
|
18
|
+
|
|
19
|
+
return await import('../addon/utils/init-particles-engine.js');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
describe('initParticlesEngine (ember addon)', () => {
|
|
23
|
+
it('calls the init callback with the engine and initializes it', async () => {
|
|
24
|
+
const { tsParticles } = await import('@tsparticles/engine');
|
|
25
|
+
|
|
26
|
+
(tsParticles.init as ReturnType<typeof vi.fn>).mockClear();
|
|
27
|
+
|
|
28
|
+
const module = await loadEngineModule(),
|
|
29
|
+
init = vi.fn(async () => Promise.resolve());
|
|
30
|
+
|
|
31
|
+
await module.initParticlesEngine(init);
|
|
32
|
+
|
|
33
|
+
expect(init).toHaveBeenCalledTimes(1);
|
|
34
|
+
expect(init).toHaveBeenCalledWith(tsParticles);
|
|
35
|
+
expect(tsParticles.init).toHaveBeenCalledTimes(1);
|
|
36
|
+
expect(module.isParticlesEngineInitialized()).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('does not re-run the init when already initialized', async () => {
|
|
40
|
+
const module = await loadEngineModule(),
|
|
41
|
+
init = vi.fn(async () => Promise.resolve());
|
|
42
|
+
|
|
43
|
+
await module.initParticlesEngine(init);
|
|
44
|
+
await module.initParticlesEngine(init);
|
|
45
|
+
|
|
46
|
+
expect(init).toHaveBeenCalledTimes(1);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('throws when the init callback changes across the app lifecycle', async () => {
|
|
50
|
+
const module = await loadEngineModule(),
|
|
51
|
+
first = module.initParticlesEngine(async () => Promise.resolve());
|
|
52
|
+
|
|
53
|
+
await expect(
|
|
54
|
+
module.initParticlesEngine(async () => Promise.resolve()),
|
|
55
|
+
).rejects.toThrow(/stable across the app lifecycle/i);
|
|
56
|
+
|
|
57
|
+
await first;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('resolves the wait helper', async () => {
|
|
61
|
+
const module = await loadEngineModule();
|
|
62
|
+
|
|
63
|
+
await expect(
|
|
64
|
+
module.waitForParticlesEngineInitialization(),
|
|
65
|
+
).resolves.toBeUndefined();
|
|
66
|
+
});
|
|
67
|
+
});
|