@pi-r/android 0.3.3 → 0.3.5

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2023 Lisa Mishima
1
+ Copyright 2024 An Pham
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
@@ -4,6 +4,7 @@ const util_1 = require("@e-mc/document/util");
4
4
  const types_1 = require("@e-mc/types");
5
5
  const Document = require("@e-mc/document");
6
6
  function finalize(instance) {
7
+ var _a;
7
8
  const config = instance.config;
8
9
  const { profileable, dependencies, dataBinding, versionName, versionCode } = config;
9
10
  if (!profileable && !dependencies && !dataBinding && !versionName && !versionCode && !config.namespace) {
@@ -149,7 +150,7 @@ function finalize(instance) {
149
150
  output = Document.updateGradle(output, ['android'], kotlin ? `buildToolsVersion = "${version}"` : `buildToolsVersion "${version}"`, true);
150
151
  }
151
152
  }
152
- if (namespace || (namespace = config.manifest?.package)) {
153
+ if (namespace || (namespace = (_a = config.manifest) === null || _a === void 0 ? void 0 : _a.package)) {
153
154
  output = Document.updateGradle(output, ['android', 'defaultConfig'], (kotlin ? 'applicationId = ' : 'applicationId ') + `"${namespace}"`, true);
154
155
  }
155
156
  setModified(output);
@@ -9,7 +9,7 @@ function finalize(instance) {
9
9
  }
10
10
  let { localUri, source, existing, kotlin } = instance.findTemplate(this.baseDirectory, 'settings.gradle', { detect: this.incremental !== 'staging', languageOf: 'gradle' });
11
11
  if (localUri && source && instance.canWrite(localUri, { ownPermissionOnly: true })) {
12
- let targetName = projectName?.replace(/"/g, '\\"'), modified;
12
+ let targetName = projectName === null || projectName === void 0 ? void 0 : projectName.replace(/"/g, '\\"'), modified;
13
13
  if (existing) {
14
14
  let match;
15
15
  if (dependencies) {
@@ -49,7 +49,7 @@ function finalize(instance) {
49
49
  }
50
50
  }
51
51
  else {
52
- if (!targetName && (targetName = manifest?.package)) {
52
+ if (!targetName && (targetName = manifest === null || manifest === void 0 ? void 0 : manifest.package)) {
53
53
  const index = targetName.lastIndexOf('.');
54
54
  targetName = index !== -1 ? targetName.substring(index + 1) : '';
55
55
  }
@@ -5,6 +5,7 @@ const child_process = require("child_process");
5
5
  const types_1 = require("@e-mc/types");
6
6
  const Document = require("@e-mc/document");
7
7
  async function finalize(instance) {
8
+ var _a, _b;
8
9
  const commands = instance.config.commands;
9
10
  if (!commands || this.incremental === 'staging') {
10
11
  return;
@@ -24,7 +25,7 @@ async function finalize(instance) {
24
25
  else {
25
26
  return;
26
27
  }
27
- const settings = instance.settings.extensions?.task || {};
28
+ const settings = ((_a = instance.settings.extensions) === null || _a === void 0 ? void 0 : _a.task) || {};
28
29
  const exec = settings.exec;
29
30
  let { broadcastId, baseDirectory } = this, command = settings.command, uid, gid, title, name, foundCwd;
30
31
  if (command) {
@@ -32,7 +33,7 @@ async function finalize(instance) {
32
33
  title = 'maven';
33
34
  }
34
35
  else {
35
- title = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)?.[1] || 'SPAWN';
36
+ title = ((_b = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)) === null || _b === void 0 ? void 0 : _b[1]) || 'SPAWN';
36
37
  }
37
38
  command = path.normalize(command);
38
39
  if (!command.includes(path.sep)) {
package/index.js CHANGED
@@ -161,13 +161,14 @@ class AndroidDocument extends Document {
161
161
  }
162
162
  }
163
163
  findTemplate(baseDir, filename, options) {
164
+ var _a;
164
165
  let detect, languageOf, subDir;
165
166
  if (options) {
166
167
  ({ detect, languageOf, subDir } = options);
167
168
  }
168
169
  let kotlin, language;
169
170
  if (languageOf) {
170
- kotlin = (language = this.settings.language?.[languageOf]) === 'kotlin';
171
+ kotlin = (language = (_a = this.settings.language) === null || _a === void 0 ? void 0 : _a[languageOf]) === 'kotlin';
171
172
  const isKts = this.detectKts(baseDir, filename);
172
173
  detect = isKts !== null && (kotlin && isKts || !kotlin && !isKts);
173
174
  if (kotlin) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/android",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
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.6.2",
24
- "@e-mc/types": "^0.6.2",
25
- "htmlparser2": "^9.0.0"
23
+ "@e-mc/document": "^0.6.7",
24
+ "@e-mc/types": "^0.6.7",
25
+ "htmlparser2": "^9.1.0"
26
26
  }
27
27
  }