@windwalker-io/core 4.1.0 → 4.1.2

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.
Files changed (32) hide show
  1. package/.gulp.json +7 -7
  2. package/LICENSE +19 -19
  3. package/dist/debugger/153.js.map +1 -1
  4. package/dist/debugger/282.js.map +1 -1
  5. package/dist/debugger/416.js.map +1 -1
  6. package/dist/debugger/489.js.map +1 -1
  7. package/dist/debugger/694.js.map +1 -1
  8. package/dist/debugger/941.js.map +1 -1
  9. package/dist/debugger/index.js +1 -1
  10. package/dist/debugger/main.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/asset-sync.mjs +7 -62
  13. package/src/debugger/types/global.d.js +2 -2
  14. package/src/debugger/webpack.config.js +9 -9
  15. package/src/index.mjs +9 -9
  16. package/src/install-vendors.mjs +6 -2
  17. package/src/legacy/4.0/js-aync.mjs +74 -0
  18. package/tsconfig.js.json +0 -15
  19. package/types/global.d.ts +0 -12
  20. package/types/index.d.ts +0 -5
  21. package/types/shims-sweetalert.d.ts +0 -8
  22. package/types/unicorn.d.ts +0 -1
  23. package/types/vendor.d.ts +0 -1
  24. package/types/vue/global.d.ts +0 -14
  25. package/types/vue/shims-vue.d.ts +0 -5
  26. package/types/vue/vue-runtime.d.ts +0 -16
  27. /package/dist/debugger/{153-0a5b226321a7cb0ca385.js → 153-2f3366cb4e48e0749485.js} +0 -0
  28. /package/dist/debugger/{282-a3b07d57b6065a0ab97b.js → 282-6f9f84a149fc7e52beb5.js} +0 -0
  29. /package/dist/debugger/{416-86068592d1c650d90f44.js → 416-ac63d360de6c26cab89a.js} +0 -0
  30. /package/dist/debugger/{489-6dc4df1408fa9cfc4c39.js → 489-e2b77a72f97d9e96f9c0.js} +0 -0
  31. /package/dist/debugger/{694-c816d301f72b3ee67630.js → 694-f1f22e67d91a57498639.js} +0 -0
  32. /package/dist/debugger/{941-b055306408b55426de85.js → 941-e1c0e725e13d8f3fcb6f.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windwalker-io/core",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "type": "module",
5
5
  "description": "Windwalker Core JS package",
6
6
  "scripts": {
@@ -5,66 +5,10 @@
5
5
  * @license __LICENSE__
6
6
  */
7
7
 
8
- import { babel, dest as toDest, src, ts, wait } from '@windwalker-io/fusion';
9
- import { postStream, prepareStream } from '@windwalker-io/fusion/src/lifecycles.js';
10
- import { extractDest } from '@windwalker-io/fusion/src/utilities/utilities.js';
11
- import { loadJson } from './utils.mjs';
12
- import rename from 'gulp-rename';
8
+ import { babel, ts } from '@windwalker-io/fusion';
13
9
  import path from 'path';
14
-
15
- /**
16
- * @deprecated
17
- */
18
- export function jsSync(source = 'src/Module', dest) {
19
- // const root = source + '/**/assets/';
20
-
21
- // glob(root, {}, function (err, dirs) {
22
- // for (let dir of dirs) {
23
- // glob(dir + '/**/*.{js,mjs}', { absolute: false }, (erro, files) => {
24
- // console.log(files);
25
- //
26
- // for (let file of files) {
27
- // console.log(
28
- // path.relative(dir, file)
29
- // );
30
- // }
31
- // });
32
- // }
33
- // });
34
-
35
- const sourceList = [];
36
-
37
- sourceList.push(...findModules('**/assets/*.{js,mjs,ts}'));
38
- sourceList.push(source + '**/assets/*.{js,mjs,ts}');
39
-
40
- let stream = prepareStream(src(sourceList));
41
-
42
- stream = stream.pipe(rename((path) => {
43
- path.dirname = path.dirname.replace(/assets$/, '').toLowerCase();
44
- }));
45
-
46
- const jsDest = extractDest(dest);
47
-
48
- //
49
- // // if (dest.merge) {
50
- // // stream = stream.pipe(rename(path.basename(dest.file)));
51
- // // }
52
- //
53
- stream = stream.pipe(toDest(jsDest.path).on('error', e => console.error(e)));
54
-
55
- return new Promise((resolve) => {
56
- postStream(stream).on('end', (event) => {
57
- const data = {
58
- event,
59
- src,
60
- dest: jsDest,
61
- stream
62
- };
63
-
64
- resolve(data);
65
- });
66
- });
67
- }
10
+ import { loadJson } from './utils.mjs';
11
+ export * from './legacy/4.0/js-aync.mjs';
68
12
 
69
13
  export function syncModuleScripts(source = 'src/Module', dest = 'www/assets/js/view/', options = {}) {
70
14
  const jsOptions = options.js || {};
@@ -97,12 +41,13 @@ export function syncModuleTS(source = 'src/Module', dest = 'www/assets/js/view/'
97
41
  return ts(
98
42
  [
99
43
  `${source}/**/*.ts`,
100
- 'node_modules/@windwalker-io/core/types/**.d.ts',
44
+ // Todo: Research if tsconfig.json can replace this line
45
+ 'resources/assets/src/**/*.d.ts',
101
46
  ...findModules('**/assets/*.ts')
102
47
  ],
103
48
  dest,
104
49
  {
105
- tsconfig: path.resolve('tsconfig.js.json'),
50
+ tsconfig: path.resolve('tsconfig.json'),
106
51
  rename: (path) => {
107
52
  path.dirname = path.dirname.replace(/assets$/, '').toLowerCase();
108
53
  },
@@ -128,5 +73,5 @@ export function findModules(suffix = '') {
128
73
  })
129
74
  .flat();
130
75
 
131
- return [ ...new Set(vendors) ];
76
+ return [...new Set(vendors)];
132
77
  }
@@ -1,2 +1,2 @@
1
- declare module '*.jpg';
2
- declare module '*.svg';
1
+ declare module '*.jpg';
2
+ declare module '*.svg';
@@ -1,9 +1,9 @@
1
- const path = require('path');
2
-
3
- module.exports = {
4
- resolve: {
5
- alias: {
6
- '@': path.resolve(__dirname),
7
- }
8
- }
9
- };
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ resolve: {
5
+ alias: {
6
+ '@': path.resolve(__dirname),
7
+ }
8
+ }
9
+ };
package/src/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- /**
2
- * Part of funclass project.
3
- *
4
- * @copyright Copyright (C) 2021 LYRASOFT.
5
- * @license __LICENSE__
6
- */
7
-
8
- export * from './asset-sync.mjs';
9
- export * from './install-vendors.mjs';
1
+ /**
2
+ * Part of funclass project.
3
+ *
4
+ * @copyright Copyright (C) 2021 LYRASOFT.
5
+ * @license __LICENSE__
6
+ */
7
+
8
+ export * from './asset-sync.mjs';
9
+ export * from './install-vendors.mjs';
@@ -87,8 +87,12 @@ function findNpmVendors(composerJsons = []) {
87
87
  .flat();
88
88
 
89
89
  const vendorsFromComposer = composerJsons
90
- .map((composerJson) => composerJson?.extra?.windwalker?.assets?.vendors || {})
91
- .map((vendors) => Object.keys(vendors))
90
+ .map((composerJson) => {
91
+ return [
92
+ ...composerJson?.extra?.windwalker?.asset_vendors || [],
93
+ ...Object.keys(composerJson?.extra?.windwalker?.assets?.vendors || {})
94
+ ]
95
+ })
92
96
  .flat();
93
97
 
94
98
  return [ ...new Set(vendors.concat(vendorsFromComposer)) ];
@@ -0,0 +1,74 @@
1
+ import { findModules } from '@windwalker-io/core/src/index.mjs';
2
+ import { dest as toDest, src, ts } from '@windwalker-io/fusion';
3
+ import { postStream, prepareStream } from '@windwalker-io/fusion/src/lifecycles.js';
4
+ import { extractDest } from '@windwalker-io/fusion/src/utilities/utilities.js';
5
+ import { existsSync } from 'fs';
6
+ import rename from 'gulp-rename';
7
+ import path from 'path';
8
+
9
+ /**
10
+ * @deprecated
11
+ */
12
+ export function jsSync(source = 'src/Module', dest, options = {}) {
13
+ const tsOptions = options.ts || {};
14
+
15
+ if (!tsOptions.tsconfig) {
16
+ tsOptions.tsconfig = path.resolve('tsconfig.json');
17
+
18
+ if (!existsSync(tsOptions.tsconfig)) {
19
+ tsOptions.tsconfig = path.resolve('node_modules/@windwalker-io/unicorn/tsconfig.js.json');
20
+ }
21
+ }
22
+
23
+ const sourceList = [];
24
+
25
+ sourceList.push(...findModules('**/assets/*.{js,mjs}'));
26
+ sourceList.push(source + '**/assets/*.{js,mjs}');
27
+
28
+ let stream = prepareStream(src(sourceList));
29
+
30
+ stream = stream.pipe(rename((path) => {
31
+ path.dirname = path.dirname.replace(/assets$/, '').toLowerCase();
32
+ }));
33
+
34
+ const jsDest = extractDest(dest);
35
+
36
+ //
37
+ // // if (dest.merge) {
38
+ // // stream = stream.pipe(rename(path.basename(dest.file)));
39
+ // // }
40
+ //
41
+ stream = stream.pipe(toDest(jsDest.path).on('error', e => console.error(e)));
42
+
43
+ return Promise.all([
44
+ new Promise((resolve) => {
45
+ postStream(stream).on('end', (event) => {
46
+ const data = {
47
+ event,
48
+ src,
49
+ dest: jsDest,
50
+ stream
51
+ };
52
+
53
+ resolve(data);
54
+ });
55
+ }),
56
+ // Legacy mode
57
+ ts(
58
+ [
59
+ `${source}/**/*.ts`,
60
+ 'node_modules/@windwalker-io/unicorn/src/types/*.d.ts',
61
+ ...findModules('**/assets/*.ts')
62
+ ],
63
+ dest,
64
+ {
65
+ rename: (path) => {
66
+ path.dirname = path.dirname.replace(/assets$/, '').toLowerCase();
67
+ },
68
+ ...tsOptions
69
+ }
70
+ )
71
+ ]).then((v) => {
72
+ return v[0];
73
+ });
74
+ }
package/tsconfig.js.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "include": [
3
- "types/index.d.ts"
4
- ],
5
- "exclude": [
6
- "node_modules/**/*"
7
- ],
8
- "compilerOptions": {
9
- "allowJs": true,
10
- "module": "system",
11
- "moduleResolution": "node",
12
- "target": "es2020",
13
- "skipLibCheck": true
14
- }
15
- }
package/types/global.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import '@windwalker-io/unicorn';
2
- import 'systemjs';
3
- import 'jquery';
4
- import 'axios';
5
- import boostrap from 'bootstrap';
6
- import * as vue from 'vue';
7
-
8
- declare global {
9
- var S: typeof System;
10
- var bootstrap: typeof boostrap;
11
- var Vue: typeof vue;
12
- }
package/types/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
-
2
- import './global';
3
- import './shims-sweetalert';
4
- import './unicorn';
5
- import './vendor';
@@ -1,8 +0,0 @@
1
- import { SwalParams } from "sweetalert/typings/core";
2
-
3
- declare global {
4
- const swal: (...params: SwalParams) => Promise<any>;
5
- }
6
-
7
- // export default swal;
8
- // export as namespace swal;
@@ -1 +0,0 @@
1
- declare module "@unicorn/*";
package/types/vendor.d.ts DELETED
@@ -1 +0,0 @@
1
- declare module "@vendor/*";
@@ -1,14 +0,0 @@
1
- /**
2
- * Part of cati project.
3
- *
4
- * @copyright Copyright (C) 2023 __ORGANIZATION__.
5
- * @license __LICENSE__
6
- */
7
-
8
- import '@windwalker-io/unicorn';
9
- import 'systemjs';
10
- import 'axios';
11
-
12
- declare global {
13
- var S: typeof System;
14
- }
@@ -1,5 +0,0 @@
1
- declare module '*.vue' {
2
- import { defineComponent } from 'vue'
3
- const component: ReturnType<typeof defineComponent>
4
- export default component
5
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * Part of cati project.
3
- *
4
- * @copyright Copyright (C) 2023 __ORGANIZATION__.
5
- * @license __LICENSE__
6
- */
7
-
8
- import Vue from 'vue'
9
-
10
- declare module '@vue/runtime-core' {
11
- interface ComponentCustomProperties {
12
- $lang: Function;
13
- questionProp: Function;
14
- introtext: Function;
15
- }
16
- }