@yamato-daiwa/automation 0.7.0-alpha.4 → 0.7.0-alpha.5
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/EntryPoint.js +78 -325
- package/package.json +1 -1
package/EntryPoint.js
CHANGED
|
@@ -34,7 +34,7 @@ function revisionHash(data) {
|
|
|
34
34
|
\***********************/
|
|
35
35
|
/***/ ((module) => {
|
|
36
36
|
|
|
37
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.7.0-alpha.
|
|
37
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@yamato-daiwa/automation","version":"0.7.0-alpha.5","description":"The project building tool with declarative YAML configuration specializing on Pug, Stylus and TypeScript as source code languages.","keywords":["build","pug","stylus","tool","typescript"],"engines":{"node":">=20.0.0"},"bin":{"yda":"Executable"},"files":["EntryPoint.js"],"dependencies":{"@eslint-community/eslint-plugin-eslint-comments":"4.5.0","@stylistic/eslint-plugin":"3.1.0","@typescript-eslint/eslint-plugin":"8.32.1","@typescript-eslint/parser":"8.32.1","@vue/compiler-sfc":"3.5.14","@webdiscus/pug-loader":"2.11.1","@yamato-daiwa/es-extensions":"1.8.0-alpha.9","@yamato-daiwa/es-extensions-nodejs":"1.8.0-alpha.9","@yamato-daiwa/style_guides":"0.6.9","autoprefixer":"10.4.21","browser-sync":"3.0.4","css-loader":"7.1.2","cssnano":"7.0.7","dotenv":"16.5.0","eslint":"9.27.0","eslint-plugin-import":"2.31.0","eslint-plugin-n":"17.18.0","eslint-plugin-react":"7.37.5","eslint-plugin-vue":"9.33.0","eslint-plugin-vue-pug":"0.6.2","fork-ts-checker-webpack-plugin":"7.3.0","gulp":"4.0.2","gulp-data":"1.3.1","gulp-if":"3.0.0","gulp-imagemin":"7.1.0","gulp-nodemon":"2.5.0","gulp-plumber":"1.2.1","gulp-postcss":"10.0.0","gulp-pug":"5.0.0","gulp-sourcemaps":"3.0.0","gulp-stylus":"3.0.1","htmlnano":"2.1.2","imagemin-pngquant":"9.0.2","js-beautify":"1.15.4","json5-loader":"4.0.1","nanoid":"5.1.5","node-html-parser":"7.0.1","node-notifier":"10.0.1","pa11y":"9.0.0","probe-image-size":"7.2.3","pug-lint":"2.7.0","pug3-ast-loader":"0.0.0","puppeteer":"24.9.0","require-from-string":"2.0.2","rev-hash":"4.1.0","stlint":"1.0.65","stream-combiner2":"1.1.1","style-loader":"4.0.0","stylus":"0.63.0","stylus-loader":"8.1.1","ts-loader":"9.5.2","vinyl":"2.2.1","vnu-jar":"24.10.17","vue-loader":"17.4.2","vue-style-loader":"4.1.3","vue-tsc":"2.2.10","webpack":"5.99.9","webpack-node-externals":"3.0.0","webpack-stream":"7.0.0","worker-loader":"3.0.8","yaml-loader":"0.8.1"},"devDependencies":{"@types/browser-sync":"2.29.0","@types/cssnano":"5.0.0","@types/gulp":"4.0.17","@types/gulp-if":"3.0.4","@types/gulp-imagemin":"7.0.3","@types/gulp-nodemon":"0.0.37","@types/gulp-plumber":"0.0.37","@types/gulp-postcss":"8.0.6","@types/gulp-sourcemaps":"0.0.38","@types/gulp-stylus":"2.7.8","@types/js-beautify":"1.14.3","@types/node":"22.15.21","@types/node-notifier":"8.0.5","@types/pa11y":"5.3.7","@types/probe-image-size":"7.2.5","@types/pug":"2.0.10","@types/require-from-string":"1.2.3","@types/vnu-jar":"17.11.2","@types/webpack-node-externals":"3.0.4","@types/webpack-stream":"3.2.15","eslint-webpack-plugin":"4.2.0","ts-node":"10.9.2","typescript":"5.8.3","webpack-cli":"6.0.1"},"scripts":{"Incremental Development Building":"webpack --mode development","Production Building":"webpack --mode production","Linting":"eslint Source"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation.git"},"homepage":"https://automation.yamato-daiwa.com/","funding":"https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation?sponsor=1","bugs":{"url":"https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation/issues","email":"tokugawa.takesi@gmail.com"}}');
|
|
38
38
|
|
|
39
39
|
/***/ }),
|
|
40
40
|
|
|
@@ -86,7 +86,7 @@ var ApplicationConsoleLineInterface;
|
|
|
86
86
|
required: false,
|
|
87
87
|
type: es_extensions_nodejs_1.ConsoleCommandsParser.ParametersTypes.string,
|
|
88
88
|
description: "Allows to specify the selection of tasks, entry points groups, etc. by selective execution ID, " +
|
|
89
|
-
"herewith the desired selective execution must be preliminarily defined in the configuration file."
|
|
89
|
+
"herewith the desired selective execution must be preliminarily defined in the configuration file."
|
|
90
90
|
},
|
|
91
91
|
configurationFile: {
|
|
92
92
|
newName: "customConfigurationFileName__possiblyWithoutExtension",
|
|
@@ -228,7 +228,7 @@ const ProjectBuildingMasterConfigRepresentative_1 = __importDefault(__webpack_re
|
|
|
228
228
|
const MarkupProcessor_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessor */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessor.ts"));
|
|
229
229
|
const MarkupSourceCodeLinter_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Subtasks/Linting/MarkupSourceCodeLinter */ "./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/Linting/MarkupSourceCodeLinter.ts"));
|
|
230
230
|
const CompiledTypeScriptImporterForPug_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Subtasks/CompiledTypeScriptImporterForPug */ "./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/CompiledTypeScriptImporterForPug.ts"));
|
|
231
|
-
const
|
|
231
|
+
const JavaScriptImporterForPug_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/Subtasks/JavaScriptImporterForPug */ "./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/JavaScriptImporterForPug.ts"));
|
|
232
232
|
const StylesProcessor_1 = __importDefault(__webpack_require__(/*! @StylesProcessing/StylesProcessor */ "./ProjectBuilding/SourceCodeProcessing/Styles/StylesProcessor.ts"));
|
|
233
233
|
const ECMA_ScriptLogicProcessor_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/ECMA_ScriptLogicProcessor */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/ECMA_ScriptLogicProcessor.ts"));
|
|
234
234
|
const ECMA_ScriptSourceCodeLinter_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/Subtasks/Linting/ECMA_ScriptSourceCodeLinter */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/Subtasks/Linting/ECMA_ScriptSourceCodeLinter.ts"));
|
|
@@ -272,8 +272,8 @@ class ProjectBuilder {
|
|
|
272
272
|
ECMA_ScriptSourceCodeLinter_1.default.provideLintingIfMust(masterConfigRepresentative),
|
|
273
273
|
gulp_1.default.series([
|
|
274
274
|
gulp_1.default.parallel([
|
|
275
|
-
ExperimentalCompiledTypeScriptImporterForPug_1.default.provideTypeScriptImportsForMarkupIfMust(masterConfigRepresentative),
|
|
276
275
|
CompiledTypeScriptImporterForPug_1.default.provideTypeScriptImportsForMarkupIfMust(masterConfigRepresentative),
|
|
276
|
+
JavaScriptImporterForPug_1.default.provideJavaScriptImportsForMarkupIfMust(masterConfigRepresentative),
|
|
277
277
|
ECMA_ScriptLogicProcessor_1.default.provideLogicProcessingIfMust(masterConfigRepresentative),
|
|
278
278
|
PlainCopier_1.default.providePlainCopierIfMust(masterConfigRepresentative)
|
|
279
279
|
]),
|
|
@@ -876,18 +876,14 @@ class FontsProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
876
876
|
src((0, es_extensions_1.readonlyArrayToMutableOne)(sourceFilesAbsolutePaths)).
|
|
877
877
|
pipe(super.handleErrorIfItWillOccur()).
|
|
878
878
|
pipe(super.logProcessedFilesIfMust()).
|
|
879
|
-
pipe(GulpStreamModifier_1.default.
|
|
880
|
-
|
|
879
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
880
|
+
onStreamStartedEventHandler: this.replacePlainVinylFileWithAssetVinylFile.bind(this)
|
|
881
881
|
})).
|
|
882
|
-
pipe(GulpStreamModifier_1.default.
|
|
883
|
-
|
|
884
|
-
[AssetVinylFile_1.default, GulpStreamsBasedAssetsProcessor_1.default.addContentHashPostfixToFileNameIfMust]
|
|
885
|
-
])
|
|
882
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
883
|
+
onStreamStartedEventHandler: GulpStreamsBasedAssetsProcessor_1.default.addContentHashPostfixToFileNameIfMust
|
|
886
884
|
})).
|
|
887
|
-
pipe(GulpStreamModifier_1.default.
|
|
888
|
-
|
|
889
|
-
[AssetVinylFile_1.default, FontsProcessor.postProcessFile]
|
|
890
|
-
])
|
|
885
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
886
|
+
onStreamStartedEventHandler: FontsProcessor.postProcessFile
|
|
891
887
|
})).
|
|
892
888
|
pipe(gulp_1.default.dest((targetFileInFinalState) => AssetVinylFile_1.default.getOutputDirectoryAbsolutePathOfExpectedToBeSelfInstance(targetFileInFinalState)));
|
|
893
889
|
}
|
|
@@ -1199,8 +1195,8 @@ class ImagesProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
1199
1195
|
src((0, es_extensions_1.readonlyArrayToMutableOne)(sourceFilesAbsolutePaths)).
|
|
1200
1196
|
pipe(super.handleErrorIfItWillOccur()).
|
|
1201
1197
|
pipe(super.logProcessedFilesIfMust()).
|
|
1202
|
-
pipe(GulpStreamModifier_1.default.
|
|
1203
|
-
|
|
1198
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
1199
|
+
onStreamStartedEventHandler: this.replacePlainVinylFileWithAssetVinylFile.bind(this)
|
|
1204
1200
|
})).
|
|
1205
1201
|
pipe((0, gulp_if_1.default)(this.projectBuildingMasterConfigRepresentative.isStagingBuildingMode ||
|
|
1206
1202
|
this.projectBuildingMasterConfigRepresentative.isProductionBuildingMode, (0, gulp_imagemin_1.default)([
|
|
@@ -1209,15 +1205,11 @@ class ImagesProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
1209
1205
|
gulp_imagemin_1.default.svgo({}),
|
|
1210
1206
|
(0, imagemin_pngquant_1.default)()
|
|
1211
1207
|
]))).
|
|
1212
|
-
pipe(GulpStreamModifier_1.default.
|
|
1213
|
-
|
|
1214
|
-
[AssetVinylFile_1.default, GulpStreamsBasedAssetsProcessor_1.default.addContentHashPostfixToFileNameIfMust]
|
|
1215
|
-
])
|
|
1208
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
1209
|
+
onStreamStartedEventHandler: GulpStreamsBasedAssetsProcessor_1.default.addContentHashPostfixToFileNameIfMust
|
|
1216
1210
|
})).
|
|
1217
|
-
pipe(GulpStreamModifier_1.default.
|
|
1218
|
-
|
|
1219
|
-
[AssetVinylFile_1.default, ImagesProcessor.postProcessFile]
|
|
1220
|
-
])
|
|
1211
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
1212
|
+
onStreamStartedEventHandler: ImagesProcessor.postProcessFile
|
|
1221
1213
|
})).
|
|
1222
1214
|
pipe(gulp_1.default.dest((targetFileInFinalState) => AssetVinylFile_1.default.getOutputDirectoryAbsolutePathOfExpectedToBeSelfInstance(targetFileInFinalState)));
|
|
1223
1215
|
}
|
|
@@ -1526,18 +1518,14 @@ class VideosProcessor extends GulpStreamsBasedAssetsProcessor_1.default {
|
|
|
1526
1518
|
src((0, es_extensions_1.readonlyArrayToMutableOne)(sourceFilesAbsolutePaths)).
|
|
1527
1519
|
pipe(super.handleErrorIfItWillOccur()).
|
|
1528
1520
|
pipe(super.logProcessedFilesIfMust()).
|
|
1529
|
-
pipe(GulpStreamModifier_1.default.
|
|
1530
|
-
|
|
1521
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
1522
|
+
onStreamStartedEventHandler: this.replacePlainVinylFileWithAssetVinylFile.bind(this)
|
|
1531
1523
|
})).
|
|
1532
|
-
pipe(GulpStreamModifier_1.default.
|
|
1533
|
-
|
|
1534
|
-
[AssetVinylFile_1.default, GulpStreamsBasedAssetsProcessor_1.default.addContentHashPostfixToFileNameIfMust]
|
|
1535
|
-
])
|
|
1524
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
1525
|
+
onStreamStartedEventHandler: GulpStreamsBasedAssetsProcessor_1.default.addContentHashPostfixToFileNameIfMust
|
|
1536
1526
|
})).
|
|
1537
|
-
pipe(GulpStreamModifier_1.default.
|
|
1538
|
-
|
|
1539
|
-
[AssetVinylFile_1.default, VideosProcessor.postProcessFile]
|
|
1540
|
-
])
|
|
1527
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
1528
|
+
onStreamStartedEventHandler: VideosProcessor.postProcessFile
|
|
1541
1529
|
})).
|
|
1542
1530
|
pipe(gulp_1.default.dest((targetFileInFinalState) => AssetVinylFile_1.default.getOutputDirectoryAbsolutePathOfExpectedToBeSelfInstance(targetFileInFinalState)));
|
|
1543
1531
|
}
|
|
@@ -8158,7 +8146,7 @@ class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
|
|
|
8158
8146
|
entryPointsGroupsNormalizedSettingsMappedByReferences;
|
|
8159
8147
|
sourceCodeLintingCommonSettings;
|
|
8160
8148
|
importingFromTypeScriptSettings;
|
|
8161
|
-
|
|
8149
|
+
importingFromJavaScriptSettings;
|
|
8162
8150
|
staticPreviewSettings;
|
|
8163
8151
|
routingSettings;
|
|
8164
8152
|
relevantEntryPointsGroupsSettings;
|
|
@@ -8171,7 +8159,7 @@ class MarkupProcessingSettingsRepresentative extends GulpStreamBasedSourceCodePr
|
|
|
8171
8159
|
super(projectBuildingMasterConfigRepresentative);
|
|
8172
8160
|
this.sourceCodeLintingCommonSettings = normalizedMarkupProcessingSettings.linting;
|
|
8173
8161
|
this.importingFromTypeScriptSettings = normalizedMarkupProcessingSettings.importingFromTypeScript;
|
|
8174
|
-
this.
|
|
8162
|
+
this.importingFromJavaScriptSettings = normalizedMarkupProcessingSettings.importingFromJavaScript;
|
|
8175
8163
|
this.staticPreviewSettings = normalizedMarkupProcessingSettings.staticPreview;
|
|
8176
8164
|
this.routingSettings = normalizedMarkupProcessingSettings.routing;
|
|
8177
8165
|
this.relevantEntryPointsGroupsSettings = normalizedMarkupProcessingSettings.relevantEntryPointsGroups;
|
|
@@ -8660,36 +8648,24 @@ var MarkupProcessingSettings__FromFile__RawValid;
|
|
|
8660
8648
|
type: String,
|
|
8661
8649
|
required: true,
|
|
8662
8650
|
minimalCharactersCount: 1
|
|
8663
|
-
},
|
|
8664
|
-
$nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected: {
|
|
8665
|
-
newName: "nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected",
|
|
8666
|
-
type: String,
|
|
8667
|
-
required: true,
|
|
8668
|
-
minimalCharactersCount: 1
|
|
8669
8651
|
}
|
|
8670
8652
|
}
|
|
8671
8653
|
},
|
|
8672
|
-
/* ━━━
|
|
8673
|
-
$
|
|
8674
|
-
newName: "
|
|
8654
|
+
/* ━━━ Importing from JavaScript ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
|
|
8655
|
+
$importingFromJavaScript: {
|
|
8656
|
+
newName: "importingFromJavaScript",
|
|
8675
8657
|
preValidationModifications: es_extensions_1.nullToUndefined,
|
|
8676
8658
|
type: Object,
|
|
8677
8659
|
required: false,
|
|
8678
8660
|
properties: {
|
|
8679
|
-
$
|
|
8680
|
-
newName: "
|
|
8681
|
-
type: String,
|
|
8682
|
-
required: false,
|
|
8683
|
-
minimalCharactersCount: 1
|
|
8684
|
-
},
|
|
8685
|
-
$importedNamespace: {
|
|
8686
|
-
newName: "importedNamespace",
|
|
8661
|
+
$sourceFileRelativePath: {
|
|
8662
|
+
newName: "sourceFileRelativePath",
|
|
8687
8663
|
type: String,
|
|
8688
8664
|
required: true,
|
|
8689
8665
|
minimalCharactersCount: 1
|
|
8690
8666
|
},
|
|
8691
|
-
$
|
|
8692
|
-
newName: "
|
|
8667
|
+
$nameOfGlobalConstantForStoringOfImports: {
|
|
8668
|
+
newName: "nameOfGlobalConstantForStoringOfImports",
|
|
8693
8669
|
type: String,
|
|
8694
8670
|
required: true,
|
|
8695
8671
|
minimalCharactersCount: 1
|
|
@@ -8997,8 +8973,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
8997
8973
|
/* ─── Utils ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
8998
8974
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
8999
8975
|
class MarkupProcessingSharedState {
|
|
9000
|
-
static
|
|
9001
|
-
static
|
|
8976
|
+
static importsFromTypeScript;
|
|
8977
|
+
static importsFromJavaScript;
|
|
9002
8978
|
static pagesVariationsMetadata = new Map();
|
|
9003
8979
|
static get entryPointsSourceAndOutputFilesAbsolutePathsCorrespondenceMap() {
|
|
9004
8980
|
return Array.from(MarkupProcessingSharedState.pagesVariationsMetadata.values()).
|
|
@@ -9165,9 +9141,6 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9165
9141
|
pipe(this.handleErrorIfItWillOccur()).
|
|
9166
9142
|
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
9167
9143
|
onStreamStartedEventHandler: this.replacePlainVinylFileWithMarkupEntryPointVinylFile.bind(this)
|
|
9168
|
-
})).
|
|
9169
|
-
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
9170
|
-
onStreamStartedEventHandler: this.injectImportsFromTypeScriptIfAnyToMarkupFile.bind(this)
|
|
9171
9144
|
})).
|
|
9172
9145
|
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
9173
9146
|
onStreamStartedEventHandler: MarkupProcessor.managePageVariations
|
|
@@ -9178,7 +9151,8 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9178
9151
|
...vinylFile.localizationData ?? null,
|
|
9179
9152
|
...this.projectBuildingMasterConfigRepresentative.isStaticPreviewBuildingMode ?
|
|
9180
9153
|
this.markupProcessingSettingsRepresentative.staticDataForStaticPreview : null,
|
|
9181
|
-
...MarkupProcessingSharedState_1.default.
|
|
9154
|
+
...MarkupProcessingSharedState_1.default.importsFromTypeScript,
|
|
9155
|
+
...MarkupProcessingSharedState_1.default.importsFromJavaScript
|
|
9182
9156
|
}))).
|
|
9183
9157
|
pipe((0, gulp_pug_1.default)({
|
|
9184
9158
|
locals: {
|
|
@@ -9213,75 +9187,6 @@ class MarkupProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
9213
9187
|
}));
|
|
9214
9188
|
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.REMOVING_FILE_FROM_STREAM);
|
|
9215
9189
|
}
|
|
9216
|
-
async injectImportsFromTypeScriptIfAnyToMarkupFile(markupEntryPointVinylFile) {
|
|
9217
|
-
if ((0, es_extensions_1.isNull)(MarkupProcessingSharedState_1.default.importingFromTypeScriptPugCodeGenerator) ||
|
|
9218
|
-
(0, es_extensions_1.isUndefined)(this.markupProcessingSettingsRepresentative.importingFromTypeScriptSettings)) {
|
|
9219
|
-
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.PASSING_ON);
|
|
9220
|
-
}
|
|
9221
|
-
const pugCode = markupEntryPointVinylFile.stringifiedContents;
|
|
9222
|
-
const lineSeparator = (0, es_extensions_1.getLineSeparatorType)(pugCode);
|
|
9223
|
-
/* [ Maintainability ] Although this option is not configurable, keep this constant to avoid the magic numbers. */
|
|
9224
|
-
const BLANK_LINES_COUNT_AFTER_JAVASCRIPT_CODE_BLOCK = 2;
|
|
9225
|
-
/* [ Theory ] For the Pug preprocessor, the single indent could be either tab or multiple spaces.
|
|
9226
|
-
* Thus, ident is not always the single character. */
|
|
9227
|
-
const indentString = PugPreProcessorSpecialist_1.default.defineIndentString(pugCode);
|
|
9228
|
-
if (!PugPreProcessorSpecialist_1.default.isSourceCodeIncludingExtendingDeclaration(pugCode)) {
|
|
9229
|
-
markupEntryPointVinylFile.setContents([
|
|
9230
|
-
MarkupProcessingSharedState_1.default.importingFromTypeScriptPugCodeGenerator({
|
|
9231
|
-
indentString,
|
|
9232
|
-
lineSeparator,
|
|
9233
|
-
initialIndentationDepth__numerationFrom0: 0
|
|
9234
|
-
}),
|
|
9235
|
-
lineSeparator.repeat(BLANK_LINES_COUNT_AFTER_JAVASCRIPT_CODE_BLOCK + 1),
|
|
9236
|
-
markupEntryPointVinylFile.stringifiedContents
|
|
9237
|
-
].join(""));
|
|
9238
|
-
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.PASSING_ON);
|
|
9239
|
-
}
|
|
9240
|
-
const sourceCodeExplodedToLines = (0, es_extensions_1.explodeStringToLines)({
|
|
9241
|
-
targetString: markupEntryPointVinylFile.stringifiedContents,
|
|
9242
|
-
mustIgnoreCarriageReturn: false
|
|
9243
|
-
});
|
|
9244
|
-
/* [ Theory ] If the Pug entry point file has been extended, the JavaScript code block could be injected only inside
|
|
9245
|
-
* th specific block which must be declared in the parent (direct or no) files. It remains to process 2 cases: when
|
|
9246
|
-
* this block has been modified in the entry point file and when this block has not been referred in the entry point. */
|
|
9247
|
-
const nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected = this.markupProcessingSettingsRepresentative.
|
|
9248
|
-
importingFromTypeScriptSettings.nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected;
|
|
9249
|
-
/* [ Theory ]
|
|
9250
|
-
* If the Pug file has been extended from another one, the extending declaration must be first, otherwise error will occur.
|
|
9251
|
-
* The only thing is allowed is the unbuffered comments (will not be compiled to HTML comments), thus Pug file could
|
|
9252
|
-
* start from the unbuffered comment which could be safely discarded. */
|
|
9253
|
-
const indexOfLineIncludingBlockModifyingDeclaration = (0, es_extensions_1.getIndexOfArrayElementSatisfiesThePredicateIfSuchElementIsExactlyOne)(sourceCodeExplodedToLines, (sourceCodeLine) => PugPreProcessorSpecialist_1.default.isSourceCodeLineIncludingSpecificBlockModifyingDeclaration({
|
|
9254
|
-
sourceCodeLine, blockName: nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected
|
|
9255
|
-
}));
|
|
9256
|
-
if ((0, es_extensions_1.isNotNull)(indexOfLineIncludingBlockModifyingDeclaration)) {
|
|
9257
|
-
const targetCodeBlockExtractingResult = PugPreProcessorSpecialist_1.default.extractBlock({
|
|
9258
|
-
sourceCodeLines: sourceCodeExplodedToLines,
|
|
9259
|
-
startLineIndex: indexOfLineIncludingBlockModifyingDeclaration
|
|
9260
|
-
});
|
|
9261
|
-
sourceCodeExplodedToLines.splice(indexOfLineIncludingBlockModifyingDeclaration, targetCodeBlockExtractingResult.codeLines.length, ...targetCodeBlockExtractingResult.codeLines, MarkupProcessingSharedState_1.default.importingFromTypeScriptPugCodeGenerator({
|
|
9262
|
-
indentString,
|
|
9263
|
-
lineSeparator,
|
|
9264
|
-
initialIndentationDepth__numerationFrom0: 1
|
|
9265
|
-
}), ...Array.from({ length: BLANK_LINES_COUNT_AFTER_JAVASCRIPT_CODE_BLOCK }).fill(""));
|
|
9266
|
-
markupEntryPointVinylFile.setContents(sourceCodeExplodedToLines.join(lineSeparator));
|
|
9267
|
-
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.PASSING_ON);
|
|
9268
|
-
}
|
|
9269
|
-
const indexOfLineContainsExtendingDeclaration = (0, es_extensions_1.getIndexOfArrayElementSatisfiesThePredicateIfSuchElementIsExactlyOne)(sourceCodeExplodedToLines, (sourceCodeLine) => PugPreProcessorSpecialist_1.default.isSourceCodeLineIncludingExtendingDeclaration(sourceCodeLine), { mustThrowErrorIfElementNotFoundOrMatchesAreMultiple: true });
|
|
9270
|
-
markupEntryPointVinylFile.setContents((0, es_extensions_1.addElementsToArray)({
|
|
9271
|
-
targetArray: sourceCodeExplodedToLines,
|
|
9272
|
-
toPosition__numerationFrom0: indexOfLineContainsExtendingDeclaration + 1,
|
|
9273
|
-
newElements: [
|
|
9274
|
-
`\n\nblock append ${nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected}\n`,
|
|
9275
|
-
MarkupProcessingSharedState_1.default.importingFromTypeScriptPugCodeGenerator({
|
|
9276
|
-
indentString,
|
|
9277
|
-
lineSeparator,
|
|
9278
|
-
initialIndentationDepth__numerationFrom0: 1
|
|
9279
|
-
})
|
|
9280
|
-
],
|
|
9281
|
-
mutably: false
|
|
9282
|
-
}).join("\n"));
|
|
9283
|
-
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.PASSING_ON);
|
|
9284
|
-
}
|
|
9285
9190
|
static async managePageVariations(markupEntryPointVinylFile, addNewFilesToStream) {
|
|
9286
9191
|
const { newFiles, mustInitialFileBeDeleted } = markupEntryPointVinylFile.manageVariations();
|
|
9287
9192
|
addNewFilesToStream(newFiles);
|
|
@@ -11933,10 +11838,10 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
11933
11838
|
importingFromTypeScript: dataHoldingSelfInstance.
|
|
11934
11839
|
normalizeImportingFromTypeScriptSettings(markupProcessingSettings__fromFile__rawValid.importingFromTypeScript)
|
|
11935
11840
|
} : null,
|
|
11936
|
-
...(0, es_extensions_1.isNotUndefined)(markupProcessingSettings__fromFile__rawValid.
|
|
11841
|
+
...(0, es_extensions_1.isNotUndefined)(markupProcessingSettings__fromFile__rawValid.importingFromJavaScript) ?
|
|
11937
11842
|
{
|
|
11938
|
-
|
|
11939
|
-
|
|
11843
|
+
importingFromJavaScript: dataHoldingSelfInstance.
|
|
11844
|
+
normalizeImportingFromJavaScriptSettings(markupProcessingSettings__fromFile__rawValid.importingFromJavaScript)
|
|
11940
11845
|
} : null,
|
|
11941
11846
|
staticPreview: {
|
|
11942
11847
|
pagesVariations: dataHoldingSelfInstance.normalizeStaticPreviewPagesVariationsSettings(),
|
|
@@ -12024,28 +11929,16 @@ class MarkupProcessingRawSettingsNormalizer extends SourceCodeProcessingRawSetti
|
|
|
12024
11929
|
MarkupProcessingSettings__Default_1.default.staticPreview.typeScriptConfigurationFileRelativePath
|
|
12025
11930
|
], { alwaysForwardSlashSeparators: true }),
|
|
12026
11931
|
sourceFileAbsolutePath,
|
|
12027
|
-
importedNamespace: importingFromTypeScriptSettings__fromFile__rawValid.importedNamespace
|
|
12028
|
-
nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected: importingFromTypeScriptSettings__fromFile__rawValid.nameOfPugBlockToWhichTranspiledTypeScriptMustBeInjected
|
|
11932
|
+
importedNamespace: importingFromTypeScriptSettings__fromFile__rawValid.importedNamespace
|
|
12029
11933
|
};
|
|
12030
11934
|
}
|
|
12031
|
-
|
|
12032
|
-
const sourceFileAbsolutePath = es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
12033
|
-
this.consumingProjectRootDirectoryAbsolutePath,
|
|
12034
|
-
experimental1Settings__fromFile__rawValid.sourceFileRelativePath
|
|
12035
|
-
], { alwaysForwardSlashSeparators: true });
|
|
11935
|
+
normalizeImportingFromJavaScriptSettings(experimental1Settings__fromFile__rawValid) {
|
|
12036
11936
|
return {
|
|
12037
|
-
|
|
11937
|
+
sourceFileAbsolutePath: es_extensions_nodejs_1.ImprovedPath.joinPathSegments([
|
|
12038
11938
|
this.consumingProjectRootDirectoryAbsolutePath,
|
|
12039
|
-
|
|
12040
|
-
(0, es_extensions_1.appendLastFileNameExtension)({
|
|
12041
|
-
targetPath: experimental1Settings__fromFile__rawValid.typeScriptConfigurationFileRelativePath,
|
|
12042
|
-
targetFileNameExtensionWithOrWithoutLeadingDot: "json",
|
|
12043
|
-
mustAppendDuplicateEvenIfTargetLastFileNameExtensionAlreadyPresentsAtSpecifiedPath: false
|
|
12044
|
-
}) :
|
|
12045
|
-
MarkupProcessingSettings__Default_1.default.staticPreview.typeScriptConfigurationFileRelativePath
|
|
11939
|
+
experimental1Settings__fromFile__rawValid.sourceFileRelativePath
|
|
12046
11940
|
], { alwaysForwardSlashSeparators: true }),
|
|
12047
|
-
|
|
12048
|
-
importedNamespace: experimental1Settings__fromFile__rawValid.importedNamespace
|
|
11941
|
+
nameOfGlobalConstantForStoringOfImports: experimental1Settings__fromFile__rawValid.nameOfGlobalConstantForStoringOfImports
|
|
12049
11942
|
};
|
|
12050
11943
|
}
|
|
12051
11944
|
normalizeStaticPreviewPagesVariationsSettings() {
|
|
@@ -12928,7 +12821,8 @@ const TypeScriptSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPar
|
|
|
12928
12821
|
const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
|
|
12929
12822
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
12930
12823
|
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
12931
|
-
|
|
12824
|
+
const require_from_string_1 = __importDefault(__webpack_require__(/*! require-from-string */ "require-from-string"));
|
|
12825
|
+
class CompiledTypeScriptImporterForPug extends GulpStreamsBasedTaskExecutor_1.default {
|
|
12932
12826
|
logging = {
|
|
12933
12827
|
pathsOfFilesWillBeProcessed: false,
|
|
12934
12828
|
quantityOfFilesWillBeProcessed: false
|
|
@@ -12945,7 +12839,7 @@ class CompiledInlineTypeScriptImporterForPug extends GulpStreamsBasedTaskExecuto
|
|
|
12945
12839
|
if ((0, es_extensions_1.isUndefined)(importingFromTypeScriptSettings)) {
|
|
12946
12840
|
return (0, createImmediatelyEndingEmptyStream_1.default)();
|
|
12947
12841
|
}
|
|
12948
|
-
const dataHoldingSelfInstance = new
|
|
12842
|
+
const dataHoldingSelfInstance = new CompiledTypeScriptImporterForPug(projectBuildingMasterConfigRepresentative, importingFromTypeScriptSettings);
|
|
12949
12843
|
return (callback) => dataHoldingSelfInstance.provideTypeScriptImports(callback);
|
|
12950
12844
|
}
|
|
12951
12845
|
constructor(projectBuildingMasterConfigRepresentative, compiledTypeScriptImportingSettings) {
|
|
@@ -12985,7 +12879,7 @@ class CompiledInlineTypeScriptImporterForPug extends GulpStreamsBasedTaskExecuto
|
|
|
12985
12879
|
entryPointsSourceFilesAbsolutePaths: [compiledTypeScriptImportingSettings.sourceFileAbsolutePath],
|
|
12986
12880
|
webpackContext: projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath
|
|
12987
12881
|
});
|
|
12988
|
-
this.webpackConfiguration =
|
|
12882
|
+
this.webpackConfiguration = CompiledTypeScriptImporterForPug.
|
|
12989
12883
|
getWebpackEntryObjectRespectiveToSpecifiedEntryPointsGroupSettings({
|
|
12990
12884
|
webpackEntryPointDefinition,
|
|
12991
12885
|
compiledTypeScriptImportingSettings,
|
|
@@ -13010,12 +12904,18 @@ class CompiledInlineTypeScriptImporterForPug extends GulpStreamsBasedTaskExecuto
|
|
|
13010
12904
|
pipe(GulpStreamModifier_1.default.modify({
|
|
13011
12905
|
onStreamStartedEventCommonHandler: async (vinylFile) => {
|
|
13012
12906
|
const outputJavaScriptCode = (0, extractStringifiedContentFromVinylFile_1.default)(vinylFile);
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
12907
|
+
const imported = (0, require_from_string_1.default)(outputJavaScriptCode);
|
|
12908
|
+
if (!(0, es_extensions_1.isArbitraryObject)(imported)) {
|
|
12909
|
+
/* [ Theory ] The subsequent invocation of the callback will be ignored. */
|
|
12910
|
+
callback();
|
|
12911
|
+
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.REMOVING_FILE_FROM_STREAM);
|
|
12912
|
+
}
|
|
12913
|
+
if (!(0, es_extensions_1.isArbitraryObject)(imported.default)) {
|
|
12914
|
+
/* [ Theory ] The subsequent invocation of the callback will be ignored. */
|
|
12915
|
+
callback();
|
|
12916
|
+
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.REMOVING_FILE_FROM_STREAM);
|
|
12917
|
+
}
|
|
12918
|
+
MarkupProcessingSharedState_1.default.importsFromTypeScript = { [this.importedNamespaceName]: imported.default };
|
|
13019
12919
|
/* [ Theory ] The subsequent invocation of the callback will be ignored. */
|
|
13020
12920
|
callback();
|
|
13021
12921
|
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.REMOVING_FILE_FROM_STREAM);
|
|
@@ -13077,15 +12977,15 @@ class CompiledInlineTypeScriptImporterForPug extends GulpStreamsBasedTaskExecuto
|
|
|
13077
12977
|
};
|
|
13078
12978
|
}
|
|
13079
12979
|
}
|
|
13080
|
-
exports["default"] =
|
|
12980
|
+
exports["default"] = CompiledTypeScriptImporterForPug;
|
|
13081
12981
|
|
|
13082
12982
|
|
|
13083
12983
|
/***/ }),
|
|
13084
12984
|
|
|
13085
|
-
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/
|
|
13086
|
-
|
|
13087
|
-
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/
|
|
13088
|
-
|
|
12985
|
+
/***/ "./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/JavaScriptImporterForPug.ts":
|
|
12986
|
+
/*!******************************************************************************************!*\
|
|
12987
|
+
!*** ./ProjectBuilding/SourceCodeProcessing/Markup/Subtasks/JavaScriptImporterForPug.ts ***!
|
|
12988
|
+
\******************************************************************************************/
|
|
13089
12989
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
13090
12990
|
|
|
13091
12991
|
|
|
@@ -13097,177 +12997,32 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
13097
12997
|
const GulpStreamsBasedTaskExecutor_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/GulpStreamsBasedTaskExecutor */ "./ProjectBuilding/Common/TasksExecutors/GulpStreamsBased/GulpStreamsBasedTaskExecutor.ts"));
|
|
13098
12998
|
/* ─── Shared State ───────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
13099
12999
|
const MarkupProcessingSharedState_1 = __importDefault(__webpack_require__(/*! @MarkupProcessing/MarkupProcessingSharedState */ "./ProjectBuilding/SourceCodeProcessing/Markup/MarkupProcessingSharedState.ts"));
|
|
13100
|
-
/* ─── Applied Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
13101
|
-
const createImmediatelyEndingEmptyStream_1 = __importDefault(__webpack_require__(/*! @Utils/createImmediatelyEndingEmptyStream */ "./Utils/createImmediatelyEndingEmptyStream.ts"));
|
|
13102
|
-
const gulp_1 = __importDefault(__webpack_require__(/*! gulp */ "gulp"));
|
|
13103
|
-
const extractStringifiedContentFromVinylFile_1 = __importDefault(__webpack_require__(/*! @Utils/extractStringifiedContentFromVinylFile */ "./Utils/extractStringifiedContentFromVinylFile.ts"));
|
|
13104
|
-
const GulpStreamModifier_1 = __importDefault(__webpack_require__(/*! @Utils/GulpStreamModifier */ "./Utils/GulpStreamModifier.ts"));
|
|
13105
|
-
const webpack_1 = __importDefault(__webpack_require__(/*! webpack */ "webpack"));
|
|
13106
|
-
const webpack_stream_1 = __importDefault(__webpack_require__(/*! webpack-stream */ "webpack-stream"));
|
|
13107
|
-
const WebpackConfigGenerator_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/Utils/WebpackConfigGenerator */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/Utils/WebpackConfigGenerator.ts"));
|
|
13108
|
-
const WebpackSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/WebpackSpecialist */ "./ThirdPartySolutionsSpecialists/WebpackSpecialist.ts"));
|
|
13109
|
-
const TypeScriptSpecialist_1 = __importDefault(__webpack_require__(/*! @ThirdPartySolutionsSpecialists/TypeScriptSpecialist */ "./ThirdPartySolutionsSpecialists/TypeScriptSpecialist.ts"));
|
|
13110
13000
|
/* ─── General Utils ──────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
13111
|
-
const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
|
|
13112
13001
|
const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
|
|
13113
|
-
const es_extensions_nodejs_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions-nodejs */ "@yamato-daiwa/es-extensions-nodejs");
|
|
13114
13002
|
const require_from_string_1 = __importDefault(__webpack_require__(/*! require-from-string */ "require-from-string"));
|
|
13115
|
-
|
|
13003
|
+
const fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
|
|
13004
|
+
class JavaScriptImporterForPug extends GulpStreamsBasedTaskExecutor_1.default {
|
|
13116
13005
|
logging = {
|
|
13117
13006
|
pathsOfFilesWillBeProcessed: false,
|
|
13118
13007
|
quantityOfFilesWillBeProcessed: false
|
|
13119
13008
|
};
|
|
13120
|
-
|
|
13121
|
-
typeScriptSourceFileAbsolutePath;
|
|
13122
|
-
importedNamespaceName;
|
|
13123
|
-
static provideTypeScriptImportsForMarkupIfMust(projectBuildingMasterConfigRepresentative) {
|
|
13009
|
+
static provideJavaScriptImportsForMarkupIfMust(projectBuildingMasterConfigRepresentative) {
|
|
13124
13010
|
const markupProcessingSettingsRepresentative = projectBuildingMasterConfigRepresentative.markupProcessingSettingsRepresentative;
|
|
13125
13011
|
if ((0, es_extensions_1.isUndefined)(markupProcessingSettingsRepresentative)) {
|
|
13126
|
-
return (
|
|
13127
|
-
}
|
|
13128
|
-
const importingFromTypeScriptSettings = markupProcessingSettingsRepresentative.experimental1Settings;
|
|
13129
|
-
if ((0, es_extensions_1.isUndefined)(importingFromTypeScriptSettings)) {
|
|
13130
|
-
return (0, createImmediatelyEndingEmptyStream_1.default)();
|
|
13131
|
-
}
|
|
13132
|
-
const dataHoldingSelfInstance = new ExperimentalCompiledTypeScriptImporterForPug(projectBuildingMasterConfigRepresentative, importingFromTypeScriptSettings);
|
|
13133
|
-
return (callback) => dataHoldingSelfInstance.provideTypeScriptImports(callback);
|
|
13134
|
-
}
|
|
13135
|
-
constructor(projectBuildingMasterConfigRepresentative, compiledTypeScriptImportingSettings) {
|
|
13136
|
-
super({
|
|
13137
|
-
projectBuildingMasterConfigRepresentative,
|
|
13138
|
-
taskTitleForLogging: "Exporting of TypeScript to Pug"
|
|
13139
|
-
});
|
|
13140
|
-
const typeScriptCompilerOptions = TypeScriptSpecialist_1.default.
|
|
13141
|
-
readTypeScriptConfigurationFileAndGetCompilerOptions(compiledTypeScriptImportingSettings.typeScriptConfigurationFileAbsolutePath);
|
|
13142
|
-
const webpackAliasesConfiguration = WebpackSpecialist_1.default.
|
|
13143
|
-
convertPathsAliasesFromTypeScriptFormatToWebpackFormat({
|
|
13144
|
-
typeScriptPathsSettings: typeScriptCompilerOptions.paths,
|
|
13145
|
-
typeScriptBasicAbsolutePath: typeScriptCompilerOptions.baseUrl ??
|
|
13146
|
-
es_extensions_nodejs_1.ImprovedPath.extractDirectoryFromFilePath({
|
|
13147
|
-
targetPath: compiledTypeScriptImportingSettings.typeScriptConfigurationFileAbsolutePath,
|
|
13148
|
-
alwaysForwardSlashSeparators: true,
|
|
13149
|
-
ambiguitiesResolution: {
|
|
13150
|
-
mustConsiderLastSegmentStartingWithDotAsDirectory: false,
|
|
13151
|
-
mustConsiderLastSegmentWithNonLeadingDotAsDirectory: false,
|
|
13152
|
-
mustConsiderLastSegmentWithoutDotsAsFileNameWithoutExtension: false
|
|
13153
|
-
}
|
|
13154
|
-
})
|
|
13155
|
-
});
|
|
13156
|
-
if (!fs_1.default.existsSync(compiledTypeScriptImportingSettings.sourceFileAbsolutePath)) {
|
|
13157
|
-
es_extensions_1.Logger.throwErrorAndLog({
|
|
13158
|
-
errorInstance: new es_extensions_nodejs_1.FileNotFoundError({
|
|
13159
|
-
customMessage: `The TypeScript file "${compiledTypeScriptImportingSettings.sourceFileAbsolutePath}" for ` +
|
|
13160
|
-
"the exporting to Pug was found. " +
|
|
13161
|
-
"Please create this file and provide some exports from it."
|
|
13162
|
-
}),
|
|
13163
|
-
title: es_extensions_nodejs_1.FileNotFoundError.localization.defaultTitle,
|
|
13164
|
-
occurrenceLocation: "compiledInlineTypeScriptImporterForPug.constructor(...parameters)"
|
|
13165
|
-
});
|
|
13166
|
-
}
|
|
13167
|
-
/** @see https://webpack.js.org/configuration/entry-context/#entry */
|
|
13168
|
-
const webpackEntryPointDefinition = WebpackConfigGenerator_1.default.getWebpackEntryObjectRespectiveToExistingEntryPoints({
|
|
13169
|
-
entryPointsSourceFilesAbsolutePaths: [compiledTypeScriptImportingSettings.sourceFileAbsolutePath],
|
|
13170
|
-
webpackContext: projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath
|
|
13171
|
-
});
|
|
13172
|
-
this.webpackConfiguration = ExperimentalCompiledTypeScriptImporterForPug.
|
|
13173
|
-
getWebpackEntryObjectRespectiveToSpecifiedEntryPointsGroupSettings({
|
|
13174
|
-
webpackEntryPointDefinition,
|
|
13175
|
-
compiledTypeScriptImportingSettings,
|
|
13176
|
-
projectBuildingMasterConfigRepresentative,
|
|
13177
|
-
webpackAliasesConfiguration
|
|
13178
|
-
});
|
|
13179
|
-
this.typeScriptSourceFileAbsolutePath = compiledTypeScriptImportingSettings.sourceFileAbsolutePath;
|
|
13180
|
-
this.importedNamespaceName = compiledTypeScriptImportingSettings.importedNamespace;
|
|
13181
|
-
}
|
|
13182
|
-
/* [ Theory ]
|
|
13183
|
-
* This Gulp task has callback and also returns the stream. Both measures signalize about completion.
|
|
13184
|
-
* The main measure is the callback, but if error will occur on first building, the callback will not be called,
|
|
13185
|
-
* but the "handleErrorIfItWillOccur" will generate the `on.("end")` event. */
|
|
13186
|
-
provideTypeScriptImports(callback) {
|
|
13187
|
-
return gulp_1.default.
|
|
13188
|
-
src(this.typeScriptSourceFileAbsolutePath).
|
|
13189
|
-
pipe(super.handleErrorIfItWillOccur()).
|
|
13190
|
-
pipe(super.logProcessedFilesIfMust()).
|
|
13191
|
-
pipe((0, webpack_stream_1.default)(this.webpackConfiguration,
|
|
13192
|
-
/* @ts-ignore: TS2345 The null as second argument is obeying to README of "webpack-stream" package. */
|
|
13193
|
-
null, this.onBuildHasCompleted.bind(this))).
|
|
13194
|
-
pipe(GulpStreamModifier_1.default.modify({
|
|
13195
|
-
onStreamStartedEventCommonHandler: async (vinylFile) => {
|
|
13196
|
-
const outputJavaScriptCode = (0, extractStringifiedContentFromVinylFile_1.default)(vinylFile);
|
|
13197
|
-
const imported = (0, require_from_string_1.default)(outputJavaScriptCode);
|
|
13198
|
-
if (!(0, es_extensions_1.isArbitraryObject)(imported)) {
|
|
13199
|
-
/* [ Theory ] The subsequent invocation of the callback will be ignored. */
|
|
13200
|
-
callback();
|
|
13201
|
-
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.REMOVING_FILE_FROM_STREAM);
|
|
13202
|
-
}
|
|
13203
|
-
if (!(0, es_extensions_1.isArbitraryObject)(imported.default)) {
|
|
13204
|
-
/* [ Theory ] The subsequent invocation of the callback will be ignored. */
|
|
13205
|
-
callback();
|
|
13206
|
-
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.REMOVING_FILE_FROM_STREAM);
|
|
13207
|
-
}
|
|
13208
|
-
MarkupProcessingSharedState_1.default.experimental = { [this.importedNamespaceName]: imported.default };
|
|
13209
|
-
/* [ Theory ] The subsequent invocation of the callback will be ignored. */
|
|
13210
|
-
callback();
|
|
13211
|
-
return Promise.resolve(GulpStreamModifier_1.default.CompletionSignals.REMOVING_FILE_FROM_STREAM);
|
|
13212
|
-
}
|
|
13213
|
-
}));
|
|
13214
|
-
}
|
|
13215
|
-
onBuildHasCompleted(hardError, statistics) {
|
|
13216
|
-
if ((0, es_extensions_1.isNeitherUndefinedNorNull)(hardError)) {
|
|
13217
|
-
/* [ Theory ] In this case, error will be emitted by "webpack-stream". */
|
|
13218
|
-
return;
|
|
13012
|
+
return (callback) => { callback(); };
|
|
13219
13013
|
}
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
description: "The TypeScript file has been transpiled and injected to Pug. " +
|
|
13224
|
-
`The exported entity stored to "${this.importedNamespaceName}" variable.`
|
|
13225
|
-
});
|
|
13226
|
-
process.stdout.write(`${statistics.toString({ colors: true })}\n`);
|
|
13014
|
+
const importingFromJavaScriptSettings = markupProcessingSettingsRepresentative.importingFromJavaScriptSettings;
|
|
13015
|
+
if ((0, es_extensions_1.isUndefined)(importingFromJavaScriptSettings)) {
|
|
13016
|
+
return (callback) => { callback(); };
|
|
13227
13017
|
}
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
entry: webpackEntryPointDefinition,
|
|
13232
|
-
output: {
|
|
13233
|
-
library: {
|
|
13234
|
-
type: "umd",
|
|
13235
|
-
name: compiledTypeScriptImportingSettings.importedNamespace
|
|
13236
|
-
},
|
|
13237
|
-
globalObject: "globalThis"
|
|
13238
|
-
},
|
|
13239
|
-
watch: projectBuildingMasterConfigRepresentative.mustProvideIncrementalBuilding,
|
|
13240
|
-
mode: "production",
|
|
13241
|
-
optimization: { minimize: true },
|
|
13242
|
-
module: {
|
|
13243
|
-
rules: [
|
|
13244
|
-
{
|
|
13245
|
-
test: /\.ts$/u,
|
|
13246
|
-
loader: "ts-loader",
|
|
13247
|
-
options: {
|
|
13248
|
-
transpileOnly: true
|
|
13249
|
-
}
|
|
13250
|
-
}
|
|
13251
|
-
]
|
|
13252
|
-
},
|
|
13253
|
-
resolve: {
|
|
13254
|
-
extensions: [".ts", ".js"],
|
|
13255
|
-
alias: webpackAliasesConfiguration
|
|
13256
|
-
},
|
|
13257
|
-
resolveLoader: WebpackSpecialist_1.default.
|
|
13258
|
-
generateLoadersResolvingSettings(projectBuildingMasterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath),
|
|
13259
|
-
plugins: [
|
|
13260
|
-
new webpack_1.default.DefinePlugin({
|
|
13261
|
-
__IS_LOCAL_DEVELOPMENT_BUILDING_MODE__: projectBuildingMasterConfigRepresentative.isLocalDevelopmentBuildingMode,
|
|
13262
|
-
__IS_TESTING_BUILDING_MODE__: projectBuildingMasterConfigRepresentative.isTestingBuildingMode,
|
|
13263
|
-
__IS_STAGING_BUILDING_MODE__: projectBuildingMasterConfigRepresentative.isStagingBuildingMode,
|
|
13264
|
-
__IS_PRODUCTION_BUILDING_MODE__: projectBuildingMasterConfigRepresentative.isProductionBuildingMode
|
|
13265
|
-
})
|
|
13266
|
-
]
|
|
13018
|
+
const loadedJavaScriptModule = (0, require_from_string_1.default)(fs_1.default.readFileSync(importingFromJavaScriptSettings.sourceFileAbsolutePath, "utf-8"));
|
|
13019
|
+
MarkupProcessingSharedState_1.default.importsFromJavaScript = {
|
|
13020
|
+
[importingFromJavaScriptSettings.nameOfGlobalConstantForStoringOfImports]: loadedJavaScriptModule
|
|
13267
13021
|
};
|
|
13022
|
+
return (callback) => { callback(); };
|
|
13268
13023
|
}
|
|
13269
13024
|
}
|
|
13270
|
-
exports["default"] =
|
|
13025
|
+
exports["default"] = JavaScriptImporterForPug;
|
|
13271
13026
|
|
|
13272
13027
|
|
|
13273
13028
|
/***/ }),
|
|
@@ -14142,10 +13897,8 @@ class StylesProcessor extends GulpStreamsBasedTaskExecutor_1.default {
|
|
|
14142
13897
|
}))).
|
|
14143
13898
|
pipe((0, gulp_if_1.default)(this.projectBuildingMasterConfigRepresentative.isStaticPreviewBuildingMode ||
|
|
14144
13899
|
this.projectBuildingMasterConfigRepresentative.isLocalDevelopmentBuildingMode, gulp_sourcemaps_1.default.write())).
|
|
14145
|
-
pipe(GulpStreamModifier_1.default.
|
|
14146
|
-
|
|
14147
|
-
[StylesEntryPointVinylFile_1.default, this.onOutputCSS_FileReady.bind(this)]
|
|
14148
|
-
])
|
|
13900
|
+
pipe(GulpStreamModifier_1.default.modifyForSingleVinylFileSubtype({
|
|
13901
|
+
onStreamStartedEventHandler: this.onOutputCSS_FileReady.bind(this)
|
|
14149
13902
|
})).
|
|
14150
13903
|
pipe(gulp_1.default.dest((targetFile) => StylesEntryPointVinylFile_1.default.getOutputDirectoryAbsolutePathOfExpectedToBeSelfInstance(targetFile)));
|
|
14151
13904
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamato-daiwa/automation",
|
|
3
|
-
"version": "0.7.0-alpha.
|
|
3
|
+
"version": "0.7.0-alpha.5",
|
|
4
4
|
"description": "The project building tool with declarative YAML configuration specializing on Pug, Stylus and TypeScript as source code languages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|