-
Notifications
You must be signed in to change notification settings - Fork 39
/
gulpfile.js
193 lines (176 loc) · 6.77 KB
/
gulpfile.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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// /gulpfile.js
var gulp = require('gulp');
var del = require('del');
var rename = require("gulp-rename");
gulp.task('clean', (done) => {
console.log("Deleting old definitions");
return del([
'app/@pnp/common/**/*',
'app/@pnp/config-store/**/*',
'app/@pnp/graph/**/*',
'app/@pnp/logging/**/*',
'app/@pnp/nodejs/**/*',
'app/@pnp/odata/**/*',
'app/@pnp/pnpjs/**/*',
'app/@pnp/sp/**/*',
'app/@pnp/adaljsclient/**/*',
'app/monaco-editor/**/*',
'app/@pnp/sp-addinhelpers/**/*',
'app/@pnp/sp-clientsvc/**/*',
'app/@pnp/sp-taxonomy/**/*',
'app/@microsoft/microsoft-graph-types/**/*',
'app/js/common.es5.umd.bundle.js',
'app/js/config-store.es5.umd.bundle.js',
'app/js/graph.es5.umd.bundle.js',
'app/js/logging.es5.umd.bundle.js',
'app/js/nodejs.es5.umd.js',
'app/js/odata.es5.umd.bundle.js',
'app/js/pnpjs.es5.umd.bundle.js',
'app/js/sp-addinhelpers.es5.umd.bundle.js',
'app/js/sp-clientsvc.es5.umd.bundle.js',
'app/js/sp-taxonomy.es5.umd.bundle.js',
'app/js/sp.es5.umd.bundle.js',
], done);
});
gulp.task('copy:commmon', (done) => {
console.log("Copy @pnp/common");
gulp.src(['./node_modules/@pnp/common/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/common/'))
gulp.src('./dist/common.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:config-store', (done) => {
console.log("Copy @pnp/config-store");
gulp.src(['./node_modules/@pnp/config-store/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/config-store/'))
gulp.src('./dist/config-store.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:graph', (done) => {
console.log("Copy @pnp/graph");
gulp.src(['./node_modules/@pnp/graph/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/graph/'))
gulp.src('./dist/graph.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:logging', (done) => {
console.log("Copy @pnp/logging");
gulp.src(['./node_modules/@pnp/logging/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/logging/'))
gulp.src('./dist/logging.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:odata', (done) => {
console.log("Copy @pnp/odata");
gulp.src(['./node_modules/@pnp/odata/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/odata/'))
gulp.src('./dist/odata.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:sp', (done) => {
console.log("Copy @pnp/sp");
gulp.src(['./node_modules/@pnp/sp/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/sp/'))
gulp.src('./dist/sp.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:sp-addinhelpers', (done) => {
console.log("Copy @pnp/sp-addinhelpers");
gulp.src(['./node_modules/@pnp/sp-addinhelpers/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/sp-addinhelpers/'))
gulp.src('./dist/sp-addinhelpers.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:adaljsclient', (done) => {
console.log("Copy @pnp/adaljsclient");
gulp.src(['./node_modules/@pnp/adaljsclient/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/adaljsclient/'))
gulp.src('./dist/adaljsclient.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:sp-clientsvc', (done) => {
console.log("Copy @pnp/sp-clientsvc");
gulp.src(['./node_modules/@pnp/sp-clientsvc/src/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/sp-clientsvc/'))
gulp.src('./node_modules/@pnp/sp-clientsvc/dist/sp-clientsvc.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:sp-taxonomy', (done) => {
console.log("Copy @pnp/sp-taxonomy");
gulp.src(['./node_modules/@pnp/sp-taxonomy/src/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*', '!./node_modules/@pnp/**/node_modules/**/*'])
.pipe(gulp.dest('./app/@pnp/sp-taxonomy/'))
gulp.src('./node_modules/@pnp/sp-taxonomy/dist/sp-taxonomy.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:microsoft-graph-types', (done) => {
console.log("Copy @microsoft/microsoft-graph-types");
gulp.src('./node_modules/@microsoft/microsoft-graph-types/microsoft-graph.d.ts')
.pipe(gulp.dest('./app/@microsoft/microsoft-graph-types/'));
done();
});
gulp.task('copy:microsoft-graph-client', (done) => {
console.log("Copy @microsoft/microsoft-graph-client");
gulp.src(['./node_modules/@microsoft/microsoft-graph-client/lib/es/**/*.d.ts'])
.pipe(gulp.dest('./app/@microsoft/microsoft-graph-client/'))
gulp.src('./dist/graph-sdk.es5.umd.bundle.js')
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:msal', (done) => {
console.log("Copy msal");
gulp.src(['./node_modules/msal/lib-es6/**/*.d.ts'])
.pipe(gulp.dest('./app/msal/'))
gulp.src('./node_modules/msal/dist/msal.js')
.pipe(rename('msal2.js'))
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('copy:monaco-editor', (done) => {
console.log("Copy monaco-editor");
gulp.src('./node_modules/monaco-editor/min/**/*')
.pipe(gulp.dest('./app/monaco-editor/min/'));
gulp.src('./node_modules/monaco-editor/min-maps/**/*')
.pipe(gulp.dest('./app/monaco-editor/min-maps/'));
gulp.src('./node_modules/monaco-editor/*', { nodir: true })
.pipe(gulp.dest('./app/monaco-editor/'));
done();
});
gulp.task('copy:pnpjs', (done) => {
console.log("Copy @pnp/pnpjs");
gulp.src(['./node_modules/@pnp/pnpjs/**/*.d.ts', '!./node_modules/@pnp/**/module/**/*'])
.pipe(gulp.dest('./app/@pnp/pnpjs/'))
// gulp.src('./dist/pnpjs.es5.umd.bundle.js')
// .pipe(gulp.dest('./app/js/'))
gulp.src('./node_modules/@pnp/pnpjs/dist/pnp.js')
.pipe(rename('pnpjs.es5.umd.bundle.js'))
.pipe(gulp.dest('./app/js/'))
done();
});
gulp.task('default',
gulp.series(['clean',
'copy:commmon',
'copy:config-store',
'copy:graph',
'copy:logging',
'copy:odata',
'copy:pnpjs',
'copy:sp',
'copy:adaljsclient',
'copy:sp-addinhelpers',
'copy:sp-clientsvc',
'copy:sp-taxonomy',
'copy:microsoft-graph-types',
'copy:microsoft-graph-client',
'copy:msal',
'copy:monaco-editor',
]));