-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pull-configs.js
69 lines (62 loc) · 2.17 KB
/
.pull-configs.js
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
const fs = require('fs')
const { pullConfigs } = require('pull-configs')
const local = __dirname + '/'
const remote = 'https://github.com/stagas/typescript-minimal-template/raw/main/'
const { assign, omit, sort, merge, replace } = pullConfigs(remote, local)
merge('package.json', (prev, next) => {
// deprecated: now using ~/.trusted-npm-deps per system configuration
delete prev.trustedDependencies
prev.types = next.types
prev.scripts = next.scripts
prev.files = next.files
sort(assign(prev.devDependencies, next.devDependencies))
// never used it - OTR screen acts like review so
// it can be accidentally published anyway. also i dont care
delete prev.private
// deprecated
delete prev.devDependencies['@stagas/documentation-fork']
delete prev.devDependencies['@rollup/plugin-commonjs']
delete prev.devDependencies['@stagas/sucrase-jest-plugin']
delete prev.devDependencies['@web/dev-server-esbuild']
delete prev.devDependencies['@web/dev-server-rollup']
delete prev.devDependencies['@web/test-runner']
delete prev.devDependencies['esbuild']
delete prev.devDependencies['esbuild-register']
delete prev.devDependencies['prettier']
delete prev.devDependencies['terser']
delete prev.devDependencies['vite-web-test-runner-plugin']
delete prev.devDependencies['@swc-node/jest']
delete prev.devDependencies['jest']
delete prev.devDependencies['jest-browser-globals']
delete prev.devDependencies['ts-jest']
delete prev.devDependencies['ts-node']
delete prev.devDependencies['wtr-plugin-vite']
delete prev.devDependencies['@stagas/jest-node-exports-resolver']
delete prev.devDependencies['vite-open']
})
replace('.gitattributes')
replace('.gitignore')
replace('.npmrc')
replace('.eslintrc.js')
replace('.pull-configs.js')
replace('.swcrc')
replace('dprint.json')
replace('tsconfig.json')
replace('tsconfig.dist.json')
replace('LICENSE')
const deprecated = [
'.vscode/extensions.json',
'.vscode',
'.prettierrc',
'.prettierignore',
'example/tsconfig.json',
'vite.config.js',
'jest.config.js',
'web-test-runner.config.js',
]
deprecated.forEach((x) => {
try {
fs.rmSync(x, { recursive: true })
console.log('removed', x)
} catch {}
})