react-native-persona 1.2.8 → 1.3.0

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 (52) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/RNPersonaInquiry.podspec +1 -1
  3. package/android/README.md +14 -0
  4. package/android/build.gradle +21 -100
  5. package/lib/commonjs/index.js +477 -0
  6. package/lib/commonjs/index.js.map +1 -0
  7. package/lib/commonjs/util.js +36 -0
  8. package/lib/commonjs/util.js.map +1 -0
  9. package/lib/commonjs/util.spec.js +31 -0
  10. package/lib/commonjs/util.spec.js.map +1 -0
  11. package/lib/module/index.js +452 -0
  12. package/lib/module/index.js.map +1 -0
  13. package/lib/module/util.js +29 -0
  14. package/lib/module/util.js.map +1 -0
  15. package/lib/module/util.spec.js +28 -0
  16. package/lib/module/util.spec.js.map +1 -0
  17. package/lib/typescript/persona-tools/Config.d.ts +15 -0
  18. package/lib/typescript/persona-tools/Theme.d.ts +124 -0
  19. package/lib/typescript/persona-tools/index.d.ts +1 -0
  20. package/lib/typescript/persona-tools/lib/AndroidResourcePrinter.d.ts +40 -0
  21. package/lib/typescript/persona-tools/lib/AndroidResourcePrinter.spec.d.ts +1 -0
  22. package/lib/typescript/persona-tools/lib/prompts.d.ts +8 -0
  23. package/lib/typescript/persona-tools/tools/AndroidThemeGenerator.d.ts +5 -0
  24. package/lib/typescript/persona-tools/tools/IosThemeInstructions.d.ts +5 -0
  25. package/{generatedTypes → lib/typescript/src}/index.d.ts +67 -3
  26. package/lib/typescript/src/util.d.ts +3 -0
  27. package/lib/typescript/src/util.spec.d.ts +1 -0
  28. package/package.json +79 -21
  29. package/persona-tools/{config.ts → Config.ts} +7 -7
  30. package/persona-tools/Theme.ts +140 -138
  31. package/persona-tools/index.ts +9 -9
  32. package/persona-tools/lib/AndroidResourcePrinter.spec.ts +100 -101
  33. package/persona-tools/lib/AndroidResourcePrinter.ts +314 -278
  34. package/persona-tools/lib/prompts.ts +11 -11
  35. package/persona-tools/tools/AndroidThemeGenerator.ts +31 -32
  36. package/persona-tools/tools/IosThemeInstructions.ts +8 -8
  37. package/src/index.ts +17 -18
  38. package/src/util.spec.ts +14 -8
  39. package/src/util.ts +3 -3
  40. package/jest.config.js +0 -10
  41. package/persona-tools/Theme.js +0 -213
  42. package/persona-tools/config.js +0 -72
  43. package/persona-tools/index.js +0 -30
  44. package/persona-tools/lib/AndroidResourcePrinter.js +0 -832
  45. package/persona-tools/lib/AndroidResourcePrinter.spec.js +0 -1135
  46. package/persona-tools/lib/prompts.js +0 -39
  47. package/persona-tools/tools/AndroidThemeGenerator.js +0 -59
  48. package/persona-tools/tools/IosThemeInstructions.js +0 -34
  49. package/src/index.js +0 -307
  50. package/src/util.js +0 -29
  51. package/src/util.spec.js +0 -15
  52. package/tsconfig.json +0 -29
@@ -1,72 +0,0 @@
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
- const cosmiconfig_1 = require("cosmiconfig");
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const Theme_1 = require("./Theme");
9
- class Configuration {
10
- async loadConfig() {
11
- if (this.config)
12
- return this.config;
13
- try {
14
- const explorer = cosmiconfig_1.cosmiconfig("persona", { packageProp: "persona" });
15
- const result = await explorer.search();
16
- if (result == null) {
17
- return null;
18
- }
19
- this.config = result.config;
20
- return this.config;
21
- }
22
- catch (e) {
23
- console.error(e);
24
- process.exit(1);
25
- }
26
- }
27
- async get() {
28
- let config = await this.loadConfig();
29
- const androidThemeLines = [];
30
- for (const key in Theme_1.ANDROID_THEME_CONFIG_KEY) {
31
- androidThemeLines.push(` "${key}": null`);
32
- }
33
- const iosThemeLines = [];
34
- for (const key in Theme_1.IOS_THEME_CONFIG_KEY) {
35
- iosThemeLines.push(` "${key}": null`);
36
- }
37
- if (config == null) {
38
- console.log(`
39
- Missing configuration.
40
-
41
- In order to use this tool, it must be configured using a ${chalk_1.default.yellow("persona")} object within
42
- your package.json.
43
-
44
- To get started, paste the following configuration into your package.json
45
-
46
- {
47
- ...
48
-
49
- "persona": {
50
- "androidTheme": {
51
- ` +
52
- androidThemeLines.join(",\n") +
53
- `
54
- },
55
- "iosTheme": {
56
- ` +
57
- iosThemeLines.join(",\n") +
58
- `
59
- }
60
- }
61
-
62
- ...
63
- }
64
-
65
- and re-run this tool :).
66
- `);
67
- process.exit(1);
68
- }
69
- return config;
70
- }
71
- }
72
- exports.default = new Configuration();
@@ -1,30 +0,0 @@
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
- const Config_1 = __importDefault(require("./Config"));
7
- const prompts_1 = require("./lib/prompts");
8
- const AndroidThemeGenerator_1 = __importDefault(require("./tools/AndroidThemeGenerator"));
9
- const IosThemeInstructions_1 = __importDefault(require("./tools/IosThemeInstructions"));
10
- console.log("");
11
- console.log("============================================");
12
- console.log("Persona React Native SDK customization tool.");
13
- console.log("============================================");
14
- console.log("");
15
- const run = async () => {
16
- // Run this once to print warning messages if it's not configured.
17
- await Config_1.default.get();
18
- const { choice } = await prompts_1.whatWouldYouLikePrompt();
19
- switch (choice) {
20
- case prompts_1.TOOL_CHOICE.AndroidTheme:
21
- await AndroidThemeGenerator_1.default.run();
22
- break;
23
- case prompts_1.TOOL_CHOICE.iosTheme:
24
- await IosThemeInstructions_1.default.run();
25
- break;
26
- default:
27
- return;
28
- }
29
- };
30
- run();