-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathpackage.json.sh
executable file
·220 lines (168 loc) · 4.8 KB
/
package.json.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#!/bin/bash
npx lsc -cj > package.json <<EOF
name: 'latex.js'
description: 'JavaScript LaTeX to HTML5 translator'
version: '0.12.6'
author:
'name': 'Michael Brade'
'email': '[email protected]'
keywords:
'pegjs'
'latex'
'parser'
'html5'
bin:
'latex.js': './bin/latex.js'
## we must not use require in .js files anymore when enabling this,
## nor can .ls files be imported as modules in tests
## bugs: https://github.com/mochajs/mocha/issues/4267, https://github.com/nodejs/node/issues/33226
# type:
# 'module'
module:
'./dist/latex.mjs'
main:
'./dist/latex.js'
exports:
import: './dist/latex.mjs'
require: './dist/latex.js'
browser:
'./dist/latex.js'
files:
'bin/latex.js'
'dist/latex.js'
'dist/latex.js.map'
'dist/latex.mjs'
'dist/latex.mjs.map'
'dist/css/'
'dist/fonts/'
'dist/js/'
'dist/packages/'
'dist/documentclasses/'
scripts:
clean: 'rimraf dist bin test/coverage test/test-results.xml docs/.vuepress/public/js;'
devbuild: "
rimraf 'dist/**/*.map';
mkdirp dist/css;
mkdirp dist/js;
mkdirp dist/fonts;
mkdirp dist/documentclasses;
mkdirp dist/packages;
touch dist/documentclasses/.keep;
touch dist/packages/.keep;
rsync -a src/css/ dist/css/;
rsync -a src/fonts/ dist/fonts/;
rsync -a node_modules/katex/dist/fonts/*.woff2 dist/fonts/;
rsync -a src/js/ dist/js/;
mkdirp bin;
lsc -bc --no-header -m embedded -p src/cli.ls > bin/latex.js;
chmod a+x bin/latex.js;
rollup -c;
"
build: 'NODE_ENV=production npm run devbuild;'
# docs/website and playground
devdocs: "
npm run devbuild;
vuepress dev docs --no-clear-screen --debug;
"
docs: "
npm run build;
[ ! -d website ] && git worktree add website gh-pages;
mv website/.git .website.git;
vuepress build docs;
mv .website.git website/.git;
cd website;
git add .;
git commit -m 'regenerated website';
"
# unit tests
test: 'mocha test/*.ls;'
iron: 'iron-node node_modules/.bin/_mocha test/*.ls;'
testc: "
nyc --include=bin --include=src --include=dist -e ls --reporter=html --reporter=text --reporter=lcovonly --report-dir=test/coverage \
npx mocha -i -g screenshot --reporter mocha-junit-reporter --reporter-options mochaFile=./test/test-results.xml test/*.ls
&&
npx mocha -g screenshot --reporter mocha-junit-reporter --reporter-options mochaFile=./test/screenshots/test-results.xml test/*.ls;
"
codecov: 'codecov;'
dependencies:
### CLI dependencies
'commander': '8.x'
'fs-extra': '10.x'
'js-beautify': '1.14.x'
'stdin': '*'
'hyphenation.en-us': '*'
'hyphenation.de': '*'
'svgdom': '^0.1.8'
#'xmldom': '0.3.x'
#'jsdom': '16.x'
#'cheerio': '1.0.x'
devDependencies:
### actual runtime dependencies, but bundled by rollup
'he': '1.2.x'
'katex': '0.13.13'
'@svgdotjs/svg.js': '3.x',
'hypher': '0.x'
'lodash': '4.x'
'livescript': 'https://github.com/michael-brade/LiveScript'
'livescript-transform-esm': '^3.1.0'
'livescript-transform-implicit-async': '^1.1.0'
'livescript-transform-object-create': '^1.1.0'
### building
'pegjs': '0.10.x'
'mkdirp': '1.0.x'
'rimraf': '3.x'
'tmp': '0.x'
'glob': '8.0.x'
### docs
'vuepress': '2.0.0-beta.61'
'@vuepress/plugin-register-components': 'next'
'rollup-plugin-string': '3.0.x'
'split-grid': '1.0.x'
'@codemirror/autocomplete': '6.x'
'@codemirror/commands': '6.x'
'@codemirror/language': '6.x'
'@codemirror/legacy-modes': '6.x'
'@codemirror/lint': '6.x'
'@codemirror/search': '6.x'
'@codemirror/state': '6.x'
'@codemirror/view': '6.x'
'vue-codemirror': '6.1.x'
'stylus': '0.59.x'
### bundling
'rollup': '3.20.x'
'@rollup/plugin-commonjs': '24.1.x'
'@rollup/plugin-node-resolve': '15.0.x'
'@rollup/plugin-terser': '0.4.x'
'rollup-plugin-visualizer': '5.8.x'
### testing
'mocha': '10.1.x'
'mocha-junit-reporter': '2.x'
'chai': '4.x'
'chai-as-promised': '7.x'
'slugify': '1.6.x'
'decache': '4.6.x'
'puppeteer': '19.1.x'
'pixelmatch': '5.3.x'
'nyc': '15.x'
'codecov': '3.x'
'serve-handler': '6.x'
mocha:
require: 'livescript'
file: 'test/lib/setup.ls'
reporter: 'spec'
inlineDiffs: true
timeout: 10000
ui: 'bdd'
checkLeaks: true
globals: 'firefox,chrome'
sort: true
repository:
type: 'git'
url: 'git+https://github.com/michael-brade/LaTeX.js.git'
license: 'MIT'
bugs:
url: 'https://github.com/michael-brade/LaTeX.js/issues'
homepage: 'https://latex.js.org'
engines:
node: '>= 14.0'
EOF