@cocreate/webpack 1.2.0 → 1.3.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## [1.3.1](https://github.com/CoCreate-app/CoCreate-webpack/compare/v1.3.0...v1.3.1) (2024-02-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Removed https://cdn.cocreate.app/latest/CoCreate.min.css ([2ce1c33](https://github.com/CoCreate-app/CoCreate-webpack/commit/2ce1c33c1f27f5fd0fdadfc053de43193d72f69a))
7
+
8
+ # [1.3.0](https://github.com/CoCreate-app/CoCreate-webpack/compare/v1.2.0...v1.3.0) (2023-12-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fileUploader handle argv ([db835c4](https://github.com/CoCreate-app/CoCreate-webpack/commit/db835c4122a2b238b149c19e0451956dc7630b1f))
14
+ * update fileUploader to pascalCase FileUploader ([1507475](https://github.com/CoCreate-app/CoCreate-webpack/commit/15074750a5f9c473841f33654b9890ce01d76e8e))
15
+
16
+
17
+ ### Features
18
+
19
+ * loader to handle special characters ([74134a6](https://github.com/CoCreate-app/CoCreate-webpack/commit/74134a6066d50a486a92ca13c7ba33090fdc190a))
20
+
1
21
  # [1.2.0](https://github.com/CoCreate-app/CoCreate-webpack/compare/v1.1.0...v1.2.0) (2023-12-28)
2
22
 
3
23
 
package/docs/index.html CHANGED
@@ -21,11 +21,6 @@
21
21
  property="og:image"
22
22
  content="https://cdn.cocreate.app/docs/webpack.png" />
23
23
 
24
- <!-- CoCreate CSS -->
25
- <link
26
- rel="stylesheet"
27
- href="https://cdn.cocreate.app/latest/CoCreate.min.css"
28
- type="text/css" />
29
24
  <link
30
25
  rel="stylesheet"
31
26
  href="../index.css"
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@cocreate/webpack",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "description": "An intergration with webpack and CoCreateJS.",
5
5
  "keywords": [
6
6
  "webpack",
7
- "chain-functions",
8
7
  "cocreate",
9
8
  "low-code-framework",
10
9
  "no-code-framework",
package/src/index.js CHANGED
@@ -57,30 +57,35 @@ class ModuleGenerator {
57
57
  }
58
58
  }
59
59
 
60
- class fileUploader {
61
- constructor(env) {
60
+ class FileUploader {
61
+ constructor(env, argv) {
62
62
  this.env = env;
63
63
  this.isWatching = false;
64
+ this.isWatch = argv.watch === true;
64
65
  }
65
66
 
66
67
  apply(compiler) {
67
- if (this.env.beforeCompilation) {
68
- // Directly perform upload here
69
- upload(process.cwd(), ['../', '-w']);
70
- }
68
+ if (this.isWatch) {
71
69
 
72
- if (this.env.afterCompilation) {
73
- compiler.hooks.emit.tapAsync('watchFiles', (compilation, callback) => {
74
- if (!this.isWatching) {
75
- this.isWatching = true;
76
- upload(process.cwd(), ['../', '-w']);
77
- }
78
- callback();
79
- });
70
+ if (this.env.beforeCompilation) {
71
+ // Directly perform upload here
72
+ upload(process.cwd(), ['../', '-w']);
73
+ }
74
+
75
+ if (this.env.afterCompilation) {
76
+ compiler.hooks.emit.tapAsync('watchFiles', (compilation, callback) => {
77
+ if (!this.isWatching) {
78
+ this.isWatching = true;
79
+ upload(process.cwd(), ['../', '-w']);
80
+ }
81
+ callback();
82
+ });
83
+ }
80
84
  }
81
85
  }
82
86
  }
83
87
 
88
+
84
89
  class SymlinkCreator {
85
90
  constructor(options) {
86
91
  // Store options if necessary, or just hard-code paths
@@ -116,4 +121,4 @@ class SymlinkCreator {
116
121
  }
117
122
  }
118
123
 
119
- module.exports = { ModuleGenerator, fileUploader, SymlinkCreator };
124
+ module.exports = { ModuleGenerator, FileUploader, SymlinkCreator };
@@ -0,0 +1,21 @@
1
+ module.exports = function (source) {
2
+ return source.replace(/\$'/g, '\\u0024\'');
3
+
4
+ // const specialChars = /[\0\x08\x09\x1a\n\r"'\\\%\$]/g; // Add or remove characters based on your needs
5
+ // const replacements = {
6
+ // // "\0": "\\0",
7
+ // // "\x08": "\\b",
8
+ // // "\x09": "\\t",
9
+ // // "\x1a": "\\z",
10
+ // // "\n": "\\n",
11
+ // // "\r": "\\r",
12
+ // // "\"": "\\\"",
13
+ // // "'": "\\'",
14
+ // // "\\": "\\\\",
15
+ // // "%": "\\%",
16
+ // "$": "\\$" // Escape for MongoDB and others
17
+ // // ... add more replacements as needed for other databases
18
+ // };
19
+
20
+ // return source.replace(specialChars, (char) => (replacements[char] || char));
21
+ };