@dcloudio/uni-cli-shared 0.0.1-nvue3.3030820220125001

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 (236) hide show
  1. package/dist/checkUpdate.d.ts +30 -0
  2. package/dist/checkUpdate.js +243 -0
  3. package/dist/constants.d.ts +19 -0
  4. package/dist/constants.js +43 -0
  5. package/dist/deps.d.ts +19 -0
  6. package/dist/deps.js +39 -0
  7. package/dist/easycom.d.ts +29 -0
  8. package/dist/easycom.js +202 -0
  9. package/dist/env/define.d.ts +15 -0
  10. package/dist/env/define.js +45 -0
  11. package/dist/env/index.d.ts +2 -0
  12. package/dist/env/index.js +8 -0
  13. package/dist/env/provide.d.ts +9 -0
  14. package/dist/env/provide.js +24 -0
  15. package/dist/esbuild.d.ts +3 -0
  16. package/dist/esbuild.js +42 -0
  17. package/dist/exports.d.ts +1 -0
  18. package/dist/exports.js +8 -0
  19. package/dist/filter.d.ts +16 -0
  20. package/dist/filter.js +60 -0
  21. package/dist/fs.d.ts +1 -0
  22. package/dist/fs.js +25 -0
  23. package/dist/hbx/alias.d.ts +5 -0
  24. package/dist/hbx/alias.js +75 -0
  25. package/dist/hbx/env.d.ts +6 -0
  26. package/dist/hbx/env.js +44 -0
  27. package/dist/hbx/index.d.ts +3 -0
  28. package/dist/hbx/index.js +36 -0
  29. package/dist/hbx/log.d.ts +6 -0
  30. package/dist/hbx/log.js +99 -0
  31. package/dist/i18n.d.ts +10 -0
  32. package/dist/i18n.js +94 -0
  33. package/dist/index.d.ts +25 -0
  34. package/dist/index.js +40 -0
  35. package/dist/json/app/index.d.ts +3 -0
  36. package/dist/json/app/index.js +17 -0
  37. package/dist/json/app/manifest/arguments.d.ts +2 -0
  38. package/dist/json/app/manifest/arguments.js +36 -0
  39. package/dist/json/app/manifest/confusion.d.ts +4 -0
  40. package/dist/json/app/manifest/confusion.js +77 -0
  41. package/dist/json/app/manifest/defaultManifestJson.d.ts +1 -0
  42. package/dist/json/app/manifest/defaultManifestJson.js +41 -0
  43. package/dist/json/app/manifest/env.d.ts +3 -0
  44. package/dist/json/app/manifest/env.js +24 -0
  45. package/dist/json/app/manifest/i18n.d.ts +1 -0
  46. package/dist/json/app/manifest/i18n.js +14 -0
  47. package/dist/json/app/manifest/index.d.ts +4 -0
  48. package/dist/json/app/manifest/index.js +49 -0
  49. package/dist/json/app/manifest/launchwebview.d.ts +1 -0
  50. package/dist/json/app/manifest/launchwebview.js +32 -0
  51. package/dist/json/app/manifest/merge.d.ts +1 -0
  52. package/dist/json/app/manifest/merge.js +17 -0
  53. package/dist/json/app/manifest/nvue.d.ts +4 -0
  54. package/dist/json/app/manifest/nvue.js +43 -0
  55. package/dist/json/app/manifest/plus.d.ts +1 -0
  56. package/dist/json/app/manifest/plus.js +83 -0
  57. package/dist/json/app/manifest/safearea.d.ts +1 -0
  58. package/dist/json/app/manifest/safearea.js +28 -0
  59. package/dist/json/app/manifest/splashscreen.d.ts +5 -0
  60. package/dist/json/app/manifest/splashscreen.js +44 -0
  61. package/dist/json/app/manifest/statusbar.d.ts +1 -0
  62. package/dist/json/app/manifest/statusbar.js +14 -0
  63. package/dist/json/app/manifest/tabBar.d.ts +1 -0
  64. package/dist/json/app/manifest/tabBar.js +27 -0
  65. package/dist/json/app/manifest/uniApp.d.ts +1 -0
  66. package/dist/json/app/manifest/uniApp.js +19 -0
  67. package/dist/json/app/pages/code.d.ts +3 -0
  68. package/dist/json/app/pages/code.js +44 -0
  69. package/dist/json/app/pages/definePage.d.ts +2 -0
  70. package/dist/json/app/pages/definePage.js +42 -0
  71. package/dist/json/app/pages/index.d.ts +3 -0
  72. package/dist/json/app/pages/index.js +28 -0
  73. package/dist/json/app/pages/uniConfig.d.ts +1 -0
  74. package/dist/json/app/pages/uniConfig.js +69 -0
  75. package/dist/json/app/pages/uniRoutes.d.ts +1 -0
  76. package/dist/json/app/pages/uniRoutes.js +8 -0
  77. package/dist/json/index.d.ts +5 -0
  78. package/dist/json/index.js +17 -0
  79. package/dist/json/json.d.ts +1 -0
  80. package/dist/json/json.js +9 -0
  81. package/dist/json/manifest.d.ts +28 -0
  82. package/dist/json/manifest.js +64 -0
  83. package/dist/json/mp/index.d.ts +4 -0
  84. package/dist/json/mp/index.js +19 -0
  85. package/dist/json/mp/jsonFile.d.ts +23 -0
  86. package/dist/json/mp/jsonFile.js +127 -0
  87. package/dist/json/mp/pages.d.ts +17 -0
  88. package/dist/json/mp/pages.js +126 -0
  89. package/dist/json/mp/project.d.ts +14 -0
  90. package/dist/json/mp/project.js +81 -0
  91. package/dist/json/mp/types.d.ts +118 -0
  92. package/dist/json/mp/types.js +2 -0
  93. package/dist/json/mp/utils.d.ts +3 -0
  94. package/dist/json/mp/utils.js +66 -0
  95. package/dist/json/pages.d.ts +30 -0
  96. package/dist/json/pages.js +383 -0
  97. package/dist/logs/console.d.ts +4 -0
  98. package/dist/logs/console.js +49 -0
  99. package/dist/logs/format.d.ts +11 -0
  100. package/dist/logs/format.js +82 -0
  101. package/dist/logs/index.d.ts +1 -0
  102. package/dist/logs/index.js +7 -0
  103. package/dist/messages/index.d.ts +20 -0
  104. package/dist/messages/index.js +23 -0
  105. package/dist/mp/ast.d.ts +4 -0
  106. package/dist/mp/ast.js +12 -0
  107. package/dist/mp/constants.d.ts +5 -0
  108. package/dist/mp/constants.js +8 -0
  109. package/dist/mp/event.d.ts +5 -0
  110. package/dist/mp/event.js +35 -0
  111. package/dist/mp/externalClasses.d.ts +5 -0
  112. package/dist/mp/externalClasses.js +42 -0
  113. package/dist/mp/imports.d.ts +12 -0
  114. package/dist/mp/imports.js +72 -0
  115. package/dist/mp/index.d.ts +11 -0
  116. package/dist/mp/index.js +38 -0
  117. package/dist/mp/nvue.d.ts +1 -0
  118. package/dist/mp/nvue.js +18 -0
  119. package/dist/mp/plugin.d.ts +2 -0
  120. package/dist/mp/plugin.js +13 -0
  121. package/dist/mp/style.d.ts +1 -0
  122. package/dist/mp/style.js +9 -0
  123. package/dist/mp/tags.d.ts +1 -0
  124. package/dist/mp/tags.js +117 -0
  125. package/dist/mp/template.d.ts +73 -0
  126. package/dist/mp/template.js +73 -0
  127. package/dist/mp/usingComponents.d.ts +65 -0
  128. package/dist/mp/usingComponents.js +402 -0
  129. package/dist/mp/wxs.d.ts +2 -0
  130. package/dist/mp/wxs.js +55 -0
  131. package/dist/platform.d.ts +2 -0
  132. package/dist/platform.js +31 -0
  133. package/dist/postcss/index.d.ts +10 -0
  134. package/dist/postcss/index.js +19 -0
  135. package/dist/postcss/plugins/stylePluginScoped.d.ts +3 -0
  136. package/dist/postcss/plugins/stylePluginScoped.js +176 -0
  137. package/dist/postcss/plugins/uniapp.d.ts +11 -0
  138. package/dist/postcss/plugins/uniapp.js +110 -0
  139. package/dist/preprocess/context.d.ts +3 -0
  140. package/dist/preprocess/context.js +81 -0
  141. package/dist/preprocess/index.d.ts +9 -0
  142. package/dist/preprocess/index.js +28 -0
  143. package/dist/resolve.d.ts +6 -0
  144. package/dist/resolve.js +102 -0
  145. package/dist/scripts.d.ts +10 -0
  146. package/dist/scripts.js +44 -0
  147. package/dist/ssr.d.ts +4 -0
  148. package/dist/ssr.js +20 -0
  149. package/dist/url.d.ts +2 -0
  150. package/dist/url.js +15 -0
  151. package/dist/utils.d.ts +13 -0
  152. package/dist/utils.js +80 -0
  153. package/dist/vite/features.d.ts +41 -0
  154. package/dist/vite/features.js +191 -0
  155. package/dist/vite/index.d.ts +36 -0
  156. package/dist/vite/index.js +17 -0
  157. package/dist/vite/plugins/console.d.ts +8 -0
  158. package/dist/vite/plugins/console.js +42 -0
  159. package/dist/vite/plugins/copy.d.ts +11 -0
  160. package/dist/vite/plugins/copy.js +51 -0
  161. package/dist/vite/plugins/cssScoped.d.ts +6 -0
  162. package/dist/vite/plugins/cssScoped.js +54 -0
  163. package/dist/vite/plugins/dynamicImportPolyfill.d.ts +2 -0
  164. package/dist/vite/plugins/dynamicImportPolyfill.js +15 -0
  165. package/dist/vite/plugins/index.d.ts +10 -0
  166. package/dist/vite/plugins/index.js +32 -0
  167. package/dist/vite/plugins/inject.d.ts +12 -0
  168. package/dist/vite/plugins/inject.js +207 -0
  169. package/dist/vite/plugins/jsonJs.d.ts +3 -0
  170. package/dist/vite/plugins/jsonJs.js +52 -0
  171. package/dist/vite/plugins/mainJs.d.ts +2 -0
  172. package/dist/vite/plugins/mainJs.js +29 -0
  173. package/dist/vite/plugins/vitejs/config.d.ts +1 -0
  174. package/dist/vite/plugins/vitejs/config.js +2 -0
  175. package/dist/vite/plugins/vitejs/constants.d.ts +8 -0
  176. package/dist/vite/plugins/vitejs/constants.js +11 -0
  177. package/dist/vite/plugins/vitejs/index.d.ts +1 -0
  178. package/dist/vite/plugins/vitejs/index.js +2 -0
  179. package/dist/vite/plugins/vitejs/plugin.d.ts +1 -0
  180. package/dist/vite/plugins/vitejs/plugin.js +2 -0
  181. package/dist/vite/plugins/vitejs/plugins/asset.d.ts +40 -0
  182. package/dist/vite/plugins/vitejs/plugins/asset.js +270 -0
  183. package/dist/vite/plugins/vitejs/plugins/css.d.ts +48 -0
  184. package/dist/vite/plugins/vitejs/plugins/css.js +760 -0
  185. package/dist/vite/plugins/vitejs/server/moduleGraph.d.ts +1 -0
  186. package/dist/vite/plugins/vitejs/server/moduleGraph.js +2 -0
  187. package/dist/vite/plugins/vitejs/utils.d.ts +29 -0
  188. package/dist/vite/plugins/vitejs/utils.js +129 -0
  189. package/dist/vite/utils/ast.d.ts +17 -0
  190. package/dist/vite/utils/ast.js +85 -0
  191. package/dist/vite/utils/index.d.ts +7 -0
  192. package/dist/vite/utils/index.js +23 -0
  193. package/dist/vite/utils/plugin.d.ts +11 -0
  194. package/dist/vite/utils/plugin.js +45 -0
  195. package/dist/vite/utils/url.d.ts +28 -0
  196. package/dist/vite/utils/url.js +69 -0
  197. package/dist/vite/utils/utils.d.ts +3 -0
  198. package/dist/vite/utils/utils.js +14 -0
  199. package/dist/vue/babel.d.ts +3 -0
  200. package/dist/vue/babel.js +17 -0
  201. package/dist/vue/index.d.ts +4 -0
  202. package/dist/vue/index.js +19 -0
  203. package/dist/vue/transforms/index.d.ts +13 -0
  204. package/dist/vue/transforms/index.js +48 -0
  205. package/dist/vue/transforms/templateTransformAssetUrl.d.ts +33 -0
  206. package/dist/vue/transforms/templateTransformAssetUrl.js +150 -0
  207. package/dist/vue/transforms/templateTransformSrcset.d.ts +4 -0
  208. package/dist/vue/transforms/templateTransformSrcset.js +122 -0
  209. package/dist/vue/transforms/templateUtils.d.ts +9 -0
  210. package/dist/vue/transforms/templateUtils.js +41 -0
  211. package/dist/vue/transforms/transformComponent.d.ts +3 -0
  212. package/dist/vue/transforms/transformComponent.js +26 -0
  213. package/dist/vue/transforms/transformEvent.d.ts +2 -0
  214. package/dist/vue/transforms/transformEvent.js +28 -0
  215. package/dist/vue/transforms/transformPageHead.d.ts +2 -0
  216. package/dist/vue/transforms/transformPageHead.js +11 -0
  217. package/dist/vue/transforms/transformRef.d.ts +2 -0
  218. package/dist/vue/transforms/transformRef.js +32 -0
  219. package/dist/vue/transforms/transformTag.d.ts +2 -0
  220. package/dist/vue/transforms/transformTag.js +18 -0
  221. package/dist/vue/transforms/vModel.d.ts +12 -0
  222. package/dist/vue/transforms/vModel.js +33 -0
  223. package/dist/vue/transforms/vOn.d.ts +15 -0
  224. package/dist/vue/transforms/vOn.js +88 -0
  225. package/dist/vue/utils.d.ts +31 -0
  226. package/dist/vue/utils.js +120 -0
  227. package/dist/watcher.d.ts +30 -0
  228. package/dist/watcher.js +92 -0
  229. package/lib/crypto.js +65 -0
  230. package/lib/nvue.css +34 -0
  231. package/lib/preprocess/LICENSE +13 -0
  232. package/lib/preprocess/README.md +410 -0
  233. package/lib/preprocess/lib/preprocess.js +437 -0
  234. package/lib/preprocess/lib/regexrules.js +121 -0
  235. package/lib/preprocess/package.json +68 -0
  236. package/package.json +68 -0
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renameProp = exports.getBaseNodeTransforms = exports.createUniVueTransformAssetUrls = exports.createBindDirectiveNode = exports.createOnDirectiveNode = exports.createDirectiveNode = exports.addStaticClass = exports.createAttributeNode = exports.isUserComponent = exports.isVueSfcFile = exports.VUE_REF_IN_FOR = exports.VUE_REF = void 0;
4
+ const shared_1 = require("@vue/shared");
5
+ const uni_shared_1 = require("@dcloudio/uni-shared");
6
+ const compiler_core_1 = require("@vue/compiler-core");
7
+ const templateTransformAssetUrl_1 = require("./transforms/templateTransformAssetUrl");
8
+ const templateTransformSrcset_1 = require("./transforms/templateTransformSrcset");
9
+ const ast_1 = require("../vite/utils/ast");
10
+ const url_1 = require("../vite/utils/url");
11
+ const constants_1 = require("../constants");
12
+ exports.VUE_REF = 'r';
13
+ exports.VUE_REF_IN_FOR = 'r-i-f';
14
+ function isVueSfcFile(id) {
15
+ const { filename, query } = (0, url_1.parseVueRequest)(id);
16
+ return constants_1.EXTNAME_VUE_RE.test(filename) && !query.vue;
17
+ }
18
+ exports.isVueSfcFile = isVueSfcFile;
19
+ function isUserComponent(node, context) {
20
+ return (node.type === 1 /* ELEMENT */ &&
21
+ node.tagType === 1 /* COMPONENT */ &&
22
+ !(0, uni_shared_1.isComponentTag)(node.tag) &&
23
+ !(0, compiler_core_1.isCoreComponent)(node.tag) &&
24
+ !context.isBuiltInComponent(node.tag));
25
+ }
26
+ exports.isUserComponent = isUserComponent;
27
+ function createAttributeNode(name, content) {
28
+ return {
29
+ type: 6 /* ATTRIBUTE */,
30
+ loc: compiler_core_1.locStub,
31
+ name,
32
+ value: {
33
+ type: 2 /* TEXT */,
34
+ loc: compiler_core_1.locStub,
35
+ content,
36
+ },
37
+ };
38
+ }
39
+ exports.createAttributeNode = createAttributeNode;
40
+ function createClassAttribute(clazz) {
41
+ return createAttributeNode('class', clazz);
42
+ }
43
+ function addStaticClass(node, clazz) {
44
+ const classProp = node.props.find((prop) => prop.type === 6 /* ATTRIBUTE */ && prop.name === 'class');
45
+ if (!classProp) {
46
+ return node.props.unshift(createClassAttribute(clazz));
47
+ }
48
+ if (classProp.value) {
49
+ return (classProp.value.content = classProp.value.content + ' ' + clazz);
50
+ }
51
+ classProp.value = {
52
+ type: 2 /* TEXT */,
53
+ loc: compiler_core_1.locStub,
54
+ content: clazz,
55
+ };
56
+ }
57
+ exports.addStaticClass = addStaticClass;
58
+ function createDirectiveNode(name, arg, exp) {
59
+ return {
60
+ type: 7 /* DIRECTIVE */,
61
+ name,
62
+ modifiers: [],
63
+ loc: compiler_core_1.locStub,
64
+ arg: (0, compiler_core_1.createSimpleExpression)(arg, true),
65
+ exp: (0, shared_1.isString)(exp) ? (0, compiler_core_1.createSimpleExpression)(exp, false) : exp,
66
+ };
67
+ }
68
+ exports.createDirectiveNode = createDirectiveNode;
69
+ function createOnDirectiveNode(name, value) {
70
+ return createDirectiveNode('on', name, value);
71
+ }
72
+ exports.createOnDirectiveNode = createOnDirectiveNode;
73
+ function createBindDirectiveNode(name, value) {
74
+ return createDirectiveNode('bind', name, value);
75
+ }
76
+ exports.createBindDirectiveNode = createBindDirectiveNode;
77
+ function createUniVueTransformAssetUrls(base) {
78
+ return {
79
+ base,
80
+ includeAbsolute: true,
81
+ tags: {
82
+ audio: ['src'],
83
+ video: ['src', 'poster'],
84
+ img: ['src'],
85
+ image: ['src'],
86
+ 'cover-image': ['src'],
87
+ // h5
88
+ 'v-uni-audio': ['src'],
89
+ 'v-uni-video': ['src', 'poster'],
90
+ 'v-uni-image': ['src'],
91
+ 'v-uni-cover-image': ['src'],
92
+ // nvue
93
+ 'u-image': ['src'],
94
+ 'u-video': ['src', 'poster'],
95
+ },
96
+ };
97
+ }
98
+ exports.createUniVueTransformAssetUrls = createUniVueTransformAssetUrls;
99
+ function getBaseNodeTransforms(base) {
100
+ const transformAssetUrls = createUniVueTransformAssetUrls(base);
101
+ return [
102
+ (0, templateTransformAssetUrl_1.createAssetUrlTransformWithOptions)(transformAssetUrls),
103
+ (0, templateTransformSrcset_1.createSrcsetTransformWithOptions)(transformAssetUrls),
104
+ ];
105
+ }
106
+ exports.getBaseNodeTransforms = getBaseNodeTransforms;
107
+ function renameProp(name, prop) {
108
+ if (!prop) {
109
+ return;
110
+ }
111
+ if ((0, ast_1.isDirectiveNode)(prop)) {
112
+ if (prop.arg && (0, compiler_core_1.isStaticExp)(prop.arg)) {
113
+ prop.arg.content = name;
114
+ }
115
+ }
116
+ else {
117
+ prop.name = name;
118
+ }
119
+ }
120
+ exports.renameProp = renameProp;
@@ -0,0 +1,30 @@
1
+ /// <reference types="node" />
2
+ import { FSWatcher, WatchOptions } from 'chokidar';
3
+ declare type FileTransform = (source: Buffer, filename: string) => void | string;
4
+ export interface FileWatcherOptions {
5
+ src: string | string[];
6
+ dest: string;
7
+ transform?: FileTransform;
8
+ verbose?: boolean;
9
+ }
10
+ export declare class FileWatcher {
11
+ private src;
12
+ private dest;
13
+ private transform?;
14
+ private verbose?;
15
+ private watcher;
16
+ private onChange?;
17
+ constructor({ src, dest, transform, verbose }: FileWatcherOptions);
18
+ watch(watchOptions: WatchOptions & {
19
+ cwd: string;
20
+ }, onReady?: (watcher: FSWatcher) => void, onChange?: () => void): FSWatcher;
21
+ add(paths: string | ReadonlyArray<string>): void;
22
+ unwatch(paths: string | ReadonlyArray<string>): void;
23
+ close(): Promise<void>;
24
+ copy(from: string): Promise<void | undefined>;
25
+ remove(from: string): Promise<void | undefined>;
26
+ info(type: 'close' | 'copy' | 'remove' | 'add' | 'unwatch', msg?: string | unknown): void;
27
+ from(from: string): string;
28
+ to(from: string): string;
29
+ }
30
+ export {};
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FileWatcher = void 0;
7
+ const fs_extra_1 = __importDefault(require("fs-extra"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const chokidar_1 = require("chokidar");
10
+ class FileWatcher {
11
+ constructor({ src, dest, transform, verbose }) {
12
+ this.src = !Array.isArray(src) ? [src] : src;
13
+ this.dest = dest;
14
+ this.transform = transform;
15
+ this.verbose = verbose;
16
+ }
17
+ watch(watchOptions, onReady, onChange) {
18
+ if (!this.watcher) {
19
+ const copy = this.copy.bind(this);
20
+ const remove = this.remove.bind(this);
21
+ this.watcher = (0, chokidar_1.watch)(this.src, watchOptions)
22
+ .on('add', copy)
23
+ .on('addDir', copy)
24
+ .on('change', copy)
25
+ .on('unlink', remove)
26
+ .on('unlinkDir', remove)
27
+ .on('ready', () => {
28
+ onReady && onReady(this.watcher);
29
+ setTimeout(() => {
30
+ this.onChange = onChange;
31
+ }, 1000);
32
+ })
33
+ .on('error', (e) => console.error('watch', e));
34
+ }
35
+ return this.watcher;
36
+ }
37
+ add(paths) {
38
+ this.info('add', paths);
39
+ return this.watcher.add(paths);
40
+ }
41
+ unwatch(paths) {
42
+ this.info('unwatch', paths);
43
+ return this.watcher.unwatch(paths);
44
+ }
45
+ close() {
46
+ this.info('close');
47
+ return this.watcher.close();
48
+ }
49
+ copy(from) {
50
+ const to = this.to(from);
51
+ this.info('copy', from + '=>' + to);
52
+ let content;
53
+ if (this.transform) {
54
+ const filename = this.from(from);
55
+ content = this.transform(fs_extra_1.default.readFileSync(filename), filename);
56
+ }
57
+ if (content) {
58
+ return fs_extra_1.default
59
+ .outputFile(to, content)
60
+ .catch(() => {
61
+ // this.info('copy', e)
62
+ })
63
+ .then(() => this.onChange && this.onChange());
64
+ }
65
+ return fs_extra_1.default
66
+ .copy(this.from(from), to, { overwrite: true })
67
+ .catch(() => {
68
+ // this.info('copy', e)
69
+ })
70
+ .then(() => this.onChange && this.onChange());
71
+ }
72
+ remove(from) {
73
+ const to = this.to(from);
74
+ this.info('remove', from + '=>' + to);
75
+ return fs_extra_1.default
76
+ .remove(to)
77
+ .catch(() => {
78
+ // this.info('remove', e)
79
+ })
80
+ .then(() => this.onChange && this.onChange());
81
+ }
82
+ info(type, msg) {
83
+ this.verbose && console.log(type, msg);
84
+ }
85
+ from(from) {
86
+ return path_1.default.join(this.watcher.options.cwd, from);
87
+ }
88
+ to(from) {
89
+ return path_1.default.join(this.dest, from);
90
+ }
91
+ }
92
+ exports.FileWatcher = FileWatcher;
package/lib/crypto.js ADDED
@@ -0,0 +1,65 @@
1
+ var lookup = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 62, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
3
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
4
+ 21, 22, 23, 24, 25, 0, 0, 0, 0, 63, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
5
+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
6
+ ]
7
+
8
+ function base64Decode (source, target) {
9
+ var sourceLength = source.length
10
+ var paddingLength = (source[sourceLength - 2] === '=' ? 2 : (source[sourceLength - 1] === '=' ? 1
11
+ : 0))
12
+
13
+ var tmp
14
+ var byteIndex = 0
15
+ var baseLength = (sourceLength - paddingLength) & 0xfffffffc
16
+
17
+ for (var i = 0; i < baseLength; i += 4) {
18
+ tmp = (lookup[source.charCodeAt(i)] << 18) |
19
+ (lookup[source.charCodeAt(i + 1)] << 12) |
20
+ (lookup[source.charCodeAt(i + 2)] << 6) |
21
+ (lookup[source.charCodeAt(i + 3)])
22
+
23
+ target[byteIndex++] = (tmp >> 16) & 0xFF
24
+ target[byteIndex++] = (tmp >> 8) & 0xFF
25
+ target[byteIndex++] = (tmp) & 0xFF
26
+ }
27
+
28
+ if (paddingLength === 1) {
29
+ tmp = (lookup[source.charCodeAt(i)] << 10) |
30
+ (lookup[source.charCodeAt(i + 1)] << 4) |
31
+ (lookup[source.charCodeAt(i + 2)] >> 2)
32
+
33
+ target[byteIndex++] = (tmp >> 8) & 0xFF
34
+ target[byteIndex++] = tmp & 0xFF
35
+ }
36
+
37
+ if (paddingLength === 2) {
38
+ tmp = (lookup[source.charCodeAt(i)] << 2) | (lookup[source.charCodeAt(i + 1)] >> 4)
39
+
40
+ target[byteIndex++] = tmp & 0xFF
41
+ }
42
+ }
43
+
44
+ export default {
45
+ getRandomValues (arr) {
46
+ if (!(
47
+ arr instanceof Int8Array ||
48
+ arr instanceof Uint8Array ||
49
+ arr instanceof Int16Array ||
50
+ arr instanceof Uint16Array ||
51
+ arr instanceof Int32Array ||
52
+ arr instanceof Uint32Array ||
53
+ arr instanceof Uint8ClampedArray
54
+ )) {
55
+ throw new Error('Expected an integer array')
56
+ }
57
+ if (arr.byteLength > 65536) {
58
+ throw new Error('Can only request a maximum of 65536 bytes')
59
+ }
60
+ var crypto = uni.requireNativePlugin('DCloud-Crypto')
61
+ base64Decode(crypto.getRandomValues(arr.byteLength), new Uint8Array(arr.buffer, arr.byteOffset,
62
+ arr.byteLength))
63
+ return arr
64
+ }
65
+ }
package/lib/nvue.css ADDED
@@ -0,0 +1,34 @@
1
+ label,
2
+ scroll-view,
3
+ swiper-item,
4
+ view {
5
+ display: flex;
6
+ flex-direction: column;
7
+ flex-shrink: 0;
8
+ flex-grow: 0;
9
+ flex-basis: auto;
10
+ align-items: stretch;
11
+ align-content: flex-start;
12
+ }
13
+
14
+ image,
15
+ input,
16
+ scroll-view,
17
+ swiper,
18
+ swiper-item,
19
+ text,
20
+ textarea,
21
+ video,
22
+ view {
23
+ position: relative;
24
+ border: 0 solid #000;
25
+ box-sizing: border-box;
26
+ }
27
+
28
+ swiper-item {
29
+ position: absolute;
30
+ }
31
+
32
+ button {
33
+ margin: 0;
34
+ }
@@ -0,0 +1,13 @@
1
+ Copyright 2012 OneHealth Solutions, Inc
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.