@e-mc/document 0.2.0 → 0.3.1
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/package.json +4 -4
- package/parse/dom.d.ts +1 -1
- package/parse/index.d.ts +1 -1
- package/parse/{document.d.ts → types/index.d.ts} +7 -3
- package/android/document.d.ts +0 -66
- package/android/extensions/app/manifest/index.js +0 -186
- package/android/extensions/gradle/dependencies/index.js +0 -212
- package/android/extensions/gradle/settings/index.js +0 -82
- package/android/extensions/task/index.js +0 -110
- package/android/index.d.ts +0 -7
- package/android/index.js +0 -217
- package/android/template/AndroidManifest.xml +0 -23
- package/android/template/java/build.gradle +0 -39
- package/android/template/java/settings.gradle +0 -18
- package/android/template/java+kotlin/build.gradle +0 -44
- package/android/template/java+kotlin/settings.gradle +0 -18
- package/android/template/kotlin/build.gradle.kts +0 -46
- package/android/template/kotlin/settings.gradle.kts +0 -18
- package/chrome/document.d.ts +0 -119
- package/chrome/index.d.ts +0 -7
- package/chrome/index.js +0 -3545
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const path = require("path");
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const child_process = require("child_process");
|
|
6
|
-
const types_1 = require("../../../../types");
|
|
7
|
-
const module_1 = require("../../../../module");
|
|
8
|
-
async function finalize(instance) {
|
|
9
|
-
const commands = instance.config.commands;
|
|
10
|
-
if (!commands || this.archiving) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
let taskArgs;
|
|
14
|
-
if (typeof commands === 'string') {
|
|
15
|
-
taskArgs = [[commands]];
|
|
16
|
-
}
|
|
17
|
-
else if ((0, types_1.isArray)(commands)) {
|
|
18
|
-
if (commands.every(value => typeof value === 'string')) {
|
|
19
|
-
taskArgs = [commands];
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
taskArgs = commands.map(value => typeof value === 'string' ? [value] : value);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
let { broadcastId, baseDirectory } = this, command = instance.settings.extensions?.task?.command, title, name, foundCwd;
|
|
29
|
-
if (command) {
|
|
30
|
-
if (command.indexOf('mvn') !== -1) {
|
|
31
|
-
title = 'maven';
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
title = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)?.[1] || 'SPAWN';
|
|
35
|
-
}
|
|
36
|
-
command = path.normalize(command);
|
|
37
|
-
if (!command.includes(path.sep)) {
|
|
38
|
-
name = command;
|
|
39
|
-
}
|
|
40
|
-
command = module_1.default.sanitizeCmd(command);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
name = 'gradlew';
|
|
44
|
-
command = '.' + path.sep + name;
|
|
45
|
-
title = 'gradle';
|
|
46
|
-
}
|
|
47
|
-
if (name) {
|
|
48
|
-
try {
|
|
49
|
-
let appDir = baseDirectory;
|
|
50
|
-
while (!(foundCwd = fs.existsSync(path.join(appDir, name)))) {
|
|
51
|
-
const parent = path.dirname(appDir);
|
|
52
|
-
if (parent === appDir) {
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
appDir = parent;
|
|
56
|
-
}
|
|
57
|
-
if (foundCwd) {
|
|
58
|
-
baseDirectory = appDir;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
catch {
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
for (const args of taskArgs) {
|
|
65
|
-
if (instance.aborted) {
|
|
66
|
-
return Promise.reject((0, types_1.createAbortError)());
|
|
67
|
-
}
|
|
68
|
-
const startTime = process.hrtime();
|
|
69
|
-
const task = args.join(' ');
|
|
70
|
-
await new Promise((resolve, reject) => {
|
|
71
|
-
this.formatMessage(4 /* LOG_TYPE.PROCESS */, title, ['Executing task...', task], baseDirectory);
|
|
72
|
-
let out = '', message = '';
|
|
73
|
-
const { stdout, stderr } = child_process.spawn(command, module_1.default.sanitizeArgs(args), { cwd: baseDirectory, shell: true, stdio: module_1.default.hasLogType(32768 /* LOG_TYPE.STDOUT */) && !broadcastId ? 'inherit' : undefined, signal: instance.signal })
|
|
74
|
-
.on('exit', code => {
|
|
75
|
-
if (!code) {
|
|
76
|
-
instance.addLog(types_1.STATUS_TYPE.INFO, out);
|
|
77
|
-
this.writeTimeProcess(title, 'Success -> ' + task, startTime);
|
|
78
|
-
resolve();
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
reject((0, types_1.errorValue)(message || (!foundCwd && code === 1 ? "Unable to execute file" /* ERR_MESSAGE.EXECUTE_FILE */ : "Unknown" /* ERR_MESSAGE.UNKNOWN */), "Error code" /* ERR_MESSAGE.ERROR_CODE */ + ': ' + code));
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
.on('error', err => reject(err));
|
|
85
|
-
if (stdout) {
|
|
86
|
-
stdout.setEncoding('utf-8').on('data', (value) => {
|
|
87
|
-
if (broadcastId) {
|
|
88
|
-
this.formatMessage(types_1.STATUS_TYPE.INFO, '', value, null, { sessionId: '' });
|
|
89
|
-
}
|
|
90
|
-
out += value;
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
if (stderr) {
|
|
94
|
-
stderr.setEncoding('utf-8').on('data', (value) => {
|
|
95
|
-
if (broadcastId) {
|
|
96
|
-
this.formatMessage(types_1.STATUS_TYPE.ERROR, '', value, null, { sessionId: '' });
|
|
97
|
-
}
|
|
98
|
-
message += value;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
.catch(err => instance.writeFail(["Unable to perform task" /* ERR_MESSAGE.PERFORM_TASK */, command + ' ' + task], err, { type: 4 /* LOG_TYPE.PROCESS */, startTime }));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
exports.default = finalize;
|
|
106
|
-
|
|
107
|
-
if (exports.default) {
|
|
108
|
-
module.exports = exports.default;
|
|
109
|
-
module.exports.default = exports.default;
|
|
110
|
-
}
|
package/android/index.d.ts
DELETED
package/android/index.js
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const types_1 = require("../../types");
|
|
6
|
-
const index_1 = require("../index");
|
|
7
|
-
class AndroidDocument extends index_1.default {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.config = {
|
|
11
|
-
mainParentDir: 'app',
|
|
12
|
-
mainSrcDir: 'src/main',
|
|
13
|
-
mainActivityFile: '',
|
|
14
|
-
javaVersion: 0,
|
|
15
|
-
dataBinding: false,
|
|
16
|
-
projectName: undefined,
|
|
17
|
-
versionName: undefined,
|
|
18
|
-
versionCode: 0,
|
|
19
|
-
manifest: undefined,
|
|
20
|
-
namespace: undefined,
|
|
21
|
-
profileable: undefined,
|
|
22
|
-
dependencies: undefined,
|
|
23
|
-
commands: undefined
|
|
24
|
-
};
|
|
25
|
-
this.elements = [];
|
|
26
|
-
this.extensionData = {};
|
|
27
|
-
this._moduleName = 'android';
|
|
28
|
-
this._threadable = true;
|
|
29
|
-
}
|
|
30
|
-
static async finalize(instance) {
|
|
31
|
-
if (instance.aborted) {
|
|
32
|
-
return Promise.reject((0, types_1.createAbortError)());
|
|
33
|
-
}
|
|
34
|
-
if (instance.extensions.length) {
|
|
35
|
-
const config = instance.config;
|
|
36
|
-
const mainActivityFile = config.mainActivityFile;
|
|
37
|
-
if (mainActivityFile && !path.isAbsolute(mainActivityFile)) {
|
|
38
|
-
let pathname = /[\\/]/.test(mainActivityFile) && path.join(this.baseDirectory, mainActivityFile);
|
|
39
|
-
if (pathname && index_1.default.isPath(pathname)) {
|
|
40
|
-
config.mainActivityFile = pathname;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
const directories = [this.baseDirectory, config.mainParentDir, config.mainSrcDir];
|
|
44
|
-
do {
|
|
45
|
-
if (index_1.default.isPath(pathname = path.join(...directories.concat(mainActivityFile)))) {
|
|
46
|
-
config.mainActivityFile = pathname;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
directories.pop();
|
|
50
|
-
} while (directories.length);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return super.finalize.call(this, instance);
|
|
55
|
-
}
|
|
56
|
-
init(assets, config) {
|
|
57
|
-
if (config) {
|
|
58
|
-
const { targetAPI, mainParentDir, mainSrcDir, mainActivityFile, javaVersion, projectName, versionName, versionCode = 0, manifest, namespace, profileable, dependencies, dataBinding, commands, directories, elements, extensionData } = config;
|
|
59
|
-
const target = this.config;
|
|
60
|
-
if (projectName) {
|
|
61
|
-
target.projectName = projectName;
|
|
62
|
-
}
|
|
63
|
-
if (namespace) {
|
|
64
|
-
target.namespace = namespace;
|
|
65
|
-
}
|
|
66
|
-
if (mainParentDir) {
|
|
67
|
-
target.mainParentDir = mainParentDir;
|
|
68
|
-
}
|
|
69
|
-
if (mainSrcDir) {
|
|
70
|
-
target.mainSrcDir = mainSrcDir;
|
|
71
|
-
}
|
|
72
|
-
if (mainActivityFile) {
|
|
73
|
-
target.mainActivityFile = mainActivityFile;
|
|
74
|
-
}
|
|
75
|
-
if (versionName) {
|
|
76
|
-
target.versionName = versionName;
|
|
77
|
-
}
|
|
78
|
-
if (manifest) {
|
|
79
|
-
target.manifest = manifest;
|
|
80
|
-
}
|
|
81
|
-
if (profileable !== undefined) {
|
|
82
|
-
target.profileable = profileable;
|
|
83
|
-
}
|
|
84
|
-
if (versionCode >= 1) {
|
|
85
|
-
target.versionCode = Math.min(Math.ceil(versionCode), 2100000000);
|
|
86
|
-
}
|
|
87
|
-
if (commands) {
|
|
88
|
-
target.commands = commands;
|
|
89
|
-
}
|
|
90
|
-
if (javaVersion) {
|
|
91
|
-
target.javaVersion = +(typeof javaVersion === 'string' ? javaVersion.toString().replace(/_/g, '.') : javaVersion);
|
|
92
|
-
}
|
|
93
|
-
if (dataBinding) {
|
|
94
|
-
target.dataBinding = true;
|
|
95
|
-
}
|
|
96
|
-
if ((0, types_1.isArray)(dependencies)) {
|
|
97
|
-
target.dependencies = dependencies;
|
|
98
|
-
}
|
|
99
|
-
if (targetAPI) {
|
|
100
|
-
this.targetAPI = targetAPI;
|
|
101
|
-
}
|
|
102
|
-
if ((0, types_1.isPlainObject)(directories)) {
|
|
103
|
-
this.directories = directories;
|
|
104
|
-
}
|
|
105
|
-
if ((0, types_1.isArray)(elements)) {
|
|
106
|
-
this.elements = elements;
|
|
107
|
-
}
|
|
108
|
-
if ((0, types_1.isPlainObject)(extensionData)) {
|
|
109
|
-
this.extensionData = extensionData;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return super.init(assets, config);
|
|
113
|
-
}
|
|
114
|
-
findVersion(name, fallback) {
|
|
115
|
-
const targetAPI = this.targetAPI;
|
|
116
|
-
if (targetAPI) {
|
|
117
|
-
if (!Array.isArray(name)) {
|
|
118
|
-
name = [name];
|
|
119
|
-
}
|
|
120
|
-
for (let i = 0; i < name.length; i += 2) {
|
|
121
|
-
name.splice(i, 0, name[i] + '-' + targetAPI);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return super.findVersion(name, fallback);
|
|
125
|
-
}
|
|
126
|
-
async using(data) {
|
|
127
|
-
if (this.aborted) {
|
|
128
|
-
return Promise.reject((0, types_1.createAbortError)());
|
|
129
|
-
}
|
|
130
|
-
const { host, file } = data;
|
|
131
|
-
const localUri = file.localUri;
|
|
132
|
-
switch (file.mimeType) {
|
|
133
|
-
case 'font/unknown':
|
|
134
|
-
switch (await host.findMime(file, true)) {
|
|
135
|
-
case 'font/ttf':
|
|
136
|
-
case 'font/otf':
|
|
137
|
-
return;
|
|
138
|
-
case 'font/woff':
|
|
139
|
-
case 'font/woff2':
|
|
140
|
-
break;
|
|
141
|
-
default:
|
|
142
|
-
host.deleteFile(localUri);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
case 'font/woff':
|
|
146
|
-
case 'font/woff2': {
|
|
147
|
-
const instance = host.loadModule('compress');
|
|
148
|
-
const buffer = host.getBuffer(file);
|
|
149
|
-
if (instance && buffer) {
|
|
150
|
-
await instance.tryFile(buffer, localUri, { format: 'ttf', etag: file.etag }, (err, result) => {
|
|
151
|
-
if (err) {
|
|
152
|
-
host.deleteFile(localUri);
|
|
153
|
-
host.writeFail("Unable to compress file" /* ERR_MESSAGE.COMPRESS_FILE */, err, 8 /* LOG_TYPE.COMPRESS */);
|
|
154
|
-
}
|
|
155
|
-
else if ((0, types_1.isString)(result)) {
|
|
156
|
-
host.replace(file, result);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
findTemplate(baseDir, filename, options) {
|
|
165
|
-
let detect, languageOf;
|
|
166
|
-
if (options) {
|
|
167
|
-
({ detect, languageOf } = options);
|
|
168
|
-
}
|
|
169
|
-
let kotlin, language;
|
|
170
|
-
if (languageOf) {
|
|
171
|
-
kotlin = (language = this.settings.language?.[languageOf]) === 'kotlin';
|
|
172
|
-
const isKts = this.detectKts(baseDir, filename);
|
|
173
|
-
detect = isKts !== null && (kotlin && isKts || !kotlin && !isKts);
|
|
174
|
-
if (kotlin) {
|
|
175
|
-
filename += '.kts';
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
const localUri = path.join(baseDir, filename);
|
|
179
|
-
try {
|
|
180
|
-
const existing = detect && fs.existsSync(localUri);
|
|
181
|
-
const paths = language ? [language, filename] : [filename];
|
|
182
|
-
let uri;
|
|
183
|
-
if (!existing && !(uri = this.resolveDir('template', ...paths)) && !fs.existsSync(uri = path.join(__dirname, 'template', ...paths))) {
|
|
184
|
-
throw (0, types_1.errorValue)("File not found" /* ERR_MESSAGE.NOTFOUND_FILE */, uri);
|
|
185
|
-
}
|
|
186
|
-
return { localUri, source: fs.readFileSync(uri || localUri, 'utf-8'), existing, kotlin, language };
|
|
187
|
-
}
|
|
188
|
-
catch (err) {
|
|
189
|
-
this.writeFail(["Unable to read file" /* ERR_MESSAGE.READ_FILE */, path.basename(localUri)], err, 32 /* LOG_TYPE.FILE */);
|
|
190
|
-
}
|
|
191
|
-
return { kotlin, language };
|
|
192
|
-
}
|
|
193
|
-
detectKts(...paths) {
|
|
194
|
-
try {
|
|
195
|
-
const file = path.join(...paths);
|
|
196
|
-
if (fs.existsSync(file)) {
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
if (fs.existsSync(file + '.kts')) {
|
|
200
|
-
return true;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
catch {
|
|
204
|
-
}
|
|
205
|
-
return null;
|
|
206
|
-
}
|
|
207
|
-
get settings() {
|
|
208
|
-
var _a;
|
|
209
|
-
return (_a = this.module).settings || (_a.settings = {});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
exports.default = AndroidDocument;
|
|
213
|
-
|
|
214
|
-
if (exports.default) {
|
|
215
|
-
module.exports = exports.default;
|
|
216
|
-
module.exports.default = exports.default;
|
|
217
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="{{package}}">
|
|
3
|
-
|
|
4
|
-
<application
|
|
5
|
-
android:icon="@mipmap/ic_launcher"
|
|
6
|
-
android:label="{{label}}"
|
|
7
|
-
android:supportsRtl="{{supportsRtl}}"
|
|
8
|
-
android:theme="{{theme}}">
|
|
9
|
-
<activity
|
|
10
|
-
android:name="{{activityName}}"
|
|
11
|
-
android:exported="true"
|
|
12
|
-
android:label="{{label}}"
|
|
13
|
-
android:theme="{{theme}}">
|
|
14
|
-
<intent-filter>
|
|
15
|
-
<action android:name="android.intent.action.MAIN" />
|
|
16
|
-
|
|
17
|
-
<category android:name="android.intent.category.LAUNCHER" />
|
|
18
|
-
</intent-filter>
|
|
19
|
-
</activity>
|
|
20
|
-
<profileable android:shell="true" android:enabled="{{profileable}}" />
|
|
21
|
-
</application>
|
|
22
|
-
|
|
23
|
-
</manifest>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
plugins {
|
|
2
|
-
id 'com.android.application'
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
android {
|
|
6
|
-
namespace ''
|
|
7
|
-
compileSdk 33
|
|
8
|
-
|
|
9
|
-
defaultConfig {
|
|
10
|
-
applicationId ''
|
|
11
|
-
minSdk 19
|
|
12
|
-
targetSdk 33
|
|
13
|
-
versionCode 1
|
|
14
|
-
versionName '1.0'
|
|
15
|
-
|
|
16
|
-
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
|
17
|
-
}
|
|
18
|
-
buildTypes {
|
|
19
|
-
release {
|
|
20
|
-
debuggable false
|
|
21
|
-
minifyEnabled true
|
|
22
|
-
shrinkResources false
|
|
23
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
compileOptions {
|
|
27
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
28
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
29
|
-
}
|
|
30
|
-
buildFeatures {
|
|
31
|
-
viewBinding false
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
dependencies {
|
|
36
|
-
testImplementation 'junit:junit:4.13.2'
|
|
37
|
-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
38
|
-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
39
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
pluginManagement {
|
|
2
|
-
repositories {
|
|
3
|
-
gradlePluginPortal()
|
|
4
|
-
google()
|
|
5
|
-
mavenCentral()
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
dependencyResolutionManagement {
|
|
10
|
-
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
11
|
-
repositories {
|
|
12
|
-
google()
|
|
13
|
-
mavenCentral()
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
rootProject.name = '{{projectName}}'
|
|
18
|
-
include '{{name}}'
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
plugins {
|
|
2
|
-
id 'com.android.application'
|
|
3
|
-
id 'org.jetbrains.kotlin.android'
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
android {
|
|
7
|
-
namespace ''
|
|
8
|
-
compileSdk 33
|
|
9
|
-
|
|
10
|
-
defaultConfig {
|
|
11
|
-
applicationId ''
|
|
12
|
-
minSdk 19
|
|
13
|
-
targetSdk 33
|
|
14
|
-
versionCode 1
|
|
15
|
-
versionName '1.0'
|
|
16
|
-
|
|
17
|
-
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
|
18
|
-
}
|
|
19
|
-
buildTypes {
|
|
20
|
-
release {
|
|
21
|
-
debuggable false
|
|
22
|
-
minifyEnabled true
|
|
23
|
-
shrinkResources false
|
|
24
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
compileOptions {
|
|
28
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
29
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
30
|
-
}
|
|
31
|
-
kotlinOptions {
|
|
32
|
-
jvmTarget = '1.8'
|
|
33
|
-
}
|
|
34
|
-
buildFeatures {
|
|
35
|
-
viewBinding false
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
dependencies {
|
|
40
|
-
implementation 'androidx.core:core-ktx:1.9.0'
|
|
41
|
-
testImplementation 'junit:junit:4.13.2'
|
|
42
|
-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
43
|
-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
44
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
pluginManagement {
|
|
2
|
-
repositories {
|
|
3
|
-
gradlePluginPortal()
|
|
4
|
-
google()
|
|
5
|
-
mavenCentral()
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
dependencyResolutionManagement {
|
|
10
|
-
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
11
|
-
repositories {
|
|
12
|
-
google()
|
|
13
|
-
mavenCentral()
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
rootProject.name = '{{projectName}}'
|
|
18
|
-
include '{{name}}'
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
plugins {
|
|
2
|
-
id("com.android.application")
|
|
3
|
-
kotlin("android")
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
android {
|
|
7
|
-
namespace = ""
|
|
8
|
-
compileSdk(33)
|
|
9
|
-
|
|
10
|
-
defaultConfig {
|
|
11
|
-
applicationId = ""
|
|
12
|
-
minSdk(19)
|
|
13
|
-
targetSdk(33)
|
|
14
|
-
versionCode = 1
|
|
15
|
-
versionName = "1.0"
|
|
16
|
-
|
|
17
|
-
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
18
|
-
}
|
|
19
|
-
buildTypes {
|
|
20
|
-
getByName("release") {
|
|
21
|
-
isDebuggable = false
|
|
22
|
-
isMinifyEnabled = true
|
|
23
|
-
isShrinkResources = false
|
|
24
|
-
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
kotlinOptions {
|
|
28
|
-
jvmTarget = "1.8"
|
|
29
|
-
}
|
|
30
|
-
buildFeatures {
|
|
31
|
-
viewBinding = true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
java {
|
|
36
|
-
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
37
|
-
targetCompatibility = JavaVersion.VERSION_1_8
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
dependencies {
|
|
41
|
-
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.10")
|
|
42
|
-
implementation("androidx.core:core-ktx:1.9.0")
|
|
43
|
-
testImplementation("junit:junit:4.13.2")
|
|
44
|
-
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
|
45
|
-
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
|
46
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
pluginManagement {
|
|
2
|
-
repositories {
|
|
3
|
-
gradlePluginPortal()
|
|
4
|
-
google()
|
|
5
|
-
mavenCentral()
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
dependencyResolutionManagement {
|
|
10
|
-
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
11
|
-
repositories {
|
|
12
|
-
google()
|
|
13
|
-
mavenCentral()
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
rootProject.name = "${{projectName}}"
|
|
18
|
-
include("{{name}}")
|
package/chrome/document.d.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import type { LocationUri, XmlTagNode } from '../../types/lib/squared';
|
|
2
|
-
import type { ChromeAsset, CssRuleData, DataSource, DocumentOutput } from '../../types/lib/chrome';
|
|
3
|
-
|
|
4
|
-
import type { DocumentConstructor, IDocument, IFileManager } from '../../types/lib';
|
|
5
|
-
import type { DocumentAsset as IDocumentAsset } from '../../types/lib/document';
|
|
6
|
-
import type { LogTime } from '../../types/lib/logger';
|
|
7
|
-
import type { DbSourceDataType, DocumentComponentOption, DocumentComponent as IDocumentComponent, DocumentComponentOptions as IDocumentComponentOptions, DocumentDirectory as IDocumentDirectory, DocumentEval as IDocumentEval, DocumentModule as IDocumentModule, DocumentSettings as IDocumentSettings } from '../../types/lib/settings';
|
|
8
|
-
|
|
9
|
-
import type { CloudScopeOrigin } from '../../cloud/types';
|
|
10
|
-
import type { IDomWriter, IXmlElement } from '../parse/document';
|
|
11
|
-
|
|
12
|
-
interface DocumentDirectory extends IDocumentDirectory {
|
|
13
|
-
template?: string;
|
|
14
|
-
data?: string;
|
|
15
|
-
export?: string;
|
|
16
|
-
schema?: string;
|
|
17
|
-
sql?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface DocumentComponentExtended<T> extends DbSourceDataType<T> {
|
|
21
|
-
uri?: T;
|
|
22
|
-
local?: T;
|
|
23
|
-
export?: T;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface DocumentComponentOptions<T> extends IDocumentComponentOptions, DocumentComponentExtended<DocumentComponentOption<T>> {}
|
|
27
|
-
|
|
28
|
-
interface DocumentEval extends IDocumentEval {
|
|
29
|
-
template?: boolean;
|
|
30
|
-
userconfig?: boolean;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface ChromeDocumentSettings extends IDocumentSettings {
|
|
34
|
-
directory?: DocumentDirectory;
|
|
35
|
-
options?: DocumentComponentOptions<boolean | number>;
|
|
36
|
-
export?: ObjectMap<string | FunctionType>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
type OutputType = "useUnsafeReplace" | "productionRelease" | "productionIncremental" | "templateMap";
|
|
40
|
-
|
|
41
|
-
export interface FormatUri extends Partial<LocationUri> {
|
|
42
|
-
dictionary?: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface FinalizeProcessing<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> {
|
|
46
|
-
readonly host: T;
|
|
47
|
-
readonly startTime: LogTime;
|
|
48
|
-
readonly hashed: Set<DocumentAsset>;
|
|
49
|
-
readonly contentMap: StringMap;
|
|
50
|
-
readonly bufferMap: ObjectMap<BufferContent>;
|
|
51
|
-
readonly cacheMiss: string[];
|
|
52
|
-
readonly productionRelease: Undef<true>;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface DocumentComponent<T = boolean> extends IDocumentComponent<T, T>, DocumentComponentExtended<T> {}
|
|
56
|
-
|
|
57
|
-
export interface DocumentModule extends IDocumentModule {
|
|
58
|
-
eval?: DocumentEval;
|
|
59
|
-
format?: {
|
|
60
|
-
uuid?: FormatUri;
|
|
61
|
-
};
|
|
62
|
-
settings?: ChromeDocumentSettings;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface DocumentAsset extends IDocumentAsset, ChromeAsset {
|
|
66
|
-
relativeUrl?: string;
|
|
67
|
-
inlineFilename?: string;
|
|
68
|
-
srcSet?: string[];
|
|
69
|
-
inlineUrl?: string;
|
|
70
|
-
inlineUrlMap?: StringMap;
|
|
71
|
-
inlineUrlCloud?: string;
|
|
72
|
-
inlineUrlCloudMap?: StringMap;
|
|
73
|
-
inlineBase64?: string;
|
|
74
|
-
modified?: boolean;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface UserConfig extends CssRuleData, Omit<DocumentOutput, OutputType> {
|
|
78
|
-
useUnsafeHtmlReplace?: boolean;
|
|
79
|
-
useUnsafeCssReplace?: boolean;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface IChromeDocument<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> extends IDocument<T, U, DocumentModule, DocumentComponent>, Pick<DocumentOutput, OutputType> {
|
|
83
|
-
htmlFile: Null<U>;
|
|
84
|
-
cssFiles: U[];
|
|
85
|
-
jsFiles: U[];
|
|
86
|
-
svgFiles: U[];
|
|
87
|
-
baseDirectory: string;
|
|
88
|
-
baseUrl: string;
|
|
89
|
-
config: UserConfig;
|
|
90
|
-
related: Map<U, Set<U>>;
|
|
91
|
-
replaced: U[];
|
|
92
|
-
formatMap?: ObjectMap<FormatUri>;
|
|
93
|
-
setElementSrc(asset: U, element: IXmlElement, value: string): void;
|
|
94
|
-
findDataValue(name: string): Undef<string>;
|
|
95
|
-
setInlinedAttributes(processing: FinalizeProcessing<T>): void;
|
|
96
|
-
applyTransforms(processing: FinalizeProcessing<T>): Promise<void>;
|
|
97
|
-
rewriteHtml(processing: FinalizeProcessing<T>): Promise<void>;
|
|
98
|
-
setElementAttributes(processing: FinalizeProcessing<T>, domBase: IDomWriter): Promise<void>;
|
|
99
|
-
applyDataSource(processing: FinalizeProcessing<T>, domBase: IDomWriter): Promise<void>;
|
|
100
|
-
setProductionAttributes(processing: FinalizeProcessing<T>): void;
|
|
101
|
-
removeUnusedStyles(source: string, options?: UserConfig): Undef<string>;
|
|
102
|
-
removeServerRoot(value: string): string;
|
|
103
|
-
replaceContent(source: string, match: RegExpExecArray | string, mimeType?: string): Undef<string>;
|
|
104
|
-
cloudInit(state: CloudScopeOrigin<T, U>): void;
|
|
105
|
-
cloudObject(state: CloudScopeOrigin<T, U>, file: U): boolean;
|
|
106
|
-
cloudUpload(state: CloudScopeOrigin<T, U>, file: U, url: string, active: boolean): Promise<boolean>;
|
|
107
|
-
cloudFinalize(state: CloudScopeOrigin<T, U>): Promise<unknown[]>;
|
|
108
|
-
get settings(): ChromeDocumentSettings;
|
|
109
|
-
get editing(): U[];
|
|
110
|
-
get dataSource(): DataSource[];
|
|
111
|
-
get elements(): XmlTagNode[];
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export interface ChromeDocumentConstructor<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> extends DocumentConstructor<T, U> {
|
|
115
|
-
INTERNAL_ASSIGNUUID: string;
|
|
116
|
-
INTERNAL_SERVERROOT: string;
|
|
117
|
-
readonly prototype: IChromeDocument<T, U>;
|
|
118
|
-
new(module?: DocumentModule, ...args: unknown[]): IChromeDocument<T, U>;
|
|
119
|
-
}
|
package/chrome/index.d.ts
DELETED