@analogjs/content 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@analogjs/content",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.5",
4
4
  "description": "Content Rendering for Analog",
5
5
  "type": "module",
6
6
  "author": "Brandon Roberts <robertsbt@gmail.com>",
@@ -4,7 +4,6 @@
4
4
  "main": "./src/index.js",
5
5
  "type": "commonjs",
6
6
  "dependencies": {
7
- "ts-morph": "^27.0.0",
8
7
  "tslib": "^2.8.1"
9
8
  },
10
9
  "peerDependencies": {
@@ -1,3 +0,0 @@
1
- import { convertNxGenerator } from '@nx/devkit';
2
- declare const _default: ReturnType<typeof convertNxGenerator>;
3
- export default _default;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const devkit_1 = require("@nx/devkit");
5
- const update_markdown_renderer_feature_1 = tslib_1.__importDefault(require("./update-markdown-renderer-feature"));
6
- const _default = (0, devkit_1.convertNxGenerator)(update_markdown_renderer_feature_1.default);
7
- exports.default = _default;
8
- //# sourceMappingURL=compat.js.map
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function update(host: Tree): Promise<(() => void) | undefined>;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = update;
4
- const devkit_1 = require("@nx/devkit");
5
- const ts_morph_1 = require("ts-morph");
6
- async function update(host) {
7
- let project;
8
- (0, devkit_1.visitNotIgnoredFiles)(host, '/', (file) => {
9
- if (file.endsWith('.ts')) {
10
- const content = host.read(file, 'utf-8');
11
- if (content &&
12
- content.includes('withMarkdownRenderer') &&
13
- !content.includes('withPrismHighlighter') &&
14
- !content.includes('withShikiHighlighter')) {
15
- if (!project) {
16
- project = new ts_morph_1.Project({
17
- useInMemoryFileSystem: true,
18
- skipAddingFilesFromTsConfig: true,
19
- });
20
- }
21
- const sourceFile = project.createSourceFile(file, content);
22
- const provideContentNode = sourceFile.getFirstDescendant((node) => ts_morph_1.Node.isCallExpression(node) &&
23
- node.getText().includes('provideContent') &&
24
- node.getText().includes('withMarkdownRenderer'));
25
- if (provideContentNode) {
26
- sourceFile.addImportDeclaration({
27
- moduleSpecifier: '@analogjs/content/prism-highlighter',
28
- namedImports: ['withPrismHighlighter'],
29
- });
30
- provideContentNode.addArgument('withPrismHighlighter()');
31
- }
32
- host.write(file, sourceFile.getFullText());
33
- }
34
- }
35
- });
36
- // NOTE: we only add the dependency if the project is an Angular project
37
- // Nx projects can add the dependency from migrations.json
38
- let dependencyAdded = false;
39
- if (host.exists('/angular.json')) {
40
- (0, devkit_1.addDependenciesToPackageJson)(host, { 'marked-mangle': '^1.1.7' }, {});
41
- dependencyAdded = true;
42
- }
43
- await (0, devkit_1.formatFiles)(host);
44
- if (dependencyAdded) {
45
- return () => (0, devkit_1.installPackagesTask)(host);
46
- }
47
- }
48
- //# sourceMappingURL=update-markdown-renderer-feature.js.map