@windwalker-io/core 4.1.2 → 4.1.4
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/dist/debugger/{index.js → debugger.js} +2 -2
- package/dist/debugger/main.js.map +1 -1
- package/fusionfile.mjs +1 -1
- package/package.json +1 -1
- package/src/asset-sync.mjs +3 -9
- package/src/install-vendors.mjs +13 -4
- package/src/legacy/4.0/js-aync.mjs +2 -2
- /package/dist/debugger/{index.js.LICENSE.txt → debugger.js.LICENSE.txt} +0 -0
package/fusionfile.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
|
15
15
|
export async function debuggers() {
|
|
16
16
|
return webpackVueBundle(
|
|
17
17
|
'src/debugger/debugger.js',
|
|
18
|
-
'dist/debugger/
|
|
18
|
+
'dist/debugger/debugger.js',
|
|
19
19
|
(config) => {
|
|
20
20
|
config.resolve.alias = {
|
|
21
21
|
'@': path.resolve(path.resolve(), './src/debugger/') // Will be overwrite when compile
|
package/package.json
CHANGED
package/src/asset-sync.mjs
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Part of funclass project.
|
|
3
|
-
*
|
|
4
|
-
* @copyright Copyright (C) 2021 LYRASOFT.
|
|
5
|
-
* @license __LICENSE__
|
|
6
|
-
*/
|
|
7
1
|
|
|
8
2
|
import { babel, ts } from '@windwalker-io/fusion';
|
|
9
3
|
import path from 'path';
|
|
@@ -23,8 +17,8 @@ export function syncModuleScripts(source = 'src/Module', dest = 'www/assets/js/v
|
|
|
23
17
|
export function syncModuleJS(source = 'src/Module', dest = 'www/assets/js/view/', options = {}) {
|
|
24
18
|
return babel(
|
|
25
19
|
[
|
|
20
|
+
...findModules('**/assets/*.{js,mjs}'),
|
|
26
21
|
`${source}/**/*.{js,mjs}`,
|
|
27
|
-
...findModules('**/assets/*.{js,mjs}')
|
|
28
22
|
],
|
|
29
23
|
dest,
|
|
30
24
|
{
|
|
@@ -40,10 +34,10 @@ export function syncModuleJS(source = 'src/Module', dest = 'www/assets/js/view/'
|
|
|
40
34
|
export function syncModuleTS(source = 'src/Module', dest = 'www/assets/js/view/', options = {}) {
|
|
41
35
|
return ts(
|
|
42
36
|
[
|
|
43
|
-
`${source}/**/*.ts`,
|
|
44
37
|
// Todo: Research if tsconfig.json can replace this line
|
|
45
38
|
'resources/assets/src/**/*.d.ts',
|
|
46
|
-
...findModules('**/assets/*.ts')
|
|
39
|
+
...findModules('**/assets/*.ts'),
|
|
40
|
+
`${source}/**/*.ts`,
|
|
47
41
|
],
|
|
48
42
|
dest,
|
|
49
43
|
{
|
package/src/install-vendors.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { loadJson } from './utils.mjs';
|
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
|
|
9
|
-
export async function installVendors(npmVendors = [],
|
|
9
|
+
export async function installVendors(npmVendors = [], legacyComposerVendors = [], to = 'www/assets/vendor') {
|
|
10
10
|
const root = to;
|
|
11
11
|
let vendors = npmVendors;
|
|
12
12
|
const action = process.env.INSTALL_VENDOR === 'hard' ? 'Copy' : 'Link';
|
|
@@ -25,7 +25,7 @@ export async function installVendors(npmVendors = [], composerVendors = [], to =
|
|
|
25
25
|
deleteExists(dir);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
const composerJsons = getInstalledComposerVendors(
|
|
28
|
+
const composerJsons = getInstalledComposerVendors()
|
|
29
29
|
.map((cv) => `vendor/${cv}/composer.json`)
|
|
30
30
|
.map((file) => loadJson(file))
|
|
31
31
|
.filter((composerJson) => composerJson?.extra?.windwalker != null);
|
|
@@ -61,6 +61,15 @@ export async function installVendors(npmVendors = [], composerVendors = [], to =
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
+
// Install legacy packages assets
|
|
65
|
+
legacyComposerVendors.forEach((vendorName) => {
|
|
66
|
+
console.log(vendorName, fs.existsSync(`vendor/${vendorName}/assets`));
|
|
67
|
+
if (fs.existsSync(`vendor/${vendorName}/assets`)) {
|
|
68
|
+
console.log(`[${action} Composer] vendor/${vendorName}/assets/ => ${root}/${vendorName}/`);
|
|
69
|
+
doInstall(`vendor/${vendorName}/assets/`, `${root}/${vendorName}/`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
64
73
|
// Install local saved vendors
|
|
65
74
|
console.log(`[${action} Local] resources/assets/vendor/**/* => ${root}/`);
|
|
66
75
|
doInstall('resources/assets/vendor/*', `${root}/`);
|
|
@@ -90,6 +99,7 @@ function findNpmVendors(composerJsons = []) {
|
|
|
90
99
|
.map((composerJson) => {
|
|
91
100
|
return [
|
|
92
101
|
...composerJson?.extra?.windwalker?.asset_vendors || [],
|
|
102
|
+
...composerJson?.extra?.windwalker?.assets?.exposes || [],
|
|
93
103
|
...Object.keys(composerJson?.extra?.windwalker?.assets?.vendors || {})
|
|
94
104
|
]
|
|
95
105
|
})
|
|
@@ -102,7 +112,7 @@ function injectNpmPackages(composerVendors = []) {
|
|
|
102
112
|
|
|
103
113
|
}
|
|
104
114
|
|
|
105
|
-
function getInstalledComposerVendors(
|
|
115
|
+
function getInstalledComposerVendors() {
|
|
106
116
|
const composerFile = path.resolve(process.cwd(), 'composer.json');
|
|
107
117
|
const composerJson = loadJson(composerFile);
|
|
108
118
|
|
|
@@ -110,7 +120,6 @@ function getInstalledComposerVendors(composerVendors = []) {
|
|
|
110
120
|
...new Set(
|
|
111
121
|
Object.keys(composerJson['require'] || {})
|
|
112
122
|
.concat(Object.keys(composerJson['require-dev'] || {}))
|
|
113
|
-
.concat(composerVendors)
|
|
114
123
|
)
|
|
115
124
|
];
|
|
116
125
|
}
|
|
@@ -56,9 +56,9 @@ export function jsSync(source = 'src/Module', dest, options = {}) {
|
|
|
56
56
|
// Legacy mode
|
|
57
57
|
ts(
|
|
58
58
|
[
|
|
59
|
-
|
|
59
|
+
...findModules('**/assets/*.ts'),
|
|
60
60
|
'node_modules/@windwalker-io/unicorn/src/types/*.d.ts',
|
|
61
|
-
|
|
61
|
+
`${source}/**/*.ts`,
|
|
62
62
|
],
|
|
63
63
|
dest,
|
|
64
64
|
{
|
|
File without changes
|