@rxap/generator-ts-morph 1.0.1-dev.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 ADDED
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## 1.0.1-dev.0 (2023-07-10)
7
+
8
+ ### Bug Fixes
9
+
10
+ - restructure and merge mono repos packages, schematics, plugins and nest ([653b4cd](https://gitlab.com/rxap/packages/commit/653b4cd39fc92d322df9b3959651fea0aa6079da))
package/GETSTARTED.md ADDED
File without changes
package/GUIDES.md ADDED
File without changes
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # @rxap/generator-ts-morph
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@rxap/generator-ts-morph?style=flat-square)](https://www.npmjs.com/package/@rxap/generator-ts-morph)
4
+ [![commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](https://commitizen.github.io/cz-cli/)
5
+ [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
+ ![Libraries.io dependency status for latest release, scoped npm package](https://img.shields.io/librariesio/release/npm/@rxap/generator-ts-morph)
7
+ ![npm](https://img.shields.io/npm/dm/@rxap/generator-ts-morph)
8
+ ![NPM](https://img.shields.io/npm/l/@rxap/generator-ts-morph)
9
+
10
+ - [Installation](#installation)
11
+
12
+ # Installation
13
+
14
+ **Add the package to your workspace:**
15
+ ```bash
16
+ yarn add @rxap/generator-ts-morph
17
+ ```
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@rxap/generator-ts-morph",
3
+ "version": "1.0.1-dev.0",
4
+ "type": "commonjs",
5
+ "peerDependencies": {
6
+ "@nx/devkit": "^16.3.2",
7
+ "ts-morph": "^18.0.0"
8
+ },
9
+ "dependencies": {
10
+ "tslib": "2.5.3"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public",
14
+ "directory": "../../../dist/packages/generator/ts-morph"
15
+ },
16
+ "keywords": [
17
+ "rxap"
18
+ ],
19
+ "homepage": "https:/gitlab.com/rxap/packages/packages/generator/ts-morph",
20
+ "bugs": {
21
+ "url": "https://gitlab.com/rxap/packages/-/issues",
22
+ "email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
23
+ },
24
+ "license": "GPL-3.0-or-later",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://gitlab.com/rxap/packages.git",
28
+ "directory": "packages/generator/ts-morph"
29
+ },
30
+ "author": {
31
+ "name": "Merzough Münker",
32
+ "email": "mmuenker@digitaix.com"
33
+ },
34
+ "nx-migrations": {
35
+ "packageGroup": []
36
+ },
37
+ "main": "./src/index.js",
38
+ "types": "./src/index.d.ts"
39
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './lib/add-dir';
package/src/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/add-dir"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/generator/ts-morph/src/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B"}
@@ -0,0 +1,10 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import { Project } from 'ts-morph';
3
+ /**
4
+ * Adds all files recursively from a specify path to the project.
5
+ * @param tree A nx Tree instance
6
+ * @param directoryPath A directory path
7
+ * @param project A ts-morph Project instance
8
+ * @param filter A filter function base on the pathFragment and dirEntry
9
+ */
10
+ export declare function AddDir(tree: Tree, directoryPath: string, project: Project, filter?: ((fileName: string, dirPath: string) => boolean)): void;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddDir = void 0;
4
+ const path_1 = require("path");
5
+ /**
6
+ * Adds all files recursively from a specify path to the project.
7
+ * @param tree A nx Tree instance
8
+ * @param directoryPath A directory path
9
+ * @param project A ts-morph Project instance
10
+ * @param filter A filter function base on the pathFragment and dirEntry
11
+ */
12
+ function AddDir(tree, directoryPath, project, filter = path => path.endsWith('.ts')) {
13
+ if (tree.isFile(directoryPath)) {
14
+ throw new Error(`The path '${directoryPath}' does not point to a dir entry`);
15
+ }
16
+ for (const fileName of tree.children(directoryPath)
17
+ .filter(fileOrDirectoryName => tree.isFile((0, path_1.join)(directoryPath, fileOrDirectoryName)))
18
+ .filter(fileName => filter(fileName, directoryPath))) {
19
+ const filePath = (0, path_1.join)(directoryPath, fileName);
20
+ if (!project.getSourceFile(filePath)) {
21
+ project.createSourceFile(filePath, tree.read(filePath).toString('utf-8'));
22
+ }
23
+ }
24
+ for (const dirName of tree.children(directoryPath).filter(pf => !tree.isFile((0, path_1.join)(directoryPath, pf)))) {
25
+ AddDir(tree, (0, path_1.join)(directoryPath, dirName), project, filter);
26
+ }
27
+ }
28
+ exports.AddDir = AddDir;
29
+ //# sourceMappingURL=add-dir.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-dir.js","sourceRoot":"","sources":["../../../../../../packages/generator/ts-morph/src/lib/add-dir.ts"],"names":[],"mappings":";;;AAEA,+BAA4B;AAE5B;;;;;;GAMG;AACH,SAAgB,MAAM,CACpB,IAAU,EACV,aAAqB,EACrB,OAAgB,EAChB,SAA2D,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;IAEvF,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,aAAc,aAAc,iCAAiC,CAAC,CAAC;KAChF;IACD,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;SACvB,MAAM,CAAC,mBAAm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