-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ts
41 lines (36 loc) · 966 Bytes
/
configure.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import ConfigureCommand from '@adonisjs/core/commands/configure'
import { stubsRoot } from './stubs/main.js'
/**
* Configures the package
*/
export async function configure(command: ConfigureCommand) {
const codemods = await command.createCodemods()
/**
* Publish config file
*/
await codemods.makeUsingStub(stubsRoot, 'start/sentry.stub', {})
/**
* Publish provider and command
*/
await codemods.updateRcFile((rcFile: any) => {
rcFile.addProvider('sentry-adonis-v6/sentry_provider')
rcFile.addCommand('sentry-adonis-v6/commands')
})
/**
* Define env variables
*/
await codemods.defineEnvVariables({
SENTRY_DSN: '',
SENTRY_ENVIRONMENT: '',
})
/**
* Define env variables validation
*/
await codemods.defineEnvValidations({
variables: {
SENTRY_DSN: 'Env.schema.string()',
SENTRY_ENVIRONMENT: 'Env.schema.string()',
},
leadingComment: 'Variables for sentry-adonis-v6',
})
}