@lensjs/adonis 1.0.1
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/LICENSE.md +9 -0
- package/README.md +1 -0
- package/build/configure.d.ts +2 -0
- package/build/configure.js +38 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +12 -0
- package/build/providers/lens_service_provider.d.ts +14 -0
- package/build/providers/lens_service_provider.js +39 -0
- package/build/src/adapter.d.ts +22 -0
- package/build/src/adapter.js +124 -0
- package/build/src/define_config.d.ts +21 -0
- package/build/src/define_config.js +6 -0
- package/build/src/utils/index.d.ts +9 -0
- package/build/src/utils/index.js +51 -0
- package/build/stubs/config/lens.stub +40 -0
- package/build/stubs/main.d.ts +5 -0
- package/build/stubs/main.js +7 -0
- package/package.json +87 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
- first user should add the running console in bin/console file
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
| Configure hook
|
|
4
|
+
|--------------------------------------------------------------------------
|
|
5
|
+
|
|
|
6
|
+
| The configure hook is called when someone runs "node ace configure <package>"
|
|
7
|
+
| command. You are free to perform any operations inside this function to
|
|
8
|
+
| configure the package.
|
|
9
|
+
|
|
|
10
|
+
| To make things easier, you have access to the underlying "ConfigureCommand"
|
|
11
|
+
| instance and you can use codemods to modify the source files.
|
|
12
|
+
|
|
|
13
|
+
*/
|
|
14
|
+
import { stubsRoot } from './stubs/main.js';
|
|
15
|
+
const registerEnvValidation = async (codemods) => {
|
|
16
|
+
try {
|
|
17
|
+
await codemods.defineEnvValidations({
|
|
18
|
+
leadingComment: 'Node lens variables',
|
|
19
|
+
variables: {
|
|
20
|
+
LENS_BASE_PATH: 'Env.schema.string.optional()',
|
|
21
|
+
LENS_ENABLED: 'Env.schema.boolean.optional()',
|
|
22
|
+
LENS_ENABLE_QUERY_WATCHER: 'Env.schema.boolean.optional()',
|
|
23
|
+
LENS_ENABLE_REQUEST_WATCHER: 'Env.schema.boolean.optional()',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error(error);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export async function configure(command) {
|
|
32
|
+
const codemods = await command.createCodemods();
|
|
33
|
+
await registerEnvValidation(codemods);
|
|
34
|
+
await codemods.makeUsingStub(stubsRoot, 'config/lens.stub', {});
|
|
35
|
+
await codemods.updateRcFile((rcFile) => {
|
|
36
|
+
rcFile.addProvider('@lensjs/adonis/lens_provider');
|
|
37
|
+
});
|
|
38
|
+
}
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
| Package entrypoint
|
|
4
|
+
|--------------------------------------------------------------------------
|
|
5
|
+
|
|
|
6
|
+
| Export values from the package entrypoint as you see fit.
|
|
7
|
+
|
|
|
8
|
+
*/
|
|
9
|
+
export { configure } from './configure.js';
|
|
10
|
+
export { defineConfig } from './src/define_config.js';
|
|
11
|
+
export { stubsRoot } from './stubs/main.js';
|
|
12
|
+
export { default as LensAdapter } from './src/adapter.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ApplicationService } from '@adonisjs/core/types';
|
|
2
|
+
import { LensConfig } from '../src/define_config.js';
|
|
3
|
+
import { QueryEntry } from '@lensjs/core';
|
|
4
|
+
declare module '@adonisjs/core/types' {
|
|
5
|
+
interface ContainerBindings {
|
|
6
|
+
lensConfig: LensConfig;
|
|
7
|
+
queries?: QueryEntry['data'][];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export default class LensServiceProvider {
|
|
11
|
+
protected app: ApplicationService;
|
|
12
|
+
constructor(app: ApplicationService);
|
|
13
|
+
boot(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { configProvider } from '@adonisjs/core';
|
|
2
|
+
import { RuntimeException } from '@poppinss/utils';
|
|
3
|
+
import { Lens, lensUtils, RequestWatcher, QueryWatcher } from '@lensjs/core';
|
|
4
|
+
import AdonisAdapter from '../src/adapter.js';
|
|
5
|
+
export default class LensServiceProvider {
|
|
6
|
+
app;
|
|
7
|
+
constructor(app) {
|
|
8
|
+
this.app = app;
|
|
9
|
+
}
|
|
10
|
+
async boot() {
|
|
11
|
+
const lensConfigProvider = this.app.config.get('lens');
|
|
12
|
+
const config = await configProvider.resolve(this.app, lensConfigProvider);
|
|
13
|
+
if (!config) {
|
|
14
|
+
throw new RuntimeException('Invalid "config/lens.ts" file. Make sure you are using the "defineConfig" method');
|
|
15
|
+
}
|
|
16
|
+
const { normalizedPath, ignoredPaths } = lensUtils.prepareIgnoredPaths(config.path, config.ignoredPaths);
|
|
17
|
+
config.ignoredPaths = ignoredPaths;
|
|
18
|
+
this.app.container.bindValue('lensConfig', config);
|
|
19
|
+
this.app.booted(async () => {
|
|
20
|
+
const watchersMap = {
|
|
21
|
+
requests: new RequestWatcher(),
|
|
22
|
+
queries: new QueryWatcher(),
|
|
23
|
+
};
|
|
24
|
+
const allowedWatchers = Object.keys(config.watchers)
|
|
25
|
+
.filter((watcher) => config.watchers[watcher])
|
|
26
|
+
.map((watcher) => watchersMap[watcher])
|
|
27
|
+
.filter((watcher) => !!watcher);
|
|
28
|
+
const adapter = new AdonisAdapter({ app: this.app })
|
|
29
|
+
.setConfig(config)
|
|
30
|
+
.setIgnoredPaths(ignoredPaths)
|
|
31
|
+
.setOnlyPaths(config.onlyPaths);
|
|
32
|
+
await Lens.setWatchers(allowedWatchers).setAdapter(adapter).start({
|
|
33
|
+
basePath: normalizedPath,
|
|
34
|
+
enabled: config.enabled,
|
|
35
|
+
appName: config.appName,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RouteDefinition, LensAdapter, RequestWatcher, QueryWatcher } from '@lensjs/core';
|
|
2
|
+
import type { ApplicationService, EmitterService, HttpRouterService } from '@adonisjs/core/types';
|
|
3
|
+
import { LensConfig } from './define_config.js';
|
|
4
|
+
export default class AdonisAdapter extends LensAdapter {
|
|
5
|
+
protected app: ApplicationService;
|
|
6
|
+
protected router: HttpRouterService;
|
|
7
|
+
protected emitter: EmitterService;
|
|
8
|
+
protected isRequestWatcherEnabled: boolean;
|
|
9
|
+
protected queryWatcher?: QueryWatcher;
|
|
10
|
+
protected config: LensConfig;
|
|
11
|
+
constructor({ app }: {
|
|
12
|
+
app: ApplicationService;
|
|
13
|
+
});
|
|
14
|
+
setup(): void;
|
|
15
|
+
setConfig(config: LensConfig): this;
|
|
16
|
+
registerRoutes(routes: RouteDefinition[]): void;
|
|
17
|
+
protected watchRequests(requestWatcher: RequestWatcher): void;
|
|
18
|
+
protected watchQueries(queryWatcher: QueryWatcher): Promise<void>;
|
|
19
|
+
serveUI(uiPath: string, spaRoute: string, _dataToInject: Record<string, any>): void;
|
|
20
|
+
private matchStaticFiles;
|
|
21
|
+
private getUserFromContext;
|
|
22
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { LensAdapter, WatcherTypeEnum, lensUtils, } from '@lensjs/core';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { shouldIgnoreLogging } from './utils/index.js';
|
|
4
|
+
import string from '@adonisjs/core/helpers/string';
|
|
5
|
+
export default class AdonisAdapter extends LensAdapter {
|
|
6
|
+
app;
|
|
7
|
+
router;
|
|
8
|
+
emitter;
|
|
9
|
+
isRequestWatcherEnabled = false;
|
|
10
|
+
queryWatcher;
|
|
11
|
+
config;
|
|
12
|
+
constructor({ app }) {
|
|
13
|
+
super();
|
|
14
|
+
this.app = app;
|
|
15
|
+
}
|
|
16
|
+
setup() {
|
|
17
|
+
this.app.booted(async () => {
|
|
18
|
+
this.router = await this.app.container.make('router');
|
|
19
|
+
this.emitter = await this.app.container.make('emitter');
|
|
20
|
+
for (const watcher of this.getWatchers()) {
|
|
21
|
+
switch (watcher.name) {
|
|
22
|
+
case WatcherTypeEnum.REQUEST:
|
|
23
|
+
this.isRequestWatcherEnabled = true;
|
|
24
|
+
this.watchRequests(watcher);
|
|
25
|
+
break;
|
|
26
|
+
case WatcherTypeEnum.QUERY:
|
|
27
|
+
this.queryWatcher = watcher;
|
|
28
|
+
await this.watchQueries(watcher);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
setConfig(config) {
|
|
35
|
+
this.config = config;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
registerRoutes(routes) {
|
|
39
|
+
this.app.booted(async () => {
|
|
40
|
+
routes.forEach((route) => {
|
|
41
|
+
this.router[route.method.toLowerCase()](route.path, async (ctx) => {
|
|
42
|
+
const data = await route.handler({ params: ctx.params, qs: ctx.request.qs() });
|
|
43
|
+
return ctx.response.json(data);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
watchRequests(requestWatcher) {
|
|
49
|
+
const self = this;
|
|
50
|
+
if (shouldIgnoreLogging(this.app) || !self.isRequestWatcherEnabled)
|
|
51
|
+
return;
|
|
52
|
+
this.emitter.on('http:request_completed', async function (event) {
|
|
53
|
+
if (self.shouldIgnorePath(event.ctx.request.url(false)))
|
|
54
|
+
return;
|
|
55
|
+
const request = event.ctx.request;
|
|
56
|
+
const requestId = lensUtils.generateRandomUuid();
|
|
57
|
+
const logPayload = {
|
|
58
|
+
request: {
|
|
59
|
+
id: requestId,
|
|
60
|
+
method: request.method(),
|
|
61
|
+
duration: string.prettyHrTime(event.duration),
|
|
62
|
+
path: request.url(true),
|
|
63
|
+
headers: request.headers(),
|
|
64
|
+
body: request.hasBody() ? request.body() : {},
|
|
65
|
+
status: event.ctx.response.response.statusCode,
|
|
66
|
+
ip: request.ip(),
|
|
67
|
+
createdAt: lensUtils.nowISO(),
|
|
68
|
+
},
|
|
69
|
+
response: {
|
|
70
|
+
json: event.ctx.response.getBody(),
|
|
71
|
+
headers: event.ctx.response.getHeaders(),
|
|
72
|
+
},
|
|
73
|
+
user: await self.getUserFromContext(event.ctx),
|
|
74
|
+
};
|
|
75
|
+
await requestWatcher.log(logPayload);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async watchQueries(queryWatcher) {
|
|
79
|
+
const self = this;
|
|
80
|
+
this.app.booted(async () => {
|
|
81
|
+
if (shouldIgnoreLogging(self.app))
|
|
82
|
+
return;
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
this.emitter.on('db:query', async function (query) {
|
|
85
|
+
const duration = query.duration ? string.prettyHrTime(query.duration) : '0 ms';
|
|
86
|
+
const payload = {
|
|
87
|
+
query: lensUtils.formatSqlQuery(lensUtils.interpolateQuery(query.sql, query.bindings), self.config.watchers.queries.provider),
|
|
88
|
+
duration,
|
|
89
|
+
createdAt: lensUtils.sqlDateTime(),
|
|
90
|
+
type: self.config.watchers.queries.provider,
|
|
91
|
+
};
|
|
92
|
+
await queryWatcher.log({
|
|
93
|
+
data: payload,
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
serveUI(uiPath, spaRoute, _dataToInject) {
|
|
99
|
+
this.app.booted(async () => {
|
|
100
|
+
this.router.get(`/${spaRoute}/favicon.svg`, (ctx) => {
|
|
101
|
+
return ctx.response.download(path.join(uiPath, 'favicon.svg'));
|
|
102
|
+
});
|
|
103
|
+
this.router.get(`/${spaRoute}`, (ctx) => {
|
|
104
|
+
return ctx.response.redirect(`/${spaRoute}/requests`);
|
|
105
|
+
});
|
|
106
|
+
this.router.get(`/${spaRoute}/*`, (ctx) => {
|
|
107
|
+
if (lensUtils.isStaticFile(ctx.params['*'])) {
|
|
108
|
+
return this.matchStaticFiles(ctx, uiPath, lensUtils.stripBeforeAssetsPath(ctx.params['*'].join('/')));
|
|
109
|
+
}
|
|
110
|
+
const htmlPath = path.join(uiPath, 'index.html');
|
|
111
|
+
return ctx.response.download(htmlPath, true);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
matchStaticFiles(ctx, uiPath, subPath) {
|
|
116
|
+
const assetPath = path.join(uiPath, subPath);
|
|
117
|
+
return ctx.response.download(assetPath);
|
|
118
|
+
}
|
|
119
|
+
async getUserFromContext(ctx) {
|
|
120
|
+
return (await this.config.isAuthenticated?.(ctx)) && this.config.getUser
|
|
121
|
+
? await this.config.getUser?.(ctx)
|
|
122
|
+
: null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HttpContext } from '@adonisjs/core/http';
|
|
2
|
+
import { QueryType, UserEntry } from '../../core/dist/types/index.js';
|
|
3
|
+
type AdonisQueryType = Extract<QueryType, "postgresql" | "sqlite" | "mysql" | "mariadb" | "plsql" | "transactsql">;
|
|
4
|
+
export type LensConfig = {
|
|
5
|
+
appName: string;
|
|
6
|
+
path: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
ignoredPaths: RegExp[];
|
|
9
|
+
onlyPaths: RegExp[];
|
|
10
|
+
watchers: {
|
|
11
|
+
queries: {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
provider: AdonisQueryType;
|
|
14
|
+
};
|
|
15
|
+
requests: boolean;
|
|
16
|
+
};
|
|
17
|
+
isAuthenticated?: (ctx: HttpContext) => Promise<boolean>;
|
|
18
|
+
getUser?: (ctx: HttpContext) => Promise<UserEntry>;
|
|
19
|
+
};
|
|
20
|
+
export declare function defineConfig(config: LensConfig): import("@adonisjs/core/types").ConfigProvider<LensConfig>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ApplicationService } from '@adonisjs/core/types';
|
|
2
|
+
import { HttpContext } from '@adonisjs/core/http';
|
|
3
|
+
import { LensConfig } from '../define_config.js';
|
|
4
|
+
export declare const runningInConsole: (app: ApplicationService) => boolean;
|
|
5
|
+
export declare const getRunningCommand: () => string;
|
|
6
|
+
export declare function allowedCommands(): boolean;
|
|
7
|
+
export declare const shouldIgnoreLogging: (app: ApplicationService) => boolean;
|
|
8
|
+
export declare const resolveConfigFromContext: (ctx: HttpContext) => Promise<LensConfig>;
|
|
9
|
+
export declare function parseDuration(durationStr: string): number;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
export const runningInConsole = (app) => {
|
|
3
|
+
return ['console', 'repl', 'test'].includes(app.getEnvironment());
|
|
4
|
+
};
|
|
5
|
+
export const getRunningCommand = () => {
|
|
6
|
+
const cmd = process.env.ACE_CLI_COMMAND;
|
|
7
|
+
if (!cmd) {
|
|
8
|
+
const message = `
|
|
9
|
+
${chalk.red.bold('✖ Could not determine running command')}
|
|
10
|
+
|
|
11
|
+
Make sure to set the environment variable:
|
|
12
|
+
|
|
13
|
+
${chalk.cyan("process.env.ACE_CLI_COMMAND = process.argv[2] ?? ''")}
|
|
14
|
+
|
|
15
|
+
before creating a new Ignitor instance in:
|
|
16
|
+
|
|
17
|
+
${chalk.yellow('start/server.ts')}
|
|
18
|
+
`;
|
|
19
|
+
throw new Error(message);
|
|
20
|
+
}
|
|
21
|
+
return cmd;
|
|
22
|
+
};
|
|
23
|
+
export function allowedCommands() {
|
|
24
|
+
const command = getRunningCommand();
|
|
25
|
+
return ['queue:listen', 'schedule:work'].includes(command ?? 'WRONG');
|
|
26
|
+
}
|
|
27
|
+
export const shouldIgnoreLogging = (app) => {
|
|
28
|
+
return runningInConsole(app) && !allowedCommands();
|
|
29
|
+
};
|
|
30
|
+
export const resolveConfigFromContext = async (ctx) => {
|
|
31
|
+
return await ctx.containerResolver.make('lensConfig');
|
|
32
|
+
};
|
|
33
|
+
export function parseDuration(durationStr) {
|
|
34
|
+
const [value, unit] = durationStr.trim().split(' ');
|
|
35
|
+
const num = parseFloat(value);
|
|
36
|
+
switch (unit) {
|
|
37
|
+
case 'ms':
|
|
38
|
+
return num;
|
|
39
|
+
case 's':
|
|
40
|
+
return num * 1000;
|
|
41
|
+
case 'μs':
|
|
42
|
+
case 'µs':
|
|
43
|
+
return num / 1000;
|
|
44
|
+
case 'ns':
|
|
45
|
+
return num / 1_000_000;
|
|
46
|
+
case 'min':
|
|
47
|
+
return num * 60_000;
|
|
48
|
+
default:
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{{{
|
|
2
|
+
exports({ to: app.configPath('lens.ts') })
|
|
3
|
+
}}}
|
|
4
|
+
import env from '#start/env'
|
|
5
|
+
import { defineConfig } from '@lensjs/adonis'
|
|
6
|
+
|
|
7
|
+
const lensConfig = defineConfig({
|
|
8
|
+
appName: env.get('APP_NAME', 'AdonisJs'),
|
|
9
|
+
enabled: env.get('LENS_ENABLED', true),
|
|
10
|
+
path: env.get('LENS_BASE_PATH', 'lens'),
|
|
11
|
+
ignoredPaths: [],
|
|
12
|
+
onlyPaths: [],
|
|
13
|
+
watchers: {
|
|
14
|
+
requests: env.get('LENS_ENABLE_REQUEST_WATCHER', true),
|
|
15
|
+
queries: {
|
|
16
|
+
enabled: env.get('LENS_ENABLE_QUERY_WATCHER', true),
|
|
17
|
+
provider: 'sqlite', // Change to your database provider
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
// Optional
|
|
21
|
+
isAuthenticated: async (ctx) => {
|
|
22
|
+
return await ctx.auth?.check()
|
|
23
|
+
},
|
|
24
|
+
// Optional
|
|
25
|
+
getUser: async (ctx) => {
|
|
26
|
+
const user = ctx.auth?.user
|
|
27
|
+
|
|
28
|
+
if (!user) {
|
|
29
|
+
return null
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
id: user.$primaryKeyValue,
|
|
34
|
+
name: user.name,
|
|
35
|
+
email: user.email,
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
export default lensConfig
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
/**
|
|
4
|
+
* Path to the root directory where the stubs are stored. We use
|
|
5
|
+
* this path within commands and the configure hook
|
|
6
|
+
*/
|
|
7
|
+
export const stubsRoot = dirname(fileURLToPath(import.meta.url));
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lensjs/adonis",
|
|
3
|
+
"description": "AdonisJs adapter for lens package",
|
|
4
|
+
"version": "1.0.1",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=20.6.0"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"files": [
|
|
10
|
+
"build/src",
|
|
11
|
+
"build/providers",
|
|
12
|
+
"build/stubs",
|
|
13
|
+
"build/index.d.ts",
|
|
14
|
+
"build/index.js",
|
|
15
|
+
"build/configure.d.ts",
|
|
16
|
+
"build/configure.js"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": "./build/index.js",
|
|
20
|
+
"./types": "./build/src/types.js",
|
|
21
|
+
"./lens_provider": "./build/providers/lens_service_provider.js",
|
|
22
|
+
"./lens_middleware": "./build/src/middlewares/lens_middleware.js"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"clean": "del-cli build",
|
|
26
|
+
"copy:templates": "copyfiles \"stubs/**/*.stub\" build",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"lint": "eslint .",
|
|
29
|
+
"format": "prettier --write .",
|
|
30
|
+
"quick:test": "node --import=./tsnode.esm.js --enable-source-maps bin/test.ts",
|
|
31
|
+
"pretest": "npm run lint",
|
|
32
|
+
"test": "c8 npm run quick:test",
|
|
33
|
+
"prebuild": "npm run clean",
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"postbuild": "npm run copy:templates",
|
|
36
|
+
"release": "np",
|
|
37
|
+
"version": "npm run build",
|
|
38
|
+
"prepublishOnly": "npm run build"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [],
|
|
41
|
+
"author": "",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@adonisjs/assembler": "^7.8.2",
|
|
45
|
+
"@adonisjs/core": "^6.12.0",
|
|
46
|
+
"@adonisjs/eslint-config": "2.0.0-beta.7",
|
|
47
|
+
"@adonisjs/lucid": "^21.8.0",
|
|
48
|
+
"@adonisjs/prettier-config": "^1.4.0",
|
|
49
|
+
"@adonisjs/tsconfig": "^1.3.0",
|
|
50
|
+
"@japa/assert": "^3.0.0",
|
|
51
|
+
"@japa/runner": "^3.1.4",
|
|
52
|
+
"@swc/core": "^1.6.3",
|
|
53
|
+
"@types/node": "^20.14.5",
|
|
54
|
+
"c8": "^10.1.2",
|
|
55
|
+
"copyfiles": "^2.4.1",
|
|
56
|
+
"del-cli": "^5.1.0",
|
|
57
|
+
"eslint": "^9.15.0",
|
|
58
|
+
"np": "^10.0.6",
|
|
59
|
+
"prettier": "^3.3.2",
|
|
60
|
+
"ts-node-maintained": "^10.9.4",
|
|
61
|
+
"typescript": "^5.4.5"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@adonisjs/core": "^6.2.0"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public",
|
|
68
|
+
"tag": "latest"
|
|
69
|
+
},
|
|
70
|
+
"np": {
|
|
71
|
+
"message": "chore(release): %s",
|
|
72
|
+
"tag": "latest",
|
|
73
|
+
"branch": "main",
|
|
74
|
+
"anyBranch": false
|
|
75
|
+
},
|
|
76
|
+
"c8": {
|
|
77
|
+
"reporter": [
|
|
78
|
+
"text",
|
|
79
|
+
"html"
|
|
80
|
+
],
|
|
81
|
+
"exclude": [
|
|
82
|
+
"tests/**"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"prettier": "@adonisjs/prettier-config",
|
|
86
|
+
"gitHead": "54568656ae9332e499ee05b21cded9c0f7dd7e40"
|
|
87
|
+
}
|