securemark 0.244.1 → 0.246.0
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.
- package/.eslintrc.json +26 -0
- package/CHANGELOG.md +12 -0
- package/dist/index.js +9308 -0
- package/global.test.d.ts +6 -2
- package/index.ts +4 -0
- package/karma.conf.js +20 -38
- package/package.json +28 -34
- package/src/parser/block/extension/table.test.ts +25 -30
- package/src/parser/block/extension/table.ts +38 -38
- package/src/parser/inline/bracket.test.ts +3 -0
- package/src/parser/inline/bracket.ts +1 -1
- package/src/renderer/render/code.ts +1 -1
- package/src/renderer/render/media/twitter.ts +2 -2
- package/tsconfig.json +10 -7
- package/webpack.config.js +129 -0
- package/dist/securemark.js +0 -8578
- package/gulpfile.js +0 -208
- package/package-lock.json +0 -11857
package/gulpfile.js
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
const gulp = require('gulp');
|
|
2
|
-
const { series } = gulp;
|
|
3
|
-
const glob = require('glob');
|
|
4
|
-
const shell = cmd => require('child_process').execSync(cmd, { stdio: [0, 1, 2] });
|
|
5
|
-
const del = require('del');
|
|
6
|
-
const source = require('vinyl-source-stream');
|
|
7
|
-
const buffer = require('vinyl-buffer');
|
|
8
|
-
const $ = require('gulp-load-plugins')();
|
|
9
|
-
const browserify = require('browserify');
|
|
10
|
-
const tsify = require('tsify');
|
|
11
|
-
const Server = require('karma').Server;
|
|
12
|
-
|
|
13
|
-
const pkg = require('./package.json');
|
|
14
|
-
const config = {
|
|
15
|
-
browsers: ['Chrome', 'Firefox'].concat((os => {
|
|
16
|
-
switch (os) {
|
|
17
|
-
case 'Windows_NT':
|
|
18
|
-
return [];
|
|
19
|
-
case 'Darwin':
|
|
20
|
-
return [];
|
|
21
|
-
default:
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
})(require('os').type())),
|
|
25
|
-
ts: {
|
|
26
|
-
dist: {
|
|
27
|
-
src: [
|
|
28
|
-
'*.ts'
|
|
29
|
-
],
|
|
30
|
-
dest: 'dist'
|
|
31
|
-
},
|
|
32
|
-
test: {
|
|
33
|
-
src: [
|
|
34
|
-
'*.ts',
|
|
35
|
-
'src/**/*.ts',
|
|
36
|
-
'test/**/*.ts'
|
|
37
|
-
],
|
|
38
|
-
dest: 'dist'
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
site: {
|
|
42
|
-
js: './gh-pages/assets/js/lib',
|
|
43
|
-
},
|
|
44
|
-
banner: [
|
|
45
|
-
`/*! ${pkg.name} v${pkg.version} ${pkg.repository.url} | (c) 2017, ${pkg.author} | ${pkg.license} */`,
|
|
46
|
-
''
|
|
47
|
-
].join('\n'),
|
|
48
|
-
module: `
|
|
49
|
-
(function (root, factory) {
|
|
50
|
-
if (typeof define === 'function' && define.amd) {
|
|
51
|
-
define([], factory);
|
|
52
|
-
} else if (typeof module === 'object' && module.exports) {
|
|
53
|
-
module.exports = factory();
|
|
54
|
-
} else {
|
|
55
|
-
root.commonJsStrict = factory();
|
|
56
|
-
}
|
|
57
|
-
}(typeof self !== 'undefined' ? self : this, function () {
|
|
58
|
-
return require('${pkg.name}');
|
|
59
|
-
}));
|
|
60
|
-
`,
|
|
61
|
-
clean: [
|
|
62
|
-
'dist',
|
|
63
|
-
'gh-pages/assets/*/**/lib',
|
|
64
|
-
]
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
function parallel(...tasks) {
|
|
68
|
-
return () =>
|
|
69
|
-
shell(`concurrently ${tasks.map(task => `"gulp ${task}"`).join(' ')}`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function compile(src, watch = false) {
|
|
73
|
-
let done = true;
|
|
74
|
-
return browserify(
|
|
75
|
-
Object.values(src).map(p => glob.sync(p)),
|
|
76
|
-
{
|
|
77
|
-
cache: {},
|
|
78
|
-
packageCache: {},
|
|
79
|
-
})
|
|
80
|
-
.require(`./index.ts`, { expose: pkg.name })
|
|
81
|
-
.plugin(tsify, { global: true, ...require('./tsconfig.json').compilerOptions })
|
|
82
|
-
.transform('browserify-shim', { global: true })
|
|
83
|
-
.bundle()
|
|
84
|
-
.on("error", err => done = console.log(err + '') || watch)
|
|
85
|
-
.pipe(source(`${pkg.name}.js`))
|
|
86
|
-
.pipe(buffer())
|
|
87
|
-
.pipe($.derequire())
|
|
88
|
-
.once("finish", () => done || process.exit(1))
|
|
89
|
-
.pipe($.footer(config.module));
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
gulp.task('ts:dev', () =>
|
|
93
|
-
gulp.watch(config.ts.test.src, { ignoreInitial: false }, () =>
|
|
94
|
-
compile(config.ts.test.src, true)
|
|
95
|
-
.pipe($.rename({ extname: '.test.js' }))
|
|
96
|
-
.pipe(gulp.dest(config.ts.test.dest))));
|
|
97
|
-
|
|
98
|
-
gulp.task('ts:test', () =>
|
|
99
|
-
compile(config.ts.test.src)
|
|
100
|
-
.pipe($.rename({ extname: '.test.js' }))
|
|
101
|
-
.pipe(gulp.dest(config.ts.test.dest))
|
|
102
|
-
.pipe($.eslint({
|
|
103
|
-
'parserOptions': {
|
|
104
|
-
'ecmaVersion': 2020,
|
|
105
|
-
},
|
|
106
|
-
'env': {
|
|
107
|
-
'es2020': true,
|
|
108
|
-
},
|
|
109
|
-
'plugins': ['redos'],
|
|
110
|
-
'rules': {
|
|
111
|
-
'redos/no-vulnerable': [
|
|
112
|
-
'error',
|
|
113
|
-
{
|
|
114
|
-
ignoreErrors: false,
|
|
115
|
-
timeout: 30000,
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
}))
|
|
120
|
-
.pipe($.eslint.format())
|
|
121
|
-
.pipe($.eslint.failAfterError()));
|
|
122
|
-
|
|
123
|
-
gulp.task('ts:dist', () =>
|
|
124
|
-
compile(config.ts.dist.src)
|
|
125
|
-
.pipe($.unassert())
|
|
126
|
-
.pipe($.header(config.banner))
|
|
127
|
-
.pipe(gulp.dest(config.site.js))
|
|
128
|
-
.pipe(gulp.dest(config.ts.dist.dest)));
|
|
129
|
-
|
|
130
|
-
gulp.task('ts:view', () =>
|
|
131
|
-
gulp.watch(config.ts.test.src, { ignoreInitial: false }, () =>
|
|
132
|
-
compile(config.ts.dist.src, true)
|
|
133
|
-
.pipe($.unassert())
|
|
134
|
-
.pipe($.header(config.banner))
|
|
135
|
-
.pipe(gulp.dest(config.site.js))));
|
|
136
|
-
|
|
137
|
-
gulp.task('karma:dev', done =>
|
|
138
|
-
void new Server({
|
|
139
|
-
configFile: __dirname + '/karma.conf.js',
|
|
140
|
-
browsers: config.browsers,
|
|
141
|
-
preprocessors: {
|
|
142
|
-
'dist/*.js': ['espower']
|
|
143
|
-
},
|
|
144
|
-
singleRun: false,
|
|
145
|
-
}, done).start());
|
|
146
|
-
|
|
147
|
-
gulp.task('karma:test', done =>
|
|
148
|
-
void new Server({
|
|
149
|
-
configFile: __dirname + '/karma.conf.js',
|
|
150
|
-
browsers: config.browsers,
|
|
151
|
-
reporters: ['dots'],
|
|
152
|
-
preprocessors: {
|
|
153
|
-
'dist/*.js': ['espower']
|
|
154
|
-
},
|
|
155
|
-
concurrency: 1,
|
|
156
|
-
}, done).start());
|
|
157
|
-
|
|
158
|
-
gulp.task('clean', () =>
|
|
159
|
-
del(config.clean));
|
|
160
|
-
|
|
161
|
-
gulp.task('install', done => {
|
|
162
|
-
shell('npm i --no-shrinkwrap');
|
|
163
|
-
done();
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
gulp.task('update', done => {
|
|
167
|
-
shell('bundle update');
|
|
168
|
-
shell('ncu -u');
|
|
169
|
-
//shell('ncu -ut greatest typescript');
|
|
170
|
-
shell('npm i --no-shrinkwrap');
|
|
171
|
-
done();
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
gulp.task('dev',
|
|
175
|
-
series(
|
|
176
|
-
'clean',
|
|
177
|
-
parallel(
|
|
178
|
-
'ts:dev',
|
|
179
|
-
'karma:dev',
|
|
180
|
-
)));
|
|
181
|
-
|
|
182
|
-
gulp.task('test',
|
|
183
|
-
series(
|
|
184
|
-
'clean',
|
|
185
|
-
series(
|
|
186
|
-
'ts:test',
|
|
187
|
-
'karma:test',
|
|
188
|
-
'ts:dist',
|
|
189
|
-
)));
|
|
190
|
-
|
|
191
|
-
gulp.task('dist',
|
|
192
|
-
series(
|
|
193
|
-
'clean',
|
|
194
|
-
series(
|
|
195
|
-
'ts:dist',
|
|
196
|
-
)));
|
|
197
|
-
|
|
198
|
-
gulp.task('view',
|
|
199
|
-
series(
|
|
200
|
-
'clean',
|
|
201
|
-
() =>
|
|
202
|
-
shell([
|
|
203
|
-
'concurrently',
|
|
204
|
-
'"gulp dev"',
|
|
205
|
-
'"gulp ts:view"',
|
|
206
|
-
'"bundle exec jekyll serve -s ./gh-pages -d ./gh-pages/_site --incremental"'
|
|
207
|
-
].join(' ')),
|
|
208
|
-
));
|