@pi-r/android 0.5.2 → 0.5.4

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,5 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  const path = require("path");
4
3
  const htmlparser2 = require("htmlparser2");
5
4
  const domhandler = require("domhandler");
@@ -178,9 +177,5 @@ function finalize(instance) {
178
177
  }
179
178
  }
180
179
  }
181
- exports.default = finalize;
182
180
 
183
- if (exports.default) {
184
- module.exports = exports.default;
185
- module.exports.default = exports.default;
186
- }
181
+ module.exports = finalize;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  const path = require("path");
4
3
  const util_1 = require("@e-mc/document/util");
5
4
  const types_1 = require("@e-mc/types");
@@ -29,6 +28,7 @@ function isUpgrade(version, pending) {
29
28
  return false;
30
29
  }
31
30
  function finalize(instance) {
31
+ var _a;
32
32
  const config = instance.config;
33
33
  const { profileable, dependencies, dataBinding, versionName, versionCode } = config;
34
34
  if (!profileable && !dependencies && !dataBinding && !versionName && !versionCode && !config.namespace) {
@@ -51,11 +51,12 @@ function finalize(instance) {
51
51
  const snapshot = hasScope('snapshot');
52
52
  const getData = () => data || (data = instance.findData('google-maven' + (snapshot ? '-snapshot' : '') + '.json', 'json'));
53
53
  const items = dependencies.map(item => {
54
+ var _a;
54
55
  let [groupId, artifactId, version, type] = item.split(':');
55
56
  if (!version || version === 'maven') {
56
57
  const maven = getData();
57
58
  let artifact;
58
- if (maven && (artifact = maven[groupId]?.find(child => child.artifactId === artifactId))) {
59
+ if (maven && (artifact = (_a = maven[groupId]) === null || _a === void 0 ? void 0 : _a.find(child => child.artifactId === artifactId))) {
59
60
  version = artifact.version;
60
61
  }
61
62
  else {
@@ -204,7 +205,7 @@ function finalize(instance) {
204
205
  let dependency;
205
206
  if (args || named) {
206
207
  const [group, name, version] = item;
207
- dependency = kotlin ? `(group = "${group}", name = "${name}", version = "${version}")` : ` group: '${group}', name: '${name}', version: '${version}'` + (args?.endsWith(',') ? ',' : '');
208
+ dependency = kotlin ? `(group = "${group}", name = "${name}", version = "${version}")` : ` group: '${group}', name: '${name}', version: '${version}'` + ((args === null || args === void 0 ? void 0 : args.endsWith(',')) ? ',' : '');
208
209
  }
209
210
  else {
210
211
  dependency = item.slice(0, 3).join(':');
@@ -323,7 +324,7 @@ function finalize(instance) {
323
324
  output = Document.updateGradle(output, ['android'], kotlin ? `buildToolsVersion = "${version}"` : `buildToolsVersion "${version}"`, true);
324
325
  }
325
326
  }
326
- if (namespace || (namespace = config.manifest?.package)) {
327
+ if (namespace || (namespace = (_a = config.manifest) === null || _a === void 0 ? void 0 : _a.package)) {
327
328
  output = Document.updateGradle(output, ['android', 'defaultConfig'], (kotlin ? 'applicationId = ' : 'applicationId ') + `"${namespace}"`, true);
328
329
  }
329
330
  setModified(output);
@@ -388,9 +389,5 @@ function finalize(instance) {
388
389
  }
389
390
  }
390
391
  }
391
- exports.default = finalize;
392
392
 
393
- if (exports.default) {
394
- module.exports = exports.default;
395
- module.exports.default = exports.default;
396
- }
393
+ module.exports = finalize;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  const path = require("path");
4
3
  const util_1 = require("@e-mc/document/util");
5
4
  const parse_1 = require("@e-mc/document/parse");
@@ -10,7 +9,7 @@ function finalize(instance) {
10
9
  }
11
10
  let { localUri, source, existing, kotlin } = instance.findTemplate(this.baseDirectory, "settings.gradle", { detect: this.incremental !== 'staging', languageOf: 'gradle' });
12
11
  if (localUri && source && instance.canWrite(localUri, { ownPermissionOnly: true })) {
13
- let targetName = projectName?.replace(/"/g, '\\"'), modified;
12
+ let targetName = projectName === null || projectName === void 0 ? void 0 : projectName.replace(/"/g, '\\"'), modified;
14
13
  if (existing) {
15
14
  let match;
16
15
  if (dependencies) {
@@ -50,7 +49,7 @@ function finalize(instance) {
50
49
  }
51
50
  }
52
51
  else {
53
- if (!targetName && (targetName = manifest?.package)) {
52
+ if (!targetName && (targetName = manifest === null || manifest === void 0 ? void 0 : manifest.package)) {
54
53
  const index = targetName.lastIndexOf('.');
55
54
  targetName = index !== -1 ? targetName.substring(index + 1) : '';
56
55
  }
@@ -77,9 +76,5 @@ function finalize(instance) {
77
76
  }
78
77
  }
79
78
  }
80
- exports.default = finalize;
81
79
 
82
- if (exports.default) {
83
- module.exports = exports.default;
84
- module.exports.default = exports.default;
85
- }
80
+ module.exports = finalize;
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  const path = require("path");
4
3
  const fs = require("fs");
5
4
  const child_process = require("child_process");
@@ -8,6 +7,7 @@ const types_1 = require("@e-mc/types");
8
7
  const Document = require("@e-mc/document");
9
8
  const checkWin32 = (value) => value === "gradlew" && process.platform === 'win32' ? value + '.bat' : value;
10
9
  async function finalize(instance) {
10
+ var _a, _b;
11
11
  const commands = instance.config.commands;
12
12
  if (!commands || this.incremental === 'staging') {
13
13
  return;
@@ -27,7 +27,7 @@ async function finalize(instance) {
27
27
  else {
28
28
  return;
29
29
  }
30
- const settings = instance.settings.extensions?.task || {};
30
+ const settings = ((_a = instance.settings.extensions) === null || _a === void 0 ? void 0 : _a.task) || {};
31
31
  const exec = settings.exec;
32
32
  let { broadcastId, baseDirectory } = this, command = settings.command, uid, gid, title, filename, altname, foundDir;
33
33
  if (command) {
@@ -35,7 +35,7 @@ async function finalize(instance) {
35
35
  title = "maven";
36
36
  }
37
37
  else {
38
- title = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)?.[1] || 'spawn';
38
+ title = ((_b = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)) === null || _b === void 0 ? void 0 : _b[1]) || 'spawn';
39
39
  }
40
40
  if (!/[\\/]/.test(command = path.normalize(command))) {
41
41
  filename = checkWin32(command);
@@ -121,9 +121,5 @@ async function finalize(instance) {
121
121
  .catch(err => instance.writeFail(["Unable to perform task", command + ' ' + task], err, { type: 4, startTime }));
122
122
  }
123
123
  }
124
- exports.default = finalize;
125
124
 
126
- if (exports.default) {
127
- module.exports = exports.default;
128
- module.exports.default = exports.default;
129
- }
125
+ module.exports = finalize;
package/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  const fs = require("fs");
4
3
  const path = require("path");
5
4
  const types_1 = require("@e-mc/types");
@@ -166,13 +165,14 @@ class AndroidDocument extends Document {
166
165
  }
167
166
  }
168
167
  findTemplate(baseDir, filename, options) {
168
+ var _a;
169
169
  let detect, languageOf, subDir;
170
170
  if (options) {
171
171
  ({ detect, languageOf, subDir } = options);
172
172
  }
173
173
  let kotlin, language;
174
174
  if (languageOf) {
175
- kotlin = (language = this.settings.language?.[languageOf]) === 'kotlin';
175
+ kotlin = (language = (_a = this.settings.language) === null || _a === void 0 ? void 0 : _a[languageOf]) === 'kotlin';
176
176
  const isKts = this.detectKts(baseDir, filename);
177
177
  detect = isKts !== null && (kotlin && isKts || !kotlin && !isKts);
178
178
  if (kotlin) {
@@ -232,9 +232,5 @@ class AndroidDocument extends Document {
232
232
  return (_a = this.module).settings || (_a.settings = {});
233
233
  }
234
234
  }
235
- exports.default = AndroidDocument;
236
235
 
237
- if (exports.default) {
238
- module.exports = exports.default;
239
- module.exports.default = exports.default;
240
- }
236
+ module.exports = AndroidDocument;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/android",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Android document constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -20,8 +20,8 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@e-mc/document": "^0.7.2",
24
- "@e-mc/types": "^0.7.2",
23
+ "@e-mc/document": "^0.7.5",
24
+ "@e-mc/types": "^0.7.5",
25
25
  "htmlparser2": "^9.0.0",
26
26
  "which": "^2.0.2"
27
27
  }