+139
-47
lines changedFilter options
+139
-47
lines changed Original file line number Diff line number Diff line change
@@ -6,8 +6,9 @@ coverage.html
6
6
*.js.map
7
7
.nyc_output
8
8
yarn-error.log
9
-
fontkit.js
10
-
fontkit.min.js
9
+
dist/
10
+
es/
11
+
lib/
11
12
trie.json
12
13
trieIndic.json
13
14
trieUse.json
Original file line number Diff line number Diff line change
@@ -10,35 +10,64 @@ target.all = () => {
10
10
target.clean();
11
11
target.generateTrieJson();
12
12
target.moveTrieJsonToRoot();
13
-
target.rollupUMD();
14
-
target.rollupUMDMin();
13
+
target.compileBabel();
14
+
// target.rollupUMD();
15
+
// target.rollupUMDMin();
15
16
};
16
17
17
18
target.generateTrieJson = () => {
19
+
env.MODULE_TYPE = 'commonjs';
18
20
exec('babel-node src/opentype/shapers/generate-data.js');
19
21
exec('babel-node src/opentype/shapers/gen-use.js');
20
22
exec('babel-node src/opentype/shapers/gen-indic.js');
21
23
};
22
24
23
25
target.moveTrieJsonToRoot = () => {
24
26
target.generateTrieJson();
25
-
// mv('src/opentype/shapers/trie.json', 'trie.json');
26
-
// mv('src/opentype/shapers/trieUse.json', 'trieUse.json');
27
-
// mv('src/opentype/shapers/trieIndic.json', 'trieIndic.json');
27
+
mkdir('-p', 'es/opentype/shapers/')
28
+
mkdir('-p', 'lib/opentype/shapers/')
29
+
cp(
30
+
'src/opentype/shapers/trie.json',
31
+
'src/opentype/shapers/trieUse.json',
32
+
'src/opentype/shapers/trieIndic.json',
33
+
'es/opentype/shapers/'
34
+
);
35
+
cp(
36
+
'src/opentype/shapers/trie.json',
37
+
'src/opentype/shapers/trieUse.json',
38
+
'src/opentype/shapers/trieIndic.json',
39
+
'lib/opentype/shapers/'
40
+
);
28
41
};
29
42
43
+
target.compileBabel = () => {
44
+
target.moveTrieJsonToRoot();
45
+
env.MODULE_TYPE = 'es6';
46
+
exec(`babel --out-dir es src/`);
47
+
env.MODULE_TYPE = 'commonjs';
48
+
exec(`babel --out-dir lib src/`);
49
+
}
50
+
30
51
target.rollupUMD = () => {
31
52
target.moveTrieJsonToRoot();
32
53
env.UGLIFY = false;
33
-
exec('rollup -c rollup.config.js -o fontkit.js');
54
+
exec('rollup -c rollup.config.js -o dist/fontkit.js');
34
55
};
35
56
36
57
target.rollupUMDMin = () => {
37
58
target.moveTrieJsonToRoot();
38
59
env.UGLIFY = true;
39
-
exec('rollup -c rollup.config.js -o fontkit.min.js');
60
+
exec('rollup -c rollup.config.js -o dist/fontkit.min.js');
40
61
};
41
62
42
63
target.clean = () => {
43
-
rm('-f', 'fonkit.js', 'fontkit.min.js', 'trie.json', 'trieUse.json', 'trieIndic.json');
64
+
rm(
65
+
'-rf',
66
+
'lib',
67
+
'es',
68
+
'dist',
69
+
'src/opentype/shapers/trie.json',
70
+
'src/opentype/shapers/trieUse.json',
71
+
'src/opentype/shapers/trieIndic.json',
72
+
);
44
73
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
1
+
module.exports = (api) => {
2
+
api.cache(true);
3
+
4
+
const { MODULE_TYPE } = process.env;
5
+
6
+
// MODULE_TYPE = 'commonjs' | 'es6'
7
+
const modules = MODULE_TYPE === 'commonjs' ? 'commonjs' : false;
8
+
9
+
return {
10
+
presets: [['@babel/preset-env', { modules }]],
11
+
plugins: [
12
+
['@babel/plugin-proposal-decorators', { legacy: true }],
13
+
['@babel/plugin-proposal-class-properties']
14
+
],
15
+
env: {
16
+
test: {
17
+
presets: [['@babel/preset-env', { modules: 'commonjs' }]],
18
+
},
19
+
cover: {
20
+
plugins: ['istanbul']
21
+
}
22
+
}
23
+
};
24
+
}
Original file line number Diff line number Diff line change
@@ -2,35 +2,27 @@
2
2
"name": "fontkit",
3
3
"version": "1.7.7",
4
4
"description": "An advanced font engine for Node and the browser",
5
-
"keywords": [
6
-
"opentype",
7
-
"font",
8
-
"typography",
9
-
"subset",
10
-
"emoji",
11
-
"glyph",
12
-
"layout"
13
-
],
5
+
"main": "lib/index.js",
6
+
"unpkg": "dist/fontkit.min.js",
7
+
"module": "es/index.js",
14
8
"scripts": {
15
9
"make": "node Makefile.js",
16
10
"clean": "node Makefile.js clean",
17
11
"test": "mocha",
18
12
"coverage": "cross-env BABEL_ENV=cover nyc mocha",
19
13
"build-bundle": "browserify --insert-globals --standalone fontkit ./index.js | uglifyjs --mangle -c > bundle.js"
20
14
},
21
-
"main": "fontkit.js",
22
-
"files": [
23
-
"src",
24
-
"base.js",
25
-
"base.js.map",
26
-
"index.js",
27
-
"index.js.map",
28
-
"data.trie",
29
-
"use.trie",
30
-
"indic.trie"
31
-
],
32
15
"author": "Devon Govett <devongovett@gmail.com>",
33
16
"license": "MIT",
17
+
"keywords": [
18
+
"opentype",
19
+
"font",
20
+
"typography",
21
+
"subset",
22
+
"emoji",
23
+
"glyph",
24
+
"layout"
25
+
],
34
26
"dependencies": {
35
27
"brotli": "^1.2.0",
36
28
"browserify-optional": "^1.0.0",
@@ -61,8 +53,10 @@
61
53
"rollup": "^0.68.0",
62
54
"rollup-plugin-analyzer": "^2.1.0",
63
55
"rollup-plugin-babel": "^4.1.0",
56
+
"rollup-plugin-commonjs": "^9.2.0",
64
57
"rollup-plugin-json": "^3.1.0",
65
58
"rollup-plugin-local-resolve": "^1.0.7",
59
+
"rollup-plugin-node-resolve": "^4.0.0",
66
60
"rollup-plugin-uglify": "^6.0.0"
67
61
}
68
62
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
1
1
import babel from 'rollup-plugin-babel';
2
+
import nodeResolve from 'rollup-plugin-node-resolve';
2
3
import localResolve from 'rollup-plugin-local-resolve';
4
+
import commonjs from 'rollup-plugin-commonjs';
3
5
import json from 'rollup-plugin-json';
4
6
import { uglify } from 'rollup-plugin-uglify';
5
7
import { plugin as analyze } from 'rollup-plugin-analyzer';
@@ -14,13 +16,26 @@ export default {
14
16
},
15
17
plugins: [
16
18
// analyze(),
17
-
localResolve(),
19
+
nodeResolve({
20
+
jsnext: true,
21
+
preferBuiltins: false,
22
+
}),
23
+
// localResolve(),
24
+
commonjs({
25
+
exclude: 'src/**',
26
+
namedExports: {
27
+
'node_modules/unicode-trie/index.js': ['default'],
28
+
29
+
// TODO: Remove this once create fork of restructure that exports es/
30
+
'node_modules/restructure/index.js': ['default'],
31
+
},
32
+
}),
18
33
json(),
19
34
babel({
20
-
// TODO: Use external .babelrc file?
21
35
babelrc: false,
36
+
// exclude: 'node_modules/**',
22
37
presets: [
23
-
['@babel/preset-env', { modules: false, loose: true }]
38
+
['@babel/preset-env', { loose: true }]
24
39
],
25
40
plugins: [
26
41
['@babel/plugin-proposal-decorators', { legacy: true }],
Original file line number Diff line number Diff line change
@@ -1031,6 +1031,11 @@ builtin-modules@^1.0.0:
1031
1031
version "1.1.1"
1032
1032
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
1033
1033
1034
+
builtin-modules@^3.0.0:
1035
+
version "3.0.0"
1036
+
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.0.0.tgz#1e587d44b006620d90286cc7a9238bbc6129cab1"
1037
+
integrity sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==
1038
+
1034
1039
cache-base@^1.0.1:
1035
1040
version "1.0.1"
1036
1041
resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
@@ -2162,6 +2167,11 @@ is-glob@^4.0.0:
2162
2167
dependencies:
2163
2168
is-extglob "^2.1.1"
2164
2169
2170
+
is-module@^1.0.0:
2171
+
version "1.0.0"
2172
+
resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
2173
+
integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=
2174
+
2165
2175
is-number@^2.1.0:
2166
2176
version "2.1.0"
2167
2177
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
@@ -2489,6 +2499,13 @@ lru-cache@^4.0.1:
2489
2499
pseudomap "^1.0.2"
2490
2500
yallist "^2.1.2"
2491
2501
2502
+
magic-string@^0.25.1:
2503
+
version "0.25.1"
2504
+
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.1.tgz#b1c248b399cd7485da0fe7385c2fc7011843266e"
2505
+
integrity sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg==
2506
+
dependencies:
2507
+
sourcemap-codec "^1.4.1"
2508
+
2492
2509
make-dir@^1.0.0:
2493
2510
version "1.3.0"
2494
2511
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
@@ -3268,7 +3285,7 @@ resolve@1.1.7:
3268
3285
version "1.1.7"
3269
3286
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
3270
3287
3271
-
resolve@^1.1.6, resolve@^1.3.2:
3288
+
resolve@^1.1.6, resolve@^1.3.2, resolve@^1.8.1:
3272
3289
version "1.9.0"
3273
3290
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06"
3274
3291
integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==
@@ -3310,6 +3327,16 @@ rollup-plugin-babel@^4.1.0:
3310
3327
"@babel/helper-module-imports" "^7.0.0"
3311
3328
rollup-pluginutils "^2.3.0"
3312
3329
3330
+
rollup-plugin-commonjs@^9.2.0:
3331
+
version "9.2.0"
3332
+
resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz#4604e25069e0c78a09e08faa95dc32dec27f7c89"
3333
+
integrity sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA==
3334
+
dependencies:
3335
+
estree-walker "^0.5.2"
3336
+
magic-string "^0.25.1"
3337
+
resolve "^1.8.1"
3338
+
rollup-pluginutils "^2.3.3"
3339
+
3313
3340
rollup-plugin-json@^3.1.0:
3314
3341
version "3.1.0"
3315
3342
resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-3.1.0.tgz#7c1daf60c46bc21021ea016bd00863561a03321b"
@@ -3321,6 +3348,15 @@ rollup-plugin-local-resolve@^1.0.7:
3321
3348
version "1.0.7"
3322
3349
resolved "https://registry.yarnpkg.com/rollup-plugin-local-resolve/-/rollup-plugin-local-resolve-1.0.7.tgz#c486701716c15add2127565c2eaa101123320887"
3323
3350
3351
+
rollup-plugin-node-resolve@^4.0.0:
3352
+
version "4.0.0"
3353
+
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.0.tgz#9bc6b8205e9936cc0e26bba2415f1ecf1e64d9b2"
3354
+
integrity sha512-7Ni+/M5RPSUBfUaP9alwYQiIKnKeXCOHiqBpKUl9kwp3jX5ZJtgXAait1cne6pGEVUUztPD6skIKH9Kq9sNtfw==
3355
+
dependencies:
3356
+
builtin-modules "^3.0.0"
3357
+
is-module "^1.0.0"
3358
+
resolve "^1.8.1"
3359
+
3324
3360
rollup-plugin-uglify@^6.0.0:
3325
3361
version "6.0.0"
3326
3362
resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.0.tgz#15aa8919e5cdc63b7cfc9319c781788b40084ce4"
@@ -3331,7 +3367,7 @@ rollup-plugin-uglify@^6.0.0:
3331
3367
serialize-javascript "^1.5.0"
3332
3368
uglify-js "^3.4.9"
3333
3369
3334
-
rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.3.1:
3370
+
rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.3.3:
3335
3371
version "2.3.3"
3336
3372
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794"
3337
3373
integrity sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==
@@ -3510,6 +3546,11 @@ source-map@~0.2.0:
3510
3546
dependencies:
3511
3547
amdefine ">=0.0.4"
3512
3548
3549
+
sourcemap-codec@^1.4.1:
3550
+
version "1.4.4"
3551
+
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz#c63ea927c029dd6bd9a2b7fa03b3fec02ad56e9f"
3552
+
integrity sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==
3553
+
3513
3554
spawn-wrap@1.2.4:
3514
3555
version "1.2.4"
3515
3556
resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.2.4.tgz#920eb211a769c093eebfbd5b0e7a5d2e68ab2e40"
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4