@akanjs/devkit 0.9.13 → 0.9.14
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/cjs/src/executors.js +18 -7
- package/cjs/src/extractDeps.js +1 -1
- package/esm/src/executors.js +18 -7
- package/esm/src/extractDeps.js +1 -1
- package/package.json +1 -1
package/cjs/src/executors.js
CHANGED
|
@@ -862,17 +862,28 @@ class AppExecutor extends SysExecutor {
|
|
|
862
862
|
}
|
|
863
863
|
async syncAssets(libDeps) {
|
|
864
864
|
const projectPublicLibPath = `${this.cwdPath}/public/libs`;
|
|
865
|
-
|
|
866
|
-
|
|
865
|
+
const projectAssetsLibPath = `${this.cwdPath}/assets/libs`;
|
|
866
|
+
await Promise.all([
|
|
867
|
+
import_fs.default.existsSync(projectPublicLibPath) && import_promises.default.rm(projectPublicLibPath, { recursive: true }),
|
|
868
|
+
import_fs.default.existsSync(projectAssetsLibPath) && import_promises.default.rm(projectAssetsLibPath, { recursive: true })
|
|
869
|
+
]);
|
|
867
870
|
const targetDeps = libDeps.filter((dep) => import_fs.default.existsSync(`${this.workspace.workspaceRoot}/libs/${dep}/public`));
|
|
868
|
-
await Promise.all(
|
|
869
|
-
|
|
870
|
-
targetDeps.map(
|
|
871
|
-
|
|
871
|
+
await Promise.all([
|
|
872
|
+
...targetDeps.map((dep) => import_promises.default.mkdir(`${projectPublicLibPath}/${dep}`, { recursive: true })),
|
|
873
|
+
...targetDeps.map((dep) => import_promises.default.mkdir(`${projectAssetsLibPath}/${dep}`, { recursive: true }))
|
|
874
|
+
]);
|
|
875
|
+
await Promise.all([
|
|
876
|
+
...targetDeps.map(
|
|
877
|
+
(dep) => import_fs.default.existsSync(`${this.workspace.workspaceRoot}/libs/${dep}/public`) && import_promises.default.cp(`${this.workspace.workspaceRoot}/libs/${dep}/public`, `${projectPublicLibPath}/${dep}`, {
|
|
878
|
+
recursive: true
|
|
879
|
+
})
|
|
880
|
+
),
|
|
881
|
+
...targetDeps.map(
|
|
882
|
+
(dep) => import_fs.default.existsSync(`${this.workspace.workspaceRoot}/libs/${dep}/assets`) && import_promises.default.cp(`${this.workspace.workspaceRoot}/libs/${dep}/assets`, `${projectAssetsLibPath}/${dep}`, {
|
|
872
883
|
recursive: true
|
|
873
884
|
})
|
|
874
885
|
)
|
|
875
|
-
);
|
|
886
|
+
]);
|
|
876
887
|
}
|
|
877
888
|
}
|
|
878
889
|
class LibExecutor extends SysExecutor {
|
package/cjs/src/extractDeps.js
CHANGED
|
@@ -74,7 +74,7 @@ const extractDependencies = (filepaths, pacakgeJson, defaultDependencies = []) =
|
|
|
74
74
|
...pacakgeJson.dependencies ?? {},
|
|
75
75
|
...pacakgeJson.devDependencies ?? {}
|
|
76
76
|
};
|
|
77
|
-
const requireRegex = /require\s*\(\s*['"`]([^'"`]+)['"`]
|
|
77
|
+
const requireRegex = /(?:require\s*\(|import\s*(?:[\w\s{},*]*\s+from\s*)?|import\s*\()\s*['"`]([^'"`]+)['"`]/g;
|
|
78
78
|
for (const { text } of filepaths.filter(({ path }) => path.endsWith(".js"))) {
|
|
79
79
|
let requireMatch;
|
|
80
80
|
while ((requireMatch = requireRegex.exec(text)) !== null) {
|
package/esm/src/executors.js
CHANGED
|
@@ -826,17 +826,28 @@ class AppExecutor extends SysExecutor {
|
|
|
826
826
|
}
|
|
827
827
|
async syncAssets(libDeps) {
|
|
828
828
|
const projectPublicLibPath = `${this.cwdPath}/public/libs`;
|
|
829
|
-
|
|
830
|
-
|
|
829
|
+
const projectAssetsLibPath = `${this.cwdPath}/assets/libs`;
|
|
830
|
+
await Promise.all([
|
|
831
|
+
fs.existsSync(projectPublicLibPath) && fsPromise.rm(projectPublicLibPath, { recursive: true }),
|
|
832
|
+
fs.existsSync(projectAssetsLibPath) && fsPromise.rm(projectAssetsLibPath, { recursive: true })
|
|
833
|
+
]);
|
|
831
834
|
const targetDeps = libDeps.filter((dep) => fs.existsSync(`${this.workspace.workspaceRoot}/libs/${dep}/public`));
|
|
832
|
-
await Promise.all(
|
|
833
|
-
|
|
834
|
-
targetDeps.map(
|
|
835
|
-
|
|
835
|
+
await Promise.all([
|
|
836
|
+
...targetDeps.map((dep) => fsPromise.mkdir(`${projectPublicLibPath}/${dep}`, { recursive: true })),
|
|
837
|
+
...targetDeps.map((dep) => fsPromise.mkdir(`${projectAssetsLibPath}/${dep}`, { recursive: true }))
|
|
838
|
+
]);
|
|
839
|
+
await Promise.all([
|
|
840
|
+
...targetDeps.map(
|
|
841
|
+
(dep) => fs.existsSync(`${this.workspace.workspaceRoot}/libs/${dep}/public`) && fsPromise.cp(`${this.workspace.workspaceRoot}/libs/${dep}/public`, `${projectPublicLibPath}/${dep}`, {
|
|
842
|
+
recursive: true
|
|
843
|
+
})
|
|
844
|
+
),
|
|
845
|
+
...targetDeps.map(
|
|
846
|
+
(dep) => fs.existsSync(`${this.workspace.workspaceRoot}/libs/${dep}/assets`) && fsPromise.cp(`${this.workspace.workspaceRoot}/libs/${dep}/assets`, `${projectAssetsLibPath}/${dep}`, {
|
|
836
847
|
recursive: true
|
|
837
848
|
})
|
|
838
849
|
)
|
|
839
|
-
);
|
|
850
|
+
]);
|
|
840
851
|
}
|
|
841
852
|
}
|
|
842
853
|
class LibExecutor extends SysExecutor {
|
package/esm/src/extractDeps.js
CHANGED
|
@@ -52,7 +52,7 @@ const extractDependencies = (filepaths, pacakgeJson, defaultDependencies = []) =
|
|
|
52
52
|
...pacakgeJson.dependencies ?? {},
|
|
53
53
|
...pacakgeJson.devDependencies ?? {}
|
|
54
54
|
};
|
|
55
|
-
const requireRegex = /require\s*\(\s*['"`]([^'"`]+)['"`]
|
|
55
|
+
const requireRegex = /(?:require\s*\(|import\s*(?:[\w\s{},*]*\s+from\s*)?|import\s*\()\s*['"`]([^'"`]+)['"`]/g;
|
|
56
56
|
for (const { text } of filepaths.filter(({ path }) => path.endsWith(".js"))) {
|
|
57
57
|
let requireMatch;
|
|
58
58
|
while ((requireMatch = requireRegex.exec(text)) !== null) {
|