ic-mops 1.7.2 → 1.8.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 +4 -0
- package/bundle/bench/bench-canister.mo +113 -0
- package/bundle/bench/user-bench.mo +14 -0
- package/bundle/bin/moc-wrapper.sh +40 -0
- package/bundle/bin/mops.js +3 -0
- package/bundle/cli.js +14 -14
- package/bundle/cli.tgz +0 -0
- package/bundle/declarations/bench/bench.did +30 -0
- package/bundle/declarations/bench/bench.did.d.ts +33 -0
- package/bundle/declarations/bench/bench.did.js +30 -0
- package/bundle/declarations/bench/index.d.ts +50 -0
- package/bundle/declarations/bench/index.js +40 -0
- package/bundle/declarations/main/index.d.ts +50 -0
- package/bundle/declarations/main/index.js +40 -0
- package/bundle/declarations/main/main.did +465 -0
- package/bundle/declarations/main/main.did.d.ts +392 -0
- package/bundle/declarations/main/main.did.js +454 -0
- package/bundle/declarations/storage/index.d.ts +50 -0
- package/bundle/declarations/storage/index.js +30 -0
- package/bundle/declarations/storage/storage.did +46 -0
- package/bundle/declarations/storage/storage.did.d.ts +40 -0
- package/bundle/declarations/storage/storage.did.js +38 -0
- package/bundle/package.json +35 -0
- package/bundle/templates/README.md +13 -0
- package/bundle/templates/licenses/Apache-2.0 +202 -0
- package/bundle/templates/licenses/Apache-2.0-NOTICE +13 -0
- package/bundle/templates/licenses/MIT +21 -0
- package/bundle/templates/mops-publish.yml +17 -0
- package/bundle/templates/mops-test.yml +24 -0
- package/bundle/templates/src/lib.mo +15 -0
- package/bundle/templates/test/lib.test.mo +4 -0
- package/bundle/wasm_bg.wasm +0 -0
- package/cli.ts +16 -0
- package/commands/format.ts +169 -0
- package/commands/watch/formatter.ts +74 -0
- package/commands/watch/watch.ts +23 -2
- package/dist/cli.js +15 -0
- package/dist/commands/format.d.ts +14 -0
- package/dist/commands/format.js +131 -0
- package/dist/commands/watch/formatter.d.ts +19 -0
- package/dist/commands/watch/formatter.js +57 -0
- package/dist/commands/watch/watch.d.ts +1 -0
- package/dist/commands/watch/watch.js +19 -1
- package/dist/package.json +4 -2
- package/package.json +6 -4
- package/types.ts +10 -0
package/dist/cli.js
CHANGED
|
@@ -27,6 +27,7 @@ import { resolvePackages } from './resolve-packages.js';
|
|
|
27
27
|
import { watch } from './commands/watch/watch.js';
|
|
28
28
|
import { addOwner, printOwners, removeOwner } from './commands/owner.js';
|
|
29
29
|
import { addMaintainer, printMaintainers, removeMaintainer } from './commands/maintainer.js';
|
|
30
|
+
import { format } from './commands/format.js';
|
|
30
31
|
events.setMaxListeners(20);
|
|
31
32
|
let networkFile = getNetworkFile();
|
|
32
33
|
if (fs.existsSync(networkFile)) {
|
|
@@ -404,6 +405,7 @@ program
|
|
|
404
405
|
.description('Watch *.mo files and check for syntax errors, warnings, run tests, generate declarations and deploy canisters')
|
|
405
406
|
.option('-e, --error', 'Check Motoko canisters or *.mo files for syntax errors')
|
|
406
407
|
.option('-w, --warning', 'Check Motoko canisters or *.mo files for warnings')
|
|
408
|
+
.option('-f, --format', 'Format Motoko code')
|
|
407
409
|
.option('-t, --test', 'Run tests')
|
|
408
410
|
.option('-g, --generate', 'Generate declarations for Motoko canisters')
|
|
409
411
|
.option('-d, --deploy', 'Deploy Motoko canisters')
|
|
@@ -411,4 +413,17 @@ program
|
|
|
411
413
|
checkConfigFile(true);
|
|
412
414
|
await watch(options);
|
|
413
415
|
});
|
|
416
|
+
// format
|
|
417
|
+
program
|
|
418
|
+
.command('format [filter]')
|
|
419
|
+
.alias('fmt')
|
|
420
|
+
.description('Format Motoko code')
|
|
421
|
+
.addOption(new Option('--check', 'Check code formatting (do not change source files)'))
|
|
422
|
+
.action(async (filter, options) => {
|
|
423
|
+
checkConfigFile(true);
|
|
424
|
+
let { ok } = await format(filter, options);
|
|
425
|
+
if (!ok) {
|
|
426
|
+
process.exit(1);
|
|
427
|
+
}
|
|
428
|
+
});
|
|
414
429
|
program.parse();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type FormatOptions = {
|
|
2
|
+
check: boolean;
|
|
3
|
+
silent: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type FormatResult = {
|
|
6
|
+
ok: boolean;
|
|
7
|
+
total: number;
|
|
8
|
+
checked: number;
|
|
9
|
+
valid: number;
|
|
10
|
+
invalid: number;
|
|
11
|
+
formatted: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function format(filter: string, options?: Partial<FormatOptions>, signal?: AbortSignal, onProgress?: (result: FormatResult) => void): Promise<FormatResult>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { globSync } from 'glob';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import * as prettier from 'prettier';
|
|
6
|
+
import motokoPlugin from 'prettier-plugin-motoko';
|
|
7
|
+
import { getRootDir } from '../mops.js';
|
|
8
|
+
import { absToRel } from './test/utils.js';
|
|
9
|
+
import { parallel } from '../parallel.js';
|
|
10
|
+
let ignore = [
|
|
11
|
+
'**/node_modules/**',
|
|
12
|
+
'**/.mops/**',
|
|
13
|
+
'**/.vessel/**',
|
|
14
|
+
'**/.git/**',
|
|
15
|
+
'**/dist/**',
|
|
16
|
+
];
|
|
17
|
+
let globConfig = {
|
|
18
|
+
nocase: true,
|
|
19
|
+
ignore: ignore,
|
|
20
|
+
};
|
|
21
|
+
export async function format(filter, options = {}, signal, onProgress) {
|
|
22
|
+
let startTime = Date.now();
|
|
23
|
+
let rootDir = getRootDir();
|
|
24
|
+
let globStr = '**/*.mo';
|
|
25
|
+
if (filter) {
|
|
26
|
+
globStr = `**/*${filter}*.mo`;
|
|
27
|
+
}
|
|
28
|
+
let files = globSync(path.join(rootDir, globStr), {
|
|
29
|
+
...globConfig,
|
|
30
|
+
cwd: rootDir,
|
|
31
|
+
});
|
|
32
|
+
let invalidFiles = 0;
|
|
33
|
+
let checkedFiles = 0;
|
|
34
|
+
let getResult = (ok) => {
|
|
35
|
+
let result = {
|
|
36
|
+
ok,
|
|
37
|
+
total: files.length,
|
|
38
|
+
checked: checkedFiles,
|
|
39
|
+
valid: files.length - invalidFiles,
|
|
40
|
+
invalid: invalidFiles,
|
|
41
|
+
formatted: invalidFiles,
|
|
42
|
+
};
|
|
43
|
+
onProgress?.(result);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
if (!files.length) {
|
|
47
|
+
if (filter) {
|
|
48
|
+
options.silent || console.log(`No files found for filter '${filter}'`);
|
|
49
|
+
return getResult(false);
|
|
50
|
+
}
|
|
51
|
+
if (!options.silent) {
|
|
52
|
+
console.log('No *.mo files found');
|
|
53
|
+
}
|
|
54
|
+
return getResult(false);
|
|
55
|
+
}
|
|
56
|
+
if (signal?.aborted) {
|
|
57
|
+
return getResult(false);
|
|
58
|
+
}
|
|
59
|
+
// get prettier config from .prettierrc
|
|
60
|
+
let prettierConfigFile = await prettier.resolveConfigFile();
|
|
61
|
+
await parallel(4, files, async (file) => {
|
|
62
|
+
if (signal?.aborted) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
let conf = await prettier.resolveConfig(file, { editorconfig: true });
|
|
66
|
+
let prettierConfig = {};
|
|
67
|
+
if (prettierConfigFile) {
|
|
68
|
+
if (conf) {
|
|
69
|
+
prettierConfig = conf;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// merge config from mops.toml [format]
|
|
73
|
+
// disabled, because we lose vscode extension support
|
|
74
|
+
// if (config.format) {
|
|
75
|
+
// Object.assign(prettierConfig, config.format);
|
|
76
|
+
// }
|
|
77
|
+
// add motoko parser plugin
|
|
78
|
+
Object.assign(prettierConfig, {
|
|
79
|
+
parser: 'motoko-tt-parse',
|
|
80
|
+
plugins: [motokoPlugin],
|
|
81
|
+
filepath: file,
|
|
82
|
+
});
|
|
83
|
+
// check file
|
|
84
|
+
let code = await fs.readFile(file, 'utf8');
|
|
85
|
+
let formatted = await prettier.format(code, prettierConfig);
|
|
86
|
+
let ok = formatted === code;
|
|
87
|
+
invalidFiles += Number(!ok);
|
|
88
|
+
if (options.check) {
|
|
89
|
+
if (ok) {
|
|
90
|
+
options.silent || console.log(`${chalk.green('✓')} ${absToRel(file)} ${chalk.gray('valid')}`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
options.silent || console.log(`${chalk.red('✖')} ${absToRel(file)} ${chalk.gray('invalid')}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
if (ok) {
|
|
98
|
+
options.silent || console.log(`${chalk.green('✓')} ${absToRel(file)} ${chalk.gray('valid')}`);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
await fs.writeFile(file, formatted);
|
|
102
|
+
options.silent || console.log(`${chalk.yellow('*')} ${absToRel(file)} ${chalk.gray('formatted')}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
checkedFiles += 1;
|
|
106
|
+
// trigger onProgress
|
|
107
|
+
getResult(false);
|
|
108
|
+
});
|
|
109
|
+
if (signal?.aborted) {
|
|
110
|
+
return getResult(false);
|
|
111
|
+
}
|
|
112
|
+
if (!options.silent) {
|
|
113
|
+
console.log('-'.repeat(50));
|
|
114
|
+
let plural = (n) => n === 1 ? '' : 's';
|
|
115
|
+
let str = `Checked ${chalk.gray(files.length)} file${plural(files.length)} in ${chalk.gray(((Date.now() - startTime) / 1000).toFixed(2) + 's')}`;
|
|
116
|
+
if (invalidFiles) {
|
|
117
|
+
str += options.check
|
|
118
|
+
? `, invalid ${chalk.redBright(invalidFiles)} file${plural(invalidFiles)}`
|
|
119
|
+
: `, formatted ${chalk.yellowBright(invalidFiles)} file${plural(invalidFiles)}`;
|
|
120
|
+
}
|
|
121
|
+
console.log(str);
|
|
122
|
+
if (!invalidFiles) {
|
|
123
|
+
console.log(chalk.green('✓ All files have valid formatting'));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (options.check && invalidFiles && !options.silent) {
|
|
127
|
+
console.log(`${(`Run '${chalk.yellow('mops format' + (filter ? ` ${filter}` : ''))}' to format your code`)}`);
|
|
128
|
+
return getResult(false);
|
|
129
|
+
}
|
|
130
|
+
return getResult(true);
|
|
131
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FormatResult } from '../format.js';
|
|
2
|
+
import { ErrorChecker } from './error-checker.js';
|
|
3
|
+
export declare class Formatter {
|
|
4
|
+
verbose: boolean;
|
|
5
|
+
status: 'pending' | 'running' | 'syntax-error' | 'error' | 'success';
|
|
6
|
+
errorChecker: ErrorChecker;
|
|
7
|
+
aborted: boolean;
|
|
8
|
+
controller: AbortController;
|
|
9
|
+
currentRun: Promise<any> | undefined;
|
|
10
|
+
result: FormatResult | undefined;
|
|
11
|
+
constructor({ verbose, errorChecker }: {
|
|
12
|
+
verbose: boolean;
|
|
13
|
+
errorChecker: ErrorChecker;
|
|
14
|
+
});
|
|
15
|
+
reset(): void;
|
|
16
|
+
abortCurrent(): Promise<void>;
|
|
17
|
+
run(onProgress: () => void): Promise<void>;
|
|
18
|
+
getOutput(): string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { format } from '../format.js';
|
|
3
|
+
export class Formatter {
|
|
4
|
+
constructor({ verbose, errorChecker }) {
|
|
5
|
+
this.verbose = false;
|
|
6
|
+
this.status = 'pending';
|
|
7
|
+
this.aborted = false;
|
|
8
|
+
this.controller = new AbortController();
|
|
9
|
+
this.verbose = verbose;
|
|
10
|
+
this.errorChecker = errorChecker;
|
|
11
|
+
}
|
|
12
|
+
reset() {
|
|
13
|
+
this.status = 'pending';
|
|
14
|
+
this.result = undefined;
|
|
15
|
+
}
|
|
16
|
+
async abortCurrent() {
|
|
17
|
+
this.aborted = true;
|
|
18
|
+
await this.currentRun;
|
|
19
|
+
this.reset();
|
|
20
|
+
this.aborted = false;
|
|
21
|
+
}
|
|
22
|
+
async run(onProgress) {
|
|
23
|
+
await this.abortCurrent();
|
|
24
|
+
if (this.errorChecker.status === 'error') {
|
|
25
|
+
this.status = 'syntax-error';
|
|
26
|
+
onProgress();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.status = 'running';
|
|
30
|
+
onProgress();
|
|
31
|
+
this.controller = new AbortController();
|
|
32
|
+
this.currentRun = format('', { silent: true }, this.controller.signal, (result) => {
|
|
33
|
+
this.result = result;
|
|
34
|
+
onProgress();
|
|
35
|
+
});
|
|
36
|
+
await this.currentRun;
|
|
37
|
+
if (!this.aborted) {
|
|
38
|
+
this.status = 'success';
|
|
39
|
+
}
|
|
40
|
+
onProgress();
|
|
41
|
+
}
|
|
42
|
+
getOutput() {
|
|
43
|
+
if (this.status === 'pending') {
|
|
44
|
+
return `Format: ${chalk.gray('(pending)')}`;
|
|
45
|
+
}
|
|
46
|
+
if (this.status === 'syntax-error') {
|
|
47
|
+
return `Format: ${chalk.gray('(errors)')}`;
|
|
48
|
+
}
|
|
49
|
+
if (!this.result) {
|
|
50
|
+
return `Format: ${chalk.gray('(pending)')}`;
|
|
51
|
+
}
|
|
52
|
+
if (this.status === 'running') {
|
|
53
|
+
return `Format: ${this.result.checked}/${this.result.total} ${chalk.gray('(running)')}`;
|
|
54
|
+
}
|
|
55
|
+
return `Format: ${chalk.greenBright(`${this.result.formatted}`)}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -9,6 +9,7 @@ import { getRootDir } from '../../mops.js';
|
|
|
9
9
|
import { Tester } from './tester.js';
|
|
10
10
|
import { Generator } from './generator.js';
|
|
11
11
|
import { Deployer } from './deployer.js';
|
|
12
|
+
import { Formatter } from './formatter.js';
|
|
12
13
|
let ignore = [
|
|
13
14
|
'**/node_modules/**',
|
|
14
15
|
'**/.mops/**',
|
|
@@ -24,6 +25,7 @@ export async function watch(options) {
|
|
|
24
25
|
test: true,
|
|
25
26
|
generate: true,
|
|
26
27
|
deploy: true,
|
|
28
|
+
format: false,
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
options.error = true;
|
|
@@ -35,6 +37,7 @@ export async function watch(options) {
|
|
|
35
37
|
let tester = new Tester({ errorChecker, verbose: true });
|
|
36
38
|
let generator = new Generator({ errorChecker, verbose: true, canisters: canistersWithDeclarations });
|
|
37
39
|
let deployer = new Deployer({ errorChecker, generator, verbose: true, canisters: canisters });
|
|
40
|
+
let formatter = new Formatter({ errorChecker, verbose: true });
|
|
38
41
|
let watcher = chokidar.watch([
|
|
39
42
|
path.join(rootDir, '**/*.mo'),
|
|
40
43
|
path.join(rootDir, 'mops.toml'),
|
|
@@ -42,14 +45,23 @@ export async function watch(options) {
|
|
|
42
45
|
ignored: ignore,
|
|
43
46
|
ignoreInitial: true,
|
|
44
47
|
});
|
|
48
|
+
let formatting = false;
|
|
45
49
|
let run = debounce(async () => {
|
|
50
|
+
if (formatting) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
46
53
|
errorChecker.reset();
|
|
47
54
|
warningChecker.reset();
|
|
48
55
|
tester.reset();
|
|
49
56
|
generator.reset();
|
|
50
57
|
deployer.reset();
|
|
58
|
+
formatter.reset();
|
|
59
|
+
if (options.format) {
|
|
60
|
+
formatting = true;
|
|
61
|
+
}
|
|
51
62
|
options.error && await errorChecker.run(print);
|
|
52
63
|
options.warning && warningChecker.run(print);
|
|
64
|
+
options.format && formatter.run(print).then(() => setTimeout(() => formatting = false, 500));
|
|
53
65
|
options.test && tester.run(print);
|
|
54
66
|
options.generate && await generator.run(print);
|
|
55
67
|
options.deploy && deployer.run(print);
|
|
@@ -59,12 +71,14 @@ export async function watch(options) {
|
|
|
59
71
|
process.stdout.write('\x1Bc');
|
|
60
72
|
options.error && console.log(errorChecker.getOutput());
|
|
61
73
|
options.warning && console.log(warningChecker.getOutput());
|
|
74
|
+
options.format && console.log(formatter.getOutput());
|
|
62
75
|
options.test && console.log(tester.getOutput());
|
|
63
76
|
options.generate && console.log(generator.getOutput());
|
|
64
77
|
options.deploy && console.log(deployer.getOutput());
|
|
65
78
|
let statuses = [];
|
|
66
79
|
options.error && statuses.push(errorChecker.status);
|
|
67
80
|
options.warning && statuses.push(warningChecker.status);
|
|
81
|
+
options.format && statuses.push(formatter.status);
|
|
68
82
|
options.test && statuses.push(tester.status);
|
|
69
83
|
options.generate && statuses.push(generator.status);
|
|
70
84
|
options.deploy && statuses.push(deployer.status);
|
|
@@ -74,6 +88,10 @@ export async function watch(options) {
|
|
|
74
88
|
console.log(chalk.dim(`Press ${chalk.bold('Ctrl+C')} to exit.`));
|
|
75
89
|
}
|
|
76
90
|
};
|
|
77
|
-
watcher.on('all',
|
|
91
|
+
watcher.on('all', () => {
|
|
92
|
+
if (!formatting) {
|
|
93
|
+
run();
|
|
94
|
+
}
|
|
95
|
+
});
|
|
78
96
|
run();
|
|
79
97
|
}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ic-mops",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mops": "bin/mops.js",
|
|
@@ -64,6 +64,8 @@
|
|
|
64
64
|
"octokit": "3.1.2",
|
|
65
65
|
"pem-file": "1.0.1",
|
|
66
66
|
"pic-ic": "0.5.3",
|
|
67
|
+
"prettier": "3.5.3",
|
|
68
|
+
"prettier-plugin-motoko": "0.11.0",
|
|
67
69
|
"promisify-child-process": "4.1.2",
|
|
68
70
|
"prompts": "2.4.2",
|
|
69
71
|
"semver": "7.7.1",
|
|
@@ -84,7 +86,7 @@
|
|
|
84
86
|
"@types/semver": "7.5.8",
|
|
85
87
|
"@types/stream-to-promise": "2.2.4",
|
|
86
88
|
"@types/tar": "6.1.13",
|
|
87
|
-
"bun": "1.
|
|
89
|
+
"bun": "1.2.10",
|
|
88
90
|
"esbuild": "0.23.1",
|
|
89
91
|
"eslint": "8.57.0",
|
|
90
92
|
"tsx": "4.19.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ic-mops",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mops": "dist/bin/mops.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"build": "npm run prepare && npm run bundle",
|
|
32
32
|
"dist": "tsc",
|
|
33
33
|
"bundle": "rm -rf ./bundle && bun build ./cli.ts --outdir ./bundle --target node --minify --external @napi-rs/lzma --external fsevents --format esm --define '__dirname=import.meta.dirname' && npm run bundle:fix && npm run bundle:copy && npm run bundle:package-json && npm run bundle:tar",
|
|
34
|
-
"bundle:fix": "npx -y rexreplace 'new URL\\(\"\\.\\./templates' 'new URL(\"./templates' bundle/cli.js",
|
|
35
|
-
"bundle:copy": "cp -r commands/bench bundle && cp -r bin declarations templates package.json bundle",
|
|
34
|
+
"bundle:fix": "npx -y rexreplace 'new URL\\(\"\\.\\./templates' 'new URL(\"./templates' bundle/cli.js && npx -y rexreplace '\"import.meta.dirname\",\"wasm_bg.wasm\"' 'import.meta.dirname || new URL(\".\", import.meta.url).pathname,\"wasm_bg.wasm\"' bundle/cli.js",
|
|
35
|
+
"bundle:copy": "cp -r commands/bench bundle && cp -r bin declarations templates package.json bundle && cp -r node_modules/prettier-plugin-motoko/wasm/pkg/nodejs/wasm_bg.wasm bundle",
|
|
36
36
|
"bundle:package-json": "tsx bundle-package-json.ts",
|
|
37
37
|
"bundle:tar": "rm -f bundle/cli.tgz && touch -t 200101010101 bundle/cli.tgz && find bundle -exec touch -d '1970-01-01 00:00:00' {} + && tar --sort name --exclude bundle/cli.tgz -cvf - bundle | gzip -n > bundle/cli.tgz",
|
|
38
38
|
"copy": "cp -r commands/bench dist/commands && cp -r declarations templates package.json bin dist | true",
|
|
@@ -80,6 +80,8 @@
|
|
|
80
80
|
"octokit": "3.1.2",
|
|
81
81
|
"pem-file": "1.0.1",
|
|
82
82
|
"pic-ic": "0.5.3",
|
|
83
|
+
"prettier": "3.5.3",
|
|
84
|
+
"prettier-plugin-motoko": "0.11.0",
|
|
83
85
|
"promisify-child-process": "4.1.2",
|
|
84
86
|
"prompts": "2.4.2",
|
|
85
87
|
"semver": "7.7.1",
|
|
@@ -100,7 +102,7 @@
|
|
|
100
102
|
"@types/semver": "7.5.8",
|
|
101
103
|
"@types/stream-to-promise": "2.2.4",
|
|
102
104
|
"@types/tar": "6.1.13",
|
|
103
|
-
"bun": "1.
|
|
105
|
+
"bun": "1.2.10",
|
|
104
106
|
"esbuild": "0.23.1",
|
|
105
107
|
"eslint": "8.57.0",
|
|
106
108
|
"tsx": "4.19.2",
|
package/types.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type Config = {
|
|
|
19
19
|
'dev-dependencies' ?: Dependencies;
|
|
20
20
|
toolchain ?: Toolchain;
|
|
21
21
|
requirements ?: Requirements;
|
|
22
|
+
// format ?: Format;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export type Dependencies = Record<string, Dependency>;
|
|
@@ -42,4 +43,13 @@ export type Requirements = {
|
|
|
42
43
|
moc ?: string;
|
|
43
44
|
};
|
|
44
45
|
|
|
46
|
+
// export type Format = {
|
|
47
|
+
// useTabs ?: boolean;
|
|
48
|
+
// tabWidth ?: number;
|
|
49
|
+
// printWidth ?: number;
|
|
50
|
+
// semi ?: boolean;
|
|
51
|
+
// bracketSpacing ?: boolean;
|
|
52
|
+
// trailingComma ?: 'none' | 'all';
|
|
53
|
+
// };
|
|
54
|
+
|
|
45
55
|
export type TestMode = 'interpreter' | 'wasi' | 'replica';
|