@cocreate/webpack 1.1.0 → 1.3.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.
- package/CHANGELOG.md +20 -0
- package/package.json +1 -1
- package/src/index.js +20 -15
- package/src/replace-unicode.js +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [1.3.0](https://github.com/CoCreate-app/CoCreate-webpack/compare/v1.2.0...v1.3.0) (2023-12-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* fileUploader handle argv ([db835c4](https://github.com/CoCreate-app/CoCreate-webpack/commit/db835c4122a2b238b149c19e0451956dc7630b1f))
|
|
7
|
+
* update fileUploader to pascalCase FileUploader ([1507475](https://github.com/CoCreate-app/CoCreate-webpack/commit/15074750a5f9c473841f33654b9890ce01d76e8e))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* loader to handle special characters ([74134a6](https://github.com/CoCreate-app/CoCreate-webpack/commit/74134a6066d50a486a92ca13c7ba33090fdc190a))
|
|
13
|
+
|
|
14
|
+
# [1.2.0](https://github.com/CoCreate-app/CoCreate-webpack/compare/v1.1.0...v1.2.0) (2023-12-28)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* symlinkCreator ([5697054](https://github.com/CoCreate-app/CoCreate-webpack/commit/5697054b547e3a9217c7563f4aca64429db3450b))
|
|
20
|
+
|
|
1
21
|
# [1.1.0](https://github.com/CoCreate-app/CoCreate-webpack/compare/v1.0.1...v1.1.0) (2023-12-28)
|
|
2
22
|
|
|
3
23
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -57,30 +57,35 @@ class ModuleGenerator {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
class
|
|
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.
|
|
68
|
-
// Directly perform upload here
|
|
69
|
-
upload(process.cwd(), ['../', '-w']);
|
|
70
|
-
}
|
|
68
|
+
if (this.isWatch) {
|
|
71
69
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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,
|
|
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
|
+
};
|