@shijiu/jsview-vue 0.9.254 → 0.9.267
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/dom/bin/package.json +11 -11
- package/dom/browser-root-style.css +21 -21
- package/loader/jsview-main.js +41 -41
- package/loader/jsview.config.default.js +37 -37
- package/loader/jsview.default.config.js +37 -37
- package/package.json +1 -5
- package/samples/AdvanceMetroWidget/App.vue +122 -122
- package/samples/AdvanceMetroWidget/Frame.vue +100 -100
- package/samples/AdvanceMetroWidget/Item.vue +57 -57
- package/samples/AdvanceMetroWidget/data.js +136 -136
- package/samples/AnimPicture/App.vue +223 -223
- package/samples/Basic/App.vue +128 -128
- package/samples/Basic/components/TitleBar.vue +28 -28
- package/samples/Basic/components/anim/AnimGroup.vue +67 -67
- package/samples/Basic/components/anim/AnimKeyframeBasic.vue +101 -101
- package/samples/Basic/components/anim/AnimKeyframeComposite.vue +52 -52
- package/samples/Basic/components/anim/AnimTransition.vue +116 -116
- package/samples/Basic/components/div/DivBackground.vue +14 -14
- package/samples/Basic/components/div/DivClip.vue +80 -80
- package/samples/Basic/components/div/DivCssScoped.vue +26 -26
- package/samples/Basic/components/div/DivCssVar.vue +49 -49
- package/samples/Basic/components/div/DivGroup1.vue +32 -32
- package/samples/Basic/components/div/DivGroup2.vue +40 -40
- package/samples/Basic/components/div/DivLayout.vue +11 -11
- package/samples/Basic/components/div/DivRadius.vue +46 -46
- package/samples/Basic/components/text/TextAlign.vue +47 -47
- package/samples/Basic/components/text/TextFontStyle.vue +57 -57
- package/samples/Basic/components/text/TextGroup.vue +31 -31
- package/samples/Basic/components/text/TextOverflow.vue +77 -77
- package/samples/BasicFocusControl/App.vue +124 -124
- package/samples/BasicFocusControl/components/BaseBlock.vue +50 -50
- package/samples/BasicFocusControl/components/MainArea.vue +97 -97
- package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +20 -20
- package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +29 -29
- package/samples/BasicFocusControl/components/SideBar.vue +72 -72
- package/samples/BasicFocusControl/components/SideBarBlock.vue +29 -29
- package/samples/ClassNameDemo/App.vue +119 -119
- package/samples/ClassNameDemo/components/ContentItem.vue +252 -252
- package/samples/ClassNameDemo/components/LoadingView.vue +43 -43
- package/samples/ClassNameDemo/components/TitleView.vue +24 -24
- package/samples/ClassNameDemo/data.js +24 -24
- package/samples/ColorSpace/App.vue +134 -134
- package/samples/DemoHomepage/App.vue +31 -31
- package/samples/DemoHomepage/components/BodyFrame.vue +81 -81
- package/samples/DemoHomepage/components/Dialog.vue +93 -93
- package/samples/DemoHomepage/components/Item.vue +76 -76
- package/samples/DemoHomepage/components/TabFrame.vue +86 -86
- package/samples/DemoHomepage/router.js +132 -132
- package/samples/DemoHomepage/views/Homepage.vue +186 -186
- package/samples/FlipCard/App.vue +80 -80
- package/samples/FlipCard/FlipCard.vue +123 -123
- package/samples/FlipCard/data.js +12 -12
- package/samples/FlowMultiWidget/App.vue +90 -90
- package/samples/FlowMultiWidget/components/Block.vue +106 -106
- package/samples/FlowMultiWidget/components/FlowPage.vue +59 -59
- package/samples/FlowMultiWidget/components/Item.vue +102 -102
- package/samples/FlowMultiWidget/components/MenuItem.vue +71 -71
- package/samples/FlowMultiWidget/components/MyMenu.vue +89 -89
- package/samples/FlowMultiWidget/data.js +446 -446
- package/samples/HashHistory/App.vue +124 -124
- package/samples/HashHistory/components/HorizontalButtonList.vue +113 -113
- package/samples/HashHistory/components/Item.vue +73 -73
- package/samples/HashHistory/router.js +29 -29
- package/samples/HashHistory/views/BasePage.vue +18 -18
- package/samples/HashHistory/views/MainPage.vue +67 -67
- package/samples/HashHistory/views/SubPage.vue +78 -78
- package/samples/HashHistory/views/SubPageFirst.vue +9 -9
- package/samples/HashHistory/views/SubPageSecond.vue +9 -9
- package/samples/LongImage/App.vue +96 -96
- package/samples/LongImage/Button.vue +153 -153
- package/samples/LongImage/LongImageScroll.vue +126 -126
- package/samples/LongImage/Scroll.vue +15 -15
- package/samples/LongText/App.vue +111 -111
- package/samples/LongText/Button.vue +153 -153
- package/samples/LongText/LongTextScroll.vue +224 -224
- package/samples/LongText/Scroll.vue +15 -15
- package/samples/Preload/App.vue +145 -145
- package/samples/Preload/data.js +22 -22
- package/samples/Preload/preloadItem.vue +21 -21
- package/samples/QrcodeDemo/App.vue +72 -72
- package/samples/SimpleWidgetDemo/App.vue +203 -203
- package/samples/SimpleWidgetDemo/Item.vue +82 -82
- package/samples/SimpleWidgetDemo/components/ContentItem.vue +411 -411
- package/samples/SimpleWidgetDemo/components/MyTab.vue +116 -116
- package/samples/SimpleWidgetDemo/data.js +110 -110
- package/samples/SprayView/App.vue +269 -269
- package/samples/SpriteImage/App.vue +174 -174
- package/samples/SpriteImage/images/egg_break.json +116 -116
- package/samples/TextBox/App.vue +178 -178
- package/samples/TextBox/RenderCenter.vue +108 -108
- package/samples/TextBox/RenderLeft.vue +108 -108
- package/samples/TextBox/RenderOneLine.vue +119 -119
- package/samples/TextBox/RenderRight.vue +106 -106
- package/samples/TextShadowDemo/App.vue +97 -97
- package/samples/TextureSize/App.vue +141 -141
- package/samples/ThrowMoveDemo/AccelerateDemo.vue +117 -117
- package/samples/ThrowMoveDemo/App.vue +113 -113
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +115 -115
- package/samples/ThrowMoveDemo/TargetDemo.vue +116 -116
- package/samples/ThrowMoveDemo/UDParabolicDemo.vue +121 -121
- package/samples/TransitPage/App.vue +40 -40
- package/samples/VideoDemo/App.vue +137 -137
- package/samples/VideoDemo/components/Button.vue +68 -68
- package/samples/VideoDemo/components/Controllor.vue +195 -195
- package/samples/VideoDemo/components/VideoFrame.vue +152 -152
- package/scripts/common.js +57 -115
- package/scripts/jsview-install-local-packages.js +73 -73
- package/scripts/jsview-post-build.js +127 -127
- package/scripts/jsview-post-install.js +78 -78
- package/scripts/jsview-run-android.js +64 -64
- package/utils/JsViewEngineWidget/bin/index.js +1 -1
- package/utils/JsViewEngineWidget/bin/package.json +11 -11
- package/utils/JsViewVueTools/JsvHashHistory.js +111 -111
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +417 -417
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +80 -80
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +147 -147
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserSpray.vue +54 -54
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/ApicDataBase.js +28 -28
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +123 -123
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/GifData.js +83 -83
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/LoopToolBase.js +25 -25
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/NormalLoopTool.js +61 -61
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/PartLoopTool.js +119 -119
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/Viewer.js +106 -106
- package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/WebpData.js +141 -141
- package/utils/JsViewVueWidget/BrowserDebugWidget/WidgetLoader.js +20 -20
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +204 -204
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +63 -63
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +426 -426
- package/utils/JsViewVueWidget/JsvActorMove/index.js +12 -12
- package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +178 -178
- package/utils/JsViewVueWidget/JsvApic/index.js +17 -17
- package/utils/JsViewVueWidget/JsvMarquee.vue +196 -196
- package/utils/JsViewVueWidget/JsvNinePatch.vue +76 -76
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +350 -350
- package/utils/JsViewVueWidget/JsvPreload/index.js +21 -21
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +140 -140
- package/utils/JsViewVueWidget/JsvQrcode/index.js +18 -18
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +139 -139
- package/utils/JsViewVueWidget/JsvSpray/index.js +14 -14
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +447 -447
- package/utils/JsViewVueWidget/JsvSpriteAnim/SpriteController.js +56 -56
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +6 -6
- package/utils/JsViewVueWidget/JsvSwiper/Indicator.vue +34 -34
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +494 -494
- package/utils/JsViewVueWidget/JsvSwiper/index.js +9 -9
- package/utils/JsViewVueWidget/JsvSwiper3D/Indicator.vue +34 -34
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +403 -403
- package/utils/JsViewVueWidget/JsvSwiper3D/index.js +9 -9
- package/utils/JsViewVueWidget/JsvTextBox.vue +110 -110
- package/utils/JsViewVueWidget/JsvVideo.vue +35 -35
- package/patches/node_modules/@babel/preset-env/lib/available-plugins.js +0 -219
- package/patches/node_modules/@vue/cli-plugin-typescript/index.js +0 -100
- package/patches/node_modules/@vue/cli-service/lib/commands/serve.js +0 -395
- package/patches/node_modules/@vue/cli-service/lib/config/app.js +0 -272
- package/patches/node_modules/@vue/cli-service/lib/config/assets.js +0 -70
- package/patches/node_modules/@vue/cli-service/lib/config/base.js +0 -212
- package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -2566
- package/patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js +0 -274
- package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1596
- package/patches/node_modules/postcss-js/objectifier.js +0 -90
- package/patches/node_modules/vue-loader/dist/resolveScript.js +0 -70
- package/scripts/deploy-fast-pack.js +0 -17
- package/scripts/deploy-fast-publish.js +0 -44
- package/scripts/deploy-git-commit-empty.js +0 -21
- package/scripts/deploy-prepare.js +0 -56
- package/scripts/make-js.sh +0 -181
- package/vetur.config.js +0 -5
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
let camelcase = require('camelcase-css')
|
|
2
|
-
|
|
3
|
-
let UNITLESS = {
|
|
4
|
-
// QCode Added >>>>>
|
|
5
|
-
left: true,
|
|
6
|
-
top: true,
|
|
7
|
-
width: true,
|
|
8
|
-
height: true,
|
|
9
|
-
// QCode Added <<<<<
|
|
10
|
-
|
|
11
|
-
boxFlex: true,
|
|
12
|
-
boxFlexGroup: true,
|
|
13
|
-
columnCount: true,
|
|
14
|
-
flex: true,
|
|
15
|
-
flexGrow: true,
|
|
16
|
-
flexPositive: true,
|
|
17
|
-
flexShrink: true,
|
|
18
|
-
flexNegative: true,
|
|
19
|
-
fontWeight: true,
|
|
20
|
-
lineClamp: true,
|
|
21
|
-
lineHeight: true,
|
|
22
|
-
opacity: true,
|
|
23
|
-
order: true,
|
|
24
|
-
orphans: true,
|
|
25
|
-
tabSize: true,
|
|
26
|
-
widows: true,
|
|
27
|
-
zIndex: true,
|
|
28
|
-
zoom: true,
|
|
29
|
-
fillOpacity: true,
|
|
30
|
-
strokeDashoffset: true,
|
|
31
|
-
strokeOpacity: true,
|
|
32
|
-
strokeWidth: true
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function atRule (node) {
|
|
36
|
-
if (typeof node.nodes === 'undefined') {
|
|
37
|
-
return true
|
|
38
|
-
} else {
|
|
39
|
-
return process(node)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function process (node) {
|
|
44
|
-
let name
|
|
45
|
-
let result = {}
|
|
46
|
-
|
|
47
|
-
node.each(child => {
|
|
48
|
-
if (child.type === 'atrule') {
|
|
49
|
-
name = '@' + child.name
|
|
50
|
-
if (child.params) name += ' ' + child.params
|
|
51
|
-
if (typeof result[name] === 'undefined') {
|
|
52
|
-
result[name] = atRule(child)
|
|
53
|
-
} else if (Array.isArray(result[name])) {
|
|
54
|
-
result[name].push(atRule(child))
|
|
55
|
-
} else {
|
|
56
|
-
result[name] = [result[name], atRule(child)]
|
|
57
|
-
}
|
|
58
|
-
} else if (child.type === 'rule') {
|
|
59
|
-
let body = process(child)
|
|
60
|
-
if (result[child.selector]) {
|
|
61
|
-
for (let i in body) {
|
|
62
|
-
result[child.selector][i] = body[i]
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
result[child.selector] = body
|
|
66
|
-
}
|
|
67
|
-
} else if (child.type === 'decl') {
|
|
68
|
-
if (child.prop[0] === '-' && child.prop[1] === '-') {
|
|
69
|
-
name = child.prop
|
|
70
|
-
} else {
|
|
71
|
-
name = camelcase(child.prop)
|
|
72
|
-
}
|
|
73
|
-
let value = child.value
|
|
74
|
-
if (!isNaN(child.value) && UNITLESS[name]) {
|
|
75
|
-
value = parseFloat(child.value)
|
|
76
|
-
}
|
|
77
|
-
if (child.important) value += ' !important'
|
|
78
|
-
if (typeof result[name] === 'undefined') {
|
|
79
|
-
result[name] = value
|
|
80
|
-
} else if (Array.isArray(result[name])) {
|
|
81
|
-
result[name].push(value)
|
|
82
|
-
} else {
|
|
83
|
-
result[name] = [result[name], value]
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
return result
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
module.exports = process
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveScript = exports.canInlineTemplate = void 0;
|
|
4
|
-
const compiler_sfc_1 = require("@vue/compiler-sfc");
|
|
5
|
-
const clientCache = new WeakMap();
|
|
6
|
-
const serverCache = new WeakMap();
|
|
7
|
-
/**
|
|
8
|
-
* inline template mode can only be enabled if:
|
|
9
|
-
* - is production (separate compilation needed for HMR during dev)
|
|
10
|
-
* - template has no pre-processor (separate loader chain required)
|
|
11
|
-
* - template is not using src
|
|
12
|
-
*/
|
|
13
|
-
function canInlineTemplate(descriptor, isProd) {
|
|
14
|
-
const templateLang = descriptor.template && descriptor.template.lang;
|
|
15
|
-
const templateSrc = descriptor.template && descriptor.template.src;
|
|
16
|
-
return false; // QCode Modified
|
|
17
|
-
}
|
|
18
|
-
exports.canInlineTemplate = canInlineTemplate;
|
|
19
|
-
function resolveScript(descriptor, scopeId, options, loaderContext) {
|
|
20
|
-
var _a;
|
|
21
|
-
if (!descriptor.script && !descriptor.scriptSetup) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
const isProd = loaderContext.mode === 'production' || process.env.NODE_ENV === 'production';
|
|
25
|
-
const isServer = (_a = options.isServerBuild) !== null && _a !== void 0 ? _a : loaderContext.target === 'node';
|
|
26
|
-
const enableInline = canInlineTemplate(descriptor, isProd);
|
|
27
|
-
const cacheToUse = isServer ? serverCache : clientCache;
|
|
28
|
-
const cached = cacheToUse.get(descriptor);
|
|
29
|
-
if (cached) {
|
|
30
|
-
return cached;
|
|
31
|
-
}
|
|
32
|
-
let resolved = null;
|
|
33
|
-
let compiler;
|
|
34
|
-
if (typeof options.compiler === 'string') {
|
|
35
|
-
compiler = require(options.compiler);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
compiler = options.compiler;
|
|
39
|
-
}
|
|
40
|
-
if (compiler_sfc_1.compileScript) {
|
|
41
|
-
try {
|
|
42
|
-
resolved = compiler_sfc_1.compileScript(descriptor, {
|
|
43
|
-
id: scopeId,
|
|
44
|
-
isProd,
|
|
45
|
-
inlineTemplate: enableInline,
|
|
46
|
-
refSugar: options.refSugar,
|
|
47
|
-
babelParserPlugins: options.babelParserPlugins,
|
|
48
|
-
templateOptions: {
|
|
49
|
-
ssr: isServer,
|
|
50
|
-
compiler,
|
|
51
|
-
compilerOptions: options.compilerOptions,
|
|
52
|
-
transformAssetUrls: options.transformAssetUrls || true,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
loaderContext.emitError(e);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else if (descriptor.scriptSetup) {
|
|
61
|
-
loaderContext.emitError(`<script setup> is not supported by the installed version of ` +
|
|
62
|
-
`@vue/compiler-sfc - please upgrade.`);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
resolved = descriptor.script;
|
|
66
|
-
}
|
|
67
|
-
cacheToUse.set(descriptor, resolved);
|
|
68
|
-
return resolved;
|
|
69
|
-
}
|
|
70
|
-
exports.resolveScript = resolveScript;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { execSync } = require('child_process');
|
|
4
|
-
|
|
5
|
-
function main() {
|
|
6
|
-
const options = {};
|
|
7
|
-
options.projectDir = process.cwd();
|
|
8
|
-
|
|
9
|
-
let cmdLine = 'cd ' + options.projectDir + '&& node ./scripts/deploy-prepare.js';
|
|
10
|
-
console.info('Run [' + cmdLine + ']... ');
|
|
11
|
-
execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
|
|
12
|
-
|
|
13
|
-
cmdLine = 'cd ' + options.projectDir + '&& npm pack';
|
|
14
|
-
console.info('Run [' + cmdLine + ']... ');
|
|
15
|
-
execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
|
|
16
|
-
}
|
|
17
|
-
main();
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const readline = require('readline')
|
|
4
|
-
const { execSync } = require('child_process');
|
|
5
|
-
const { syncReadIO } = require('./common');
|
|
6
|
-
|
|
7
|
-
function login(registry) {
|
|
8
|
-
let cmdLine = 'npm whoami --registry ' + registry;
|
|
9
|
-
console.info('Run [' + cmdLine + ']... ');
|
|
10
|
-
let ret;
|
|
11
|
-
try {
|
|
12
|
-
ret = execSync(cmdLine, { stderr: 'ignore' });
|
|
13
|
-
console.info('Logined user name is: ' + ret?.toString())
|
|
14
|
-
} catch (err) {
|
|
15
|
-
}
|
|
16
|
-
if (!ret?.toString().startsWith('qcast')) {
|
|
17
|
-
console.info('Please use "qcast" [support@qcast.cn] to login and publish jsview to npmjs.')
|
|
18
|
-
let cmdLine = 'npm adduser --registry ' + registry;
|
|
19
|
-
console.info('Run [' + cmdLine + ']... ');
|
|
20
|
-
try {
|
|
21
|
-
execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
|
|
22
|
-
} catch (err) {
|
|
23
|
-
console.error('Failed to login to npmjs.')
|
|
24
|
-
process.exit(1)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function main() {
|
|
30
|
-
const options = {};
|
|
31
|
-
options.projectDir = process.cwd();
|
|
32
|
-
options.registry = 'https://registry.npmjs.com';
|
|
33
|
-
|
|
34
|
-
login(options.registry);
|
|
35
|
-
|
|
36
|
-
cmdLine = 'cd ' + options.projectDir + '&& node ./scripts/deploy-prepare.js';
|
|
37
|
-
console.info('Run [' + cmdLine + ']... ');
|
|
38
|
-
execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
|
|
39
|
-
|
|
40
|
-
cmdLine = 'cd ' + options.projectDir + '&& npm publish --tag latest --access=public --registry ' + options.registry;
|
|
41
|
-
console.info('Run [' + cmdLine + ']... ');
|
|
42
|
-
execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
|
|
43
|
-
}
|
|
44
|
-
main();
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { execSync } = require('child_process');
|
|
4
|
-
|
|
5
|
-
function main() {
|
|
6
|
-
// 安装dom和widget
|
|
7
|
-
let cmdLine = "git diff --cached";
|
|
8
|
-
console.info("\nRunning [" + cmdLine + "]... ");
|
|
9
|
-
let ret = execSync(cmdLine, { stderr: "inherit" });
|
|
10
|
-
if(ret) {
|
|
11
|
-
console.error("\nError: There have same uncommitted files in cache, please cleanup first.");
|
|
12
|
-
process.exit(1);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// 安装dom和widget
|
|
17
|
-
cmdLine = "git commit --allow-empty -m \"强制版本+1\"";
|
|
18
|
-
console.info("\nRunning [" + cmdLine + "]... ");
|
|
19
|
-
execSync(cmdLine, { stdio: "inherit", stderr: "inherit" });
|
|
20
|
-
}
|
|
21
|
-
main();
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { execSync } = require('child_process');
|
|
6
|
-
const { cpSync, syncReadIO, updateVersion } = require('./common');
|
|
7
|
-
|
|
8
|
-
async function updateVersionWithPrompt(projectDir) {
|
|
9
|
-
const gitChanges = updateVersion(projectDir);
|
|
10
|
-
if (gitChanges) {
|
|
11
|
-
console.log('Git changes:\n' + gitChanges);
|
|
12
|
-
|
|
13
|
-
const answer = await syncReadIO('Warning: Git working directory not clean, do you want to update version continue? [yes/NO]\n');
|
|
14
|
-
if (answer?.toLowerCase() === 'yes') {
|
|
15
|
-
updateVersion(projectDir, true);
|
|
16
|
-
} else {
|
|
17
|
-
console.error("Error: User cancelled.")
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function buildAndInstallModules(moduleName, projectDir, sourceDir, distBinDir) {
|
|
24
|
-
console.info('\nBuilding ' + moduleName + '... ');
|
|
25
|
-
pkgPkgFile = path.resolve(sourceDir, 'package.json');
|
|
26
|
-
if (!fs.existsSync(pkgPkgFile)) {
|
|
27
|
-
console.error('Error: Failed to build ' + moduleName + ', "' + path.relative(projectDir, pkgPkgFile) + '" is not exists.');
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
cmdLine = 'cd ' + sourceDir + ' && npm install && npm run build';
|
|
32
|
-
console.info('Run [' + cmdLine + ']... ');
|
|
33
|
-
execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
|
|
34
|
-
|
|
35
|
-
cpSync(projectDir, path.resolve(sourceDir, 'dist'), distBinDir);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function main() {
|
|
39
|
-
const options = {};
|
|
40
|
-
options.projectDir = process.cwd();
|
|
41
|
-
options.domBinDir = path.resolve(options.projectDir, 'dom/bin');
|
|
42
|
-
options.widgetBinDir = path.resolve(options.projectDir, 'utils/JsViewEngineWidget/bin');
|
|
43
|
-
options.domSourceDir = path.resolve(options.projectDir, 'deps/jsview-dom');
|
|
44
|
-
options.widgetSourceDir = path.resolve(options.projectDir, 'deps/jsview-vue3-engine-widget');
|
|
45
|
-
|
|
46
|
-
const ret = await updateVersionWithPrompt(options.projectDir);
|
|
47
|
-
|
|
48
|
-
buildAndInstallModules('jsview-dom',
|
|
49
|
-
options.projectDir,
|
|
50
|
-
options.domSourceDir, options.domBinDir);
|
|
51
|
-
buildAndInstallModules('jsview-vue3-engine-widget',
|
|
52
|
-
options.projectDir,
|
|
53
|
-
options.widgetSourceDir, options.widgetBinDir);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
main();
|
package/scripts/make-js.sh
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
set -o errexit
|
|
4
|
-
set -o nounset
|
|
5
|
-
|
|
6
|
-
print_usage()
|
|
7
|
-
{
|
|
8
|
-
echo '
|
|
9
|
-
NAME
|
|
10
|
-
make-js
|
|
11
|
-
|
|
12
|
-
SYNOPSIS
|
|
13
|
-
make-js
|
|
14
|
-
|
|
15
|
-
DESCRIPTION
|
|
16
|
-
build sample_with_button APK. auto setup code revision
|
|
17
|
-
Example: ./make-js
|
|
18
|
-
|
|
19
|
-
OPTIONS
|
|
20
|
-
--certpath=Path(from folder react_js) of certification, such as src/appConfig = react_js/src/appConfig/
|
|
21
|
-
default value is src/appConfig
|
|
22
|
-
-h, --help
|
|
23
|
-
Optional. Print help infomation and exit successfully.;
|
|
24
|
-
';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
parse_options()
|
|
28
|
-
{
|
|
29
|
-
cmd_getopt="getopt";
|
|
30
|
-
if [ "$KERNEL_NAME" == "Darwin" ]; then
|
|
31
|
-
cmd_getopt="/usr/local/Cellar/gnu-getopt/2.37.2/bin/getopt";
|
|
32
|
-
fi
|
|
33
|
-
|
|
34
|
-
options=`$cmd_getopt -o h \
|
|
35
|
-
--long "certpath:,help" \
|
|
36
|
-
-n 'make-js' -- "$@"`;
|
|
37
|
-
eval set -- "$options"
|
|
38
|
-
while true; do
|
|
39
|
-
case "$1" in
|
|
40
|
-
(-h | --help)
|
|
41
|
-
print_usage;
|
|
42
|
-
exit 0;
|
|
43
|
-
;;
|
|
44
|
-
(--certpath)
|
|
45
|
-
CERT_PATH=$2;
|
|
46
|
-
shift 2;
|
|
47
|
-
;;
|
|
48
|
-
(- | --)
|
|
49
|
-
shift;
|
|
50
|
-
break;
|
|
51
|
-
;;
|
|
52
|
-
(*)
|
|
53
|
-
echo "Internal error!";
|
|
54
|
-
exit 1;
|
|
55
|
-
;;
|
|
56
|
-
esac
|
|
57
|
-
done
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
logdbg()
|
|
61
|
-
{
|
|
62
|
-
if [[ $DEBUG_VERBOSE == false ]]; then
|
|
63
|
-
return;
|
|
64
|
-
fi
|
|
65
|
-
|
|
66
|
-
echo -e " [d]: $@";
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
logtrace()
|
|
70
|
-
{
|
|
71
|
-
echo -e "\033[1;34m [-]: $@ \033[00m";
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
loginfo()
|
|
75
|
-
{
|
|
76
|
-
echo -e "\033[1;32m [+]: $@ \033[00m";
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
logwarn()
|
|
80
|
-
{
|
|
81
|
-
echo -e "\033[1;33m [!]: $@ \033[00m";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
logerr_and_exit()
|
|
85
|
-
{
|
|
86
|
-
echo -e "\033[1;31m [x]: $@ \033[00m";
|
|
87
|
-
exit 1;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
trim() {
|
|
91
|
-
local var="$*"
|
|
92
|
-
var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
|
|
93
|
-
var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
|
|
94
|
-
echo -n "$var"
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
print_version_log()
|
|
98
|
-
{
|
|
99
|
-
logtrace "*********************************************************";
|
|
100
|
-
logtrace " Version infomation";
|
|
101
|
-
logtrace " codeRevision : ${CODE_REVISION}";
|
|
102
|
-
logtrace "*********************************************************";
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
prepare_env()
|
|
106
|
-
{
|
|
107
|
-
CODE_REVISION="$(git rev-list --count HEAD)";
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
# common variable
|
|
111
|
-
SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd);
|
|
112
|
-
PROJECT_DIR=$(dirname "$SCRIPT_DIR");
|
|
113
|
-
PROJECT_DIR=$(dirname "$PROJECT_DIR");
|
|
114
|
-
KERNEL_NAME=$(uname -s);
|
|
115
|
-
DEBUG_VERBOSE=false;
|
|
116
|
-
CERT_PATH=src/appConfig
|
|
117
|
-
|
|
118
|
-
# specific variable
|
|
119
|
-
CODE_REVISION=0;
|
|
120
|
-
|
|
121
|
-
main_run()
|
|
122
|
-
{
|
|
123
|
-
loginfo "parsing options";
|
|
124
|
-
parse_options $@;
|
|
125
|
-
|
|
126
|
-
loginfo "prepare env";
|
|
127
|
-
prepare_env;
|
|
128
|
-
|
|
129
|
-
print_version_log;
|
|
130
|
-
|
|
131
|
-
# TODO: cd 到vue工程代码的根目录(有node_modules的那个目录)
|
|
132
|
-
# cd react_js;
|
|
133
|
-
|
|
134
|
-
# 更新环境状态
|
|
135
|
-
#if [ -f "package-lock.json-perfect" ]; then
|
|
136
|
-
#loginfo "USE package-lock.json-perfect"
|
|
137
|
-
#cp package-lock.json-perfect package-lock.json
|
|
138
|
-
#fi
|
|
139
|
-
npm ci
|
|
140
|
-
#cd jsview/
|
|
141
|
-
#node scripts/do-patch.js
|
|
142
|
-
#cd ../
|
|
143
|
-
|
|
144
|
-
loginfo "CERT_PATH=${CERT_PATH}"
|
|
145
|
-
|
|
146
|
-
# 替换App为DemoHomepage
|
|
147
|
-
SED_CMD='sed -i ';
|
|
148
|
-
if [ "$KERNEL_NAME" == "Darwin" ]; then
|
|
149
|
-
SED_CMD+=' ""';
|
|
150
|
-
fi
|
|
151
|
-
$SED_CMD 's|@/App.vue|jsview/samples/DemoHomepage/App.vue|' src/main.ts;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
# 生成crt和pem签名文件
|
|
155
|
-
cp ${CERT_PATH}/app_sign_private_key_sample.crt src/appConfig/app_sign_private_key.crt
|
|
156
|
-
cp ${CERT_PATH}/app_sign_public_key_sample.pem src/appConfig/app_sign_public_key.pem
|
|
157
|
-
|
|
158
|
-
# 编译JS
|
|
159
|
-
npm run-script build
|
|
160
|
-
|
|
161
|
-
# 输出主文件路径
|
|
162
|
-
local main_path=`find dist | grep "main\..*\.js$"`
|
|
163
|
-
echo "MAIN JS SUB_PATH: ${main_path}"
|
|
164
|
-
|
|
165
|
-
# 输出 Core 版本信息
|
|
166
|
-
local core_revision=`cat jsview/dom/target_core_revision.js | grep "CoreRevision"`
|
|
167
|
-
core_revision=${core_revision#*\"CoreRevision\":}; # 去掉开头
|
|
168
|
-
core_revision=${core_revision%,*}; # 去掉末尾的引号
|
|
169
|
-
echo "CORE REVISION: ${core_revision}"
|
|
170
|
-
|
|
171
|
-
# 输出 engineJs 信息
|
|
172
|
-
local engine_js=`cat jsview/dom/target_core_revision.js | grep "JsViewES6"`
|
|
173
|
-
engine_js=${engine_js#*\"}; # 去掉开头的引号
|
|
174
|
-
engine_js=${engine_js%\",*}; # 去掉末尾的引号
|
|
175
|
-
echo "ENGINE JS: ${engine_js}"
|
|
176
|
-
|
|
177
|
-
loginfo "DONE !!!";
|
|
178
|
-
loginfo "BUILD SUCCESSED";
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
main_run $@;
|