Skip to content

Commit b456d80

Browse files
committed
Updated ajv version + WIP pkg script
1 parent 339d4b2 commit b456d80

File tree

8 files changed

+44
-10
lines changed

8 files changed

+44
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"ajv": "^8.12.0",
1212
"ajv-formats": "^3.0.1",
1313
"chalk": "^5.3.0",
14-
"codify-schemas": "1.0.44",
14+
"codify-schemas": "1.0.45",
1515
"debug": "^4.3.4",
1616
"ink": "^4.4.1",
1717
"parse-json": "^8.1.0",

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import copy from 'rollup-plugin-copy';
99
export default {
1010
input: 'src/index.ts',
1111
output: {
12-
dir:'dist',
12+
dir:'./build/dist',
1313
format: 'es'
1414
},
1515
plugins: [

scripts/pkg.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
import chalk from 'chalk'
3+
import { ChildProcess, exec } from 'node:child_process'
4+
import fs from 'node:fs/promises'
5+
6+
console.log(chalk.magenta('Removing ./dist folder'))
7+
await fs.rm('../dist', {
8+
force: true,
9+
recursive: true,
10+
})
11+
12+
console.log(chalk.magenta('Creating build directory'))
13+
try {
14+
await fs.mkdir('../build', {});
15+
} catch {
16+
console.error('Directory already exists')
17+
}
18+
19+
await fs.cp('../src/', '../build')
20+
await fs.cp('../package.json', '../build')
21+
22+
23+
console.log(chalk.magenta('Running rollup'))
24+
const rollupProcess = exec('rollup -c --file ');
25+
addStdout(rollupProcess)
26+
27+
function addStdout(process: ChildProcess) {
28+
process.stdout!.on('data', (data) => {
29+
console.log(data)
30+
})
31+
process.stderr!.on('data', (data) => {
32+
console.log(data)
33+
})
34+
}

src/commands/apply/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Args, Flags } from '@oclif/core'
1+
import Flags from '@oclif/core/flags'
22
import * as path from 'node:path';
33

44
import { BaseCommand } from '../../common/base-command.js';

src/commands/plan/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Args, Flags } from '@oclif/core'
1+
import Flags from '@oclif/core/flags'
22
import * as path from 'node:path';
33

4-
import { PlanOrchestrator } from '../../orchestrators/plan.js';
54
import { BaseCommand } from '../../common/base-command.js';
5+
import { PlanOrchestrator } from '../../orchestrators/plan.js';
66

77
export default class Plan extends BaseCommand {
88
static description = 'Generate a plan based on a codify.json file. This plan will list ' +

src/common/base-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Command, Flags } from '@oclif/core';
2+
import { OutputFlags } from '@oclif/core/interfaces';
23
import chalk from 'chalk';
34
import { SudoRequestData } from 'codify-schemas';
45
import createDebug from 'debug';
56

67
import { Event, ctx } from '../events/context.js';
78
import { Reporter, ReporterFactory, ReporterType } from '../ui/reporters/reporter.js';
89
import { prettyPrintError } from './errors.js';
9-
import { OutputFlags } from '@oclif/core/interfaces';
1010

1111
export abstract class BaseCommand extends Command {
1212

src/utils/ajv.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import Ajv2020 from 'ajv/dist/2020.js';
2-
import addFormats from 'ajv-formats';
1+
import { Ajv } from 'ajv';
32
import { ErrorObject } from 'ajv';
3+
import addFormats from 'ajv-formats';
4+
45
import { SourceMapCache } from '../parser/source-maps.js';
56

6-
const ajv = new Ajv2020.default({
7+
const ajv = new Ajv({
78
allErrors: true,
89
strict: true,
910
});

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"compilerOptions": {
3-
"declaration": true,
43
"module": "NodeNext",
54
"moduleResolution": "Node16",
65
"esModuleInterop": true,

0 commit comments

Comments
 (0)