Skip to content

Commit 56d64da

Browse files
committed
chore(developer): npm install and fix import
1 parent 232c918 commit 56d64da

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

developer/src/kmc/src/commands/buildClasses/BuildModelInfo.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as fs from 'fs';
22
import { BuildActivity } from './BuildActivity.js';
33
import { CompilerCallbacks, CompilerOptions, KeymanFileTypes } from '@keymanapp/common-types';
4-
import { writeModelMetadataFile } from '@keymanapp/kmc-model-info';
4+
import { ModelInfoCompiler } from '@keymanapp/kmc-model-info';
55
import { KmpCompiler } from '@keymanapp/kmc-package';
66
import { loadProject } from '../../util/projectLoader.js';
77
import { InfrastructureMessages } from '../../messages/infrastructureMessages.js';
88
import { calculateSourcePath } from '../../util/calculateSourcePath.js';
9-
import { getLastGitCommitDate } from 'src/util/getLastGitCommitDate.js';
9+
import { getLastGitCommitDate } from '../../util/getLastGitCommitDate.js';
1010

1111
export class BuildModelInfo extends BuildActivity {
1212
public get name(): string { return 'Lexical model metadata'; }
@@ -57,19 +57,16 @@ export class BuildModelInfo extends BuildActivity {
5757
}
5858

5959
const lastCommitDate = getLastGitCommitDate(project.projectPath);
60-
61-
const data = writeModelMetadataFile(
62-
callbacks,
63-
{
64-
model_id: callbacks.path.basename(project.projectPath, KeymanFileTypes.Source.Project),
65-
kmpJsonData,
66-
sourcePath: calculateSourcePath(infile),
67-
modelFileName: project.resolveOutputFilePath(model, KeymanFileTypes.Source.Model, KeymanFileTypes.Binary.Model),
68-
kmpFileName: project.resolveOutputFilePath(kps, KeymanFileTypes.Source.Package, KeymanFileTypes.Binary.Package),
69-
kpsFilename: project.resolveInputFilePath(kps),
70-
lastCommitDate
71-
}
72-
);
60+
const compiler = new ModelInfoCompiler(callbacks);
61+
const data = compiler.writeModelMetadataFile({
62+
model_id: callbacks.path.basename(project.projectPath, KeymanFileTypes.Source.Project),
63+
kmpJsonData,
64+
sourcePath: calculateSourcePath(infile),
65+
modelFileName: project.resolveOutputFilePath(model, KeymanFileTypes.Source.Model, KeymanFileTypes.Binary.Model),
66+
kmpFileName: project.resolveOutputFilePath(kps, KeymanFileTypes.Source.Package, KeymanFileTypes.Binary.Package),
67+
kpsFilename: project.resolveInputFilePath(kps),
68+
lastCommitDate
69+
});
7370

7471
if(data == null) {
7572
// Error messages have already been emitted by writeModelMetadataFile

package-lock.json

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)