@tmsfe/tmskit 0.0.15-beta.5 → 0.0.17
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 +10 -2
- package/README.md +2 -3
- package/dist/index.cjs.js +809 -454
- package/package.json +12 -4
- package/src/compile/dev.js +16 -15
- package/src/compile/plugins/gulp-watch/index.js +172 -0
- package/src/compile/plugins/mpJsonDep.js +1 -1
- package/src/compile/watch.js +22 -3
- package/src/core/buildAppJson.js +14 -17
- package/src/core/tmsMpconfig.js +22 -25
- package/src/entry.js +11 -0
- package/src/scripts/run/build/index.js +3 -0
- package/src/scripts/run/cloud/index.js +12 -0
- package/src/scripts/run/dev/index.js +3 -2
- package/src/scripts/run/index.js +4 -0
- package/src/scripts/run/init/index.js +2 -14
- package/src/scripts/run/install/index.js +16 -0
- package/src/utils/io.js +20 -0
- package/build/postInstall.js +0 -15
package/src/utils/io.js
CHANGED
|
@@ -97,6 +97,25 @@ const fileInDir = (dir, file) => {
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
|
|
100
|
+
function findAllFilesOfDir(dir) {
|
|
101
|
+
const list = [];
|
|
102
|
+
function listFile(dir) {
|
|
103
|
+
const arr = fs.readdirSync(dir);
|
|
104
|
+
arr.forEach((item) => {
|
|
105
|
+
const fullPath = path.join(dir, item);
|
|
106
|
+
const stats = fs.statSync(fullPath);
|
|
107
|
+
if (stats.isDirectory()) {
|
|
108
|
+
listFile(fullPath);
|
|
109
|
+
} else {
|
|
110
|
+
list.push(fullPath);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
return list;
|
|
114
|
+
}
|
|
115
|
+
listFile(dir);
|
|
116
|
+
return list;
|
|
117
|
+
}
|
|
118
|
+
|
|
100
119
|
module.exports = {
|
|
101
120
|
isDirEmpty,
|
|
102
121
|
copyFile,
|
|
@@ -105,4 +124,5 @@ module.exports = {
|
|
|
105
124
|
ext,
|
|
106
125
|
fileInDir,
|
|
107
126
|
isFile,
|
|
127
|
+
findAllFilesOfDir,
|
|
108
128
|
};
|
package/build/postInstall.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const shellJs = require('shelljs');
|
|
3
|
-
|
|
4
|
-
function main() {
|
|
5
|
-
const pwd = shellJs.pwd();
|
|
6
|
-
const gulpWatchDirNM = `${pwd}/node_modules/gulp-watch/node_modules`;
|
|
7
|
-
if (fs.existsSync(gulpWatchDirNM)) {
|
|
8
|
-
shellJs.cd(gulpWatchDirNM);
|
|
9
|
-
console.log('pwd pwd pwd', shellJs.pwd());
|
|
10
|
-
shellJs.rm('-rf', 'chokidar');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
main();
|
|
15
|
-
|