Skip to content

Commit e2e767f

Browse files
authored
Merge branch 'master' into use-xver-packages
2 parents 1917af2 + e3f9d6e commit e2e767f

7 files changed

Lines changed: 50 additions & 94 deletions

File tree

src/app.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -330,18 +330,9 @@ async function runBuild(input: string, program: OptionValues, helpText: string)
330330
const igExporter = new IGExporter(outPackage, defs, igFilesPath);
331331
igExporter.export(outDir);
332332
logger.info('Assembled Implementation Guide sources; ready for IG Publisher.');
333-
if (
334-
!fs
335-
.readdirSync(outDir)
336-
.some(
337-
file =>
338-
file.startsWith('_genonce') ||
339-
file.startsWith('_updatePublisher') ||
340-
file.startsWith('_build')
341-
)
342-
) {
333+
if (!fs.readdirSync(outDir).some(file => file.startsWith('_build'))) {
343334
logger.info(
344-
'The sample-ig located at https://github.com/FHIR/sample-ig contains scripts useful for downloading and running the IG Publisher.'
335+
'The _build script hosted at https://github.com/HL7/ig-publisher-scripts is useful for downloading and running the IG Publisher.'
345336
);
346337
}
347338
}

src/ig/IGExporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ export class IGExporter {
15121512
);
15131513
}
15141514
if (inputIni.IG.template == null) {
1515-
const templateValue = 'fhir.base.template';
1515+
const templateValue = 'fhir2.base.template';
15161516
inputIni.IG.template = templateValue;
15171517
logger.error(
15181518
`The ig.ini file must have a "template" property. Please update ${filePathString} to include ` +

src/utils/Processing.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -898,14 +898,9 @@ export async function init(
898898
path.join(initProjectDir, 'ignoreWarnings.txt'),
899899
path.join(outputDir, 'input', 'ignoreWarnings.txt')
900900
);
901-
// Add the _updatePublisher, _genonce, and _gencontinuous scripts
902-
console.log('Downloading publisher scripts from https://github.com/HL7/ig-publisher-scripts');
903-
for (const script of [
904-
'_genonce.bat',
905-
'_genonce.sh',
906-
'_updatePublisher.bat',
907-
'_updatePublisher.sh'
908-
]) {
901+
// Add the _build script
902+
console.log('Downloading _build scripts from https://github.com/HL7/ig-publisher-scripts');
903+
for (const script of ['_build.bat', '_build.sh']) {
909904
const url = `https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main/${script}`;
910905
try {
911906
const res = await axiosGet(url);

src/utils/init-project/ig.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[IG]
22
ig = fsh-generated/resources/ImplementationGuide-fhir.example.json
3-
template = fhir.base.template#current
3+
template = fhir2.base.template#current

test/ig/IGExporter.IG.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ describe('IGExporter', () => {
11781178
}
11791179
],
11801180
status: 'active',
1181-
template: 'fhir.base.template',
1181+
template: 'fhir2.base.template',
11821182
fhirVersion: ['4.0.1'],
11831183
language: 'en',
11841184
publisher: 'James Tuna',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[IG]
22
ig = sneaky-input/ImplementationGuide.json
3-
template = fhir.base.template
3+
template = fhir2.base.template

test/utils/Processing.test.ts

Lines changed: 41 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ describe('Processing', () => {
21252125
expect(ensureDirSpy.mock.calls[0][0]).toMatch(/.*ExampleIG.*input.*pagecontent/);
21262126
expect(ensureDirSpy.mock.calls[1][0]).toMatch(/.*ExampleIG.*input.*fsh/);
21272127

2128-
expect(writeSpy.mock.calls).toHaveLength(7);
2128+
expect(writeSpy.mock.calls).toHaveLength(5);
21292129
expect(writeSpy.mock.calls[0][0]).toMatch(/.*index\.md/);
21302130
expect(writeSpy.mock.calls[0][1]).toMatch(/# ExampleIG/);
21312131
expect(writeSpy.mock.calls[1][0]).toMatch(/.*ig\.ini/);
@@ -2146,21 +2146,15 @@ describe('Processing', () => {
21462146
expect(copyFileSpy.mock.calls[1][1]).toMatch(/.*ExampleIG.*\.gitignore/);
21472147
expect(copyFileSpy.mock.calls[2][1]).toMatch(/.*ExampleIG.*input.*ignoreWarnings\.txt/);
21482148

2149-
expect(getSpy.mock.calls).toHaveLength(4);
2149+
expect(getSpy.mock.calls).toHaveLength(2);
21502150
const base = 'https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main/';
2151-
expect(getSpy.mock.calls[0][0]).toBe(base + '_genonce.bat');
2152-
expect(getSpy.mock.calls[1][0]).toBe(base + '_genonce.sh');
2153-
expect(getSpy.mock.calls[2][0]).toBe(base + '_updatePublisher.bat');
2154-
expect(getSpy.mock.calls[3][0]).toBe(base + '_updatePublisher.sh');
2151+
expect(getSpy.mock.calls[0][0]).toBe(base + '_build.bat');
2152+
expect(getSpy.mock.calls[1][0]).toBe(base + '_build.sh');
21552153

2156-
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_genonce\.bat/);
2157-
expect(writeSpy.mock.calls[3][1]).toMatch(/_genonce\.bat/);
2158-
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_genonce\.sh/);
2159-
expect(writeSpy.mock.calls[4][1]).toMatch(/_genonce\.sh/);
2160-
expect(writeSpy.mock.calls[5][0]).toMatch(/.*_updatePublisher\.bat/);
2161-
expect(writeSpy.mock.calls[5][1]).toMatch(/_updatePublisher\.bat/);
2162-
expect(writeSpy.mock.calls[6][0]).toMatch(/.*_updatePublisher\.sh/);
2163-
expect(writeSpy.mock.calls[6][1]).toMatch(/_updatePublisher\.sh/);
2154+
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_build\.bat/);
2155+
expect(writeSpy.mock.calls[3][1]).toMatch(/_build\.bat/);
2156+
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_build\.sh/);
2157+
expect(writeSpy.mock.calls[4][1]).toMatch(/_build\.sh/);
21642158
});
21652159

21662160
it('should initialize a project with user input', async () => {
@@ -2203,7 +2197,7 @@ describe('Processing', () => {
22032197
expect(ensureDirSpy.mock.calls[0][0]).toMatch(/.*MyNonDefaultName.*input.*pagecontent/);
22042198
expect(ensureDirSpy.mock.calls[1][0]).toMatch(/.*MyNonDefaultName.*input.*fsh/);
22052199

2206-
expect(writeSpy.mock.calls).toHaveLength(7);
2200+
expect(writeSpy.mock.calls).toHaveLength(5);
22072201
expect(writeSpy.mock.calls[0][0]).toMatch(/.*index\.md/);
22082202
expect(writeSpy.mock.calls[0][1]).toMatch(/# MyNonDefaultName/);
22092203
expect(writeSpy.mock.calls[1][0]).toMatch(/.*ig\.ini/);
@@ -2225,21 +2219,15 @@ describe('Processing', () => {
22252219
/.*MyNonDefaultName.*input.*ignoreWarnings\.txt/
22262220
);
22272221

2228-
expect(getSpy.mock.calls).toHaveLength(4);
2222+
expect(getSpy.mock.calls).toHaveLength(2);
22292223
const base = 'https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main/';
2230-
expect(getSpy.mock.calls[0][0]).toBe(base + '_genonce.bat');
2231-
expect(getSpy.mock.calls[1][0]).toBe(base + '_genonce.sh');
2232-
expect(getSpy.mock.calls[2][0]).toBe(base + '_updatePublisher.bat');
2233-
expect(getSpy.mock.calls[3][0]).toBe(base + '_updatePublisher.sh');
2224+
expect(getSpy.mock.calls[0][0]).toBe(base + '_build.bat');
2225+
expect(getSpy.mock.calls[1][0]).toBe(base + '_build.sh');
22342226

2235-
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_genonce\.bat/);
2236-
expect(writeSpy.mock.calls[3][1]).toMatch(/_genonce\.bat/);
2237-
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_genonce\.sh/);
2238-
expect(writeSpy.mock.calls[4][1]).toMatch(/_genonce\.sh/);
2239-
expect(writeSpy.mock.calls[5][0]).toMatch(/.*_updatePublisher\.bat/);
2240-
expect(writeSpy.mock.calls[5][1]).toMatch(/_updatePublisher\.bat/);
2241-
expect(writeSpy.mock.calls[6][0]).toMatch(/.*_updatePublisher\.sh/);
2242-
expect(writeSpy.mock.calls[6][1]).toMatch(/_updatePublisher\.sh/);
2227+
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_build\.bat/);
2228+
expect(writeSpy.mock.calls[3][1]).toMatch(/_build\.bat/);
2229+
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_build\.sh/);
2230+
expect(writeSpy.mock.calls[4][1]).toMatch(/_build\.sh/);
22432231
});
22442232

22452233
it('should abort initializing a project when the user does not confirm', async () => {
@@ -2284,7 +2272,7 @@ describe('Processing', () => {
22842272
expect(ensureDirSpy.mock.calls[0][0]).toMatch(/.*MyCLIOptionProject.*input.*pagecontent/);
22852273
expect(ensureDirSpy.mock.calls[1][0]).toMatch(/.*MyCLIOptionProject.*input.*fsh/);
22862274

2287-
expect(writeSpy.mock.calls).toHaveLength(7);
2275+
expect(writeSpy.mock.calls).toHaveLength(5);
22882276
expect(writeSpy.mock.calls[0][0]).toMatch(/.*index\.md/);
22892277
expect(writeSpy.mock.calls[0][1]).toMatch(/# MyCLIOptionProject/);
22902278
expect(writeSpy.mock.calls[1][0]).toMatch(/.*ig\.ini/);
@@ -2307,21 +2295,15 @@ describe('Processing', () => {
23072295
/.*MyCLIOptionProject.*input.*ignoreWarnings\.txt/
23082296
);
23092297

2310-
expect(getSpy.mock.calls).toHaveLength(4);
2298+
expect(getSpy.mock.calls).toHaveLength(2);
23112299
const base = 'https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main/';
2312-
expect(getSpy.mock.calls[0][0]).toBe(base + '_genonce.bat');
2313-
expect(getSpy.mock.calls[1][0]).toBe(base + '_genonce.sh');
2314-
expect(getSpy.mock.calls[2][0]).toBe(base + '_updatePublisher.bat');
2315-
expect(getSpy.mock.calls[3][0]).toBe(base + '_updatePublisher.sh');
2300+
expect(getSpy.mock.calls[0][0]).toBe(base + '_build.bat');
2301+
expect(getSpy.mock.calls[1][0]).toBe(base + '_build.sh');
23162302

2317-
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_genonce\.bat/);
2318-
expect(writeSpy.mock.calls[3][1]).toMatch(/_genonce\.bat/);
2319-
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_genonce\.sh/);
2320-
expect(writeSpy.mock.calls[4][1]).toMatch(/_genonce\.sh/);
2321-
expect(writeSpy.mock.calls[5][0]).toMatch(/.*_updatePublisher\.bat/);
2322-
expect(writeSpy.mock.calls[5][1]).toMatch(/_updatePublisher\.bat/);
2323-
expect(writeSpy.mock.calls[6][0]).toMatch(/.*_updatePublisher\.sh/);
2324-
expect(writeSpy.mock.calls[6][1]).toMatch(/_updatePublisher\.sh/);
2303+
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_build\.bat/);
2304+
expect(writeSpy.mock.calls[3][1]).toMatch(/_build\.bat/);
2305+
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_build\.sh/);
2306+
expect(writeSpy.mock.calls[4][1]).toMatch(/_build\.sh/);
23252307
});
23262308

23272309
it('should prompt for and accept inputs for any option not already set with a command line config option', async () => {
@@ -2363,7 +2345,7 @@ describe('Processing', () => {
23632345
expect(ensureDirSpy.mock.calls[0][0]).toMatch(/.*MySemiCLIOptionProject.*input.*pagecontent/);
23642346
expect(ensureDirSpy.mock.calls[1][0]).toMatch(/.*MySemiCLIOptionProject.*input.*fsh/);
23652347

2366-
expect(writeSpy.mock.calls).toHaveLength(7);
2348+
expect(writeSpy.mock.calls).toHaveLength(5);
23672349
expect(writeSpy.mock.calls[0][0]).toMatch(/.*index\.md/);
23682350
expect(writeSpy.mock.calls[0][1]).toMatch(/# MySemiCLIOptionProject/);
23692351
expect(writeSpy.mock.calls[1][0]).toMatch(/.*ig\.ini/);
@@ -2386,21 +2368,15 @@ describe('Processing', () => {
23862368
/.*MySemiCLIOptionProject.*input.*ignoreWarnings\.txt/
23872369
);
23882370

2389-
expect(getSpy.mock.calls).toHaveLength(4);
2371+
expect(getSpy.mock.calls).toHaveLength(2);
23902372
const base = 'https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main/';
2391-
expect(getSpy.mock.calls[0][0]).toBe(base + '_genonce.bat');
2392-
expect(getSpy.mock.calls[1][0]).toBe(base + '_genonce.sh');
2393-
expect(getSpy.mock.calls[2][0]).toBe(base + '_updatePublisher.bat');
2394-
expect(getSpy.mock.calls[3][0]).toBe(base + '_updatePublisher.sh');
2373+
expect(getSpy.mock.calls[0][0]).toBe(base + '_build.bat');
2374+
expect(getSpy.mock.calls[1][0]).toBe(base + '_build.sh');
23952375

2396-
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_genonce\.bat/);
2397-
expect(writeSpy.mock.calls[3][1]).toMatch(/_genonce\.bat/);
2398-
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_genonce\.sh/);
2399-
expect(writeSpy.mock.calls[4][1]).toMatch(/_genonce\.sh/);
2400-
expect(writeSpy.mock.calls[5][0]).toMatch(/.*_updatePublisher\.bat/);
2401-
expect(writeSpy.mock.calls[5][1]).toMatch(/_updatePublisher\.bat/);
2402-
expect(writeSpy.mock.calls[6][0]).toMatch(/.*_updatePublisher\.sh/);
2403-
expect(writeSpy.mock.calls[6][1]).toMatch(/_updatePublisher\.sh/);
2376+
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_build\.bat/);
2377+
expect(writeSpy.mock.calls[3][1]).toMatch(/_build\.bat/);
2378+
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_build\.sh/);
2379+
expect(writeSpy.mock.calls[4][1]).toMatch(/_build\.sh/);
24042380
});
24052381

24062382
it('should accept remaining defaults without prompting for any options not already set with a command line config option when default option is used', async () => {
@@ -2424,7 +2400,7 @@ describe('Processing', () => {
24242400
);
24252401
expect(ensureDirSpy.mock.calls[1][0]).toMatch(/.*MyCLIOptionWithDefaultsProject.*input.*fsh/);
24262402

2427-
expect(writeSpy.mock.calls).toHaveLength(7);
2403+
expect(writeSpy.mock.calls).toHaveLength(5);
24282404
expect(writeSpy.mock.calls[0][0]).toMatch(/.*index\.md/);
24292405
expect(writeSpy.mock.calls[0][1]).toMatch(/# MyCLIOptionWithDefaultsProject/);
24302406
expect(writeSpy.mock.calls[1][0]).toMatch(/.*ig\.ini/);
@@ -2449,21 +2425,15 @@ describe('Processing', () => {
24492425
/.*MyCLIOptionWithDefaultsProject.*input.*ignoreWarnings\.txt/
24502426
);
24512427

2452-
expect(getSpy.mock.calls).toHaveLength(4);
2428+
expect(getSpy.mock.calls).toHaveLength(2);
24532429
const base = 'https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main/';
2454-
expect(getSpy.mock.calls[0][0]).toBe(base + '_genonce.bat');
2455-
expect(getSpy.mock.calls[1][0]).toBe(base + '_genonce.sh');
2456-
expect(getSpy.mock.calls[2][0]).toBe(base + '_updatePublisher.bat');
2457-
expect(getSpy.mock.calls[3][0]).toBe(base + '_updatePublisher.sh');
2458-
2459-
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_genonce\.bat/);
2460-
expect(writeSpy.mock.calls[3][1]).toMatch(/_genonce\.bat/);
2461-
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_genonce\.sh/);
2462-
expect(writeSpy.mock.calls[4][1]).toMatch(/_genonce\.sh/);
2463-
expect(writeSpy.mock.calls[5][0]).toMatch(/.*_updatePublisher\.bat/);
2464-
expect(writeSpy.mock.calls[5][1]).toMatch(/_updatePublisher\.bat/);
2465-
expect(writeSpy.mock.calls[6][0]).toMatch(/.*_updatePublisher\.sh/);
2466-
expect(writeSpy.mock.calls[6][1]).toMatch(/_updatePublisher\.sh/);
2430+
expect(getSpy.mock.calls[0][0]).toBe(base + '_build.bat');
2431+
expect(getSpy.mock.calls[1][0]).toBe(base + '_build.sh');
2432+
2433+
expect(writeSpy.mock.calls[3][0]).toMatch(/.*_build\.bat/);
2434+
expect(writeSpy.mock.calls[3][1]).toMatch(/_build\.bat/);
2435+
expect(writeSpy.mock.calls[4][0]).toMatch(/.*_build\.sh/);
2436+
expect(writeSpy.mock.calls[4][1]).toMatch(/_build\.sh/);
24672437
});
24682438
});
24692439

0 commit comments

Comments
 (0)