Comparing version 1.5.2 to 1.6.0
@@ -8,2 +8,9 @@ # Change Log | ||
## [1.6.0] - 2023-12-10 | ||
### Added | ||
`ReplaceCommand.contentStepEnd()` callback when the relevant ContentStep is terminating. | ||
## [1.5.2] - 2023-11-02 | ||
@@ -10,0 +17,0 @@ |
import { SsgStep } from "../SsgStep"; | ||
import { SsgContext } from "../../SsgContext"; | ||
import { OutputFunc } from "../../Ssg"; | ||
import { ReplaceCommand } from "./replace/ReplaceCommand"; | ||
import { SsgFile } from "../../util/file/SsgFile"; | ||
import { ReplaceCommand } from './replace'; | ||
import { SsgFile } from '../../util'; | ||
export type ContentStepConfig<C extends SsgContext = SsgContext> = { | ||
@@ -7,0 +7,0 @@ /** |
@@ -26,2 +26,7 @@ import { promise as glob } from "glob-promise"; | ||
} | ||
for (const contents of this.contents) { | ||
for (const replacement of contents.replacements) { | ||
await replacement.contentStepEnd(); | ||
} | ||
} | ||
return { | ||
@@ -28,0 +33,0 @@ contentCount |
import { ReplaceCommand } from "./ReplaceCommand"; | ||
import { SsgFile } from "../../../util/file/SsgFile"; | ||
import { SsgFile } from '../../../util'; | ||
import { HtmlSsgContext } from "../../../HtmlSsgContext"; | ||
@@ -22,2 +22,3 @@ import { DomReplacer } from "./DomReplacer"; | ||
protected postExecute(context: C): Promise<void>; | ||
contentStepEnd(): Promise<void>; | ||
} |
@@ -34,2 +34,5 @@ export class DomReplaceCommand { | ||
} | ||
async contentStepEnd() { | ||
// NOP | ||
} | ||
} |
@@ -8,2 +8,3 @@ import { ReplaceCommand } from "../ReplaceCommand"; | ||
protected abstract handleRedirect(from: string, to: string): string; | ||
contentStepEnd(): Promise<void>; | ||
} |
@@ -38,2 +38,5 @@ var HtAccessCommands; | ||
} | ||
async contentStepEnd() { | ||
// NOP | ||
} | ||
} |
@@ -24,2 +24,3 @@ import { RegexReplacer } from "./RegexReplacer"; | ||
protected abstract createReplacer(context: C): Promise<RegexReplacer>; | ||
contentStepEnd(): Promise<void>; | ||
} |
@@ -26,2 +26,5 @@ /** | ||
} | ||
async contentStepEnd() { | ||
// NOP | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { SsgFile } from "../../../util/file/SsgFile"; | ||
import { SsgFile } from '../../../util'; | ||
import { SsgContext } from "../../../SsgContext"; | ||
@@ -11,2 +11,6 @@ export interface ReplaceCommand<C extends SsgContext> { | ||
execute(context: C): Promise<SsgFile>; | ||
/** | ||
* Called when content step is terminating. | ||
*/ | ||
contentStepEnd(): Promise<void>; | ||
} |
@@ -5,3 +5,3 @@ { | ||
"author": "Jérôme Beau <javarome@gmail.com> (https://javarome.com)", | ||
"version": "1.5.2", | ||
"version": "1.6.0", | ||
"description": "Static Site Generation TypeScript API", | ||
@@ -8,0 +8,0 @@ "exports": "./dist/src/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138581
2466
145