This repository was archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.py
More file actions
78 lines (68 loc) · 2.06 KB
/
template.py
File metadata and controls
78 lines (68 loc) · 2.06 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
import shutil
from pathlib import Path
from youwol.pipelines.pipeline_typescript_weback_npm import Template, PackageType, Dependencies, \
RunTimeDeps, generate_template, DevServer, Bundles, MainModule
from youwol.utils import parse_json
folder_path = Path(__file__).parent
pkg_json = parse_json(folder_path / 'package.json')
load_dependencies = {
'@youwol/fv-code-mirror-editors': '^0.3.1',
'@youwol/os-core': '^0.1.5',
'@youwol/fv-tabs': '^0.2.1',
'@youwol/os-top-banner': '^0.1.1',
'@youwol/cdn-client': '^2.0.3',
'@youwol/http-clients': '^2.0.1',
'@youwol/flux-view': '^1.1.1',
'@youwol/fv-context-menu': '^0.1.1',
'@youwol/fv-tree': '^0.2.3',
'lodash': '^4.17.15',
'rxjs': '^6.5.5',
"@youwol/logging": "^0.1.0",
'uuid': '^8.3.2',
"@youwol/pyodide-helpers": "^0.1.4",
}
template = Template(
path=folder_path,
type=PackageType.APPLICATION,
name=pkg_json['name'],
version=pkg_json['version'],
shortDescription=pkg_json['description'],
author=pkg_json['author'],
inPackageJson={
"resolutions": {
"@youwol/fv-code-mirror-editors/typescript": "5.3.3"
},
},
dependencies=Dependencies(
runTime=RunTimeDeps(
externals={
**load_dependencies
},
),
devTime={
# those two prevent failure of typedoc
"lz-string": "^1.4.4"
}
),
userGuide=True,
bundles=Bundles(
mainModule=MainModule(
entryFile="./index.ts",
loadDependencies=list(load_dependencies.keys())
)
),
devServer=DevServer(
port=3012
)
)
generate_template(template)
shutil.copyfile(
src=folder_path / '.template' / 'src' / 'auto-generated.ts',
dst=folder_path / 'src' / 'auto-generated.ts'
)
for file in ['README.md', '.gitignore', '.npmignore', '.prettierignore', 'LICENSE', 'package.json',
'tsconfig.json', 'webpack.config.ts']:
shutil.copyfile(
src=folder_path / '.template' / file,
dst=folder_path / file
)