@pi-r/android 0.10.3 → 0.10.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.
@@ -10,7 +10,7 @@ const REGEXP_DEPENDENCY = /([ \t]*)([A-Za-z_$][\w$]*)(?:\s*\(?\s*(?:module\(?\s*
10
10
  const REGEXP_DEPENDENCY_KOTLIN = /([ \t]*)([A-Za-z_$][\w$]*)\((?:\s*(?:(?:module\(\s*)?"([^"]+)"|((?:\s*(?:group|name|version)\s*=\s*"(?:[^"]|(?<=\\)")+"\s*,?){3}))\s*\))?/gd;
11
11
  const REGEXP_LIBRARY = /([ \t]*)implementation\s+(?:(project|files)\s*\(\s*("(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+')\s*\)|(fileTree)\s*\(\s*((?:\s*(?:dir|include)\s*:\s*(?:"(?:[^"]|(?<=\\)")+"|'(?:[^']|(?<=\\)')+'|\[[^\]]+\])\s*,?){2})\s*\))[ \t\r]*\n/gd;
12
12
  const REGEXP_LIBRARY_KOTLIN = /([ \t]*)implementation\(\s*(?:(project|files)\(\s*"(.+)"\s*\)|(fileTree)\(\s*mapOf\(((?:\s*"(?:dir|include)"\s+to\s+(?:"(?:[^"]|(?<=\\)")+"|listOf\([^)]+\))\s*,?){2})\)\s*\))\s*\)[ \t\r]*\n/gd;
13
- const REGEXP_VERSIONS = /([^\s]+)\s*=\s*(?:"([^":]+)"|'([^':]+)'|(\{(?:\s*(?:require|strictly|prefer|reject(?:All)?)\s*=\s*(?:"[^":]+"|'[^':]+')\s*,?)+\s*\}))/g;
13
+ const REGEXP_VERSIONS = /([^\s]+)\s*=\s*(?:"([^"]+)"|'([^']+)'|(\{(?:\s*(?:require|strictly|prefer|reject(?:All)?)\s*=\s*(?:"[^"]+"|'[^']+')\s*,?)+\s*\}))/g;
14
14
  const REGEXP_VERSIONS_LIB = /([^\s]+)\s*=\s*(?:\{\s*(group|name|module|version(?:\.ref)?)\s*=\s*(?:"([^"]+)"|'([^']+)'|(\{[^}]+\}))\s*,\s*(group|name|module|version(?:\.ref)?)\s*=\s*(?:"([^"]+)"|'([^']+)'|(\{[^}]+\}))(?:\s*,\s*(group|name|module|version(?:\.ref)?)\s*=\s*(?:"([^"]+)"|'([^']+)')|(\{[^}]+\}))?\s*\}|(?:"([^:]+:[^"]+)"|'([^:]+:[^']+)'))/gd;
15
15
  function isUpgrade(version, pending) {
16
16
  if (isSemVer(pending)) {
@@ -98,6 +98,7 @@ function writeMethod(kotlin, named, item, args = '', prefix = 'implementation')
98
98
  }
99
99
  const isLatest = (value) => value === '' || value.startsWith('latest.');
100
100
  const isSemVer = (value) => isLatest(value) || REGEXP_SEMVER.test(value);
101
+ const writeOutput = (match, source, value) => (0, util_1.spliceString)(source, match.index, match.index + match[0].length, value);
101
102
  const toCamelCase = (value) => value.replace(/-([a-z])/gi, (...capture) => capture[1].toUpperCase());
102
103
  function finalize(instance) {
103
104
  const { profileable, dependencies, libraries, dataBinding, jvmToolchain, versionName, versionCode, namespace, applicationId, mainParentDir } = instance.config;
@@ -339,22 +340,17 @@ function finalize(instance) {
339
340
  item[2] = '';
340
341
  libs[key] = { group, name, "version.ref": versionRef };
341
342
  }
342
- let section = /\[libraries\]\s*/.exec(config);
343
- const writeOutput = (value) => (0, util_1.spliceString)(config, section.index, section.index + section[0].length, value);
344
- if (section) {
345
- config = writeOutput(output);
343
+ const lib = /\[libraries\]\s*/.exec(config);
344
+ if (lib) {
345
+ config = writeOutput(lib, config, output);
346
346
  }
347
347
  else {
348
348
  config += output;
349
349
  }
350
350
  if (outputVer) {
351
351
  outputVer = '[versions]' + newLine + outputVer;
352
- if (section = /\[versions\]\s*/.exec(config)) {
353
- config = writeOutput(outputVer);
354
- }
355
- else {
356
- config = outputVer + newLine + config;
357
- }
352
+ const ver = /\[versions\]\s*/.exec(config);
353
+ config = ver ? writeOutput(ver, config, outputVer) : outputVer + newLine + config;
358
354
  }
359
355
  REGEXP_VERSIONS.lastIndex = 0;
360
356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/android",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "description": "Android document constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -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.12.7",
24
- "@e-mc/types": "^0.12.7",
23
+ "@e-mc/document": "^0.12.17",
24
+ "@e-mc/types": "^0.12.17",
25
25
  "dom-serializer": "^2.0.0",
26
26
  "domhandler": "^5.0.3",
27
27
  "domutils": "^3.2.2",