@analogjs/astro-angular 0.2.11 → 0.2.12
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 +3 -1
- package/package.json +2 -2
- package/src/index.d.ts.map +1 -1
- package/src/index.js +12 -1
- package/src/index.js.map +1 -1
package/README.md
CHANGED
|
@@ -279,13 +279,15 @@ export class TodosComponent implements OnInit {
|
|
|
279
279
|
|
|
280
280
|
To use components with MDX pages, you must install and configure MDX support by following the Astro integration of [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/). Your `astro.config.mjs` should now include the `@astrojs/mdx` integration.
|
|
281
281
|
|
|
282
|
+
> Note: Shiki is the default syntax highlighter for the MDX plugin and is currently unsupported. `astro-angular` will override this with `prism` but you should specify it in the config to prevent warnings or issues.
|
|
283
|
+
|
|
282
284
|
```js
|
|
283
285
|
import { defineConfig } from 'astro/config';
|
|
284
286
|
import mdx from '@astrojs/mdx';
|
|
285
287
|
import angular from '@analogjs/astro-angular';
|
|
286
288
|
|
|
287
289
|
export default defineConfig({
|
|
288
|
-
integrations: [mdx(), angular()],
|
|
290
|
+
integrations: [mdx({ syntaxHighlight: 'prism' }), angular()],
|
|
289
291
|
});
|
|
290
292
|
```
|
|
291
293
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/astro-angular",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Use Angular components within Astro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"url": "https://github.com/analogjs/analog.git"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@analogjs/vite-plugin-angular": "^0.2.
|
|
31
|
+
"@analogjs/vite-plugin-angular": "^0.2.12"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@angular-devkit/build-angular": "^16.0.0",
|
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,EAAE,gBAAgB,EAAiB,MAAM,OAAO,CAAC;AAExD,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AA4DD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC,EAAE,cAAc,GAAG,gBAAgB,
|
|
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,EAAE,gBAAgB,EAAiB,MAAM,OAAO,CAAC;AAExD,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AA4DD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAiCnE"}
|
package/src/index.js
CHANGED
|
@@ -55,10 +55,21 @@ export default function (options) {
|
|
|
55
55
|
return {
|
|
56
56
|
name: '@analogjs/astro-angular',
|
|
57
57
|
hooks: {
|
|
58
|
-
'astro:config:setup': ({ addRenderer, updateConfig }) => {
|
|
58
|
+
'astro:config:setup': ({ addRenderer, config, isRestart, updateConfig, }) => {
|
|
59
|
+
var _a;
|
|
60
|
+
if (!isRestart && ((_a = config.markdown) === null || _a === void 0 ? void 0 : _a.syntaxHighlight) === 'shiki') {
|
|
61
|
+
config.markdown.syntaxHighlight = 'prism';
|
|
62
|
+
}
|
|
59
63
|
addRenderer(getRenderer());
|
|
60
64
|
updateConfig({ vite: getViteConfiguration(options === null || options === void 0 ? void 0 : options.vite) });
|
|
61
65
|
},
|
|
66
|
+
'astro:config:done': ({ config }) => {
|
|
67
|
+
if ('markdown' in config &&
|
|
68
|
+
config.markdown.syntaxHighlight === 'shiki') {
|
|
69
|
+
console.warn(`[warning] The Angular integration doesn't support Shiki syntax highlighting in MDX files. Overriding with Prism.\n
|
|
70
|
+
To disable this warning, set the syntaxHighlight option in your astro.config.mjs mdx() integration to 'prism' or false.`);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
62
73
|
'astro:build:setup': () => {
|
|
63
74
|
enableProdMode();
|
|
64
75
|
},
|
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;AAO/C,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,IAAoB;IAChD,OAAO;QACL,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,2BAA2B;gBAC3B,eAAe;gBACf,mCAAmC;aACpC;YACD,OAAO,EAAE;gBACP,0BAA0B;gBAC1B,mCAAmC;aACpC;SACF;QACD;;;;;;;;;;WAUG;QACH,OAAO,EAAE;YACN,WAAmB,CAAC,OAAO,CAAC,IAAI,CAAC;YAClC;gBACE,IAAI,EAAE,yCAAyC;gBAC/C,SAAS,CAAC,IAAY,EAAE,EAAU;oBAChC,IAAI,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;wBAClC,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;qBACH;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;QACL,IAAI,EAAE,yBAAyB;QAC/B,KAAK,EAAE;YACL,oBAAoB,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;AAO/C,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,IAAoB;IAChD,OAAO;QACL,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,2BAA2B;gBAC3B,eAAe;gBACf,mCAAmC;aACpC;YACD,OAAO,EAAE;gBACP,0BAA0B;gBAC1B,mCAAmC;aACpC;SACF;QACD;;;;;;;;;;WAUG;QACH,OAAO,EAAE;YACN,WAAmB,CAAC,OAAO,CAAC,IAAI,CAAC;YAClC;gBACE,IAAI,EAAE,yCAAyC;gBAC/C,SAAS,CAAC,IAAY,EAAE,EAAU;oBAChC,IAAI,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;wBAClC,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;qBACH;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;QACL,IAAI,EAAE,yBAAyB;QAC/B,KAAK,EAAE;YACL,oBAAoB,EAAE,CAAC,EACrB,WAAW,EACX,MAAM,EACN,SAAS,EACT,YAAY,GACb,EAAE,EAAE;;gBACH,IAAI,CAAC,SAAS,IAAI,CAAA,MAAA,MAAM,CAAC,QAAQ,0CAAE,eAAe,MAAK,OAAO,EAAE;oBAC9D,MAAM,CAAC,QAAQ,CAAC,eAAe,GAAG,OAAO,CAAC;iBAC3C;gBAED,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC3B,YAAY,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,EAAE,CAAC,CAAC;YAC9D,CAAC;YACD,mBAAmB,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;gBAClC,IACE,UAAU,IAAI,MAAM;oBACpB,MAAM,CAAC,QAAQ,CAAC,eAAe,KAAK,OAAO,EAC3C;oBACA,OAAO,CAAC,IAAI,CACV;wHAC4G,CAC7G,CAAC;iBACH;YACH,CAAC;YACD,mBAAmB,EAAE,GAAG,EAAE;gBACxB,cAAc,EAAE,CAAC;YACnB,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import viteAngular, { PluginOptions } from '@analogjs/vite-plugin-angular';\nimport { enableProdMode } from '@angular/core';\nimport { AstroIntegration, AstroRenderer } from 'astro';\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(vite?: PluginOptions) {\n return {\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 *\n * Why I am casting viteAngular as any\n *\n * The vite angular plugins is shipped as commonjs, while this astro\n * integration is shipped using ESM and if you call the default\n * function, you get the following error: viteAngular is not a function.\n * Attempt to use ESM for the angular vite plugin broke something, hence\n * this workaround for now.\n *\n */\n plugins: [\n (viteAngular as any).default(vite),\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 return {\n name: '@analogjs/astro-angular',\n hooks: {\n 'astro:config:setup': ({\n addRenderer,\n config,\n isRestart,\n updateConfig,\n }) => {\n if (!isRestart && config.markdown?.syntaxHighlight === 'shiki') {\n config.markdown.syntaxHighlight = 'prism';\n }\n\n addRenderer(getRenderer());\n updateConfig({ vite: getViteConfiguration(options?.vite) });\n },\n 'astro:config:done': ({ config }) => {\n if (\n 'markdown' in config &&\n config.markdown.syntaxHighlight === 'shiki'\n ) {\n console.warn(\n `[warning] The Angular integration doesn't support Shiki syntax highlighting in MDX files. Overriding with Prism.\\n\nTo disable this warning, set the syntaxHighlight option in your astro.config.mjs mdx() integration to 'prism' or false.`\n );\n }\n },\n 'astro:build:setup': () => {\n enableProdMode();\n },\n },\n };\n}\n"]}
|