@yamato-daiwa/automation 0.0.6 → 0.0.9

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.
Files changed (2) hide show
  1. package/EntryPoint.js +129 -30
  2. package/package.json +10 -1
package/EntryPoint.js CHANGED
@@ -73,11 +73,11 @@ const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
73
73
  const yamljs_1 = __importDefault(__webpack_require__(/*! yamljs */ "yamljs"));
74
74
  class EntryPoint {
75
75
  static interpretAndExecuteConsoleCommand(rawConsoleCommand) {
76
- const parsedCommand = es_extensions_nodejs_1.ConsoleCommandsParser.parse(rawConsoleCommand, ApplicationConsoleLineInterface_1.default.specification);
76
+ const parsedConsoleCommand = es_extensions_nodejs_1.ConsoleCommandsParser.parse(rawConsoleCommand, ApplicationConsoleLineInterface_1.default.specification);
77
77
  if (true) {
78
78
  PoliteErrorsMessagesBuilder_1.default.setTechnicalDetailsOnlyMode();
79
79
  }
80
- switch (parsedCommand.phrase) {
80
+ switch (parsedConsoleCommand.phrase) {
81
81
  case ApplicationConsoleLineInterface_1.default.CommandPhrases.buildProject: {
82
82
  const consumingProjectRootDirectoryAbsolutePath = process.cwd();
83
83
  const rawConfigFileAbsolutePath = path_1.default.resolve(consumingProjectRootDirectoryAbsolutePath, CONFIG_FILE_DEFAULT_NAME_WITH_EXTENSION_1.default);
@@ -98,8 +98,8 @@ class EntryPoint {
98
98
  ProjectBuilder_1.default.buildProject({
99
99
  consumingProjectRootDirectoryAbsolutePath,
100
100
  projectBuildingConfig__fromConsole: {
101
- projectBuildingMode: parsedCommand.projectBuildingMode,
102
- selectiveExecutionID: parsedCommand.selectiveExecutionID
101
+ projectBuildingMode: parsedConsoleCommand.projectBuildingMode,
102
+ selectiveExecutionID: parsedConsoleCommand.selectiveExecutionID
103
103
  },
104
104
  rawConfigFromFile
105
105
  });
@@ -1507,8 +1507,7 @@ var AssetsProcessingSettingsGenericProperties__FromFile__RawValid;
1507
1507
  buildingModeDependent.outputBaseDirectoryRelativePath.KEY]: {
1508
1508
  newName: "outputBaseDirectoryRelativePath",
1509
1509
  type: String,
1510
- required: true,
1511
- minimalCharactersCount: 1
1510
+ required: true
1512
1511
  },
1513
1512
  [assetsProcessingSettingsGenericPropertiesLocalization.assetsGroups.buildingModeDependent.revisioning.KEY]: {
1514
1513
  newName: "revisioning",
@@ -2398,7 +2397,7 @@ class GulpStreamsBasedSourceCodeProcessor extends GulpStreamsBasedTaskExecutor_1
2398
2397
  initializeSourceFilesDirectoriesWhichAlwaysWillBeBeingWatchedGlobSelectors() {
2399
2398
  this.globSelectorsOfSourceFilesWithSupportedFilenameExtensionsInEntryPointsGroupRootDirectoryAndBelow.push(...this.associatedSourceCodeProcessingSettingsRepresentative.
2400
2399
  relevantEntryPointsSourceDirectoriesAbsolutePaths.
2401
- map((entryPointsSourceFilesDirectoryAbsolutePath) => ImprovedGlob_1.default.buildAllFilesInCurrentDirectoryButNotBelowGlobSelector({
2400
+ map((entryPointsSourceFilesDirectoryAbsolutePath) => ImprovedGlob_1.default.buildAllFilesInCurrentDirectoryAndBelowGlobSelector({
2402
2401
  basicDirectoryPath: entryPointsSourceFilesDirectoryAbsolutePath,
2403
2402
  fileNamesExtensions: this.associatedSourceCodeProcessingSettingsRepresentative.
2404
2403
  supportedEntryPointsSourceFileNameExtensionsWithoutLeadingDots
@@ -3025,6 +3024,19 @@ const ProjectBuildingConfigFromFileDefaultLocalization = {
3025
3024
  KEY: "linting",
3026
3025
  disable: { KEY: "disable" }
3027
3026
  },
3027
+ distributing: {
3028
+ KEY: "distributing",
3029
+ exposingOfExportsFromEntryPoints: {
3030
+ KEY: "exposingOfExportsFromEntryPoints",
3031
+ mustExpose: { KEY: "mustExpose" },
3032
+ namespace: { KEY: "namespace" }
3033
+ },
3034
+ typeScriptTypesDeclarations: {
3035
+ KEY: "typeScriptTypesDeclarations",
3036
+ mustGenerate: { KEY: "mustGenerate" },
3037
+ fileNameWithoutExtension: { KEY: "outputRelativePath" }
3038
+ }
3039
+ },
3028
3040
  buildingModeDependent: {
3029
3041
  KEY: "buildingModeDependent",
3030
3042
  outputBaseDirectoryRelativePath: { KEY: "outputBaseDirectoryRelativePath" },
@@ -3520,6 +3532,7 @@ class ECMA_ScriptLogicProcessingRawSettingsNormalizer extends SourceCodeProcessi
3520
3532
  };
3521
3533
  }
3522
3534
  completeEntryPointsGroupNormalizedSettingsCommonPropertiesUntilECMA_ScriptLogicEntryPointsGroupNormalizedSettings(entryPointsGroupGenericSettings__normalized, entryPointsGroupSettings__rawValid) {
3535
+ const distributingSettings__rawValid = entryPointsGroupSettings__rawValid.distributing;
3523
3536
  return {
3524
3537
  ...entryPointsGroupGenericSettings__normalized,
3525
3538
  targetRuntime: (() => {
@@ -3545,6 +3558,11 @@ class ECMA_ScriptLogicProcessingRawSettingsNormalizer extends SourceCodeProcessi
3545
3558
  }
3546
3559
  };
3547
3560
  }
3561
+ case SupportedECMA_ScriptRuntimesTypes.pug: {
3562
+ return {
3563
+ type: SupportedECMA_ScriptRuntimesTypes.pug
3564
+ };
3565
+ }
3548
3566
  }
3549
3567
  })(),
3550
3568
  entryPointsSourceFilesTopDirectoryOrSingleFilePathAliasForReferencingFromHTML: `${ECMA_ScriptLogicProcessingSettings__Default_1.default.filePathAliasNotation}` +
@@ -3573,7 +3591,22 @@ class ECMA_ScriptLogicProcessingRawSettingsNormalizer extends SourceCodeProcessi
3573
3591
  contentHashPostfixSeparator: entryPointsGroupSettings__rawValid.buildingModeDependent[this.consumingProjectBuildingMode].
3574
3592
  revisioning?.contentHashPostfixSeparator ??
3575
3593
  ECMA_ScriptLogicProcessingSettings__Default_1.default.revisioning.contentHashPostfixSeparator
3576
- }
3594
+ },
3595
+ ...(0, es_extensions_1.isNotUndefined)(distributingSettings__rawValid) ? {
3596
+ distributing: {
3597
+ exposingOfExportsFromEntryPoints: {
3598
+ mustExpose: distributingSettings__rawValid.exposingOfExportsFromEntryPoints?.mustExpose ??
3599
+ ECMA_ScriptLogicProcessingSettings__Default_1.default.distributing.exposingOfExportsFromEntryPoints.mustExpose,
3600
+ namespace: distributingSettings__rawValid.exposingOfExportsFromEntryPoints?.namespace
3601
+ },
3602
+ typeScriptTypesDeclarations: {
3603
+ mustGenerate: distributingSettings__rawValid.typeScriptTypesDeclarations?.mustGenerate ??
3604
+ ECMA_ScriptLogicProcessingSettings__Default_1.default.distributing.typeScriptTypesDeclarations.mustGenerate,
3605
+ fileNameWithoutExtension: distributingSettings__rawValid.typeScriptTypesDeclarations?.fileNameWithoutExtension ??
3606
+ ECMA_ScriptLogicProcessingSettings__Default_1.default.distributing.typeScriptTypesDeclarations.fileNameWithoutExtension
3607
+ }
3608
+ }
3609
+ } : null
3577
3610
  };
3578
3611
  }
3579
3612
  }
@@ -3599,6 +3632,7 @@ var ECMA_ScriptLogicProcessingRestrictions;
3599
3632
  SupportedECMA_ScriptRuntimesTypes["browser"] = "BROWSER";
3600
3633
  SupportedECMA_ScriptRuntimesTypes["webWorker"] = "WEB_WORKER";
3601
3634
  SupportedECMA_ScriptRuntimesTypes["nodeJS"] = "NODEJS";
3635
+ SupportedECMA_ScriptRuntimesTypes["pug"] = "PUG";
3602
3636
  })(SupportedECMA_ScriptRuntimesTypes = ECMA_ScriptLogicProcessingRestrictions.SupportedECMA_ScriptRuntimesTypes || (ECMA_ScriptLogicProcessingRestrictions.SupportedECMA_ScriptRuntimesTypes = {}));
3603
3637
  })(ECMA_ScriptLogicProcessingRestrictions || (ECMA_ScriptLogicProcessingRestrictions = {}));
3604
3638
  exports["default"] = ECMA_ScriptLogicProcessingRestrictions;
@@ -3690,6 +3724,15 @@ exports["default"] = {
3690
3724
  linting: {
3691
3725
  mustExecute: false,
3692
3726
  isDisabledForEntryPointGroups: false
3727
+ },
3728
+ distributing: {
3729
+ exposingOfExportsFromEntryPoints: {
3730
+ mustExpose: false
3731
+ },
3732
+ typeScriptTypesDeclarations: {
3733
+ mustGenerate: false,
3734
+ fileNameWithoutExtension: "index.d.ts"
3735
+ }
3693
3736
  }
3694
3737
  };
3695
3738
 
@@ -3710,7 +3753,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3710
3753
  /* --- Restrictions ------------------------------------------------------------------------------------------------- */
3711
3754
  const ECMA_ScriptLogicProcessingRestrictions_1 = __importDefault(__webpack_require__(/*! @ECMA_ScriptProcessing/ECMA_ScriptLogicProcessingRestrictions */ "./ProjectBuilding/SourceCodeProcessing/ECMA_Script/ECMA_ScriptLogicProcessingRestrictions.ts"));
3712
3755
  var SupportedECMA_ScriptRuntimesTypes = ECMA_ScriptLogicProcessingRestrictions_1.default.SupportedECMA_ScriptRuntimesTypes;
3713
- /* --- Default settings ----------------------------------------------------------------------------------------------- */
3756
+ /* --- Default settings --------------------------------------------------------------------------------------------- */
3714
3757
  const ConsumingProjectPreDefinedBuildingModes_1 = __importDefault(__webpack_require__(/*! @ProjectBuilding/Common/Defaults/ConsumingProjectPreDefinedBuildingModes */ "./ProjectBuilding/Common/Defaults/ConsumingProjectPreDefinedBuildingModes.ts"));
3715
3758
  const es_extensions_1 = __webpack_require__(/*! @yamato-daiwa/es-extensions */ "@yamato-daiwa/es-extensions");
3716
3759
  /* eslint-disable-next-line @typescript-eslint/no-redeclare --
@@ -3822,6 +3865,51 @@ var ECMA_ScriptLogicProcessingSettings__FromFile__RawValid;
3822
3865
  }
3823
3866
  }
3824
3867
  },
3868
+ [ECMA_ScriptProcessingLocalization.entryPointsGroups.distributing.KEY]: {
3869
+ newName: "distributing",
3870
+ type: Object,
3871
+ required: false,
3872
+ properties: {
3873
+ [ECMA_ScriptProcessingLocalization.entryPointsGroups.distributing.exposingOfExportsFromEntryPoints.KEY]: {
3874
+ newName: "exposingOfExportsFromEntryPoints",
3875
+ type: Object,
3876
+ required: false,
3877
+ properties: {
3878
+ [ECMA_ScriptProcessingLocalization.entryPointsGroups.distributing.
3879
+ exposingOfExportsFromEntryPoints.mustExpose.KEY]: {
3880
+ newName: "mustExpose",
3881
+ type: Boolean,
3882
+ required: true
3883
+ },
3884
+ [ECMA_ScriptProcessingLocalization.entryPointsGroups.distributing.
3885
+ exposingOfExportsFromEntryPoints.namespace.KEY]: {
3886
+ newName: "namespace",
3887
+ type: String,
3888
+ required: false
3889
+ }
3890
+ }
3891
+ },
3892
+ [ECMA_ScriptProcessingLocalization.entryPointsGroups.distributing.typeScriptTypesDeclarations.KEY]: {
3893
+ newName: "typeScriptTypesDeclarations",
3894
+ type: Object,
3895
+ required: false,
3896
+ properties: {
3897
+ [ECMA_ScriptProcessingLocalization.entryPointsGroups.distributing.
3898
+ typeScriptTypesDeclarations.mustGenerate.KEY]: {
3899
+ newName: "mustGenerate",
3900
+ type: Boolean,
3901
+ required: false
3902
+ },
3903
+ [ECMA_ScriptProcessingLocalization.entryPointsGroups.distributing.
3904
+ typeScriptTypesDeclarations.fileNameWithoutExtension.KEY]: {
3905
+ newName: "fileNameWithoutExtension",
3906
+ type: String,
3907
+ required: false
3908
+ }
3909
+ }
3910
+ }
3911
+ }
3912
+ },
3825
3913
  [ECMA_ScriptProcessingLocalization.entryPointsGroups.buildingModeDependent.KEY]: {
3826
3914
  newName: "buildingModeDependent",
3827
3915
  type: es_extensions_1.RawObjectDataProcessor.ValuesTypesIDs.associativeArrayOfUniformTypeValues,
@@ -3842,8 +3930,7 @@ var ECMA_ScriptLogicProcessingSettings__FromFile__RawValid;
3842
3930
  buildingModeDependent.outputBaseDirectoryRelativePath.KEY]: {
3843
3931
  newName: "outputBaseDirectoryRelativePath",
3844
3932
  type: String,
3845
- required: true,
3846
- minimalCharactersCount: 1
3933
+ required: true
3847
3934
  },
3848
3935
  [ECMA_ScriptProcessingLocalization.entryPointsGroups.buildingModeDependent.revisioning.KEY]: {
3849
3936
  newName: "revisioning",
@@ -4119,6 +4206,12 @@ class WebpackConfigGenerator {
4119
4206
  return null;
4120
4207
  }
4121
4208
  const webpackPublicPath = this.computePublicPathIfPossible(entryPointsGroupSettings);
4209
+ const willBrowserJS_LibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
4210
+ entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.browser;
4211
+ const willNodeJS_LibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
4212
+ entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.nodeJS;
4213
+ const willPugLibraryBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
4214
+ entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.pug;
4122
4215
  return {
4123
4216
  name: entryPointsGroupSettings.ID,
4124
4217
  /* [ Webpack theory ] In this case, path separators must be operating system dependent, otherwise following error
@@ -4127,7 +4220,8 @@ class WebpackConfigGenerator {
4127
4220
  /* [ Reference ] https://webpack.js.org/configuration/target/ */
4128
4221
  target: (() => {
4129
4222
  switch (entryPointsGroupSettings.targetRuntime.type) {
4130
- case SupportedECMA_ScriptRuntimesTypes.browser: {
4223
+ case SupportedECMA_ScriptRuntimesTypes.browser:
4224
+ case SupportedECMA_ScriptRuntimesTypes.pug: {
4131
4225
  return "web";
4132
4226
  }
4133
4227
  case SupportedECMA_ScriptRuntimesTypes.webWorker: {
@@ -4150,13 +4244,25 @@ class WebpackConfigGenerator {
4150
4244
  `[name]${entryPointsGroupSettings.revisioning.contentHashPostfixSeparator}[contenthash].js` : "[name].js",
4151
4245
  chunkFilename: entryPointsGroupSettings.revisioning.mustExecute ?
4152
4246
  `[id]${entryPointsGroupSettings.revisioning.contentHashPostfixSeparator}[contenthash].js` :
4153
- "[id][contenthash].js"
4154
- /* [ Reference ] https://webpack.js.org/guides/author-libraries/ */
4155
- /* ...isNotUndefined(entryPointsGroupSettings.entryPointsImportsSharing) ? {
4156
- name: entryPointsGroupSettings.entryPointsImportsSharing.namespace,
4157
- ...entryPointsGroupSettings.entryPointsImportsSharing.crossEnvironmental ? { type: "umd" } : null
4158
- } : {} */
4247
+ "[id][contenthash].js",
4248
+ ...entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true ? {
4249
+ library: {
4250
+ type: (() => {
4251
+ switch (entryPointsGroupSettings.targetRuntime.type) {
4252
+ case SupportedECMA_ScriptRuntimesTypes.browser: return "module";
4253
+ case SupportedECMA_ScriptRuntimesTypes.webWorker: return "module";
4254
+ case SupportedECMA_ScriptRuntimesTypes.nodeJS: return "commonjs";
4255
+ case SupportedECMA_ScriptRuntimesTypes.pug: return "umd";
4256
+ }
4257
+ })(),
4258
+ ...willNodeJS_LibraryBeBuilt || willPugLibraryBeBuilt ? {
4259
+ name: entryPointsGroupSettings.distributing.exposingOfExportsFromEntryPoints.namespace
4260
+ } : null
4261
+ }
4262
+ } : null,
4263
+ ...willPugLibraryBeBuilt ? { globalObject: "globalThis" } : null
4159
4264
  },
4265
+ ...willBrowserJS_LibraryBeBuilt ? { experiments: { outputModule: true } } : null,
4160
4266
  mode: this.masterConfigRepresentative.isDevelopmentBuildingMode ? "development" : "production",
4161
4267
  watch: this.masterConfigRepresentative.isDevelopmentBuildingMode,
4162
4268
  devtool: this.masterConfigRepresentative.isDevelopmentBuildingMode ? "eval" : false,
@@ -4348,7 +4454,6 @@ class WebpackConfigGenerator {
4348
4454
  return "/";
4349
4455
  }
4350
4456
  return ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID.replace(ECMA_ScriptLogicEntryPointsGroupSettings__normalized.ID, "/");
4351
- // Return "/";
4352
4457
  }
4353
4458
  static getWebpackEntryObjectRespectiveToSpecifiedEntryPointsGroupSettings({ ECMA_ScriptLogicEntryPointsGroupSettings__normalized, webpackContext }) {
4354
4459
  /* [ Reference ] https://webpack.js.org/configuration/entry-context/#entry */
@@ -4738,8 +4843,7 @@ var MarkupProcessingSettings__FromFile__RawValid;
4738
4843
  [markupProcessingLocalization.entryPointsGroups.buildingModeDependent.outputBaseDirectoryRelativePath.KEY]: {
4739
4844
  newName: "outputBaseDirectoryRelativePath",
4740
4845
  type: String,
4741
- required: true,
4742
- minimalCharactersCount: 1
4846
+ required: true
4743
4847
  }
4744
4848
  }
4745
4849
  }
@@ -5893,8 +5997,7 @@ var StylesProcessingSettings__FromFile__RawValid;
5893
5997
  [stylesProcessingLocalization.entryPointsGroups.buildingModeDependent.outputBaseDirectoryRelativePath.KEY]: {
5894
5998
  newName: "outputBaseDirectoryRelativePath",
5895
5999
  type: String,
5896
- required: true,
5897
- minimalCharactersCount: 1
6000
+ required: true
5898
6001
  },
5899
6002
  [stylesProcessingLocalization.entryPointsGroups.buildingModeDependent.revisioning.KEY]: {
5900
6003
  newName: "revisioning",
@@ -6640,13 +6743,9 @@ class PartialsFilesMapper {
6640
6743
  description: `Mapping of ${sourceFilesTypeLabelForLogging} entry points and partial files relations done. ` +
6641
6744
  `${mappingTimeMeasuringStopwatch.stop().seconds} seconds elapsed.`
6642
6745
  });
6643
- /* If (masterConfigRepresentative.mustDebugEntryPointsAndPartialFiles) {
6644
- PartialsFilesMapper.dumpIncludedFilesAndEntryPointsAccordanceMap(
6645
- partialFilesAndParentEntryPointsRelationsMap,
6646
- masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath
6647
- );
6648
- } */
6649
- PartialsFilesMapper.dumpIncludedFilesAndEntryPointsAccordanceMap(partialFilesAndParentEntryPointsRelationsMap, masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath);
6746
+ if (masterConfigRepresentative.mustDebugEntryPointsAndPartialFiles) {
6747
+ PartialsFilesMapper.dumpIncludedFilesAndEntryPointsAccordanceMap(partialFilesAndParentEntryPointsRelationsMap, masterConfigRepresentative.consumingProjectRootDirectoryAbsolutePath);
6748
+ }
6650
6749
  return partialFilesAndParentEntryPointsRelationsMap;
6651
6750
  }
6652
6751
  static addAbsolutePathsOfExistingPartialsOfCurrentEntryPointOrPartialFileToQueue({ targetEntryPointOrPartialFileAbsolutePath, queueOfAbsolutePathsOfPartialFilesWhichWillBeScanned }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamato-daiwa/automation",
3
- "version": "0.0.6",
3
+ "version": "0.0.9",
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",
@@ -99,5 +99,14 @@
99
99
  "Incremental development build": "webpack --mode development",
100
100
  "Production build": "webpack --mode production",
101
101
  "Lint": "eslint Source"
102
+ },
103
+ "license": "MIT",
104
+ "repository": {
105
+ "type": "git",
106
+ "url": "https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation"
107
+ },
108
+ "bugs": {
109
+ "url": "https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation/issues",
110
+ "email": "tokugawa.takesi@gmail.com"
102
111
  }
103
112
  }