forked from toeverything/blocksuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.size-limit.cjs
107 lines (99 loc) · 2.62 KB
/
.size-limit.cjs
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
const path = require('path');
const fs = require('fs');
const entry = path.resolve(__dirname, 'packages');
function getFoldersWithPackageJson(dir) {
let folders = [];
const items = fs.readdirSync(dir);
for (const item of items) {
if (item.includes('node_modules') || item.includes('src')) {
break;
}
const fullPath = path.join(dir, item);
if (fs.statSync(fullPath).isDirectory()) {
if (fs.existsSync(path.join(fullPath, 'package.json'))) {
folders.push(fullPath);
}
folders = folders.concat(getFoldersWithPackageJson(fullPath));
}
}
return folders;
}
const packagejson = require('./package.json');
const folders = getFoldersWithPackageJson(entry)
.map(p => {
const packageJson = path.join(p, 'package.json');
const json = require(packageJson);
return { json, path: p };
})
.filter(data => {
return !data.json.private;
})
.map(data => ({
name: data.json.name,
path: [path.join(data.path, 'src', '!(__tests__)', '**', '*.ts')],
ignore: Object.keys({
...packagejson.dependencies,
...packagejson.devDependencies,
...data.json.dependencies,
...data.json.devDependencies,
}),
}));
module.exports = folders;
// module.exports = [
// {
// name: '@blocksuite/global',
// path: 'packages/framework/global/dist',
// },
// {
// name: '@blocksuite/store',
// path: 'packages/framework/store/dist',
// },
// {
// name: '@blocksuite/block-std',
// path: 'packages/framework/block-std/dist',
// },
// {
// name: '@blocksuite/inline',
// path: 'packages/framework/inline/dist',
// },
// {
// name: '@blocksuite/sync',
// path: 'packages/framework/sync/dist',
// },
// {
// name: '@blocksuite/affine-shared',
// path: 'packages/affine/shared/dist',
// },
// {
// name: '@blocksuite/affine-model',
// path: 'packages/affine/model/dist',
// },
// {
// name: '@blocksuite/affine-components',
// path: 'packages/affine/components/dist',
// },
// {
// name: '@blocksuite/affine-block-list',
// path: 'packages/affine/block-list/dist',
// },
// {
// name: '@blocksuite/affine-block-paragraph',
// path: 'packages/affine/block-paragraph/dist',
// },
// {
// name: '@blocksuite/affine-block-surface',
// path: 'packages/affine/block-surface/dist',
// },
// {
// name: '@blocksuite/data-view',
// path: 'packages/affine/data-view/dist',
// },
// {
// name: '@blocksuite/blocks',
// path: 'packages/presets/dist',
// },
// {
// name: '@blocksuite/presets',
// path: 'packages/presets/dist',
// },
// ];