@nzz/q-cli 1.5.5 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dev-server/server.js +3 -0
- package/package.json +1 -1
- package/skeletons/custom-code-skeleton/README.md +17 -6
- package/skeletons/custom-code-skeleton/index.d.ts +3 -0
- package/skeletons/custom-code-skeleton/package-lock.json +118 -54
- package/skeletons/custom-code-skeleton/package.json +13 -6
- package/skeletons/custom-code-skeleton/q.config.json +2 -2
- package/skeletons/custom-code-skeleton/rollup.config.js +56 -56
- package/skeletons/custom-code-skeleton/src/App.scss +3 -1
- package/skeletons/custom-code-skeleton/src/App.svelte +3 -1
- package/skeletons/custom-code-skeleton/src/interfaces.ts +0 -0
- package/skeletons/custom-code-skeleton/src/{main-prod.js → main-prod.ts} +0 -0
- package/skeletons/custom-code-skeleton/src/main.ts +18 -0
- package/skeletons/custom-code-skeleton/tsconfig.json +15 -0
- package/skeletons/custom-code-skeleton/src/main.js +0 -11
package/dev-server/server.js
CHANGED
package/package.json
CHANGED
@@ -1,15 +1,26 @@
|
|
1
|
-
##
|
1
|
+
## Custom code boilerplate
|
2
2
|
|
3
|
-
Install the dependencies
|
3
|
+
Install the dependencies
|
4
4
|
|
5
5
|
```bash
|
6
6
|
npm install
|
7
7
|
```
|
8
8
|
|
9
|
-
|
9
|
+
#### Running it locally
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
Regular layout
|
12
|
+
```
|
13
|
+
npm start
|
14
|
+
```
|
15
|
+
|
16
|
+
Longform standard
|
17
|
+
```
|
18
|
+
npm run start-ls
|
19
|
+
```
|
20
|
+
|
21
|
+
Longform Visual
|
22
|
+
```
|
23
|
+
npm run start-lv
|
13
24
|
```
|
14
25
|
|
15
|
-
Navigate to [
|
26
|
+
Navigate to [http://0.0.0.0:5555](http://0.0.0.0:5555). You should see your app running. Edit a component file in `src`, save it and see the changes in the browser.
|
@@ -11,21 +11,24 @@
|
|
11
11
|
"@nzz/q-cli": "^1.4.11",
|
12
12
|
"@rollup/plugin-commonjs": "^21.0.0",
|
13
13
|
"@rollup/plugin-html": "^0.2.4",
|
14
|
+
"@rollup/plugin-image": "^2.1.1",
|
14
15
|
"@rollup/plugin-json": "^4.1.0",
|
15
16
|
"@rollup/plugin-node-resolve": "^13.0.5",
|
17
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
16
18
|
"autoprefixer": "^10.4.0",
|
17
19
|
"cssnano": "^5.0.10",
|
18
20
|
"npm-run-all": "^4.1.5",
|
21
|
+
"nzz.ch-static": "git+https://github.com/nzzdev/nzz.ch-static.git",
|
19
22
|
"postcss": "^8.3.11",
|
20
23
|
"rollup": "^2.50.1",
|
21
24
|
"rollup-plugin-livereload": "^2.0.5",
|
22
25
|
"rollup-plugin-scss": "^3.0.0",
|
23
26
|
"rollup-plugin-svelte": "^7.1.0",
|
24
|
-
"rollup-plugin-svg": "^2.0.0",
|
25
27
|
"rollup-plugin-terser": "^7.0.2",
|
26
28
|
"sass": "^1.43.4",
|
27
29
|
"sirv-cli": "^1.0.12",
|
28
|
-
"svelte": "^3.43.1"
|
30
|
+
"svelte": "^3.43.1",
|
31
|
+
"typescript": "^4.6.4"
|
29
32
|
}
|
30
33
|
},
|
31
34
|
"node_modules/@babel/code-frame": {
|
@@ -546,6 +549,22 @@
|
|
546
549
|
"rollup": "^1.20.0||^2.0.0"
|
547
550
|
}
|
548
551
|
},
|
552
|
+
"node_modules/@rollup/plugin-image": {
|
553
|
+
"version": "2.1.1",
|
554
|
+
"resolved": "https://registry.npmjs.org/@rollup/plugin-image/-/plugin-image-2.1.1.tgz",
|
555
|
+
"integrity": "sha512-AgP4U85zuQJdUopLUCM+hTf45RepgXeTb8EJsleExVy99dIoYpt3ZlDYJdKmAc2KLkNntCDg6BPJvgJU3uGF+g==",
|
556
|
+
"dev": true,
|
557
|
+
"dependencies": {
|
558
|
+
"@rollup/pluginutils": "^3.1.0",
|
559
|
+
"mini-svg-data-uri": "^1.2.3"
|
560
|
+
},
|
561
|
+
"engines": {
|
562
|
+
"node": ">= 8.0.0"
|
563
|
+
},
|
564
|
+
"peerDependencies": {
|
565
|
+
"rollup": "^1.20.0 || ^2.0.0"
|
566
|
+
}
|
567
|
+
},
|
549
568
|
"node_modules/@rollup/plugin-json": {
|
550
569
|
"version": "4.1.0",
|
551
570
|
"resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz",
|
@@ -578,6 +597,24 @@
|
|
578
597
|
"rollup": "^2.42.0"
|
579
598
|
}
|
580
599
|
},
|
600
|
+
"node_modules/@rollup/plugin-typescript": {
|
601
|
+
"version": "8.3.2",
|
602
|
+
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.2.tgz",
|
603
|
+
"integrity": "sha512-MtgyR5LNHZr3GyN0tM7gNO9D0CS+Y+vflS4v/PHmrX17JCkHUYKvQ5jN5o3cz1YKllM3duXUqu3yOHwMPUxhDg==",
|
604
|
+
"dev": true,
|
605
|
+
"dependencies": {
|
606
|
+
"@rollup/pluginutils": "^3.1.0",
|
607
|
+
"resolve": "^1.17.0"
|
608
|
+
},
|
609
|
+
"engines": {
|
610
|
+
"node": ">=8.0.0"
|
611
|
+
},
|
612
|
+
"peerDependencies": {
|
613
|
+
"rollup": "^2.14.0",
|
614
|
+
"tslib": "*",
|
615
|
+
"typescript": ">=3.7.0"
|
616
|
+
}
|
617
|
+
},
|
581
618
|
"node_modules/@rollup/pluginutils": {
|
582
619
|
"version": "3.1.0",
|
583
620
|
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
|
@@ -2240,6 +2277,15 @@
|
|
2240
2277
|
"node": ">= 0.6"
|
2241
2278
|
}
|
2242
2279
|
},
|
2280
|
+
"node_modules/mini-svg-data-uri": {
|
2281
|
+
"version": "1.4.4",
|
2282
|
+
"resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz",
|
2283
|
+
"integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==",
|
2284
|
+
"dev": true,
|
2285
|
+
"bin": {
|
2286
|
+
"mini-svg-data-uri": "cli.js"
|
2287
|
+
}
|
2288
|
+
},
|
2243
2289
|
"node_modules/minimatch": {
|
2244
2290
|
"version": "3.0.4",
|
2245
2291
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
@@ -2478,6 +2524,12 @@
|
|
2478
2524
|
}
|
2479
2525
|
}
|
2480
2526
|
},
|
2527
|
+
"node_modules/nzz.ch-static": {
|
2528
|
+
"version": "1.0.0",
|
2529
|
+
"resolved": "git+ssh://git@github.com/nzzdev/nzz.ch-static.git#90992f8a37797a45d20a4fc7ed6edb8ee1991012",
|
2530
|
+
"dev": true,
|
2531
|
+
"license": "ISC"
|
2532
|
+
},
|
2481
2533
|
"node_modules/object-inspect": {
|
2482
2534
|
"version": "1.11.0",
|
2483
2535
|
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
|
@@ -3348,31 +3400,6 @@
|
|
3348
3400
|
"svelte": ">=3.5.0"
|
3349
3401
|
}
|
3350
3402
|
},
|
3351
|
-
"node_modules/rollup-plugin-svg": {
|
3352
|
-
"version": "2.0.0",
|
3353
|
-
"resolved": "https://registry.npmjs.org/rollup-plugin-svg/-/rollup-plugin-svg-2.0.0.tgz",
|
3354
|
-
"integrity": "sha512-DmE7dSQHo1SC5L2uH2qul3Mjyd5oV6U1aVVkyvTLX/mUsRink7f1b1zaIm+32GEBA6EHu8H/JJi3DdWqM53ySQ==",
|
3355
|
-
"dev": true,
|
3356
|
-
"dependencies": {
|
3357
|
-
"rollup-pluginutils": "^1.3.1"
|
3358
|
-
}
|
3359
|
-
},
|
3360
|
-
"node_modules/rollup-plugin-svg/node_modules/estree-walker": {
|
3361
|
-
"version": "0.2.1",
|
3362
|
-
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz",
|
3363
|
-
"integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=",
|
3364
|
-
"dev": true
|
3365
|
-
},
|
3366
|
-
"node_modules/rollup-plugin-svg/node_modules/rollup-pluginutils": {
|
3367
|
-
"version": "1.5.2",
|
3368
|
-
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz",
|
3369
|
-
"integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=",
|
3370
|
-
"dev": true,
|
3371
|
-
"dependencies": {
|
3372
|
-
"estree-walker": "^0.2.1",
|
3373
|
-
"minimatch": "^3.0.2"
|
3374
|
-
}
|
3375
|
-
},
|
3376
3403
|
"node_modules/rollup-plugin-terser": {
|
3377
3404
|
"version": "7.0.2",
|
3378
3405
|
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz",
|
@@ -3879,6 +3906,13 @@
|
|
3879
3906
|
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
|
3880
3907
|
"dev": true
|
3881
3908
|
},
|
3909
|
+
"node_modules/tslib": {
|
3910
|
+
"version": "2.4.0",
|
3911
|
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
|
3912
|
+
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
|
3913
|
+
"dev": true,
|
3914
|
+
"peer": true
|
3915
|
+
},
|
3882
3916
|
"node_modules/typedarray-to-buffer": {
|
3883
3917
|
"version": "3.1.5",
|
3884
3918
|
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
|
@@ -3888,6 +3922,19 @@
|
|
3888
3922
|
"is-typedarray": "^1.0.0"
|
3889
3923
|
}
|
3890
3924
|
},
|
3925
|
+
"node_modules/typescript": {
|
3926
|
+
"version": "4.6.4",
|
3927
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
3928
|
+
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
|
3929
|
+
"dev": true,
|
3930
|
+
"bin": {
|
3931
|
+
"tsc": "bin/tsc",
|
3932
|
+
"tsserver": "bin/tsserver"
|
3933
|
+
},
|
3934
|
+
"engines": {
|
3935
|
+
"node": ">=4.2.0"
|
3936
|
+
}
|
3937
|
+
},
|
3891
3938
|
"node_modules/unbox-primitive": {
|
3892
3939
|
"version": "1.0.1",
|
3893
3940
|
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
|
@@ -4614,6 +4661,16 @@
|
|
4614
4661
|
"dev": true,
|
4615
4662
|
"requires": {}
|
4616
4663
|
},
|
4664
|
+
"@rollup/plugin-image": {
|
4665
|
+
"version": "2.1.1",
|
4666
|
+
"resolved": "https://registry.npmjs.org/@rollup/plugin-image/-/plugin-image-2.1.1.tgz",
|
4667
|
+
"integrity": "sha512-AgP4U85zuQJdUopLUCM+hTf45RepgXeTb8EJsleExVy99dIoYpt3ZlDYJdKmAc2KLkNntCDg6BPJvgJU3uGF+g==",
|
4668
|
+
"dev": true,
|
4669
|
+
"requires": {
|
4670
|
+
"@rollup/pluginutils": "^3.1.0",
|
4671
|
+
"mini-svg-data-uri": "^1.2.3"
|
4672
|
+
}
|
4673
|
+
},
|
4617
4674
|
"@rollup/plugin-json": {
|
4618
4675
|
"version": "4.1.0",
|
4619
4676
|
"resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz",
|
@@ -4637,6 +4694,16 @@
|
|
4637
4694
|
"resolve": "^1.19.0"
|
4638
4695
|
}
|
4639
4696
|
},
|
4697
|
+
"@rollup/plugin-typescript": {
|
4698
|
+
"version": "8.3.2",
|
4699
|
+
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.2.tgz",
|
4700
|
+
"integrity": "sha512-MtgyR5LNHZr3GyN0tM7gNO9D0CS+Y+vflS4v/PHmrX17JCkHUYKvQ5jN5o3cz1YKllM3duXUqu3yOHwMPUxhDg==",
|
4701
|
+
"dev": true,
|
4702
|
+
"requires": {
|
4703
|
+
"@rollup/pluginutils": "^3.1.0",
|
4704
|
+
"resolve": "^1.17.0"
|
4705
|
+
}
|
4706
|
+
},
|
4640
4707
|
"@rollup/pluginutils": {
|
4641
4708
|
"version": "3.1.0",
|
4642
4709
|
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
|
@@ -5879,6 +5946,12 @@
|
|
5879
5946
|
"mime-db": "1.51.0"
|
5880
5947
|
}
|
5881
5948
|
},
|
5949
|
+
"mini-svg-data-uri": {
|
5950
|
+
"version": "1.4.4",
|
5951
|
+
"resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz",
|
5952
|
+
"integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==",
|
5953
|
+
"dev": true
|
5954
|
+
},
|
5882
5955
|
"minimatch": {
|
5883
5956
|
"version": "3.0.4",
|
5884
5957
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
@@ -6054,6 +6127,11 @@
|
|
6054
6127
|
"commander": "^5.1.0"
|
6055
6128
|
}
|
6056
6129
|
},
|
6130
|
+
"nzz.ch-static": {
|
6131
|
+
"version": "git+ssh://git@github.com/nzzdev/nzz.ch-static.git#90992f8a37797a45d20a4fc7ed6edb8ee1991012",
|
6132
|
+
"dev": true,
|
6133
|
+
"from": "nzz.ch-static@git+https://github.com/nzzdev/nzz.ch-static.git"
|
6134
|
+
},
|
6057
6135
|
"object-inspect": {
|
6058
6136
|
"version": "1.11.0",
|
6059
6137
|
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
|
@@ -6659,33 +6737,6 @@
|
|
6659
6737
|
"rollup-pluginutils": "^2.8.2"
|
6660
6738
|
}
|
6661
6739
|
},
|
6662
|
-
"rollup-plugin-svg": {
|
6663
|
-
"version": "2.0.0",
|
6664
|
-
"resolved": "https://registry.npmjs.org/rollup-plugin-svg/-/rollup-plugin-svg-2.0.0.tgz",
|
6665
|
-
"integrity": "sha512-DmE7dSQHo1SC5L2uH2qul3Mjyd5oV6U1aVVkyvTLX/mUsRink7f1b1zaIm+32GEBA6EHu8H/JJi3DdWqM53ySQ==",
|
6666
|
-
"dev": true,
|
6667
|
-
"requires": {
|
6668
|
-
"rollup-pluginutils": "^1.3.1"
|
6669
|
-
},
|
6670
|
-
"dependencies": {
|
6671
|
-
"estree-walker": {
|
6672
|
-
"version": "0.2.1",
|
6673
|
-
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz",
|
6674
|
-
"integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=",
|
6675
|
-
"dev": true
|
6676
|
-
},
|
6677
|
-
"rollup-pluginutils": {
|
6678
|
-
"version": "1.5.2",
|
6679
|
-
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz",
|
6680
|
-
"integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=",
|
6681
|
-
"dev": true,
|
6682
|
-
"requires": {
|
6683
|
-
"estree-walker": "^0.2.1",
|
6684
|
-
"minimatch": "^3.0.2"
|
6685
|
-
}
|
6686
|
-
}
|
6687
|
-
}
|
6688
|
-
},
|
6689
6740
|
"rollup-plugin-terser": {
|
6690
6741
|
"version": "7.0.2",
|
6691
6742
|
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz",
|
@@ -7068,6 +7119,13 @@
|
|
7068
7119
|
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
|
7069
7120
|
"dev": true
|
7070
7121
|
},
|
7122
|
+
"tslib": {
|
7123
|
+
"version": "2.4.0",
|
7124
|
+
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
|
7125
|
+
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==",
|
7126
|
+
"dev": true,
|
7127
|
+
"peer": true
|
7128
|
+
},
|
7071
7129
|
"typedarray-to-buffer": {
|
7072
7130
|
"version": "3.1.5",
|
7073
7131
|
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
|
@@ -7077,6 +7135,12 @@
|
|
7077
7135
|
"is-typedarray": "^1.0.0"
|
7078
7136
|
}
|
7079
7137
|
},
|
7138
|
+
"typescript": {
|
7139
|
+
"version": "4.6.4",
|
7140
|
+
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",
|
7141
|
+
"integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==",
|
7142
|
+
"dev": true
|
7143
|
+
},
|
7080
7144
|
"unbox-primitive": {
|
7081
7145
|
"version": "1.0.1",
|
7082
7146
|
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
|
@@ -2,11 +2,16 @@
|
|
2
2
|
"name": "custom-code-skeleton",
|
3
3
|
"version": "1.0.0",
|
4
4
|
"devDependencies": {
|
5
|
+
"@nzz/nzz.ch-static": "github:nzzdev/ed-tech-nzz.ch-static#v1.0.0",
|
5
6
|
"@nzz/q-cli": "^1.4.11",
|
7
|
+
"@rollup/plugin-alias": "^3.1.9",
|
6
8
|
"@rollup/plugin-commonjs": "^21.0.0",
|
7
9
|
"@rollup/plugin-html": "^0.2.4",
|
10
|
+
"@rollup/plugin-image": "^2.1.1",
|
8
11
|
"@rollup/plugin-json": "^4.1.0",
|
9
12
|
"@rollup/plugin-node-resolve": "^13.0.5",
|
13
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
14
|
+
"@tsconfig/svelte": "^3.0.0",
|
10
15
|
"autoprefixer": "^10.4.0",
|
11
16
|
"cssnano": "^5.0.10",
|
12
17
|
"npm-run-all": "^4.1.5",
|
@@ -15,11 +20,11 @@
|
|
15
20
|
"rollup-plugin-livereload": "^2.0.5",
|
16
21
|
"rollup-plugin-scss": "^3.0.0",
|
17
22
|
"rollup-plugin-svelte": "^7.1.0",
|
18
|
-
"rollup-plugin-svg": "^2.0.0",
|
19
23
|
"rollup-plugin-terser": "^7.0.2",
|
20
24
|
"sass": "^1.43.4",
|
21
25
|
"sirv-cli": "^1.0.12",
|
22
|
-
"svelte": "^3.43.1"
|
26
|
+
"svelte": "^3.43.1",
|
27
|
+
"typescript": "^4.6.4"
|
23
28
|
},
|
24
29
|
"scripts": {
|
25
30
|
"update-all": "npm run build && Q update-item",
|
@@ -27,9 +32,11 @@
|
|
27
32
|
"update-staging": "npm run build && Q update-item -e staging",
|
28
33
|
"update-test": "npm run build && Q update-item -e test",
|
29
34
|
"build": "rollup -c",
|
30
|
-
"
|
31
|
-
"
|
32
|
-
"start": "
|
33
|
-
"start
|
35
|
+
"start": "npm run start-regular",
|
36
|
+
"start-regular": "LAYOUT=regular run-p serve rollup",
|
37
|
+
"start-ls": "LAYOUT=longform-standard run-p serve rollup",
|
38
|
+
"start-lv": "LAYOUT=longform-visual run-p serve rollup",
|
39
|
+
"rollup": "rollup -c -w",
|
40
|
+
"serve": "sirv public --dev --port 5555 --host 0.0.0.0"
|
34
41
|
}
|
35
42
|
}
|
@@ -3,7 +3,6 @@ import * as path from "path";
|
|
3
3
|
import nodeResolve from "@rollup/plugin-node-resolve";
|
4
4
|
import commonjs from "@rollup/plugin-commonjs";
|
5
5
|
import json from "@rollup/plugin-json";
|
6
|
-
import svg from "rollup-plugin-svg";
|
7
6
|
import html from "@rollup/plugin-html";
|
8
7
|
import svelte from "rollup-plugin-svelte";
|
9
8
|
import { terser } from "rollup-plugin-terser";
|
@@ -12,10 +11,18 @@ import scss from "rollup-plugin-scss";
|
|
12
11
|
import postcss from "postcss";
|
13
12
|
import cssnano from "cssnano";
|
14
13
|
import autoprefixer from "autoprefixer";
|
15
|
-
import packageConfig from "./package.json";
|
16
14
|
import qConfig from "./q.config.json";
|
15
|
+
import typescript from '@rollup/plugin-typescript';
|
16
|
+
import image from '@rollup/plugin-image';
|
17
|
+
import alias from '@rollup/plugin-alias';
|
18
|
+
import { createContentWidthQElement, createFullwidthQElement, getHtml, createSubtitle, createParagraph } from '@nzz/nzz.ch-static';
|
19
|
+
|
20
|
+
// Which nzz layout to use?
|
21
|
+
const LAYOUT = process.env.LAYOUT;
|
22
|
+
const builtCssFilename = 'bundle';
|
17
23
|
|
18
24
|
const production = !process.env.ROLLUP_WATCH;
|
25
|
+
const projectRootDir = path.resolve(__dirname);
|
19
26
|
|
20
27
|
function getOutputConfigs() {
|
21
28
|
const outputConfigs = [];
|
@@ -35,57 +42,42 @@ function getOutputConfigs() {
|
|
35
42
|
return outputConfigs;
|
36
43
|
}
|
37
44
|
|
38
|
-
function getTemplate(options) {
|
39
|
-
return `<!DOCTYPE html>
|
40
|
-
<html lang="de">
|
41
|
-
<head>
|
42
|
-
<meta charset="utf-8">
|
43
|
-
<meta name="viewport" content="width=device-width">
|
44
|
-
<title>${packageConfig.name}</title>
|
45
|
-
<link rel="stylesheet" href="https://context-service.st.nzz.ch/stylesheet/all/nzz.ch.css" />
|
46
|
-
<link rel="stylesheet" href="https://service.sophie.nzz.ch/bundle/sophie-q@^1,sophie-input@^1,sophie-font@^1,sophie-color@^1,sophie-viz-color@^1,sophie-legend@^1.css" />
|
47
|
-
<link rel="stylesheet" href="bundle.css" />
|
48
|
-
</head>
|
49
|
-
<!-- we have four different article templates, since the article itself has the same structure in each template
|
50
|
-
we can use either of these classes: regular, longformstandard, regular, opinion
|
51
|
-
if one changes the class attached to body tag one should change the class in section tag accordingly (maybe further adjustments needed too) -->
|
52
|
-
<body class="regular">
|
53
|
-
<div id="__nzz">
|
54
|
-
<div id="__layout">
|
55
|
-
<div class="page--article-id">
|
56
|
-
<div class="pageholder">
|
57
|
-
<div class="nzz-container">
|
58
|
-
<div class="nzz-page-transition">
|
59
|
-
<div class="article">
|
60
|
-
<!-- also here change layout--{template} accordingly -->
|
61
|
-
<section class="container container--article layout--regular">
|
62
|
-
<!-- default = content width, for fullwidth, small left/right one has to add one of
|
63
|
-
the following classes accordingly: widget--fullwidth, widget--left, widget--right-->
|
64
|
-
<div class="articlecomponent q-embed widget--qembed regwalled">
|
65
|
-
<div>
|
66
|
-
<div class="s-q-item" id="container"></div>
|
67
|
-
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Map,URL,Promise,fetch,URLSearchParams,Array.prototype.find,Array.prototype.findIndex,Object.entries,Array.prototype.includes,CustomEvent,Array.from,String.prototype.startsWith&flags=gated&unknown=polyfill"></script>
|
68
|
-
<script src="${options.files.js[0].fileName}"></script>
|
69
|
-
</div>
|
70
|
-
</div>
|
71
|
-
</section>
|
72
|
-
</div>
|
73
|
-
</div>
|
74
|
-
</div>
|
75
|
-
</div>
|
76
|
-
</div>
|
77
|
-
</div>
|
78
|
-
</div>
|
79
|
-
</body>
|
80
|
-
</html>`;
|
81
|
-
}
|
82
|
-
|
83
45
|
function getHtmlOptions() {
|
84
46
|
return {
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
47
|
+
fileName: 'index.html',
|
48
|
+
template: function (options) {
|
49
|
+
return getHtml({
|
50
|
+
// These 3 options are the most important. Without them the static website will not function.
|
51
|
+
layout: LAYOUT, // Type of layout.
|
52
|
+
builtCssFilename, // Will be appended at the end of <head>.
|
53
|
+
builtJsFilename: options.files.js[0].fileName, // Will appended to the end of <body>.
|
54
|
+
|
55
|
+
// Create mock elements to simulate your article.
|
56
|
+
content: `
|
57
|
+
${createSubtitle('Test Subtitle')}
|
58
|
+
${createParagraph('Test paragraph')}
|
59
|
+
${createFullwidthQElement('custom-code-fw')}
|
60
|
+
${createContentWidthQElement('custom-code-cw')}
|
61
|
+
`,
|
62
|
+
|
63
|
+
// Other options.
|
64
|
+
author: 'Max Musterman',
|
65
|
+
lead: 'Test lead.',
|
66
|
+
title: 'Test title',
|
67
|
+
|
68
|
+
// Links to other css files that need to be loaded.
|
69
|
+
// Will be appended to <head> but before the bundled css file of your app.
|
70
|
+
customCssLinks: [
|
71
|
+
'https://service.sophie.nzz.ch/bundle/sophie-q@^1,sophie-input@^1,sophie-font@^1,sophie-color@^1,sophie-viz-color@^1,sophie-legend@^1.css',
|
72
|
+
],
|
73
|
+
|
74
|
+
// Links to other js filed that need to be loaded.
|
75
|
+
// Will be appended at the end of the body, but before the built js file for the app.
|
76
|
+
customJsLinks: [
|
77
|
+
'https://cdn.polyfill.io/v2/polyfill.min.js?features=Map,URL,Promise,fetch,URLSearchParams,Array.prototype.find,Array.prototype.findIndex,Object.entries,Array.prototype.includes,CustomEvent,Array.from,String.prototype.startsWith&flags=gated&unknown=polyfill'
|
78
|
+
],
|
79
|
+
});
|
80
|
+
},
|
89
81
|
};
|
90
82
|
}
|
91
83
|
|
@@ -107,7 +99,7 @@ function createOutputCssFunction() {
|
|
107
99
|
fs.mkdirSync(publicDir);
|
108
100
|
}
|
109
101
|
|
110
|
-
fs.writeFileSync(`${publicDir}
|
102
|
+
fs.writeFileSync(`${publicDir}/${builtCssFilename}.css`, styles);
|
111
103
|
};
|
112
104
|
|
113
105
|
return outputCssFunction;
|
@@ -126,8 +118,8 @@ function getSassConfig(isProduction) {
|
|
126
118
|
processor: (css) =>
|
127
119
|
postcss(getPostcssPlugins(isProduction))
|
128
120
|
.process(css, {
|
129
|
-
from: path.join(__dirname,
|
130
|
-
to: path.join(__dirname,
|
121
|
+
from: path.join(__dirname, `/public/${builtCssFilename}.css`),
|
122
|
+
to: path.join(__dirname, `/public/${builtCssFilename}.css`),
|
131
123
|
map: isProduction ? false : { inline: true }, // Set to false after: https://github.com/thgh/rollup-plugin-scss/issues/7
|
132
124
|
})
|
133
125
|
.then((result) => result.css),
|
@@ -138,11 +130,19 @@ function getSassConfig(isProduction) {
|
|
138
130
|
}
|
139
131
|
|
140
132
|
export default {
|
141
|
-
input: production ? "src/main-prod.
|
133
|
+
input: production ? "src/main-prod.ts" : "src/main.ts",
|
142
134
|
output: getOutputConfigs(),
|
143
135
|
plugins: [
|
136
|
+
alias({
|
137
|
+
entries: [
|
138
|
+
{ find: '@src', replacement: path.resolve(projectRootDir, 'src') },
|
139
|
+
{ find: '@interfaces', replacement: path.resolve(projectRootDir, 'src/interfaces.ts') },
|
140
|
+
]
|
141
|
+
}),
|
142
|
+
|
143
|
+
typescript({ sourceMap: !production }),
|
144
144
|
json(),
|
145
|
-
|
145
|
+
image(),
|
146
146
|
svelte({
|
147
147
|
compilerOptions: {
|
148
148
|
// enable run-time checks when not in production
|
File without changes
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import App from "./App.svelte";
|
2
|
+
import "./main.scss";
|
3
|
+
|
4
|
+
const app = new App({
|
5
|
+
target: document.querySelector("#custom-code-fw"),
|
6
|
+
props: {
|
7
|
+
name: "custom-code-skeleton - Fullwidth",
|
8
|
+
},
|
9
|
+
});
|
10
|
+
|
11
|
+
new App({
|
12
|
+
target: document.querySelector("#custom-code-cw"),
|
13
|
+
props: {
|
14
|
+
name: "custom-code-skeleton - Content Width",
|
15
|
+
},
|
16
|
+
});
|
17
|
+
|
18
|
+
export default app;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"extends": "@tsconfig/svelte/tsconfig.json",
|
3
|
+
"include": ["src/**/*"],
|
4
|
+
"exclude": ["node_modules/*", "__sapper__/*", "public/*"],
|
5
|
+
"compilerOptions": {
|
6
|
+
"lib": ["es2015", "DOM"],
|
7
|
+
"types": ["svelte"],
|
8
|
+
"outDir": "public",
|
9
|
+
"declaration": false,
|
10
|
+
"paths": {
|
11
|
+
"@src": ["./src/"],
|
12
|
+
"@interfaces": ["./src/interfaces.ts"]
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|