@analogjs/astro-angular 3.0.0-alpha.3 → 3.0.0-alpha.5
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/package.json +4 -3
- package/src/index.d.ts.map +1 -1
- package/src/index.js +6 -4
- package/src/index.js.map +1 -1
- package/src/utils.d.ts +1 -1
- package/src/utils.d.ts.map +1 -1
- package/src/utils.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/astro-angular",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.5",
|
|
4
4
|
"description": "Use Angular components within Astro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/sponsors/brandonroberts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@analogjs/vite-plugin-angular": "^3.0.0-alpha.
|
|
35
|
+
"@analogjs/vite-plugin-angular": "^3.0.0-alpha.5"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@angular/build": ">=20.0.0",
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"@angular/platform-browser": ">=20.0.0",
|
|
46
46
|
"@angular/platform-server": ">=20.0.0",
|
|
47
47
|
"rxjs": "^7.8.0",
|
|
48
|
-
"tslib": "^2.4.0"
|
|
48
|
+
"tslib": "^2.4.0",
|
|
49
|
+
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
49
50
|
},
|
|
50
51
|
"ng-update": {
|
|
51
52
|
"packageGroup": [
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/astro-angular/src/index.ts"],"names":[],"mappings":"AAAA,OAAoB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAiC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/astro-angular/src/index.ts"],"names":[],"mappings":"AAAA,OAAoB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAiC,MAAM,OAAO,CAAC;AAG7E,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAsDD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAqBnE"}
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import viteAngular from '@analogjs/vite-plugin-angular';
|
|
2
2
|
import { enableProdMode } from '@angular/core';
|
|
3
|
+
import * as vite from 'vite';
|
|
3
4
|
function getRenderer() {
|
|
4
5
|
return {
|
|
5
6
|
name: '@analogjs/astro-angular',
|
|
@@ -7,10 +8,11 @@ function getRenderer() {
|
|
|
7
8
|
serverEntrypoint: '@analogjs/astro-angular/server.js',
|
|
8
9
|
};
|
|
9
10
|
}
|
|
10
|
-
function getViteConfiguration(
|
|
11
|
+
function getViteConfiguration(pluginOptions) {
|
|
12
|
+
const isRolldown = !!vite.rolldownVersion;
|
|
11
13
|
return {
|
|
12
|
-
esbuild: {
|
|
13
|
-
jsxDev: true,
|
|
14
|
+
[isRolldown ? 'oxc' : 'esbuild']: {
|
|
15
|
+
...(isRolldown ? { jsx: { development: true } } : { jsxDev: true }),
|
|
14
16
|
},
|
|
15
17
|
optimizeDeps: {
|
|
16
18
|
include: [
|
|
@@ -24,7 +26,7 @@ function getViteConfiguration(vite) {
|
|
|
24
26
|
],
|
|
25
27
|
},
|
|
26
28
|
plugins: [
|
|
27
|
-
viteAngular(
|
|
29
|
+
viteAngular(pluginOptions),
|
|
28
30
|
{
|
|
29
31
|
name: '@analogjs/astro-angular-platform-server',
|
|
30
32
|
transform(code, id) {
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/astro-angular/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAA8B,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/astro-angular/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAA8B,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAM7B,SAAS,WAAW;IAClB,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,gBAAgB,EAAE,mCAAmC;QACrD,gBAAgB,EAAE,mCAAmC;KACtD,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,aAA6B;IACzD,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;IAC1C,OAAO;QACL,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;YAChC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;SACpE;QACD,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,2BAA2B;gBAC3B,eAAe;gBACf,mCAAmC;aACpC;YACD,OAAO,EAAE;gBACP,0BAA0B;gBAC1B,mCAAmC;aACpC;SACF;QAED,OAAO,EAAE;YACP,WAAW,CAAC,aAAa,CAAC;YAC1B;gBACE,IAAI,EAAE,yCAAyC;gBAC/C,SAAS,CAAC,IAAY,EAAE,EAAU;oBAChC,IAAI,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;wBACnC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;wBAEhD,OAAO;4BACL,IAAI,EAAE,IAAI,CAAC,OAAO,CAChB,yBAAyB,EACzB,mDAAmD,CACpD;yBACF,CAAC;oBACJ,CAAC;oBAED,OAAO;gBACT,CAAC;aACF;SACF;QACD,GAAG,EAAE;YACH,UAAU,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;SAC5C;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,WAAW,OAAwB;IAC/C,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;IAErC,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,KAAK,EAAE;YACL,oBAAoB,EAAE,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAE;gBACtD,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC3B,YAAY,CAAC;oBACX,IAAI,EAAE,oBAAoB,CACxB,OAAO,EAAE,IAAI,CACe;iBAC/B,CAAC,CAAC;YACL,CAAC;YACD,mBAAmB,EAAE,GAAG,EAAE;gBACxB,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY,EAAE,CAAC;oBAC7C,cAAc,EAAE,CAAC;gBACnB,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import viteAngular, { PluginOptions } from '@analogjs/vite-plugin-angular';\nimport { enableProdMode } from '@angular/core';\nimport type { AstroIntegration, AstroRenderer, ViteUserConfig } from 'astro';\nimport * as vite from 'vite';\n\ninterface AngularOptions {\n vite?: PluginOptions;\n}\n\nfunction getRenderer(): AstroRenderer {\n return {\n name: '@analogjs/astro-angular',\n clientEntrypoint: '@analogjs/astro-angular/client.js',\n serverEntrypoint: '@analogjs/astro-angular/server.js',\n };\n}\n\nfunction getViteConfiguration(pluginOptions?: PluginOptions) {\n const isRolldown = !!vite.rolldownVersion;\n return {\n [isRolldown ? 'oxc' : 'esbuild']: {\n ...(isRolldown ? { jsx: { development: true } } : { jsxDev: true }),\n },\n optimizeDeps: {\n include: [\n '@angular/platform-browser',\n '@angular/core',\n '@analogjs/astro-angular/client.js',\n ],\n exclude: [\n '@angular/platform-server',\n '@analogjs/astro-angular/server.js',\n ],\n },\n\n plugins: [\n viteAngular(pluginOptions),\n {\n name: '@analogjs/astro-angular-platform-server',\n transform(code: string, id: string) {\n if (id.includes('platform-server')) {\n code = code.replace(/global\\./g, 'globalThis.');\n\n return {\n code: code.replace(\n 'new xhr2.XMLHttpRequest',\n 'new (xhr2.default.XMLHttpRequest || xhr2.default)',\n ),\n };\n }\n\n return;\n },\n },\n ],\n ssr: {\n noExternal: ['@angular/**', '@analogjs/**'],\n },\n };\n}\n\nexport default function (options?: AngularOptions): AstroIntegration {\n process.env['ANALOG_ASTRO'] = 'true';\n\n return {\n name: '@analogjs/astro-angular',\n hooks: {\n 'astro:config:setup': ({ addRenderer, updateConfig }) => {\n addRenderer(getRenderer());\n updateConfig({\n vite: getViteConfiguration(\n options?.vite,\n ) as unknown as ViteUserConfig,\n });\n },\n 'astro:config:done': () => {\n if (process.env['NODE_ENV'] === 'production') {\n enableProdMode();\n }\n },\n },\n };\n}\n"]}
|
package/src/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function addOutputListener(analogId: string, outputName: string, callback: (...args:
|
|
1
|
+
export declare function addOutputListener(analogId: string, outputName: string, callback: (...args: unknown[]) => unknown, eventListenerOptions?: EventListenerOptions): () => void;
|
|
2
2
|
//# sourceMappingURL=utils.d.ts.map
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../packages/astro-angular/src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../packages/astro-angular/src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EACzC,oBAAoB,GAAE,oBAAyB,GAC9C,MAAM,IAAI,CAeZ"}
|
package/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../packages/astro-angular/src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAC/B,QAAgB,EAChB,UAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../packages/astro-angular/src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAC/B,QAAgB,EAChB,UAAkB,EAClB,QAAyC,EACzC,uBAA6C,EAAE;IAE/C,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE;QAClD,MAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAChC,CAAC,QAAQ,EAAE,EAAE,CACV,QAAQ,CAAC,MAAsB,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,KAAK,QAAQ,CACtE,EAAE,MAAM,CAAC;QAEV,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,CAAC,gBAAgB,CAAC,UAAU,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC;YACzE,QAAQ,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAErE,OAAO,GAAS,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["export function addOutputListener(\n analogId: string,\n outputName: string,\n callback: (...args: unknown[]) => unknown,\n eventListenerOptions: EventListenerOptions = {},\n): () => void {\n const observer = new MutationObserver((mutations) => {\n const foundTarget = mutations.find(\n (mutation) =>\n (mutation.target as HTMLElement).dataset?.['analogId'] === analogId,\n )?.target;\n\n if (foundTarget) {\n foundTarget.addEventListener(outputName, callback, eventListenerOptions);\n observer.disconnect();\n }\n });\n observer.observe(document.body, { attributes: true, subtree: true });\n\n return (): void => observer.disconnect();\n}\n"]}
|