perseus-custom 0.0.7 → 0.0.9

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 (39) hide show
  1. package/README.md +24 -0
  2. package/dist/es/index.js +2300 -1004
  3. package/dist/es/index.js.map +1 -1
  4. package/dist/index.js +2300 -1003
  5. package/dist/index.js.map +1 -1
  6. package/index.html +194 -0
  7. package/package.json +8 -7
  8. package/src/__genfiles__/parser.js +214 -117
  9. package/src/__tests__/parsing_test.js +24 -0
  10. package/src/a.txt +9087 -0
  11. package/src/nodes.js +45 -0
  12. package/src/parser-generator.js +52 -4
  13. package/dist/__tests__/checking-form_test.d.ts +0 -2
  14. package/dist/__tests__/checking-form_test.d.ts.map +0 -1
  15. package/dist/__tests__/comparing_test.d.ts +0 -2
  16. package/dist/__tests__/comparing_test.d.ts.map +0 -1
  17. package/dist/__tests__/compilation_test.d.ts +0 -2
  18. package/dist/__tests__/compilation_test.d.ts.map +0 -1
  19. package/dist/__tests__/evaluating_test.d.ts +0 -2
  20. package/dist/__tests__/evaluating_test.d.ts.map +0 -1
  21. package/dist/__tests__/index_test.d.ts +0 -2
  22. package/dist/__tests__/index_test.d.ts.map +0 -1
  23. package/dist/__tests__/parsing_test.d.ts +0 -2
  24. package/dist/__tests__/parsing_test.d.ts.map +0 -1
  25. package/dist/__tests__/rendering_test.d.ts +0 -2
  26. package/dist/__tests__/rendering_test.d.ts.map +0 -1
  27. package/dist/__tests__/transforming_test.d.ts +0 -2
  28. package/dist/__tests__/transforming_test.d.ts.map +0 -1
  29. package/dist/__tests__/units_test.d.ts +0 -2
  30. package/dist/__tests__/units_test.d.ts.map +0 -1
  31. package/dist/compare.d.ts +0 -12
  32. package/dist/compare.d.ts.map +0 -1
  33. package/dist/index.d.ts +0 -127
  34. package/dist/index.d.ts.map +0 -1
  35. package/dist/nodes.d.ts +0 -118
  36. package/dist/nodes.d.ts.map +0 -1
  37. package/dist/parser-generator.d.ts +0 -3
  38. package/dist/parser-generator.d.ts.map +0 -1
  39. package/src/index.d.ts +0 -127
package/README.md CHANGED
@@ -89,6 +89,30 @@ First, make any changes in `src/parser-generator.js`
89
89
  npm install
90
90
  npm run build:parser
91
91
 
92
+ How to run tests
93
+ ----------------
94
+ From the monorepo root, run:
95
+
96
+ yarn test packages/kas
97
+
98
+ If the monorepo test infrastructure has compatibility issues (e.g., ESM module errors with enzyme/cheerio), you can run kas tests directly with a minimal jest config:
99
+
100
+ ```bash
101
+ npx jest packages/kas/src/__tests__/parsing_test.js --no-coverage \
102
+ --config='{"testEnvironment":"node","transform":{"^.+\\.jsx?$":"<rootDir>/config/test/test.transform.js"},"moduleNameMapper":{"^@khanacademy/kas$":"<rootDir>/packages/kas/src/index.js"}}'
103
+ ```
104
+
105
+ Or test parsing manually with node:
106
+
107
+ ```bash
108
+ cd packages/kas && yarn build
109
+ node -e "
110
+ const KAS = require('./dist/index.js');
111
+ console.log(KAS.parse('(2,3)'));
112
+ // { parsed: true, expr: Coord { x: Int, y: Int } }
113
+ "
114
+ ```
115
+
92
116
  License
93
117
  -------
94
118
  [MIT License](http://opensource.org/licenses/MIT)