dismantle 0.2.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 (73) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +40 -0
  3. package/dist/cjs/development/index.cjs +1484 -0
  4. package/dist/cjs/development/index.cjs.map +7 -0
  5. package/dist/cjs/development/runtime.cjs +1484 -0
  6. package/dist/cjs/development/runtime.cjs.map +7 -0
  7. package/dist/cjs/production/index.cjs +1 -0
  8. package/dist/cjs/production/runtime.cjs +1 -0
  9. package/dist/esm/development/index.mjs +1453 -0
  10. package/dist/esm/development/index.mjs.map +7 -0
  11. package/dist/esm/development/runtime.mjs +1453 -0
  12. package/dist/esm/development/runtime.mjs.map +7 -0
  13. package/dist/esm/production/index.mjs +1 -0
  14. package/dist/esm/production/runtime.mjs +1 -0
  15. package/dist/types/hidden-imports.d.ts +4 -0
  16. package/dist/types/hidden-imports.d.ts.map +1 -0
  17. package/dist/types/index.d.ts +9 -0
  18. package/dist/types/index.d.ts.map +1 -0
  19. package/dist/types/plugin.d.ts +8 -0
  20. package/dist/types/plugin.d.ts.map +1 -0
  21. package/dist/types/split.d.ts +7 -0
  22. package/dist/types/split.d.ts.map +1 -0
  23. package/dist/types/transform-block.d.ts +5 -0
  24. package/dist/types/transform-block.d.ts.map +1 -0
  25. package/dist/types/transform-call.d.ts +5 -0
  26. package/dist/types/transform-call.d.ts.map +1 -0
  27. package/dist/types/types.d.ts +62 -0
  28. package/dist/types/types.d.ts.map +1 -0
  29. package/dist/types/utils/assert.d.ts +2 -0
  30. package/dist/types/utils/assert.d.ts.map +1 -0
  31. package/dist/types/utils/generator-shim.d.ts +4 -0
  32. package/dist/types/utils/generator-shim.d.ts.map +1 -0
  33. package/dist/types/utils/get-descriptive-name.d.ts +3 -0
  34. package/dist/types/utils/get-descriptive-name.d.ts.map +1 -0
  35. package/dist/types/utils/get-foreign-bindings.d.ts +3 -0
  36. package/dist/types/utils/get-foreign-bindings.d.ts.map +1 -0
  37. package/dist/types/utils/get-identifiers-from-lval.d.ts +3 -0
  38. package/dist/types/utils/get-identifiers-from-lval.d.ts.map +1 -0
  39. package/dist/types/utils/get-import-identifier.d.ts +5 -0
  40. package/dist/types/utils/get-import-identifier.d.ts.map +1 -0
  41. package/dist/types/utils/get-import-specifier-name.d.ts +3 -0
  42. package/dist/types/utils/get-import-specifier-name.d.ts.map +1 -0
  43. package/dist/types/utils/get-module-definition.d.ts +4 -0
  44. package/dist/types/utils/get-module-definition.d.ts.map +1 -0
  45. package/dist/types/utils/get-root-statement-path.d.ts +3 -0
  46. package/dist/types/utils/get-root-statement-path.d.ts.map +1 -0
  47. package/dist/types/utils/register-import-specifiers.d.ts +5 -0
  48. package/dist/types/utils/register-import-specifiers.d.ts.map +1 -0
  49. package/dist/types/utils/unwrap.d.ts +11 -0
  50. package/dist/types/utils/unwrap.d.ts.map +1 -0
  51. package/dist/types/utils/xxhash32.d.ts +7 -0
  52. package/dist/types/utils/xxhash32.d.ts.map +1 -0
  53. package/package.json +90 -0
  54. package/src/hidden-imports.ts +13 -0
  55. package/src/index.ts +90 -0
  56. package/src/plugin.ts +26 -0
  57. package/src/split.ts +1074 -0
  58. package/src/transform-block.ts +115 -0
  59. package/src/transform-call.ts +100 -0
  60. package/src/types.ts +73 -0
  61. package/src/utils/assert.ts +5 -0
  62. package/src/utils/errors.ts +21 -0
  63. package/src/utils/generator-shim.ts +22 -0
  64. package/src/utils/get-descriptive-name.ts +42 -0
  65. package/src/utils/get-foreign-bindings.ts +60 -0
  66. package/src/utils/get-identifiers-from-lval.ts +44 -0
  67. package/src/utils/get-import-identifier.ts +23 -0
  68. package/src/utils/get-import-specifier-name.ts +10 -0
  69. package/src/utils/get-module-definition.ts +53 -0
  70. package/src/utils/get-root-statement-path.ts +14 -0
  71. package/src/utils/register-import-specifiers.ts +77 -0
  72. package/src/utils/unwrap.ts +63 -0
  73. package/src/utils/xxhash32.ts +214 -0
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ MIT License Copyright (c) 2023 Alexis Munsayac
2
+
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
+
5
+ The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # `dismantle`
2
+
3
+ > Universal directive code-splitter
4
+
5
+ [![NPM](https://img.shields.io/npm/v/dismantle.svg)](https://www.npmjs.com/package/dismantle) [![JavaScript Style Guide](https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb)](https://github.com/airbnb/javascript)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm i dismantle
11
+ ```
12
+
13
+ ```bash
14
+ yarn add dismantle
15
+ ```
16
+
17
+ ```bash
18
+ pnpm add dismantle
19
+ ```
20
+
21
+ ## Features
22
+
23
+ - Directive Splitting
24
+ - Function Call Splitting
25
+ - Closure Extraction
26
+ - Remote Control Flows
27
+ - Remote Mutations
28
+
29
+ ## Docs
30
+
31
+ - [Configuration](https://github.com/lxsmnsyc/dismantle/blob/main/docs/configuration.md)
32
+ - [Contracts](https://github.com/lxsmnsyc/dismantle/blob/main/docs/contracts.md)
33
+
34
+ ## Sponsors
35
+
36
+ ![Sponsors](https://github.com/lxsmnsyc/sponsors/blob/main/sponsors.svg?raw=true)
37
+
38
+ ## License
39
+
40
+ MIT © [lxsmnsyc](https://github.com/lxsmnsyc)