Repository navigation
Expand file tree
/
Copy pathpackage-scripts.js
More file actions
81 lines (72 loc) · 3.19 KB
/
Copy pathpackage-scripts.js
File metadata and controls
81 lines (72 loc) · 3.19 KB
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
/**
* Copyright (c) Forward Email LLC
* SPDX-License-Identifier: BUSL-1.1
*/
const process = require('node:process');
const { series, concurrent } = require('nps-utils');
module.exports = {
scripts: {
all: series.nps('build', 'apps-and-watch'),
appsAndWatch: concurrent.nps('apps', 'watch'),
apps: series.nps('bree', 'api', 'web', 'smtp', 'imap', 'pop3', 'sqlite'),
// `web` is nodemon and never exits, so it and `watch` must run side by
// side (as appsAndWatch does) rather than in series.
webAndWatch: series.nps('build', 'web-and-watch-only'),
webAndWatchOnly: concurrent.nps('web', 'watch'),
// Rule-multiset diff of two compiled bundles, and the screenshot sweep;
// see the headers of the two scripts for usage.
cssDiff: 'node scripts/css-diff.js',
visualSweep: 'node test/visual/sweep.js',
bree: 'nodemon bree.js',
api: 'nodemon api.js',
web: 'nodemon web.js',
smtp: 'SMTP_ALLOW_INSECURE_AUTH=true SMTP_PORT=2432 nodemon smtp.js',
imap: 'IMAP_PORT=2113 nodemon imap.js',
pop3: 'POP3_PORT=2115 nodemon pop3.js',
sqlite: 'nodemon sqlite.js',
// caldav: 'NODE_TLS_REJECT_UNAUTHORIZED=0 nodemon caldav.js',
caldav: 'nodemon caldav.js',
carddav: 'nodemon carddav.js',
mx: 'nodemon mx.js',
watch: 'gulp watch',
clean: 'gulp clean',
build: series('nps buildSieve', 'gulp build'),
buildSieve:
'peggy --format commonjs -o helpers/sieve/parser-generated.js helpers/sieve/grammar.pegjs',
buildTest: series('nps buildSieve', 'NODE_ENV=test gulp build'),
//
// TODO: once remark-preset-github is upgraded to ESM and all deps upgraded
// then we can change `-qo` to `-qfo` to get failure on warnings
// <https://github.com/remarkjs/remark-lint/blob/main/packages/remark-preset-lint-recommended/index.js>
//
lintMd: 'remark . -qo',
lintPkg: 'fixpack',
lintPug: 'prettier --write **/*.pug && pug-lint **/*.pug',
lintJs: 'xo --fix',
lintScss: 'stylelint --fix **/*.scss',
lintCsp: 'node scripts/audit-pug-nonces.js app/views',
lint: concurrent.nps(
'lint-js',
'lint-md',
'lint-pug',
'lint-pkg',
'lint-scss',
'lint-csp'
),
// <https://github.com/kentcdodds/nps-utils/issues/24>
pretest: concurrent.nps('lint', 'build-test'),
test:
process.env.CI_SHARD && process.env.CI_SHARD !== '1'
? 'AVA_SHARD=1 nyc ava'
: process.env.CI_SHARD === '1' || process.env.LOCAL_TEST_SERIAL === '1'
? series('AVA_SHARD=1 nyc ava', 'nps test-sieve')
: 'nps test-shards',
testShards: 'node scripts/run-local-test-shards.js',
testSieve:
'node --test test/sieve/parser.js test/sieve/engine.js test/sieve/extensions.js test/sieve/store.js test/sieve/filter-handler.js test/sieve/security.js test/sieve/managesieve-server.js test/sieve/mx-integration.js test/sieve/runtime-enforcement.js test/sieve/capabilities.js',
testUpdateSnapshots: series('nps pretest', 'ava --update-snapshots'),
testSieveAva: 'ava test/sieve/auth.js test/sieve/integration.js',
testCustomerSupportAi:
'NODE_ENV=test node node_modules/.pnpm/ava@5.3.1/node_modules/ava/entrypoints/cli.mjs test/customer-support-ai'
}
};