@yamato-daiwa/automation 0.0.7 → 0.0.8

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 +140 -22
  2. package/package.json +11 -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",
@@ -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",
@@ -4069,6 +4156,7 @@ const webpack_1 = __importDefault(__webpack_require__(/*! webpack */ "webpack"))
4069
4156
  const vue_loader_1 = __webpack_require__(/*! vue-loader */ "vue-loader");
4070
4157
  const fork_ts_checker_webpack_plugin_1 = __importDefault(__webpack_require__(/*! fork-ts-checker-webpack-plugin */ "fork-ts-checker-webpack-plugin"));
4071
4158
  const eslint_webpack_plugin_1 = __importDefault(__webpack_require__(/*! eslint-webpack-plugin */ "eslint-webpack-plugin"));
4159
+ const typescript_declaration_webpack_plugin_1 = __importDefault(__webpack_require__(/*! typescript-declaration-webpack-plugin */ "typescript-declaration-webpack-plugin"));
4072
4160
  const webpack_node_externals_1 = __importDefault(__webpack_require__(/*! webpack-node-externals */ "webpack-node-externals"));
4073
4161
  /* --- General utils ------------------------------------------------------------------------------------------------ */
4074
4162
  const path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
@@ -4119,6 +4207,12 @@ class WebpackConfigGenerator {
4119
4207
  return null;
4120
4208
  }
4121
4209
  const webpackPublicPath = this.computePublicPathIfPossible(entryPointsGroupSettings);
4210
+ const isBrowserJS_LibraryWillBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
4211
+ entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.browser;
4212
+ const isNodeJS_LibraryWillBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
4213
+ entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.nodeJS;
4214
+ const isPugLibraryWillBeBuilt = entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true &&
4215
+ entryPointsGroupSettings.targetRuntime.type === SupportedECMA_ScriptRuntimesTypes.pug;
4122
4216
  return {
4123
4217
  name: entryPointsGroupSettings.ID,
4124
4218
  /* [ Webpack theory ] In this case, path separators must be operating system dependent, otherwise following error
@@ -4127,7 +4221,8 @@ class WebpackConfigGenerator {
4127
4221
  /* [ Reference ] https://webpack.js.org/configuration/target/ */
4128
4222
  target: (() => {
4129
4223
  switch (entryPointsGroupSettings.targetRuntime.type) {
4130
- case SupportedECMA_ScriptRuntimesTypes.browser: {
4224
+ case SupportedECMA_ScriptRuntimesTypes.browser:
4225
+ case SupportedECMA_ScriptRuntimesTypes.pug: {
4131
4226
  return "web";
4132
4227
  }
4133
4228
  case SupportedECMA_ScriptRuntimesTypes.webWorker: {
@@ -4150,13 +4245,25 @@ class WebpackConfigGenerator {
4150
4245
  `[name]${entryPointsGroupSettings.revisioning.contentHashPostfixSeparator}[contenthash].js` : "[name].js",
4151
4246
  chunkFilename: entryPointsGroupSettings.revisioning.mustExecute ?
4152
4247
  `[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
- } : {} */
4248
+ "[id][contenthash].js",
4249
+ ...entryPointsGroupSettings.distributing?.exposingOfExportsFromEntryPoints.mustExpose === true ? {
4250
+ library: {
4251
+ type: (() => {
4252
+ switch (entryPointsGroupSettings.targetRuntime.type) {
4253
+ case SupportedECMA_ScriptRuntimesTypes.browser: return "module";
4254
+ case SupportedECMA_ScriptRuntimesTypes.webWorker: return "module";
4255
+ case SupportedECMA_ScriptRuntimesTypes.nodeJS: return "commonjs";
4256
+ case SupportedECMA_ScriptRuntimesTypes.pug: return "umd";
4257
+ }
4258
+ })(),
4259
+ ...isNodeJS_LibraryWillBeBuilt || isPugLibraryWillBeBuilt ? {
4260
+ name: entryPointsGroupSettings.distributing.exposingOfExportsFromEntryPoints.namespace
4261
+ } : null
4262
+ }
4263
+ } : null,
4264
+ ...isPugLibraryWillBeBuilt ? { globalObject: "globalThis" } : null
4159
4265
  },
4266
+ ...isBrowserJS_LibraryWillBeBuilt ? { experiments: { outputModule: true } } : null,
4160
4267
  mode: this.masterConfigRepresentative.isDevelopmentBuildingMode ? "development" : "production",
4161
4268
  watch: this.masterConfigRepresentative.isDevelopmentBuildingMode,
4162
4269
  devtool: this.masterConfigRepresentative.isDevelopmentBuildingMode ? "eval" : false,
@@ -4317,7 +4424,10 @@ class WebpackConfigGenerator {
4317
4424
  extensions: ["js", "ts", "vue"],
4318
4425
  failOnError: this.masterConfigRepresentative.isProductionBuildingMode,
4319
4426
  failOnWarning: this.masterConfigRepresentative.isProductionBuildingMode
4320
- })
4427
+ }),
4428
+ ...(0, es_extensions_1.isNotUndefined)(entryPointsGroupSettings.distributing) &&
4429
+ entryPointsGroupSettings.distributing.typeScriptTypesDeclarations.mustGenerate ?
4430
+ [new typescript_declaration_webpack_plugin_1.default({})] : []
4321
4431
  ],
4322
4432
  optimization: {
4323
4433
  minimize: this.masterConfigRepresentative.isProductionBuildingMode,
@@ -4738,8 +4848,7 @@ var MarkupProcessingSettings__FromFile__RawValid;
4738
4848
  [markupProcessingLocalization.entryPointsGroups.buildingModeDependent.outputBaseDirectoryRelativePath.KEY]: {
4739
4849
  newName: "outputBaseDirectoryRelativePath",
4740
4850
  type: String,
4741
- required: true,
4742
- minimalCharactersCount: 1
4851
+ required: true
4743
4852
  }
4744
4853
  }
4745
4854
  }
@@ -5893,8 +6002,7 @@ var StylesProcessingSettings__FromFile__RawValid;
5893
6002
  [stylesProcessingLocalization.entryPointsGroups.buildingModeDependent.outputBaseDirectoryRelativePath.KEY]: {
5894
6003
  newName: "outputBaseDirectoryRelativePath",
5895
6004
  type: String,
5896
- required: true,
5897
- minimalCharactersCount: 1
6005
+ required: true
5898
6006
  },
5899
6007
  [stylesProcessingLocalization.entryPointsGroups.buildingModeDependent.revisioning.KEY]: {
5900
6008
  newName: "revisioning",
@@ -7263,6 +7371,16 @@ module.exports = require("node-notifier");
7263
7371
 
7264
7372
  /***/ }),
7265
7373
 
7374
+ /***/ "typescript-declaration-webpack-plugin":
7375
+ /*!********************************************************!*\
7376
+ !*** external "typescript-declaration-webpack-plugin" ***!
7377
+ \********************************************************/
7378
+ /***/ ((module) => {
7379
+
7380
+ module.exports = require("typescript-declaration-webpack-plugin");
7381
+
7382
+ /***/ }),
7383
+
7266
7384
  /***/ "vue-loader":
7267
7385
  /*!*****************************!*\
7268
7386
  !*** external "vue-loader" ***!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamato-daiwa/automation",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
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",
@@ -61,6 +61,7 @@
61
61
  "style-loader": "3.3.1",
62
62
  "stylus-loader": "6.2.0",
63
63
  "ts-loader": "9.3.0",
64
+ "typescript-declaration-webpack-plugin": "0.2.2",
64
65
  "vinyl": "2.2.1",
65
66
  "vue": "3.2.37",
66
67
  "vue-loader": "17.0.0",
@@ -99,5 +100,14 @@
99
100
  "Incremental development build": "webpack --mode development",
100
101
  "Production build": "webpack --mode production",
101
102
  "Lint": "eslint Source"
103
+ },
104
+ "license": "MIT",
105
+ "repository": {
106
+ "type": "git",
107
+ "url": "https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation"
108
+ },
109
+ "bugs": {
110
+ "url": "https://github.com/TokugawaTakeshi/Yamato-Daiwa-Automation/issues",
111
+ "email": "tokugawa.takesi@gmail.com"
102
112
  }
103
113
  }