| 1 |
#!/bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
node <<'EOF' |
| 5 |
const assert = require('assert') |
| 6 |
const fs = require('fs') |
| 7 |
const vm = require('vm') |
| 8 |
|
| 9 |
const fullcalendar = require('/usr/share/nodejs/fullcalendar/index.cjs') |
| 10 |
assert.strictEqual(typeof fullcalendar.Calendar, 'function') |
| 11 |
|
| 12 |
for (const moduleName of [ |
| 13 |
'bootstrap', |
| 14 |
'bootstrap5', |
| 15 |
'core', |
| 16 |
'daygrid', |
| 17 |
'google-calendar', |
| 18 |
'icalendar', |
| 19 |
'interaction', |
| 20 |
'list', |
| 21 |
'luxon', |
| 22 |
'luxon2', |
| 23 |
'luxon3', |
| 24 |
'moment', |
| 25 |
'moment-timezone', |
| 26 |
'multimonth', |
| 27 |
'rrule', |
| 28 |
'timegrid', |
| 29 |
]) { |
| 30 |
const mod = require(`/usr/share/nodejs/@fullcalendar/${moduleName}/index.cjs`) |
| 31 |
assert.ok(mod.default || mod.Calendar || Object.keys(mod).length, moduleName) |
| 32 |
} |
| 33 |
|
| 34 |
for (const filename of [ |
| 35 |
'/usr/share/javascript/fullcalendar/index.global.js', |
| 36 |
'/usr/share/javascript/fullcalendar/index.global.min.js', |
| 37 |
]) { |
| 38 |
const context = {} |
| 39 |
vm.runInNewContext(fs.readFileSync(filename, 'utf8'), context, { filename }) |
| 40 |
assert.strictEqual(typeof context.FullCalendar.Calendar, 'function') |
| 41 |
} |
| 42 |
EOF |
| 43 |
|
| 44 |
node --input-type=module <<'EOF' |
| 45 |
const fullcalendar = await import('/usr/share/nodejs/fullcalendar/index.js') |
| 46 |
if (typeof fullcalendar.Calendar !== 'function') { |
| 47 |
throw new Error('fullcalendar ESM did not export Calendar') |
| 48 |
} |
| 49 |
EOF |