tiny-essentials 1.1.0 → 1.2.0

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 (43) hide show
  1. package/README.md +3 -0
  2. package/dist/TinyBasicsEs.js +2784 -0
  3. package/dist/TinyBasicsEs.min.js +2 -0
  4. package/dist/TinyBasicsEs.min.js.LICENSE.txt +8 -0
  5. package/dist/TinyCertCrypto.js +76229 -0
  6. package/dist/TinyCertCrypto.min.js +2 -0
  7. package/dist/TinyCertCrypto.min.js.LICENSE.txt +10 -0
  8. package/dist/TinyCrypto.js +48115 -0
  9. package/dist/TinyCrypto.min.js +2 -0
  10. package/dist/TinyCrypto.min.js.LICENSE.txt +10 -0
  11. package/dist/TinyEssentials.js +77599 -0
  12. package/dist/TinyEssentials.min.js +2 -1
  13. package/dist/TinyEssentials.min.js.LICENSE.txt +10 -0
  14. package/dist/TinyLevelUp.js +173 -0
  15. package/dist/TinyLevelUp.min.js +1 -0
  16. package/dist/v1/basics/index.cjs +27 -0
  17. package/dist/v1/basics/index.d.mts +17 -0
  18. package/dist/v1/basics/index.mjs +7 -0
  19. package/dist/v1/basics/objFilter.cjs +5 -3
  20. package/dist/v1/basics/objFilter.mjs +3 -2
  21. package/dist/v1/build/TinyCertCrypto.cjs +7 -0
  22. package/dist/v1/build/TinyCertCrypto.d.mts +2 -0
  23. package/dist/v1/build/TinyCertCrypto.mjs +2 -0
  24. package/dist/v1/build/TinyCrypto.cjs +7 -0
  25. package/dist/v1/build/TinyCrypto.d.mts +2 -0
  26. package/dist/v1/build/TinyCrypto.mjs +2 -0
  27. package/dist/v1/build/TinyLevelUp.cjs +7 -0
  28. package/dist/v1/build/TinyLevelUp.d.mts +2 -0
  29. package/dist/v1/build/TinyLevelUp.mjs +2 -0
  30. package/dist/v1/index.cjs +2 -0
  31. package/dist/v1/index.d.mts +2 -1
  32. package/dist/v1/index.mjs +2 -1
  33. package/dist/v1/libs/TinyCertCrypto.cjs +514 -0
  34. package/dist/v1/libs/TinyCertCrypto.d.mts +191 -0
  35. package/dist/v1/libs/TinyCertCrypto.mjs +450 -0
  36. package/dist/v1/libs/TinyCrypto.cjs +69 -62
  37. package/dist/v1/libs/TinyCrypto.d.mts +1 -0
  38. package/dist/v1/libs/TinyCrypto.mjs +59 -50
  39. package/docs/README.md +2 -0
  40. package/docs/libs/TinyCertCrypto.md +202 -0
  41. package/docs/libs/TinyCrypto.md +2 -2
  42. package/package.json +11 -6
  43. package/webpack.config.mjs +69 -0
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "tiny-essentials",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
5
5
  "scripts": {
6
6
  "test": "npm run test:mjs && npm run test:cjs && npm run test:js",
7
7
  "test:js": "npx babel-node test/index.js",
8
8
  "test:mjs": "node test/index.mjs",
9
9
  "test:cjs": "node test/index.cjs",
10
- "fix:prettier": "prettier --write ./src/* && prettier --write ./test/*",
10
+ "fix:prettier": "npm run fix:prettier:src && npm run fix:prettier:test && npm run fix:prettier:rollup.config && npm run fix:prettier:webpack.config",
11
+ "fix:prettier:src": "prettier --write ./src/*",
12
+ "fix:prettier:test": "prettier --write ./test/*",
13
+ "fix:prettier:rollup.config": "prettier --write ./rollup.config.mjs",
14
+ "fix:prettier:webpack.config": "prettier --write ./webpack.config.mjs",
11
15
  "auto-build": "npm run build",
12
- "build": "tsc -p tsconfig.json && rollup -c",
16
+ "build": "tsc -p tsconfig.json && rollup -c && webpack --mode production",
13
17
  "build-clean": "npm run clean && npm run build",
14
18
  "build-dist": "npm run build",
15
19
  "build-browserify": "npx browserify build/browserify.js -p esmify > dist/TinyAiApi.web.js",
@@ -58,7 +62,6 @@
58
62
  "@rollup/plugin-commonjs": "^28.0.3",
59
63
  "@rollup/plugin-json": "^6.1.0",
60
64
  "@rollup/plugin-node-resolve": "^16.0.1",
61
- "@rollup/plugin-terser": "^0.4.4",
62
65
  "@rollup/plugin-typescript": "^12.1.2",
63
66
  "babel-preset-es2015": "^6.24.1",
64
67
  "byte-length": "^1.0.2",
@@ -72,15 +75,17 @@
72
75
  "moment-timezone": "^0.5.48",
73
76
  "mysql": "^2.18.1",
74
77
  "node-fetch": "2.7.0",
78
+ "node-forge": "^1.3.1",
79
+ "node-polyfill-webpack-plugin": "^4.1.0",
75
80
  "object-hash": "^3.0.0",
76
81
  "prettier": "3.5.3",
77
82
  "rollup": "^4.40.0",
78
- "rollup-plugin-polyfill-node": "^0.13.0",
79
83
  "rollup-preserve-directives": "^1.1.3",
80
84
  "tinycolor2": "^1.6.0",
81
85
  "tslib": "^2.8.1",
82
86
  "type-fest": "^4.40.0",
83
87
  "typescript": "^5.8.3",
84
- "util": "^0.12.5"
88
+ "webpack": "^5.99.6",
89
+ "webpack-cli": "^6.0.1"
85
90
  }
86
91
  }
@@ -0,0 +1,69 @@
1
+ import path from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ import webpack from 'webpack';
4
+ import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
8
+
9
+ // Add modules
10
+ const modules = [];
11
+ const addModule = (entry, library, isClass = false) => {
12
+ const baseConfig = {
13
+ entry,
14
+ output: {
15
+ path: path.resolve(__dirname, 'dist'),
16
+ library,
17
+ libraryTarget: 'window',
18
+ libraryExport: isClass ? library : undefined,
19
+ },
20
+ optimization: {
21
+ runtimeChunk: false,
22
+ splitChunks: false,
23
+ },
24
+ plugins: [
25
+ new NodePolyfillPlugin(),
26
+ new webpack.ProvidePlugin({
27
+ process: 'process/browser',
28
+ }),
29
+ ],
30
+ };
31
+ modules.push(
32
+ // Non-minified version
33
+ {
34
+ ...baseConfig,
35
+ mode: 'development',
36
+ output: {
37
+ ...baseConfig.output,
38
+ filename: `${library}.js`,
39
+ },
40
+ optimization: {
41
+ ...baseConfig.optimization,
42
+ minimize: false,
43
+ },
44
+ },
45
+ // Minified version
46
+ {
47
+ ...baseConfig,
48
+ mode: 'production',
49
+ output: {
50
+ ...baseConfig.output,
51
+ filename: `${library}.min.js`,
52
+ },
53
+ optimization: {
54
+ ...baseConfig.optimization,
55
+ minimize: true,
56
+ },
57
+ },
58
+ );
59
+ };
60
+
61
+ // Main
62
+ addModule('./src/v1/index.mjs', 'TinyEssentials');
63
+ addModule('./src/v1/basics/index.mjs', 'TinyBasicsEs');
64
+
65
+ addModule('./src/v1/build/TinyLevelUp.mjs', 'TinyLevelUp', true);
66
+ addModule('./src/v1/build/TinyCertCrypto.mjs', 'TinyCertCrypto', true);
67
+ addModule('./src/v1/build/TinyCrypto.mjs', 'TinyCrypto', true);
68
+
69
+ export default modules;