expensify-common 1.0.1 → 2.0.2

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 (104) hide show
  1. package/README.md +15 -6
  2. package/dist/API.d.ts +11 -0
  3. package/{lib/API.jsx → dist/API.js} +230 -165
  4. package/dist/APIDeferred.d.ts +7 -0
  5. package/{lib/APIDeferred.jsx → dist/APIDeferred.js} +35 -53
  6. package/dist/BrowserDetect.d.ts +19 -0
  7. package/dist/BrowserDetect.js +107 -0
  8. package/dist/CONST.d.ts +813 -0
  9. package/{lib/CONST.jsx → dist/CONST.js} +245 -167
  10. package/dist/Cookie.d.ts +68 -0
  11. package/{lib/Cookie.jsx → dist/Cookie.js} +23 -36
  12. package/dist/CredentialsWrapper.d.ts +32 -0
  13. package/dist/CredentialsWrapper.js +52 -0
  14. package/dist/Device.d.ts +8 -0
  15. package/dist/Device.js +15 -0
  16. package/dist/ExpenseRule.d.ts +39 -0
  17. package/{lib/ExpenseRule.jsx → dist/ExpenseRule.js} +12 -14
  18. package/dist/ExpensiMark.d.ts +142 -0
  19. package/dist/ExpensiMark.js +1026 -0
  20. package/dist/Func.d.ts +40 -0
  21. package/{lib/Func.jsx → dist/Func.js} +19 -25
  22. package/dist/Log.d.ts +3 -0
  23. package/dist/Log.js +41 -0
  24. package/dist/Logger.d.ts +77 -0
  25. package/dist/Logger.js +126 -0
  26. package/dist/Network.d.ts +6 -0
  27. package/{lib/Network.jsx → dist/Network.js} +48 -45
  28. package/dist/Num.d.ts +95 -0
  29. package/{lib/Num.jsx → dist/Num.js} +20 -40
  30. package/dist/PageEvent.d.ts +25 -0
  31. package/dist/PageEvent.js +28 -0
  32. package/dist/PubSub.d.ts +2 -0
  33. package/{lib/PubSub.jsx → dist/PubSub.js} +27 -39
  34. package/dist/ReportHistoryStore.d.ts +64 -0
  35. package/dist/ReportHistoryStore.js +261 -0
  36. package/dist/Templates.d.ts +2 -0
  37. package/{lib/Templates.jsx → dist/Templates.js} +33 -48
  38. package/dist/Url.d.ts +22 -0
  39. package/dist/Url.js +30 -0
  40. package/dist/components/CopyText.d.ts +45 -0
  41. package/{lib/components/CopyText.jsx → dist/components/CopyText.js} +16 -23
  42. package/dist/components/StepProgressBar.d.ts +22 -0
  43. package/dist/components/StepProgressBar.js +68 -0
  44. package/dist/components/form/element/combobox.d.ts +237 -0
  45. package/{lib → dist}/components/form/element/combobox.js +361 -516
  46. package/dist/components/form/element/dropdown.d.ts +35 -0
  47. package/dist/components/form/element/dropdown.js +66 -0
  48. package/dist/components/form/element/dropdownItem.d.ts +55 -0
  49. package/dist/components/form/element/dropdownItem.js +118 -0
  50. package/dist/components/form/element/onOffSwitch.d.ts +94 -0
  51. package/dist/components/form/element/onOffSwitch.js +195 -0
  52. package/dist/components/form/element/switch.d.ts +58 -0
  53. package/{lib → dist}/components/form/element/switch.js +29 -66
  54. package/dist/fastMerge.d.ts +9 -0
  55. package/dist/fastMerge.js +77 -0
  56. package/dist/index.d.ts +19 -0
  57. package/dist/index.js +71 -0
  58. package/dist/jquery.expensifyIframify.d.ts +10 -0
  59. package/{lib → dist}/jquery.expensifyIframify.js +52 -93
  60. package/dist/mixins/PubSub.d.ts +20 -0
  61. package/{lib/mixins/PubSub.jsx → dist/mixins/PubSub.js} +12 -11
  62. package/dist/mixins/extraClasses.d.ts +8 -0
  63. package/{lib → dist}/mixins/extraClasses.js +8 -12
  64. package/dist/mixins/validationClasses.d.ts +12 -0
  65. package/dist/mixins/validationClasses.js +58 -0
  66. package/dist/str.d.ts +613 -0
  67. package/{lib → dist}/str.js +176 -160
  68. package/dist/tlds.d.ts +2 -0
  69. package/dist/tlds.js +4 -0
  70. package/dist/utils.d.ts +5 -0
  71. package/dist/utils.js +13 -0
  72. package/package.json +47 -18
  73. package/.editorconfig +0 -34
  74. package/.eslintrc.js +0 -11
  75. package/.github/CODEOWNERS +0 -2
  76. package/.github/CONTRIBUTING.md +0 -163
  77. package/.github/ISSUE_TEMPLATE.md +0 -3
  78. package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
  79. package/.github/workflows/cla.yml +0 -39
  80. package/.github/workflows/lint.yml +0 -29
  81. package/.github/workflows/test.yml +0 -29
  82. package/CLA.md +0 -20
  83. package/Gruntfile.js +0 -13
  84. package/__tests__/ExpensiMark-test.js +0 -340
  85. package/__tests__/Logger-test.js +0 -55
  86. package/__tests__/Str-test.js +0 -53
  87. package/babel.config.js +0 -12
  88. package/grunt/configloader.js +0 -17
  89. package/grunt/configs/chokidar.js +0 -23
  90. package/grunt/configs/eslint.js +0 -15
  91. package/grunt/task/watch.js +0 -3
  92. package/grunt/taskloader.js +0 -25
  93. package/lib/BrowserDetect.jsx +0 -91
  94. package/lib/ExpensiMark.js +0 -253
  95. package/lib/Log.jsx +0 -36
  96. package/lib/Logger.jsx +0 -154
  97. package/lib/PageEvent.jsx +0 -23
  98. package/lib/ReportHistoryStore.jsx +0 -194
  99. package/lib/components/StepProgressBar.js +0 -49
  100. package/lib/components/form/element/dropdown.js +0 -90
  101. package/lib/components/form/element/dropdownItem.js +0 -178
  102. package/lib/components/form/element/onOffSwitch.jsx +0 -229
  103. package/lib/mixins/validationClasses.js +0 -23
  104. package/lib/tlds.jsx +0 -3
package/README.md CHANGED
@@ -1,14 +1,16 @@
1
1
  # `expensify-common`
2
- This is a collection of JS libraries and components which are used across various Expensify projects. These libraries are provided as-is, and the repos which use them will need to do their own bundling, minifying, and uglifying.
2
+ This is a collection of JS/TS libraries and components which are used across various Expensify projects. These libraries are provided as-is, and the repos which use them will need to do their own bundling, minifying, and uglifying.
3
3
 
4
4
  # Installation
5
- 1. Clone this repo to a directory of your choosing
6
- 2. Run `npm install` to install all the dependencies
5
+ `expensify-common` is published to [`npm`](https://www.npmjs.com/package/expensify-common)
6
+
7
+ ```shell
8
+ npm install expensify-common
9
+ ```
7
10
 
8
11
  # Development
9
12
  * Write all code as ES6.
10
- * Always lint your code with `npm run grunt watch`
11
- * Make sure you're using http://editorconfig.org/
13
+ * Always lint your code with `npm run lint`
12
14
 
13
15
  ## Testing your code while you are developing
14
16
  The best way to test your code while you are developing changes is via `npm link`.
@@ -17,6 +19,8 @@ The best way to test your code while you are developing changes is via `npm link
17
19
  1. `cd` into the project directory that has a dependency on `expensify-common`
18
20
  1. Run `npm link expensify-common`
19
21
 
22
+ If that does not work, another option is running `npm i expensify-common ../expensify-common --save`.
23
+
20
24
  Alternatively, you can edit files directly in a project's `node_modules` then apply those changes to this repository.
21
25
 
22
26
  # Proposing a Change (Non-Expensify Contributors)
@@ -26,4 +30,9 @@ Alternatively, you can edit files directly in a project's `node_modules` then ap
26
30
  1. They will review and accept your changes, merge them, then deploy a new version
27
31
 
28
32
  # Deploying a Change (Expensify Only)
29
- 1. Once the PR has been merged update the `package.json` commit hash in any repos with a dependency on `expensify-common`
33
+ Once the PR has been merged, install the new version of the package with `npm install expensify-common@x.x.x` command. Be sure to check the repos below to confirm whether or not they are affected by your changes!
34
+ - Expensify/Web-Expensify
35
+ - Expensify/Web-Secure
36
+ - Expensify/Mobile-Expensify
37
+ - Expensify/App
38
+ - Expensify/Comp
package/dist/API.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @param {Network} network
3
+ * @param {Object} [args]
4
+ * @param {Function} [args.enhanceParameters] A function that takes the existing command parameters and returns a
5
+ * modified version of them (for things like adding CSRF tokens)
6
+ *
7
+ * @returns {Object}
8
+ */
9
+ export default function API(network: Network, args?: {
10
+ enhanceParameters?: Function | undefined;
11
+ } | undefined): Object;