@shijiu/jsview-vue 0.9.247 → 0.9.261

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.
@@ -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,19 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { execSync } = require('child_process');
4
-
5
- function main() {
6
- console.log(process.argv)
7
-
8
- const options = {};
9
- options.projectDir = process.cwd();
10
-
11
- let cmdLine = 'cd ' + options.projectDir + '&& node ./scripts/deploy-prepare.js';
12
- console.info('Run [' + cmdLine + ']... ');
13
- execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
14
-
15
- cmdLine = 'cd ' + options.projectDir + '&& npm pack';
16
- console.info('Run [' + cmdLine + ']... ');
17
- execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
18
- }
19
- main();
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { execSync } = require('child_process');
4
-
5
- function main() {
6
- console.log(process.argv)
7
-
8
- const options = {};
9
- options.projectDir = process.cwd();
10
-
11
- let cmdLine = 'cd ' + options.projectDir + '&& node ./scripts/deploy-prepare.js';
12
- console.info('Run [' + cmdLine + ']... ');
13
- execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
14
-
15
- cmdLine = 'cd ' + options.projectDir + '&& npm publish --access=public --registry https://registry.npmjs.com';
16
- console.info('Run [' + cmdLine + ']... ');
17
- execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
18
- }
19
- 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,75 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const readline = require('readline')
6
- const { execSync } = require('child_process');
7
- const { cpSync, updateVersion } = require('./common');
8
-
9
- async function updateVersionWithPrompt() {
10
- const options = {};
11
- options.projectDir = process.cwd();
12
-
13
- const gitChanges = updateVersion(options.projectDir);
14
- if (gitChanges) {
15
- console.log('Git changes:\n' + gitChanges);
16
-
17
- const input = readline.createInterface({
18
- input: process.stdin,
19
- output: process.stdout
20
- });
21
- input.on('SIGINT', function () {
22
- console.error("Error: User cancelled.")
23
- process.exit(1);
24
- });
25
-
26
- input.question('Warning: Git working directory not clean, do you want to update version continue? [yes/NO]\n',
27
- answer => {
28
- input.close();
29
- if (answer.toLowerCase() === 'yes') {
30
- updateVersion(options.projectDir, true);
31
- } else {
32
- console.error("Error: User cancelled.")
33
- process.exit(1);
34
- }
35
- });
36
- for await (const line of input) {
37
- return 0;
38
- }
39
- }
40
- }
41
-
42
- function buildAndInstallModules(moduleName, projectDir, sourceDir, distBinDir) {
43
- console.info('\nBuilding ' + moduleName + '... ');
44
- pkgPkgFile = path.resolve(sourceDir, 'package.json');
45
- if (!fs.existsSync(pkgPkgFile)) {
46
- console.error('Error: Failed to build ' + moduleName + ', "' + path.relative(options.projectDir, pkgPkgFile) + '" is not exists.');
47
- process.exit(1);
48
- }
49
-
50
- cmdLine = 'cd ' + sourceDir + ' && npm install && npm run build';
51
- console.info('Run [' + cmdLine + ']... ');
52
- execSync(cmdLine, { stdio: 'inherit', stderr: 'inherit' });
53
-
54
- cpSync(projectDir, path.resolve(sourceDir, 'dist'), distBinDir);
55
- }
56
-
57
- async function main() {
58
- const options = {};
59
- options.projectDir = process.cwd();
60
- options.domBinDir = path.resolve(options.projectDir, 'dom/bin');
61
- options.widgetBinDir = path.resolve(options.projectDir, 'utils/JsViewEngineWidget/bin');
62
- options.domSourceDir = path.resolve(options.projectDir, 'deps/jsview-dom');
63
- options.widgetSourceDir = path.resolve(options.projectDir, 'deps/jsview-vue3-engine-widget');
64
-
65
- const ret = await updateVersionWithPrompt();
66
-
67
- buildAndInstallModules('jsview-dom',
68
- options.projectDir,
69
- options.domSourceDir, options.domBinDir);
70
- buildAndInstallModules('jsview-vue3-engine-widget',
71
- options.projectDir,
72
- options.widgetSourceDir, options.widgetBinDir);
73
- }
74
-
75
- main();
@@ -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 $@;
package/vetur.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- projects: [
3
- './test',
4
- ]
5
- }