version 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #! /usr/bin/env node
  2. /*************************************************************
  3. *
  4. * Copyright (c) 2022 The MathJax Consortium
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. /**
  19. * @fileoverview Creates the version.ts file from the package version number
  20. *
  21. * @author dpvc@mathjax.org (Davide Cervone)
  22. */
  23. const fs = require('fs');
  24. const path = require('path');
  25. const package = path.resolve(__dirname, '..', '..', 'package.json');
  26. const version = require(package).version;
  27. const lines = `/*************************************************************
  28. *
  29. * Copyright (c) 2022 The MathJax Consortium
  30. *
  31. * Licensed under the Apache License, Version 2.0 (the "License");
  32. * you may not use this file except in compliance with the License.
  33. * You may obtain a copy of the License at
  34. *
  35. * http://www.apache.org/licenses/LICENSE-2.0
  36. *
  37. * Unless required by applicable law or agreed to in writing, software
  38. * distributed under the License is distributed on an "AS IS" BASIS,
  39. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  40. * See the License for the specific language governing permissions and
  41. * limitations under the License.
  42. */
  43. /**
  44. * @fileoverview The version of MathJax (used to tell what version a component
  45. * was compiled against).
  46. *
  47. * @author dpvc@mathjax.org (Davide Cervone)
  48. */
  49. export const VERSION = '${version}';
  50. `;
  51. fs.writeFileSync(path.resolve(__dirname, '..', '..', 'ts', 'components', 'version.ts'), lines);