@tuyau/core 0.1.3 → 0.2.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/README.md +1 -114
- package/build/{chunk-3KNDPG6Y.js → chunk-ADS4GRIL.js} +1 -2
- package/build/commands/commands.json +1 -1
- package/build/commands/generate.js +76 -46
- package/build/index.js +1 -1
- package/build/providers/tuyau_provider.js +1 -1
- package/build/src/hooks/build_hook.d.ts +5 -0
- package/build/src/hooks/build_hook.js +14 -0
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -1,115 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tuyau/core
|
|
2
2
|
|
|
3
|
-
> A boilerplate for creating AdonisJS packages
|
|
4
|
-
|
|
5
|
-
This repo provides you with a starting point for creating AdonisJS packages. Of course, you can create a package from scratch with your folder structure and workflow. However, using this starter kit can speed up the process, as you have fewer decisions to make.
|
|
6
|
-
|
|
7
|
-
## Setup
|
|
8
|
-
|
|
9
|
-
- Clone the repo on your computer, or use `giget` to download this repo without the Git history.
|
|
10
|
-
```sh
|
|
11
|
-
npx giget@latest gh:adonisjs/pkg-starter-kit
|
|
12
|
-
```
|
|
13
|
-
- Install dependencies.
|
|
14
|
-
- Update the `package.json` file and define the `name`, `description`, `keywords`, and `author` properties.
|
|
15
|
-
- The repo is configured with an MIT license. Feel free to change that if you are not publishing under the MIT license.
|
|
16
|
-
|
|
17
|
-
## Folder structure
|
|
18
|
-
|
|
19
|
-
The starter kit mimics the folder structure of the official packages. Feel free to rename files and folders as per your requirements.
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
├── providers
|
|
23
|
-
├── src
|
|
24
|
-
├── bin
|
|
25
|
-
├── stubs
|
|
26
|
-
├── configure.ts
|
|
27
|
-
├── index.ts
|
|
28
|
-
├── LICENSE.md
|
|
29
|
-
├── package.json
|
|
30
|
-
├── README.md
|
|
31
|
-
├── tsconfig.json
|
|
32
|
-
├── tsnode.esm.js
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
- The `configure.ts` file exports the `configure` hook to configure the package using the `node ace configure` command.
|
|
36
|
-
- The `index.ts` file is the main entry point of the package.
|
|
37
|
-
- The `tsnode.esm.js` file runs TypeScript code using TS-Node + SWC. Please read the code comment in this file to learn more.
|
|
38
|
-
- The `bin` directory contains the entry point file to run Japa tests.
|
|
39
|
-
- Learn more about [the `providers` directory](./providers/README.md).
|
|
40
|
-
- Learn more about [the `src` directory](./src/README.md).
|
|
41
|
-
- Learn more about [the `stubs` directory](./stubs/README.md).
|
|
42
|
-
|
|
43
|
-
### File system naming convention
|
|
44
|
-
|
|
45
|
-
We use `snake_case` naming conventions for the file system. The rule is enforced using ESLint. However, turn off the rule and use your preferred naming conventions.
|
|
46
|
-
|
|
47
|
-
## Peer dependencies
|
|
48
|
-
|
|
49
|
-
The starter kit has a peer dependency on `@adonisjs/core@6`. Since you are creating a package for AdonisJS, you must make it against a specific version of the framework core.
|
|
50
|
-
|
|
51
|
-
If your package needs Lucid to be functional, you may install `@adonisjs/lucid` as a development dependency and add it to the list of `peerDependencies`.
|
|
52
|
-
|
|
53
|
-
As a rule of thumb, packages installed in the user application should be part of the `peerDependencies` of your package and not the main dependency.
|
|
54
|
-
|
|
55
|
-
For example, if you install `@adonisjs/core` as a main dependency, then essentially, you are importing a separate copy of `@adonisjs/core` and not sharing the one from the user application. Here is a great article explaining [peer dependencies](https://blog.bitsrc.io/understanding-peer-dependencies-in-javascript-dbdb4ab5a7be).
|
|
56
|
-
|
|
57
|
-
## Published files
|
|
58
|
-
|
|
59
|
-
Instead of publishing your repo's source code to npm, you must cherry-pick files and folders to publish only the required files.
|
|
60
|
-
|
|
61
|
-
The cherry-picking uses the `files` property inside the `package.json` file. By default, we publish the following files and folders.
|
|
62
|
-
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"files": ["build/src", "build/providers", "build/stubs", "build/index.d.ts", "build/index.js"]
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
If you create additional folders or files, mention them inside the `files` array.
|
|
70
|
-
|
|
71
|
-
## Exports
|
|
72
|
-
|
|
73
|
-
[Node.js Subpath exports](https://nodejs.org/api/packages.html#subpath-exports) allows you to define the exports of your package regardless of the folder structure. This starter kit defines the following exports.
|
|
74
|
-
|
|
75
|
-
```json
|
|
76
|
-
{
|
|
77
|
-
"exports": {
|
|
78
|
-
".": "./build/index.js",
|
|
79
|
-
"./types": "./build/src/types.js"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
- The dot `.` export is the main export.
|
|
85
|
-
- The `./types` exports all the types defined inside the `./build/src/types.js` file (the compiled output).
|
|
86
|
-
|
|
87
|
-
Feel free to change the exports as per your requirements.
|
|
88
|
-
|
|
89
|
-
## Testing
|
|
90
|
-
|
|
91
|
-
We configure the [Japa test runner](https://japa.dev/) with this starter kit. Japa is used in AdonisJS applications as well. Just run one of the following commands to execute tests.
|
|
92
|
-
|
|
93
|
-
- `npm run test`: This command will first lint the code using ESlint and then run tests and report the test coverage using [c8](https://github.com/bcoe/c8).
|
|
94
|
-
- `npm run quick:test`: Runs only the tests without linting or coverage reporting.
|
|
95
|
-
|
|
96
|
-
The starter kit also has a Github workflow file to run tests using Github Actions. The tests are executed against `Node.js 20.x` and `Node.js 21.x` versions on both Linux and Windows. Feel free to edit the workflow file in the `.github/workflows` directory.
|
|
97
|
-
|
|
98
|
-
## TypeScript workflow
|
|
99
|
-
|
|
100
|
-
- The starter kit uses [tsc](https://www.typescriptlang.org/docs/handbook/compiler-options.html) for compiling the TypeScript to JavaScript when publishing the package.
|
|
101
|
-
- [TS-Node](https://typestrong.org/ts-node/) and [SWC](https://swc.rs/) are used to run tests without compiling the source code.
|
|
102
|
-
- The `tsconfig.json` file is extended from [`@adonisjs/tsconfig`](https://github.com/adonisjs/tooling-config/tree/main/packages/typescript-config) and uses the `NodeNext` module system. Meaning the packages are written using ES modules.
|
|
103
|
-
- You can perform type checking without compiling the source code using the `npm run type check` script.
|
|
104
|
-
|
|
105
|
-
Feel free to explore the `tsconfig.json` file for all the configured options.
|
|
106
|
-
|
|
107
|
-
## ESLint and Prettier setup
|
|
108
|
-
|
|
109
|
-
The starter kit configures ESLint and Prettier. Both configurations are stored within the `package.json` file and use our [shared config](https://github.com/adonisjs/tooling-config/tree/main/packages). Feel free to change the configuration, use custom plugins, or remove both tools altogether.
|
|
110
|
-
|
|
111
|
-
## Using Stale bot
|
|
112
|
-
|
|
113
|
-
The [Stale bot](https://github.com/apps/stale) is a Github application that automatically marks issues and PRs as stale and closes after a specific duration of inactivity.
|
|
114
|
-
|
|
115
|
-
Feel free to delete the `.github/stale.yml` and `.github/lock.yml` files if you decide not to use the Stale bot.
|
|
@@ -5,8 +5,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
5
5
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
6
|
if (decorator = decorators[i])
|
|
7
7
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result)
|
|
9
|
-
__defProp(target, key, result);
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
9
|
return result;
|
|
11
10
|
};
|
|
12
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commands":[{"commandName":"tuyau:generate","description":"Tuyau generator command","help":"","namespace":"tuyau","aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Verbose logs","default":false,"alias":"v"}],"args":[],"options":{"startApp":true},"filePath":"generate.js"
|
|
1
|
+
{"commands":[{"commandName":"tuyau:generate","description":"Tuyau generator command","help":"","namespace":"tuyau","aliases":[],"flags":[{"name":"verbose","flagName":"verbose","required":false,"type":"boolean","description":"Verbose logs","default":false,"alias":"v"}],"args":[],"options":{"startApp":true},"filePath":"generate.js"}],"version":1}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__decorateClass
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-ADS4GRIL.js";
|
|
4
4
|
|
|
5
5
|
// commands/generate.ts
|
|
6
6
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
@@ -11,6 +11,7 @@ import { BaseCommand, flags } from "@adonisjs/core/ace";
|
|
|
11
11
|
import { Node } from "ts-morph";
|
|
12
12
|
import matchit from "@poppinss/matchit";
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
|
+
import { readFile } from "node:fs/promises";
|
|
14
15
|
import { dirname, relative } from "node:path";
|
|
15
16
|
import { existsSync, mkdirSync } from "node:fs";
|
|
16
17
|
import string from "@adonisjs/core/helpers/string";
|
|
@@ -22,6 +23,7 @@ var ApiTypesGenerator = class {
|
|
|
22
23
|
#config;
|
|
23
24
|
#routes;
|
|
24
25
|
#destination;
|
|
26
|
+
#isTuyauInertiaInstalledCached;
|
|
25
27
|
constructor(options) {
|
|
26
28
|
this.#config = options.config;
|
|
27
29
|
this.#routes = options.routes;
|
|
@@ -30,6 +32,24 @@ var ApiTypesGenerator = class {
|
|
|
30
32
|
this.#appRoot = options.appRoot;
|
|
31
33
|
this.#prepareDestination();
|
|
32
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if the @tuyau/inertia package is installed.
|
|
37
|
+
*/
|
|
38
|
+
async #isTuyauInertiaInstalled() {
|
|
39
|
+
if (this.#isTuyauInertiaInstalledCached !== void 0)
|
|
40
|
+
return this.#isTuyauInertiaInstalledCached;
|
|
41
|
+
try {
|
|
42
|
+
const pkgJsonText = await readFile(
|
|
43
|
+
fileURLToPath(new URL("./package.json", this.#appRoot)),
|
|
44
|
+
"utf-8"
|
|
45
|
+
);
|
|
46
|
+
const pkgJson = JSON.parse(pkgJsonText);
|
|
47
|
+
this.#isTuyauInertiaInstalledCached = !!pkgJson.dependencies?.["@tuyau/inertia"];
|
|
48
|
+
return this.#isTuyauInertiaInstalledCached;
|
|
49
|
+
} catch (error) {
|
|
50
|
+
throw new Error("Unable to read the package.json file", { cause: error });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
33
53
|
#getDestinationDirectory() {
|
|
34
54
|
return dirname(this.#destination);
|
|
35
55
|
}
|
|
@@ -48,15 +68,34 @@ var ApiTypesGenerator = class {
|
|
|
48
68
|
*/
|
|
49
69
|
#extractClassHandlerData(file, routeHandler) {
|
|
50
70
|
const classDef = file.getClasses().find((c) => c.isDefaultExport());
|
|
51
|
-
if (!classDef)
|
|
52
|
-
return;
|
|
71
|
+
if (!classDef) return;
|
|
53
72
|
const method = classDef.getMethod(routeHandler.method);
|
|
54
|
-
if (!method)
|
|
55
|
-
return;
|
|
73
|
+
if (!method) return;
|
|
56
74
|
const body = method.getBody();
|
|
57
|
-
if (!body)
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
if (!body) return;
|
|
76
|
+
return { method, body, file };
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Get the import type of an identifier
|
|
80
|
+
*/
|
|
81
|
+
#getIdentifierImportType(identifier) {
|
|
82
|
+
const sourceFile = identifier.getSourceFile();
|
|
83
|
+
const namedImport = sourceFile.getImportDeclaration((importNode) => {
|
|
84
|
+
const namedImports = importNode.getNamedImports();
|
|
85
|
+
if (namedImports.find((namedImport2) => namedImport2.getName() === identifier.getText())) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
});
|
|
90
|
+
const defaultImport = sourceFile.getImportDeclaration((importNode) => {
|
|
91
|
+
if (importNode.getDefaultImport()?.getText() === identifier.getText()) return true;
|
|
92
|
+
return false;
|
|
93
|
+
});
|
|
94
|
+
const isValidFile = (namedImport || defaultImport)?.getModuleSpecifierSourceFile();
|
|
95
|
+
if (!isValidFile) return void 0;
|
|
96
|
+
if (namedImport) return "named";
|
|
97
|
+
if (defaultImport) return "default";
|
|
98
|
+
return void 0;
|
|
60
99
|
}
|
|
61
100
|
/**
|
|
62
101
|
* We have multiple ways to get the request payload :
|
|
@@ -68,8 +107,7 @@ var ApiTypesGenerator = class {
|
|
|
68
107
|
*/
|
|
69
108
|
#extractRequest(handlerData) {
|
|
70
109
|
const validateUsingCallNode = handlerData.method.forEachDescendant((node) => {
|
|
71
|
-
if (!Node.isCallExpression(node))
|
|
72
|
-
return false;
|
|
110
|
+
if (!Node.isCallExpression(node)) return false;
|
|
73
111
|
if (node.getExpression().getText().includes("validateUsing")) {
|
|
74
112
|
return node;
|
|
75
113
|
}
|
|
@@ -77,16 +115,18 @@ var ApiTypesGenerator = class {
|
|
|
77
115
|
});
|
|
78
116
|
if (validateUsingCallNode) {
|
|
79
117
|
const schema = validateUsingCallNode.getArguments()[0];
|
|
80
|
-
if (!Node.isIdentifier(schema))
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
118
|
+
if (!Node.isIdentifier(schema)) return;
|
|
119
|
+
const definition = schema.getDefinitions().at(0);
|
|
120
|
+
const importType = this.#getIdentifierImportType(schema);
|
|
121
|
+
const isReExportedFromThisFile = definition ? handlerData.file.getExportedDeclarations().has(definition.getNode().getText()) : false;
|
|
122
|
+
if (!importType && !isReExportedFromThisFile) {
|
|
84
123
|
this.#logger.warning(`Unable to find the schema file for ${schema.getText()}`);
|
|
85
124
|
return;
|
|
86
125
|
}
|
|
87
|
-
const importPath =
|
|
126
|
+
const importPath = definition.getSourceFile().getFilePath();
|
|
88
127
|
const relativeImportPath = slash(relative(this.#getDestinationDirectory(), importPath));
|
|
89
|
-
|
|
128
|
+
const propName = importType === "default" ? "default" : schema.getText();
|
|
129
|
+
return `InferInput<typeof import('${relativeImportPath}')['${propName}']>`;
|
|
90
130
|
}
|
|
91
131
|
return void 0;
|
|
92
132
|
}
|
|
@@ -114,28 +154,21 @@ var ApiTypesGenerator = class {
|
|
|
114
154
|
*/
|
|
115
155
|
#filterRoutes(routes, mode) {
|
|
116
156
|
const config = this.#config.codegen?.[mode];
|
|
117
|
-
if (!config || !config.only && !config.except)
|
|
118
|
-
return routes;
|
|
157
|
+
if (!config || !config.only && !config.except) return routes;
|
|
119
158
|
return routes.filter((route) => {
|
|
120
|
-
if (typeof config.only === "function")
|
|
121
|
-
|
|
122
|
-
if (typeof config.except === "function")
|
|
123
|
-
return !config.except(route);
|
|
159
|
+
if (typeof config.only === "function") return config.only(route);
|
|
160
|
+
if (typeof config.except === "function") return !config.except(route);
|
|
124
161
|
if (config.only) {
|
|
125
162
|
for (const pattern of config.only) {
|
|
126
|
-
if (pattern instanceof RegExp && pattern.test(route.pattern))
|
|
127
|
-
|
|
128
|
-
if (route.pattern === pattern)
|
|
129
|
-
return true;
|
|
163
|
+
if (pattern instanceof RegExp && pattern.test(route.pattern)) return true;
|
|
164
|
+
if (route.pattern === pattern) return true;
|
|
130
165
|
}
|
|
131
166
|
return false;
|
|
132
167
|
}
|
|
133
168
|
if (config.except) {
|
|
134
169
|
for (const pattern of config.except) {
|
|
135
|
-
if (pattern instanceof RegExp && pattern.test(route.pattern))
|
|
136
|
-
|
|
137
|
-
if (route.pattern === pattern)
|
|
138
|
-
return false;
|
|
170
|
+
if (pattern instanceof RegExp && pattern.test(route.pattern)) return false;
|
|
171
|
+
if (route.pattern === pattern) return false;
|
|
139
172
|
}
|
|
140
173
|
return true;
|
|
141
174
|
}
|
|
@@ -156,15 +189,14 @@ var ApiTypesGenerator = class {
|
|
|
156
189
|
return routes.map(({ name, pattern, methods }) => {
|
|
157
190
|
const params = matchit.parse(pattern).filter((node) => node.type !== 0).map((node) => node.val);
|
|
158
191
|
let typeName = this.#generateTypeName({ pattern, methods });
|
|
159
|
-
if (!typesByPattern[typeName])
|
|
160
|
-
typeName = "unknown";
|
|
192
|
+
if (!typesByPattern[typeName]) typeName = "unknown";
|
|
161
193
|
return { params, name, path: pattern, method: methods, types: typeName };
|
|
162
194
|
}).filter((route) => !!route.name);
|
|
163
195
|
}
|
|
164
196
|
async #writeApiFile(options) {
|
|
165
197
|
const file = this.#project.createSourceFile(this.#destination, "", { overwrite: true });
|
|
166
|
-
if (!file)
|
|
167
|
-
|
|
198
|
+
if (!file) throw new Error("Unable to create the api.ts file");
|
|
199
|
+
const isTuyauInertiaInstalled = await this.#isTuyauInertiaInstalled();
|
|
168
200
|
file.removeText().insertText(0, (writer) => {
|
|
169
201
|
writer.writeLine(`import type { MakeTuyauRequest, MakeTuyauResponse } from '@tuyau/utils/types'`).writeLine(`import type { InferInput } from '@vinejs/vine/types'`).newLine();
|
|
170
202
|
Object.entries(options.typesByPattern).forEach(([key, value]) => {
|
|
@@ -186,10 +218,12 @@ var ApiTypesGenerator = class {
|
|
|
186
218
|
}
|
|
187
219
|
writer.writeLine(`] as const;`);
|
|
188
220
|
writer.writeLine(`export const api = {`).writeLine(` routes,`).writeLine(` definition: {} as ApiDefinition`).writeLine(`}`);
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
221
|
+
if (isTuyauInertiaInstalled) {
|
|
222
|
+
writer.writeLine(`declare module '@tuyau/inertia/types' {`);
|
|
223
|
+
writer.writeLine(` type ApiDefinition = typeof api`);
|
|
224
|
+
writer.writeLine(` export interface Api extends ApiDefinition {}`);
|
|
225
|
+
writer.writeLine(`}`);
|
|
226
|
+
}
|
|
193
227
|
});
|
|
194
228
|
await file.save();
|
|
195
229
|
}
|
|
@@ -199,8 +233,7 @@ var ApiTypesGenerator = class {
|
|
|
199
233
|
const sourcesFiles = this.#project.getSourceFiles();
|
|
200
234
|
const routes = this.#filterRoutes(this.#routes, "definitions");
|
|
201
235
|
for (const route of routes) {
|
|
202
|
-
if (typeof route.handler === "function")
|
|
203
|
-
continue;
|
|
236
|
+
if (typeof route.handler === "function") continue;
|
|
204
237
|
const routeHandler = await parseBindingReference(route.handler.reference);
|
|
205
238
|
const file = sourcesFiles.find(
|
|
206
239
|
(sf) => sf.getFilePath().endsWith(`${routeHandler.moduleNameOrPath.replace("#", "")}.ts`)
|
|
@@ -221,19 +254,16 @@ var ApiTypesGenerator = class {
|
|
|
221
254
|
let currentLevel = definition;
|
|
222
255
|
const relativePath = slash(relative(this.#getDestinationDirectory(), file.getFilePath()));
|
|
223
256
|
segments.forEach((segment, i) => {
|
|
224
|
-
if (!currentLevel[segment])
|
|
225
|
-
currentLevel[segment] = {};
|
|
257
|
+
if (!currentLevel[segment]) currentLevel[segment] = {};
|
|
226
258
|
currentLevel = currentLevel[segment];
|
|
227
|
-
if (i !== segments.length - 1)
|
|
228
|
-
return;
|
|
259
|
+
if (i !== segments.length - 1) return;
|
|
229
260
|
const typeName = this.#generateTypeName(route);
|
|
230
261
|
typesByPattern[typeName] = {
|
|
231
262
|
request: schemaImport ? `MakeTuyauRequest<${schemaImport}>` : "unknown",
|
|
232
263
|
response: `MakeTuyauResponse<import('${relativePath}').default['${routeHandler.method}']>`
|
|
233
264
|
};
|
|
234
265
|
currentLevel.$url = {};
|
|
235
|
-
for (const method of methods)
|
|
236
|
-
currentLevel[method] = typeName;
|
|
266
|
+
for (const method of methods) currentLevel[method] = typeName;
|
|
237
267
|
});
|
|
238
268
|
}
|
|
239
269
|
const routesNameArray = this.#generateRoutesNameArray(
|
package/build/index.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "../../chunk-ADS4GRIL.js";
|
|
2
|
+
|
|
3
|
+
// src/hooks/build_hook.ts
|
|
4
|
+
import util from "node:util";
|
|
5
|
+
import { exec as cpExec } from "node:child_process";
|
|
6
|
+
var exec = util.promisify(cpExec);
|
|
7
|
+
async function tuyauBuildHook({ logger }) {
|
|
8
|
+
logger.info("generating tuyau codegen file", { suffix: "tuyau" });
|
|
9
|
+
const { stderr } = await exec("node ace tuyau:generate");
|
|
10
|
+
if (stderr) throw new Error(stderr);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
tuyauBuildHook as default
|
|
14
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuyau/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
".": "./build/index.js",
|
|
11
11
|
"./types": "./build/src/types.js",
|
|
12
12
|
"./commands": "./build/commands/main.js",
|
|
13
|
-
"./tuyau_provider": "./build/providers/tuyau_provider.js"
|
|
13
|
+
"./tuyau_provider": "./build/providers/tuyau_provider.js",
|
|
14
|
+
"./build_hook": "./build/src/hooks/build_hook.js"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"build"
|
|
@@ -22,16 +23,16 @@
|
|
|
22
23
|
"@adonisjs/core": "^6.2.0"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"ts-morph": "^
|
|
26
|
+
"ts-morph": "^23.0.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@adonisjs/assembler": "^7.
|
|
29
|
-
"@adonisjs/core": "^6.
|
|
29
|
+
"@adonisjs/assembler": "^7.8.2",
|
|
30
|
+
"@adonisjs/core": "^6.14.0",
|
|
30
31
|
"@julr/tooling-configs": "^2.2.0",
|
|
31
32
|
"@poppinss/cliui": "^6.4.1",
|
|
32
33
|
"@poppinss/matchit": "^3.1.2",
|
|
33
|
-
"@types/node": "^20.
|
|
34
|
-
"@tuyau/client": "0.1.
|
|
34
|
+
"@types/node": "^20.16.5",
|
|
35
|
+
"@tuyau/client": "0.1.2",
|
|
35
36
|
"@tuyau/utils": "0.0.4"
|
|
36
37
|
},
|
|
37
38
|
"publishConfig": {
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"entry": [
|
|
52
53
|
"./index.ts",
|
|
53
54
|
"./src/types.ts",
|
|
55
|
+
"./src/hooks/build_hook.ts",
|
|
54
56
|
"./commands/generate.ts",
|
|
55
57
|
"./providers/tuyau_provider.ts"
|
|
56
58
|
],
|