weboptimizer 4.0.95 → 4.0.96

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 (30) hide show
  1. package/{browser.js → dist/browser.js} +1 -1
  2. package/{configurator.js → dist/configurator.js} +3 -3
  3. package/{ejsLoader.js → dist/ejsLoader.js} +1 -1
  4. package/{eslint.config.js → dist/eslint.config.js} +1 -1
  5. package/{helper.js → dist/helper.js} +1 -1
  6. package/{index.js → dist/index.js} +2 -2
  7. package/{jestSetup.js → dist/jestSetup.js} +1 -1
  8. package/{plugins → dist/plugins}/HTMLTransformation.js +1 -1
  9. package/{plugins → dist/plugins}/InPlaceAssetsIntoHTML.js +1 -1
  10. package/{stylelintConfigurator.js → dist/stylelintConfigurator.js} +1 -1
  11. package/{type.js → dist/type.js} +1 -1
  12. package/{webpackConfigurator.js → dist/webpackConfigurator.js} +1 -1
  13. package/jest.json +1 -1
  14. package/package.json +32 -53
  15. package/readme.md +1 -1
  16. package/tsconfig.json +2 -0
  17. /package/{browser.d.ts → dist/browser.d.ts} +0 -0
  18. /package/{configurator.d.ts → dist/configurator.d.ts} +0 -0
  19. /package/{declarations.d.ts → dist/declarations.d.ts} +0 -0
  20. /package/{ejsLoader.d.ts → dist/ejsLoader.d.ts} +0 -0
  21. /package/{eslint.config.d.ts → dist/eslint.config.d.ts} +0 -0
  22. /package/{helper.d.ts → dist/helper.d.ts} +0 -0
  23. /package/{index.d.ts → dist/index.d.ts} +0 -0
  24. /package/{index.html.ejs → dist/index.html.ejs} +0 -0
  25. /package/{jestSetup.d.ts → dist/jestSetup.d.ts} +0 -0
  26. /package/{plugins → dist/plugins}/HTMLTransformation.d.ts +0 -0
  27. /package/{plugins → dist/plugins}/InPlaceAssetsIntoHTML.d.ts +0 -0
  28. /package/{stylelintConfigurator.d.ts → dist/stylelintConfigurator.d.ts} +0 -0
  29. /package/{type.d.ts → dist/type.d.ts} +0 -0
  30. /package/{webpackConfigurator.d.ts → dist/webpackConfigurator.d.ts} +0 -0
@@ -144,4 +144,4 @@ export const getInitializedBrowser = async (replaceWindow = true) => {
144
144
  if (browser.initialized) wrappedCallback();else onCreatedListener.push(wrappedCallback);
145
145
  return promise;
146
146
  };
147
- export default getInitializedBrowser;
147
+ export default getInitializedBrowser;
@@ -21,7 +21,7 @@ import fileSystemSynchronous from 'fs';
21
21
  import fileSystem, { lstat, readFile, unlink } from 'fs/promises';
22
22
  import path, { basename, dirname, join, resolve } from 'path';
23
23
  import { determineAssetType, determineModuleFilePath, determineModuleLocations, resolveAutoInjection, resolveBuildConfigurationFilePaths, resolveModulesInFolders, normalizeGivenInjection, normalizePaths } from "./helper.js";
24
- import packageConfiguration from './package.json' with { type: 'json' };
24
+ import packageConfiguration from '../package.json' with { type: 'json' };
25
25
  import { SubConfigurationTypes } from "./type.js";
26
26
  // endregion
27
27
  const {
@@ -45,7 +45,7 @@ await importFilesystemAPI();
45
45
  * @param environment - Environment variables to take into account.
46
46
  * @returns Nothing.
47
47
  */
48
- export const load = async (context, currentWorkingDirectory = process.cwd(), commandLineArguments = process.argv, webOptimizerPath = import.meta.dirname,
48
+ export const load = async (context, currentWorkingDirectory = process.cwd(), commandLineArguments = process.argv, webOptimizerPath = resolve(import.meta.dirname, '..'),
49
49
  /*
50
50
  NOTE: We have to avoid that some pre-processor removes this
51
51
  assignment.
@@ -289,4 +289,4 @@ export const get = async () => {
289
289
  if (!loadedConfiguration) loadedConfiguration = await load();
290
290
  return loadedConfiguration;
291
291
  };
292
- export default get;
292
+ export default get;
@@ -275,4 +275,4 @@ export const loader = async function (source) {
275
275
  callback(error);
276
276
  }
277
277
  };
278
- export default loader;
278
+ export default loader;
@@ -42,7 +42,7 @@ for (const filePath of ['./tsconfig.eslint.json', './tsconfig.json', './tsconfig
42
42
  let PROJECT_SPECIFIC_CONFIGURATION = [];
43
43
  if (PACKAGE_CONFIGURATION.name !== 'weboptimizer') try {
44
44
  // @ts-expect-error Need to create polymorphic type.
45
- const config = await import('../../eslint.config.js');
45
+ const config = await import('../../../eslint.config.js');
46
46
  const resolvedConfig = config.config ?? config.default ?? config.configuration ?? config;
47
47
  PROJECT_SPECIFIC_CONFIGURATION = PROJECT_SPECIFIC_CONFIGURATION.concat(resolvedConfig);
48
48
  } catch {
@@ -622,4 +622,4 @@ export const getClosestPackageDescriptor = async (modulePath, fileName = 'packag
622
622
  filePath
623
623
  };
624
624
  };
625
- // endregion
625
+ // endregion
@@ -52,7 +52,7 @@ await importFilesystemAPI();
52
52
  * @param environment - Environment variables to take into account.
53
53
  * @returns Nothing.
54
54
  */
55
- const main = async (context, currentWorkingDirectory = process.cwd(), commandLineArguments = process.argv, webOptimizerPath = import.meta.dirname,
55
+ const main = async (context, currentWorkingDirectory = process.cwd(), commandLineArguments = process.argv, webOptimizerPath = resolve(import.meta.dirname, '..'),
56
56
  /*
57
57
  NOTE: We have to avoid that some pre-processor removes this
58
58
  assignment.
@@ -325,4 +325,4 @@ environment = eval('process.env')) => {
325
325
  return clear;
326
326
  };
327
327
  if (import.meta.main) void main();
328
- export default main;
328
+ export default main;
@@ -19,4 +19,4 @@ import { globalContext, optionalImport } from 'clientnode';
19
19
  import { TextEncoder, TextDecoder } from 'util';
20
20
  globalContext.TextEncoder = TextEncoder;
21
21
  globalContext.TextDecoder = TextDecoder;
22
- if (await optionalImport('jest-canvas-mock')) console.info('Canvas mocking module loaded.');
22
+ if (await optionalImport('jest-canvas-mock')) console.info('Canvas mocking module loaded.');
@@ -92,4 +92,4 @@ export class HTMLTransformation {
92
92
  });
93
93
  }
94
94
  }
95
- export default HTMLTransformation;
95
+ export default HTMLTransformation;
@@ -79,4 +79,4 @@ export class InPlaceAssetsIntoHTML {
79
79
  });
80
80
  }
81
81
  }
82
- export default InPlaceAssetsIntoHTML;
82
+ export default InPlaceAssetsIntoHTML;
@@ -17,4 +17,4 @@
17
17
  */
18
18
  import getConfiguration from "./configurator.js";
19
19
  const configuration = await getConfiguration();
20
- export default configuration.stylelint;
20
+ export default configuration.stylelint;
@@ -38,4 +38,4 @@ export const TaskTypes = ['build', 'serve', ...SubConfigurationTypes];
38
38
  /// endregion
39
39
  // NOTE: Not yet defined in webpack types.
40
40
 
41
- // endregion
41
+ // endregion
@@ -1038,4 +1038,4 @@ void log.debug('Using webpack configuration:', util.inspect(webpackConfiguration
1038
1038
  }));
1039
1039
 
1040
1040
  // endregion
1041
- export default webpackConfiguration;
1041
+ export default webpackConfiguration;
package/jest.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "\\.((css)|(less)|(sass)|(scss))$": "identity-obj-proxy"
5
5
  },
6
6
  "rootDir": "../../",
7
- "setupFilesAfterEnv": ["./node_modules/weboptimizer/jestSetup.js"],
7
+ "setupFilesAfterEnv": ["./node_modules/weboptimizer/dist/jestSetup.js"],
8
8
  "testPathIgnorePatterns": ["^(.*[/])?testHelper([./].*)?$"]
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "4.0.95",
3
+ "version": "4.0.96",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -30,67 +30,46 @@
30
30
  },
31
31
  "type": "module",
32
32
  "exports": {
33
- ".": "/.index.js",
34
- "./browser": "./browser.js",
35
- "./browser.js": "./browser.js",
36
- "./ejsLoader": "./ejsLoader.js",
37
- "./ejsLoader.js": "./ejsLoader.js",
38
- "./type": "./type.js",
39
- "./type.js": "./type.js"
33
+ ".": "./dist/index.js",
34
+ "./browser": "./dist/browser.js",
35
+ "./browser.js": "./dist/browser.js",
36
+ "./ejsLoader": "./dist/ejsLoader.js",
37
+ "./ejsLoader.js": "./dist/ejsLoader.js",
38
+ "./type": "./dist/type.js",
39
+ "./type.js": "./dist/type.js"
40
40
  },
41
41
  "bin": {
42
- "weboptimizer": "index.js"
42
+ "weboptimizer": "dist/index.js"
43
43
  },
44
44
  "files": [
45
- "browser.d.ts",
46
- "browser.js",
47
- "configurator.d.ts",
48
- "configurator.js",
49
- "declarations.d.ts",
50
- "ejsLoader.d.ts",
51
- "ejsLoader.js",
52
- "eslint.config.d.ts",
53
- "eslint.config.js",
54
- "helper.d.ts",
55
- "helper.js",
56
- "index.d.ts",
57
- "index.html.ejs",
58
- "index.js",
45
+ "dist/*.d.ts",
46
+ "dist/*.js",
47
+ "dist/index.html.ejs",
48
+ "dist/plugins/*.d.ts",
49
+ "dist/plugins/*.js",
59
50
  "jest.json",
60
- "jestSetup.d.ts",
61
- "jestSetup.js",
62
- "plugins/HTMLTransformation.d.ts",
63
- "plugins/HTMLTransformation.js",
64
- "plugins/InPlaceAssetsIntoHTML.d.ts",
65
- "plugins/InPlaceAssetsIntoHTML.js",
66
- "stylelintConfigurator.d.ts",
67
- "stylelintConfigurator.js",
68
51
  "tsconfig.json",
69
52
  "tsconfig.application.json",
70
- "tsconfig.library.json",
71
- "type.d.ts",
72
- "type.js",
73
- "webpackConfigurator.d.ts",
74
- "webpackConfigurator.js"
53
+ "tsconfig.library.json"
75
54
  ],
76
55
  "sideEffects": true,
77
56
  "scripts": {
78
57
  "build": "yarn build:types && yarn build:lint && yarn build:plain",
79
- "build:copy-test-artefacts": "cd test/simple && shx touch yarn.lock && shx rm -rf node_modules && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && shx rm -rf node_modules && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && shx rm -rf node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && shx mkdir -p node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && copyCommand='shx cp -r plugins *.ts *.js *.json *.ejs' && $copyCommand node_modules/weboptimizer/ && $copyCommand test/simple/node_modules/weboptimizer/ && $copyCommand test/scss/node_modules/weboptimizer/",
80
- "build:lint": " babel --extensions '.ts' --out-file eslint.config.js eslint.config.ts",
81
- "build:plain": "command=\"babel --extensions '.ts' --out-file\" && $command browser.js browser.ts && $command configurator.js configurator.ts && $command ejsLoader.js ejsLoader.ts && $command helper.js helper.ts && $command index.js index.ts && $command jestSetup.js jestSetup.ts && $command plugins/HTMLTransformation.js plugins/HTMLTransformation.ts && $command plugins/InPlaceAssetsIntoHTML.js plugins/InPlaceAssetsIntoHTML.ts && $command stylelintConfigurator.js stylelintConfigurator.ts && $command type.js type.ts && $command webpackConfigurator.js webpackConfigurator.ts && shx chmod +x index.js && shx sed -i 's/(#!\\\\/usr\\\\/bin\\\\/env )babel-(node)/$1$2/' index.js 1>/dev/null",
82
- "build:test": " yarn clear && yarn build && command='babel --extensions '.ts' --source-root ../ --out-file' && yarn build:copy-test-artefacts && $command test/browser.js test/browser.ts && $command test/configurator.js test/configurator.ts && $command test/helper.js test/helper.ts && $command test/ejsLoader.js test/ejsLoader.ts && $command test/stylelintConfigurator.js test/stylelintConfigurator.ts && $command test/index.js test/index.ts && $command test/webpackConfigurator.js test/webpackConfigurator.ts",
83
- "build:test:source-map": "yarn clear && yarn build && command='babel --extensions '.ts' --source-maps inline --source-root ../ --out-file' && yarn build:copy-test-artefacts && $command test/browser.js test/browser.ts && $command test/configurator.js test/configurator.ts && $command test/helper.js test/helper.ts && $command test/ejsLoader.js test/ejsLoader.ts && $command test/stylelintConfigurator.js test/stylelintConfigurator.ts && $command test/index.js test/index.ts && $command test/webpackConfigurator.js test/webpackConfigurator.ts",
84
- "build:types": "tsc --declaration --emitDeclarationOnly",
58
+ "build:copy-test-artefacts": "cd src/test/simple && shx touch yarn.lock && shx rm -rf node_modules && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../../ && cd src/test/scss && shx touch yarn.lock && shx rm -rf node_modules && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../../ && shx rm -rf node_modules/weboptimizer src/test/simple/node_modules/weboptimizer src/test/scss/node_modules/weboptimizer && shx mkdir -p node_modules/weboptimizer src/test/simple/node_modules/weboptimizer src/test/scss/node_modules/weboptimizer && copyCommand='shx cp -r dist *.json' && $copyCommand node_modules/weboptimizer/ && $copyCommand src/test/simple/node_modules/weboptimizer/ && $copyCommand src/test/scss/node_modules/weboptimizer/",
59
+ "build:lint": " babel --extensions '.ts' --out-file dist/eslint.config.js src/eslint.config.ts",
60
+ "build:plain": "babel --extensions '.ts' --ignore 'src/**/*.d.ts,src/eslint.config.ts,src/test/**' --copy-files --no-copy-ignored --out-dir dist src && shx cp src/declarations.d.ts dist/ && shx chmod +x dist/index.js && shx sed -i 's/(#!\\\\/usr\\\\/bin\\\\/env )babel-(node)/$1$2/' dist/index.js 1>/dev/null",
61
+ "build:test": " yarn clear && yarn build && yarn build:copy-test-artefacts && babel --extensions '.ts' --ignore 'src/test/**/*.d.ts,src/test/scss/**,src/test/simple/**' --out-dir dist/test src/test",
62
+ "build:test:source-map": "yarn clear && yarn build && yarn build:copy-test-artefacts && babel --extensions '.ts' --ignore 'src/test/**/*.d.ts,src/test/scss/**,src/test/simple/**' --source-maps inline --out-dir dist/test src/test",
63
+ "build:types": "tsc --declaration --emitDeclarationOnly --rootDir src --declarationDir dist",
85
64
  "check": "yarn check:types && yarn lint",
86
65
  "check:types": "tsc --noEmit",
87
- "clear": "shx rm -rf apiDocumentation browser.d.ts configurator.d.ts ejsLoader.d.ts eslint.config.d.ts helper.d.ts index.d.ts jestSetup.d.ts 'plugins/*.d.ts' 'plugins/*.js' stylelintConfigurator.d.ts 'test/*.js' 'test/*.compiled.*' 'test/*.d.ts' 'test/**/yarn.lock' 'test/**/node_modules' type.d.ts webpackConfigurator.d.ts '*.compiled.*' '*.compiled' '*.html' '*.js' '*.log' node_modules/weboptimizer .coverage .nyc_output",
88
- "document": "yarn build:plain && jsdoc --package ./package.json --readme ./readme.md --destination apiDocumentation *.js",
66
+ "clear": "shx rm -rf apiDocumentation dist 'src/test/*/*.d.ts' 'src/test/**/yarn.lock' 'src/test/**/node_modules' '*.log' node_modules/weboptimizer .coverage .nyc_output",
67
+ "document": "yarn build:plain && jsdoc --package ./package.json --readme ./readme.md --destination apiDocumentation dist/*.js",
89
68
  "lint": "yarn build:lint && yarn lint:base",
90
- "lint:base": "eslint --no-warn-ignored *.ts */*.ts test/*/*.ts",
69
+ "lint:base": "eslint --config dist/eslint.config.js --no-warn-ignored src/*.ts src/*/*.ts src/test/*/*.ts",
91
70
  "prepare": "yarn build",
92
71
  "prettify": "yarn lint:base --fix || true",
93
- "test": "yarn build:test && node --experimental-vm-modules node_modules/.bin/jest --config ./weboptimizerJest.json --noStackTrace --root-dir './' --test-regex '/test/.+\\\\.js$' test/browser.js test/configurator.js test/ejsLoader.js test/helper.js test/stylelintConfigurator.js test/index.js test/webpackConfigurator.js",
72
+ "test": "yarn build:test && node --experimental-vm-modules node_modules/.bin/jest --config ./weboptimizerJest.json --noStackTrace --root-dir './' --test-regex '/dist/test/.+\\\\.js$' dist/test/browser.js dist/test/configurator.js dist/test/ejsLoader.js dist/test/helper.js dist/test/stylelintConfigurator.js dist/test/index.js dist/test/webpackConfigurator.js",
94
73
  "test:coverage": "yarn test --ci --coverage --coverageReporters=text --coverageReporters=text-summary --silent --testLocationInResults",
95
74
  "test:coverage:report": "yarn test:coverage --coverageDirectory=.coverage --coverageReporters=lcov --outputFile=lcov.info",
96
75
  "test:watch": "yarn test --watch",
@@ -108,7 +87,7 @@
108
87
  "babel-loader": "^10.1.1",
109
88
  "babel-plugin-polyfill-corejs3": "^1.0.0",
110
89
  "babel-plugin-transform-rewrite-imports": "^1.5.4",
111
- "clientnode": "4.0.1524",
90
+ "clientnode": "4.0.1526",
112
91
  "core-js": "^3.51.0",
113
92
  "ejs": "^7.0.2",
114
93
  "exports-loader": "^5.0.0",
@@ -135,7 +114,7 @@
135
114
  "@types/html-minifier": "^4.0.6",
136
115
  "@types/html-minifier-terser": "^7.0.2",
137
116
  "@types/imagemin": "^9.0.1",
138
- "@types/node": "^26.6.5",
117
+ "@types/node": "^26.6.6",
139
118
  "@types/postcss-import": "^14.0.3",
140
119
  "@types/postcss-url": "^10.0.4",
141
120
  "@types/webpack-env": "^1.18.8",
@@ -466,7 +445,7 @@
466
445
  "arguments": [
467
446
  "--config",
468
447
  {
469
- "__evaluate__": "`${webOptimizerPath}/webpackConfigurator.js`"
448
+ "__evaluate__": "`${webOptimizerPath}/dist/webpackConfigurator.js`"
470
449
  },
471
450
  "--progress"
472
451
  ],
@@ -518,7 +497,7 @@
518
497
  },
519
498
  "--config",
520
499
  {
521
- "__evaluate__": "path.relative(self.path.context, path.resolve(webOptimizerPath, 'stylelintConfigurator.js'))"
500
+ "__evaluate__": "path.relative(self.path.context, path.resolve(webOptimizerPath, 'dist', 'stylelintConfigurator.js'))"
522
501
  }
523
502
  ],
524
503
  "command": "stylelint",
@@ -528,7 +507,7 @@
528
507
  "arguments": [
529
508
  "--config",
530
509
  {
531
- "__evaluate__": "`'${webOptimizerPath}/eslint.config.js'`"
510
+ "__evaluate__": "`'${webOptimizerPath}/dist/eslint.config.js'`"
532
511
  },
533
512
  "--ignore-pattern",
534
513
  {
@@ -552,7 +531,7 @@
552
531
  "serve",
553
532
  "--config",
554
533
  {
555
- "__evaluate__": "`'${webOptimizerPath}/webpackConfigurator.js'`"
534
+ "__evaluate__": "`'${webOptimizerPath}/dist/webpackConfigurator.js'`"
556
535
  },
557
536
  "--progress"
558
537
  ],
@@ -751,7 +730,7 @@
751
730
  "scriptLoading": "module",
752
731
  "template": {
753
732
  "filePath": {
754
- "__evaluate__": "`${filesystem.isFileSync(path.resolve(self.path.source.base, `${self.files.defaultHTML.filename}.ejs`)) ? path.resolve(self.path.source.base, `${self.files.defaultHTML.filename}.ejs`) : path.resolve(webOptimizerPath, 'index.html.ejs')}`"
733
+ "__evaluate__": "`${filesystem.isFileSync(path.resolve(self.path.source.base, `${self.files.defaultHTML.filename}.ejs`)) ? path.resolve(self.path.source.base, `${self.files.defaultHTML.filename}.ejs`) : path.resolve(webOptimizerPath, 'dist', 'index.html.ejs')}`"
755
734
  },
756
735
  "postCompileOptions": {
757
736
  "_with": false,
package/readme.md CHANGED
@@ -322,4 +322,4 @@ package.json (see the API-Documentation, link above, for more details):
322
322
  2. Set Working directory:
323
323
  /PATH/TO/PROJECT
324
324
  3. Set configuration file path:
325
- /PATH/TO/PROJECT/node_modules/weboptimizer/eslint.config.js
325
+ /PATH/TO/PROJECT/node_modules/weboptimizer/dist/eslint.config.js
package/tsconfig.json CHANGED
@@ -24,6 +24,8 @@
24
24
  },
25
25
  "exclude": [
26
26
  "**/exclude/*",
27
+ "dist",
28
+ "src/test/**/*.d.ts",
27
29
  "test/**/*.d.ts"
28
30
  ],
29
31
  "include": [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes