@aarhus-university/au-designsystem-delphinus 0.48.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/Gruntfile.js +74 -288
- package/app.js +41 -0
- package/bin/www +90 -0
- package/esbuild.mjs +18 -0
- package/package.json +25 -51
- package/{build → public}/figma-tokens/color-themes.json +57 -57
- package/{build → public}/figma-tokens/design-system.json +64 -64
- package/public/figma-tokens/style.css +1502 -0
- package/public/js/app.js +1 -0
- package/public/js/app.js.map +1 -0
- package/{build → public}/js/components/helpers.ts +0 -63
- package/public/js/demo.js +13 -0
- package/public/js/demo.js.map +1 -0
- package/{build → public}/js/production/app.ts +2 -11
- package/{build → public}/js/production/typo3.ts +2 -16
- package/public/projects/bachelor-applications/js/app.js +1 -0
- package/public/projects/bachelor-applications/style.css +9789 -0
- package/public/projects/brightspace/style.css +9792 -0
- package/public/projects/course-catalogue/js/app.js +1 -0
- package/public/projects/course-catalogue/style.css +9028 -0
- package/public/projects/medarbejdere/js/app.js +1 -0
- package/public/projects/medarbejdere/style.css +11853 -0
- package/public/projects/mitstudie/js/app.js +1 -0
- package/public/projects/mitstudie/style.css +11633 -0
- package/public/projects/queue-it/style.css +4848 -0
- package/public/projects/typo3/assets/chart-empty.png +0 -0
- package/public/projects/typo3/assets/chart-grades.png +0 -0
- package/public/projects/typo3/assets/delphinus-mug-back.jpg +0 -0
- package/public/projects/typo3/assets/delphinus-mug-front.jpg +0 -0
- package/public/projects/typo3/assets/delphinus-mug-stack.jpg +0 -0
- package/public/projects/typo3/js/app.js +1 -0
- package/public/projects/typo3/style.css +10320 -0
- package/public/style.css +11134 -0
- package/routes/index.js +236 -0
- package/routes/users.js +9 -0
- package/source/atoms/colors/_color-functions.scss +5 -2
- package/source/atoms/colors/_colors.scss +65 -67
- package/source/atoms/colors/atom-colors.scss +10 -7
- package/source/atoms/colors.pug +1 -1
- package/source/atoms/fonts/_fonts.scss +8 -8
- package/source/atoms/fonts/atom-fonts.scss +13 -10
- package/source/atoms/fonts.pug +1 -1
- package/source/atoms/functions/_power.scss +2 -2
- package/source/atoms/misc/_atom-layout.pug +1 -2
- package/source/atoms/misc/_atom-template.scss +2 -2
- package/source/atoms/misc/atom-iframe.css +8 -0
- package/source/atoms/misc/atom-iframe.css.map +1 -0
- package/source/atoms/misc/atoms-style.scss +3 -0
- package/source/atoms/spacing/atom-spacing.scss +5 -2
- package/source/atoms/spacing.pug +1 -1
- package/source/figma-tokens/cssvars/figma-tokens.scss +10 -7
- package/source/js/production/app.ts +1 -1
- package/source/markup/atom-colors.pug +2 -6
- package/source/markup/atom-fonts.pug +2 -5
- package/source/markup/atom-spacing.pug +2 -5
- package/source/markup/code/bem-class-naming.pug +4 -4
- package/source/markup/code/color.pug +2 -2
- package/source/markup/code/font-size.pug +2 -2
- package/source/markup/code/icon-style.pug +1 -1
- package/source/markup/code/line-height.pug +1 -1
- package/source/markup/code/set-colors.pug +1 -1
- package/source/markup/code/set-font.pug +1 -1
- package/source/markup/code/set-icon.pug +3 -3
- package/source/markup/code/spacing.pug +1 -1
- package/source/markup/colors-all.pug +1 -1
- package/source/markup/colors.pug +3 -3
- package/source/markup/components/autosuggest.pug +1 -1
- package/source/markup/components/horizontal-scroll-full-width.pug +1 -1
- package/source/markup/components/horizontal-scroll.pug +1 -4
- package/source/markup/components/large-bullets.pug +1 -1
- package/source/markup/components/modal-view.pug +3 -3
- package/source/markup/components/profile-image.pug +2 -2
- package/source/markup/components/switch.pug +6 -6
- package/source/markup/components/tabbed-content.pug +2 -2
- package/source/markup/components/tags.pug +1 -1
- package/source/markup/components/toolbar.pug +5 -5
- package/source/markup/form-character-count.pug +2 -2
- package/source/markup/form-example-change-password.pug +1 -1
- package/source/markup/form-invalid.pug +1 -1
- package/source/markup/form-locked.pug +2 -2
- package/source/markup/form-visually-disabled.pug +1 -1
- package/source/markup/form.pug +4 -4
- package/source/markup/headings.pug +1 -1
- package/source/markup/index.pug +7 -7
- package/source/markup/partials/mixins/_nav-items.pug +1 -1
- package/source/markup/partials/mixins-demo/_nav-code.pug +0 -1
- package/source/markup/partials/page-templates/_layout.pug +3 -21
- package/source/markup/spacings.pug +1 -1
- package/source/projects/bachelor-applications/impersonation-active.pug +1 -1
- package/source/projects/bachelor-applications/impersonation-form.pug +1 -1
- package/source/projects/bachelor-applications/index.pug +22 -22
- package/source/projects/bachelor-applications/kontoaktivering/index.pug +5 -5
- package/source/projects/bachelor-applications/markup/_bachelor-applications-template.pug +2 -2
- package/source/projects/bachelor-applications/receipt-accepted-animation-landscape.pug +1 -1
- package/source/projects/bachelor-applications/receipt-accepted-animation-portrait.pug +1 -1
- package/source/projects/bachelor-applications/receipt-accepted-multiple-links.pug +1 -1
- package/source/projects/bachelor-applications/receipt-accepted.pug +1 -1
- package/source/projects/bachelor-applications/receipt-rejected.pug +1 -1
- package/source/projects/bachelor-applications/style/_student-place-offer.scss +1 -1
- package/source/projects/bachelor-applications/style.scss +3 -0
- package/source/projects/brightspace/index.pug +4 -4
- package/source/projects/brightspace/style.scss +3 -0
- package/source/projects/course-catalogue/index.pug +8 -8
- package/source/projects/course-catalogue/markup/_course-cards.pug +1 -1
- package/source/projects/course-catalogue/markup/_course-catalogue-template.pug +1 -1
- package/source/projects/course-catalogue/markup/_course-details.pug +3 -3
- package/source/projects/course-catalogue/saved-courses.pug +1 -1
- package/source/projects/course-catalogue/style.scss +3 -0
- package/source/projects/medarbejdere/index.pug +12 -12
- package/source/projects/medarbejdere/markup/_medarbejdere-template.pug +1 -1
- package/source/projects/medarbejdere/markup/_pure-editor-forms.pug +3 -3
- package/source/projects/medarbejdere/markup/_pure-profile-editor.pug +27 -27
- package/source/projects/medarbejdere/pure-profile-editor-cv.pug +1 -1
- package/source/projects/medarbejdere/pure-profile-editor-free-form-text.pug +1 -1
- package/source/projects/medarbejdere/pure-profile-editor-image-receipt.pug +1 -1
- package/source/projects/medarbejdere/pure-profile-editor-image.pug +1 -1
- package/source/projects/medarbejdere/pure-profile-editor-links.pug +1 -1
- package/source/projects/medarbejdere/pure-profile-editor-subject-areas.pug +1 -1
- package/source/projects/medarbejdere/style/_pure-profile-editor-form.scss +1 -1
- package/source/projects/medarbejdere/style.scss +3 -0
- package/source/projects/mitstudie/applications-credit-transfer-intro.pug +2 -2
- package/source/projects/mitstudie/applications-credit-transfer-receipt.pug +1 -1
- package/source/projects/mitstudie/applications-credit-transfer-step1-edit.pug +3 -3
- package/source/projects/mitstudie/applications-credit-transfer-step1.pug +2 -2
- package/source/projects/mitstudie/applications-credit-transfer-step2.pug +3 -3
- package/source/projects/mitstudie/applications-credit-transfer-step3.pug +2 -2
- package/source/projects/mitstudie/applications-credit-transfer-step4.pug +3 -3
- package/source/projects/mitstudie/applications-credit-transfer-step5.pug +1 -1
- package/source/projects/mitstudie/applications-credit-transfer-step6.pug +2 -2
- package/source/projects/mitstudie/applications.pug +1 -1
- package/source/projects/mitstudie/home.pug +1 -1
- package/source/projects/mitstudie/index.pug +17 -17
- package/source/projects/mitstudie/markup/_mitstudie-template.pug +4 -4
- package/source/projects/mitstudie/style/_diagramme.scss +1 -6
- package/source/projects/mitstudie/style/_student-id.scss +5 -5
- package/source/projects/mitstudie/style/_timeline.scss +4 -4
- package/source/projects/mitstudie/style/_timetable.scss +7 -7
- package/source/projects/mitstudie/style.scss +3 -0
- package/source/projects/mitstudie/timetable-link-not-accessible.pug +1 -1
- package/source/projects/queue-it/style/_au-style.scss +1 -1
- package/source/projects/queue-it/style.scss +3 -1
- package/source/projects/typo3/employee-profiles/index.pug +12 -12
- package/source/projects/typo3/news-events/_content-elements.pug +16 -16
- package/source/projects/typo3/news-events/_elements.pug +5 -5
- package/source/projects/typo3/news-events/index.pug +15 -15
- package/source/projects/typo3/page/index.pug +8 -8
- package/source/projects/typo3/style/_contact-list.scss +1 -1
- package/source/projects/typo3/style/_news-event.scss +17 -17
- package/source/projects/typo3/style/_profile-header.scss +1 -1
- package/source/projects/typo3/style/_typo3-component-sass-variables.scss +6 -6
- package/source/projects/typo3/style/_typo3-delphinus-component-fixes.scss +1 -1
- package/source/projects/typo3/style/_typo3-sass-variables.scss +1 -1
- package/source/projects/typo3/style.scss +5 -2
- package/source/projects/typo3/typo3-markup/_typo3-header.pug +2 -1
- package/source/style/_includes/_transparent.scss +9 -10
- package/source/style/_sass-variables.scss +9 -14
- package/source/style/base/_buttons.scss +1 -1
- package/source/style/base/_links.scss +1 -1
- package/source/style/base/_text.scss +2 -2
- package/source/style/layout/_breakpoints.scss +3 -3
- package/source/style/layout/_page.scss +12 -12
- package/source/style/layout/_vertical-spacing.scss +1 -1
- package/source/style/module/_card.scss +3 -3
- package/source/style/module/_header-callout.scss +2 -2
- package/source/style/module/_nav.scss +3 -3
- package/source/style/module/_pre-header.scss +2 -2
- package/source/style/module/_search-filter.scss +2 -2
- package/source/style/module/_stepper.scss +2 -2
- package/source/style/module/_toast-notification.scss +1 -1
- package/source/style/module/_toolbar.scss +1 -1
- package/source/style/module/_tooltip.scss +4 -3
- package/source/style/module-demo/_demo.scss +8 -1
- package/source/style/module-demo/_prism-modifications.scss +1 -1
- package/source/style.scss +3 -1
- package/.eslintrc.js +0 -35
- package/README.md +0 -5
- package/babel.config.js +0 -16
- package/build/changelog.html +0 -871
- package/build/js/app.js +0 -2
- package/build/js/app.js.map +0 -1
- package/build/js/components/affiliate-expand.ts +0 -31
- package/build/projects/bachelor-applications/js/app.js +0 -2
- package/build/projects/bachelor-applications/js/app.js.map +0 -1
- package/build/projects/bachelor-applications/style.css +0 -3
- package/build/projects/bachelor-applications/style.css.map +0 -87
- package/build/projects/brightspace/style.css +0 -3
- package/build/projects/brightspace/style.css.map +0 -60
- package/build/projects/course-catalogue/js/app.js +0 -2
- package/build/projects/course-catalogue/js/app.js.map +0 -1
- package/build/projects/course-catalogue/style.css +0 -3
- package/build/projects/course-catalogue/style.css.map +0 -77
- package/build/projects/medarbejdere/js/app.js +0 -2
- package/build/projects/medarbejdere/js/app.js.map +0 -1
- package/build/projects/medarbejdere/style.css +0 -3
- package/build/projects/medarbejdere/style.css.map +0 -92
- package/build/projects/mitstudie/js/app.js +0 -2
- package/build/projects/mitstudie/js/app.js.map +0 -1
- package/build/projects/mitstudie/style.css +0 -3
- package/build/projects/mitstudie/style.css.map +0 -94
- package/build/projects/queue-it/style.css +0 -3
- package/build/projects/queue-it/style.css.map +0 -46
- package/build/projects/typo3/js/app.js +0 -2
- package/build/projects/typo3/js/app.js.map +0 -1
- package/build/projects/typo3/style.css +0 -3
- package/build/projects/typo3/style.css.map +0 -71
- package/build/style.css +0 -3
- package/build/style.css.map +0 -89
- package/source/.htaccess +0 -14
- package/source/projects/bachelor-applications/kontoaktivering/originals/faq.pug +0 -168
- package/source/projects/bachelor-applications/kontoaktivering/originals/password.pug +0 -205
- package/source/projects/bachelor-applications/kontoaktivering/originals/receipt.pug +0 -170
- package/source/projects/typo3/plain-delphinus.scss +0 -20
- package/tsconfig.json +0 -47
- package/webpack.config.js +0 -77
- /package/{source → public}/assets/au-logo-da.svg +0 -0
- /package/{source → public}/assets/au-logo-en.svg +0 -0
- /package/{source → public}/assets/au-seal-white.svg +0 -0
- /package/{source → public}/assets/au-seal.svg +0 -0
- /package/{source → public}/assets/delphinus-apple-touch-icon.png +0 -0
- /package/{source → public}/assets/delphinus-favicon.ico +0 -0
- /package/{source → public}/assets/delphinus-favicon.svg +0 -0
- /package/{source → public}/assets/delphinus-logo.svg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-1.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-10.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-2.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-3.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-4.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-5.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-6.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-7.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-8.jpg +0 -0
- /package/{source → public}/assets/profile-images/originals/profile-image-9.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/default/profile-image-1.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/default/profile-image-2.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/default/profile-image-3.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/default/profile-image-4.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/default/profile-image-5.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/default/profile-image-6.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/large/profile-image-1.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/large/profile-image-2.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/large/profile-image-3.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/large/profile-image-4.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/large/profile-image-5.jpg +0 -0
- /package/{source → public}/assets/profile-images/portrait/large/profile-image-6.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-1.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-10.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-2.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-3.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-4.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-5.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-6.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-7.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-8.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/default/profile-image-9.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-1.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-10.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-2.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-3.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-4.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-5.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-6.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-7.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-8.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/large/profile-image-9.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-1.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-10.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-2.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-3.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-4.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-5.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-6.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-7.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-8.jpg +0 -0
- /package/{source → public}/assets/profile-images/square/small/profile-image-9.jpg +0 -0
- /package/{source → public}/favicon.ico +0 -0
- /package/{build → public}/figma-tokens/breakpoint-styles.json +0 -0
- /package/{build → public}/figma-tokens/design-file.json +0 -0
- /package/{build → public}/js/3rdparty/iframeResizer.contentWindow.min.js +0 -0
- /package/{build → public}/js/3rdparty/iframeResizer.min.js +0 -0
- /package/{build → public}/js/3rdparty/prism.js +0 -0
- /package/{build → public}/js/autocomplete.js +0 -0
- /package/{build → public}/js/autocomplete.js.map +0 -0
- /package/{build → public}/js/components/atom-picker.ts +0 -0
- /package/{build → public}/js/components/content-toggle.ts +0 -0
- /package/{build → public}/js/components/copy-hex-code.ts +0 -0
- /package/{build → public}/js/components/form.ts +0 -0
- /package/{build → public}/js/components/modal-view.ts +0 -0
- /package/{build → public}/js/components/nav.ts +0 -0
- /package/{build → public}/js/components/ready.ts +0 -0
- /package/{build → public}/js/components/selection-list.ts +0 -0
- /package/{build → public}/js/components/table.ts +0 -0
- /package/{build → public}/js/components/tabs.ts +0 -0
- /package/{build → public}/js/components/toolbar.ts +0 -0
- /package/{build → public}/js/components/truncator.ts +0 -0
- /package/{build → public}/js/demo/app.ts +0 -0
- /package/{source → public}/projects/typo3/assets/au-herning.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/hc-oersted-guldmedalje-16-9.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/hc-oersted-guldmedalje-content-width.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/hc-oersted-guldmedalje-narrow.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/hc-oersted-guldmedalje-wide.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/hc-oersted-guldmedalje.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/hero-3-2.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/karl-anker-closeup.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/karl-anker-narrow.jpg +0 -0
- /package/{source → public}/projects/typo3/assets/karl-anker.jpg +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 1.0.0 (July 20, 2023)
|
|
2
|
+
**Big release!** At least for those of us building Delphinus. With this release, we have transitioned away from using Grunt as our build tool. From now on Sass and TypeScript files are compiled using Node, and Pug files render on the fly using an Express server. This results in dramatically improved build speed and development experience.
|
|
3
|
+
|
|
4
|
+
Two things to note:
|
|
5
|
+
* If you have cloned the Delpinus repo, please delete your local copy and clone from new and run `npm install`.
|
|
6
|
+
* If you are sourceing the compiled css files from the CDN, please note that the URLs have a slight change, as compiled css files are now in the `public` dir, not in the previous `build` dir.
|
|
7
|
+
|
|
8
|
+
Hopefulley, this update will make us able to build and develop Delphinus at warp speed ;)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## 0.48.1 (July 18, 2023)
|
|
12
|
+
|
|
13
|
+
### Core Delphinus Updates
|
|
14
|
+
Updates Figma tokens to use the new black Omnibus theme color.
|
|
15
|
+
|
|
16
|
+
### Delphinus Projects Updates
|
|
17
|
+
None
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
1
21
|
## 0.48.0 (July 18, 2023)
|
|
2
22
|
|
|
3
23
|
### Core Delphinus Updates
|
package/Gruntfile.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
/* eslint-disable consistent-return */
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
4
|
-
/* eslint-env node */
|
|
5
|
-
const sass = require('node-sass');
|
|
6
|
-
const webpackConfig = require('./webpack.config.js');
|
|
7
|
-
|
|
8
1
|
module.exports = (grunt) => {
|
|
9
2
|
// configure the tasks
|
|
10
3
|
grunt.initConfig({
|
|
@@ -12,289 +5,104 @@ module.exports = (grunt) => {
|
|
|
12
5
|
|
|
13
6
|
// clean the build directory
|
|
14
7
|
clean: {
|
|
15
|
-
|
|
16
|
-
src: ['
|
|
17
|
-
},
|
|
18
|
-
postbuild: {
|
|
19
|
-
src: ['build/**/_*.html'],
|
|
20
|
-
},
|
|
21
|
-
figmatokens: {
|
|
22
|
-
src: ['build/figma-tokens', 'bin'],
|
|
8
|
+
figmatokensbin: {
|
|
9
|
+
src: ['public/figma-tokens/bin'],
|
|
23
10
|
},
|
|
24
|
-
bin: {
|
|
25
|
-
src: ['bin'],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
cleanempty: {
|
|
29
|
-
options: {},
|
|
30
|
-
src: ['build/**'],
|
|
31
11
|
},
|
|
32
12
|
// copy from the source directory to build
|
|
33
13
|
copy: {
|
|
34
|
-
build: {
|
|
35
|
-
cwd: 'source',
|
|
36
|
-
src: [
|
|
37
|
-
'**',
|
|
38
|
-
'!**/*.scss',
|
|
39
|
-
'!**/*.pug',
|
|
40
|
-
'!**/*.js',
|
|
41
|
-
'!figma-tokens/**/*.json',
|
|
42
|
-
'js/3rdparty/**/*.js',
|
|
43
|
-
'projects/**/*.js',
|
|
44
|
-
'.htaccess',
|
|
45
|
-
],
|
|
46
|
-
dest: 'build',
|
|
47
|
-
expand: true,
|
|
48
|
-
},
|
|
49
14
|
figmastyles: {
|
|
50
15
|
options: {
|
|
51
16
|
flatten: true,
|
|
52
17
|
},
|
|
53
18
|
files: {
|
|
54
19
|
// the breakpoints
|
|
55
|
-
'bin/pre/breakpoint/01_medium.json': 'source/figma-tokens/styles/breakpoint.json',
|
|
56
|
-
'bin/pre/breakpoint/02_wide.json': 'source/figma-tokens/styles/breakpoint.json',
|
|
20
|
+
'public/figma-tokens/bin/pre/breakpoint/01_medium.json': 'source/figma-tokens/styles/breakpoint.json',
|
|
21
|
+
'public/figma-tokens/bin/pre/breakpoint/02_wide.json': 'source/figma-tokens/styles/breakpoint.json',
|
|
57
22
|
// the color colorthemes
|
|
58
|
-
'bin/pre/theme/01_cyan.json': 'source/figma-tokens/styles/theme.json',
|
|
59
|
-
'bin/pre/theme/02_turquoise.json': 'source/figma-tokens/styles/theme.json',
|
|
60
|
-
'bin/pre/theme/03_green.json': 'source/figma-tokens/styles/theme.json',
|
|
61
|
-
'bin/pre/theme/04_yellow.json': 'source/figma-tokens/styles/theme.json',
|
|
62
|
-
'bin/pre/theme/05_orange.json': 'source/figma-tokens/styles/theme.json',
|
|
63
|
-
'bin/pre/theme/06_red.json': 'source/figma-tokens/styles/theme.json',
|
|
64
|
-
'bin/pre/theme/07_magenta.json': 'source/figma-tokens/styles/theme.json',
|
|
65
|
-
'bin/pre/theme/08_purple.json': 'source/figma-tokens/styles/theme.json',
|
|
66
|
-
'bin/pre/theme/09_blue.json': 'source/figma-tokens/styles/theme.json',
|
|
67
|
-
'bin/pre/theme/21_mitstudie.json': 'source/figma-tokens/styles/theme.json',
|
|
68
|
-
'bin/pre/theme/22_omnibus.json': 'source/figma-tokens/styles/theme.json',
|
|
69
|
-
'bin/pre/theme/23_brightspace.json': 'source/figma-tokens/styles/theme.json',
|
|
23
|
+
'public/figma-tokens/bin/pre/theme/01_cyan.json': 'source/figma-tokens/styles/theme.json',
|
|
24
|
+
'public/figma-tokens/bin/pre/theme/02_turquoise.json': 'source/figma-tokens/styles/theme.json',
|
|
25
|
+
'public/figma-tokens/bin/pre/theme/03_green.json': 'source/figma-tokens/styles/theme.json',
|
|
26
|
+
'public/figma-tokens/bin/pre/theme/04_yellow.json': 'source/figma-tokens/styles/theme.json',
|
|
27
|
+
'public/figma-tokens/bin/pre/theme/05_orange.json': 'source/figma-tokens/styles/theme.json',
|
|
28
|
+
'public/figma-tokens/bin/pre/theme/06_red.json': 'source/figma-tokens/styles/theme.json',
|
|
29
|
+
'public/figma-tokens/bin/pre/theme/07_magenta.json': 'source/figma-tokens/styles/theme.json',
|
|
30
|
+
'public/figma-tokens/bin/pre/theme/08_purple.json': 'source/figma-tokens/styles/theme.json',
|
|
31
|
+
'public/figma-tokens/bin/pre/theme/09_blue.json': 'source/figma-tokens/styles/theme.json',
|
|
32
|
+
'public/figma-tokens/bin/pre/theme/21_mitstudie.json': 'source/figma-tokens/styles/theme.json',
|
|
33
|
+
'public/figma-tokens/bin/pre/theme/22_omnibus.json': 'source/figma-tokens/styles/theme.json',
|
|
34
|
+
'public/figma-tokens/bin/pre/theme/23_brightspace.json': 'source/figma-tokens/styles/theme.json',
|
|
70
35
|
},
|
|
71
36
|
},
|
|
72
37
|
figmatokens: {
|
|
73
38
|
cwd: 'source',
|
|
74
39
|
src: 'figma-tokens/*.json',
|
|
75
|
-
dest: 'bin/pre',
|
|
40
|
+
dest: 'public/figma-tokens/bin/pre',
|
|
76
41
|
expand: true,
|
|
77
42
|
flatten: true,
|
|
78
43
|
},
|
|
79
44
|
},
|
|
80
|
-
watch: {
|
|
81
|
-
sass: {
|
|
82
|
-
files: ['source/**/*.scss', '!source/figma-tokens/**/*.scss'],
|
|
83
|
-
tasks: ['sass', 'cleanempty'],
|
|
84
|
-
},
|
|
85
|
-
pug: {
|
|
86
|
-
files: ['source/**/*.pug', 'CHANGELOG.md'],
|
|
87
|
-
tasks: ['pug', 'cleanempty'],
|
|
88
|
-
},
|
|
89
|
-
webpack: {
|
|
90
|
-
files: ['source/**/*.ts'],
|
|
91
|
-
tasks: ['webpack'],
|
|
92
|
-
},
|
|
93
|
-
copy: {
|
|
94
|
-
files: ['source/**', '!source/**/*.scss', '!source/**/*.pug', '!source/figma-tokens/**/*.json'],
|
|
95
|
-
tasks: ['copy', 'cleanempty'],
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
pug: {
|
|
99
|
-
compile: {
|
|
100
|
-
options: {
|
|
101
|
-
data: {},
|
|
102
|
-
},
|
|
103
|
-
files: [
|
|
104
|
-
{
|
|
105
|
-
expand: true,
|
|
106
|
-
cwd: 'source/markup',
|
|
107
|
-
src: ['**/*.pug'],
|
|
108
|
-
dest: 'build',
|
|
109
|
-
ext: '.html',
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
compileatoms: {
|
|
114
|
-
options: {
|
|
115
|
-
data: {},
|
|
116
|
-
},
|
|
117
|
-
files: [
|
|
118
|
-
{
|
|
119
|
-
expand: true,
|
|
120
|
-
cwd: 'source/atoms',
|
|
121
|
-
src: ['**/*.pug'],
|
|
122
|
-
dest: 'build/atoms',
|
|
123
|
-
ext: '.html',
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
compileprojects: {
|
|
128
|
-
options: {
|
|
129
|
-
data: {},
|
|
130
|
-
},
|
|
131
|
-
files: [
|
|
132
|
-
{
|
|
133
|
-
expand: true,
|
|
134
|
-
cwd: 'source/projects',
|
|
135
|
-
//src: ['typo3/**/*.pug', 'medarbejdere/**/*.pug'],
|
|
136
|
-
src: ['**/*.pug'],
|
|
137
|
-
dest: 'build/projects',
|
|
138
|
-
ext: '.html',
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
sass: {
|
|
144
|
-
options: {
|
|
145
|
-
outputStyle: 'compressed',
|
|
146
|
-
implementation: sass,
|
|
147
|
-
sourceMap: true,
|
|
148
|
-
},
|
|
149
|
-
dist: {
|
|
150
|
-
files: [
|
|
151
|
-
{
|
|
152
|
-
expand: true,
|
|
153
|
-
cwd: 'source',
|
|
154
|
-
src: ['**/*.scss'],
|
|
155
|
-
dest: 'build',
|
|
156
|
-
ext: '.css',
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
},
|
|
160
|
-
figmatokens: {
|
|
161
|
-
files: [
|
|
162
|
-
{
|
|
163
|
-
expand: true,
|
|
164
|
-
cwd: 'source',
|
|
165
|
-
src: ['figma-tokens/**/*.scss'],
|
|
166
|
-
dest: 'bin/pre/cssvars',
|
|
167
|
-
ext: '.css',
|
|
168
|
-
flatten: true,
|
|
169
|
-
},
|
|
170
|
-
],
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
connect: {
|
|
174
|
-
server: {
|
|
175
|
-
options: {
|
|
176
|
-
port: 3001,
|
|
177
|
-
base: 'build',
|
|
178
|
-
hostname: '*',
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
browserSync: {
|
|
183
|
-
dev: {
|
|
184
|
-
bsFiles: {
|
|
185
|
-
src: ['img/**/*'],
|
|
186
|
-
},
|
|
187
|
-
options: {
|
|
188
|
-
watchTask: true,
|
|
189
|
-
proxy: 'http://localhost:3001',
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
webpack: {
|
|
194
|
-
prod: webpackConfig,
|
|
195
|
-
dev: webpackConfig,
|
|
196
|
-
},
|
|
197
|
-
'sftp-deploy': {
|
|
198
|
-
production: {
|
|
199
|
-
auth: {
|
|
200
|
-
host: 'cmsftp.auit.au.dk',
|
|
201
|
-
port: 22,
|
|
202
|
-
authKey: 'key1',
|
|
203
|
-
},
|
|
204
|
-
cache: false,
|
|
205
|
-
src: 'build',
|
|
206
|
-
dest: '/aucms/installations/delphinus.au.dk/http',
|
|
207
|
-
exclusions: [
|
|
208
|
-
'build/**/.DS_Store',
|
|
209
|
-
'build/.htaccess',
|
|
210
|
-
'build/projects/au-webshop/*',
|
|
211
|
-
],
|
|
212
|
-
serverSep: '/',
|
|
213
|
-
localSep: '/',
|
|
214
|
-
concurrency: 4,
|
|
215
|
-
progress: true,
|
|
216
|
-
},
|
|
217
|
-
dev: {
|
|
218
|
-
auth: {
|
|
219
|
-
host: 'cmsftp.auit.au.dk',
|
|
220
|
-
port: 22,
|
|
221
|
-
authKey: 'key1',
|
|
222
|
-
},
|
|
223
|
-
cache: false,
|
|
224
|
-
src: 'build',
|
|
225
|
-
dest: '/aucms/installations/delphinus.au.dk/dev',
|
|
226
|
-
exclusions: [
|
|
227
|
-
'build/**/.DS_Store',
|
|
228
|
-
'build/.htaccess',
|
|
229
|
-
'build/projects/au-webshop/*',
|
|
230
|
-
],
|
|
231
|
-
serverSep: '/',
|
|
232
|
-
localSep: '/',
|
|
233
|
-
concurrency: 4,
|
|
234
|
-
progress: true,
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
45
|
'merge-json': {
|
|
238
46
|
breakpoints: {
|
|
239
|
-
src: ['bin/pre/breakpoint/*.json'],
|
|
240
|
-
dest: 'bin/pre/sizes-breakpoints.json',
|
|
47
|
+
src: ['public/figma-tokens/bin/pre/breakpoint/*.json'],
|
|
48
|
+
dest: 'public/figma-tokens/bin/pre/sizes-breakpoints.json',
|
|
241
49
|
},
|
|
242
50
|
themes: {
|
|
243
|
-
src: ['bin/pre/theme/*.json'],
|
|
244
|
-
dest: 'bin/pre/colors-themes.json',
|
|
51
|
+
src: ['public/figma-tokens/bin/pre/theme/*.json'],
|
|
52
|
+
dest: 'public/figma-tokens/bin/pre/colors-themes.json',
|
|
245
53
|
},
|
|
246
54
|
designsystem: {
|
|
247
55
|
src: [
|
|
248
|
-
'
|
|
249
|
-
'
|
|
250
|
-
'
|
|
251
|
-
'
|
|
252
|
-
'
|
|
253
|
-
'
|
|
254
|
-
'
|
|
255
|
-
'
|
|
256
|
-
'
|
|
257
|
-
'
|
|
258
|
-
'
|
|
259
|
-
'
|
|
260
|
-
'
|
|
261
|
-
'
|
|
262
|
-
'
|
|
263
|
-
'
|
|
56
|
+
'public/figma-tokens/bin/colors-all.json',
|
|
57
|
+
'public/figma-tokens/bin/colors-themes.json',
|
|
58
|
+
'public/figma-tokens/bin/sizes-default.json',
|
|
59
|
+
'public/figma-tokens/bin/sizes-breakpoints.json',
|
|
60
|
+
'public/figma-tokens/bin/sizing.json',
|
|
61
|
+
'public/figma-tokens/bin/spacing.json',
|
|
62
|
+
'public/figma-tokens/bin/shadows-default.json',
|
|
63
|
+
'public/figma-tokens/bin/blurs-default.json',
|
|
64
|
+
'public/figma-tokens/bin/typography-fonts.json',
|
|
65
|
+
'public/figma-tokens/bin/typography-line-widths.json',
|
|
66
|
+
'public/figma-tokens/bin/typography-styles.json',
|
|
67
|
+
'public/figma-tokens/bin/borders-widths.json',
|
|
68
|
+
'public/figma-tokens/bin/borders-default.json',
|
|
69
|
+
'public/figma-tokens/bin/borders-theme.json',
|
|
70
|
+
'public/figma-tokens/bin/borders-nav-item.json',
|
|
71
|
+
'public/figma-tokens/bin/borders-nav-item-theme.json',
|
|
264
72
|
],
|
|
265
|
-
dest: '
|
|
73
|
+
dest: 'public/figma-tokens/design-system.json',
|
|
266
74
|
},
|
|
267
75
|
designfile: {
|
|
268
76
|
src: [
|
|
269
|
-
'
|
|
270
|
-
'
|
|
271
|
-
'
|
|
272
|
-
'
|
|
273
|
-
'
|
|
274
|
-
'
|
|
275
|
-
'
|
|
276
|
-
'
|
|
277
|
-
'
|
|
77
|
+
'public/figma-tokens/bin/sizes-default.json',
|
|
78
|
+
'public/figma-tokens/bin/sizes-breakpoints.json',
|
|
79
|
+
'public/figma-tokens/bin/sizing.json',
|
|
80
|
+
'public/figma-tokens/bin/spacing.json',
|
|
81
|
+
'public/figma-tokens/bin/blurs-default.json',
|
|
82
|
+
'public/figma-tokens/bin/typography-fonts.json',
|
|
83
|
+
'public/figma-tokens/bin/typography-line-widths.json',
|
|
84
|
+
'public/figma-tokens/bin/typography-styles.json',
|
|
85
|
+
'public/figma-tokens/bin/borders-widths.json',
|
|
278
86
|
],
|
|
279
|
-
dest: '
|
|
87
|
+
dest: 'public/figma-tokens/design-file.json',
|
|
280
88
|
},
|
|
281
89
|
colorthemes: {
|
|
282
90
|
src: [
|
|
283
|
-
'
|
|
284
|
-
'
|
|
285
|
-
'
|
|
286
|
-
'
|
|
91
|
+
'public/figma-tokens/bin/borders-widths.json',
|
|
92
|
+
'public/figma-tokens/bin/borders-theme.json',
|
|
93
|
+
'public/figma-tokens/bin/borders-nav-item-theme.json',
|
|
94
|
+
'public/figma-tokens/bin/colors-themes.json',
|
|
287
95
|
],
|
|
288
|
-
dest: '
|
|
96
|
+
dest: 'public/figma-tokens/color-themes.json',
|
|
289
97
|
},
|
|
290
98
|
breakpointstyles: {
|
|
291
99
|
src: [
|
|
292
|
-
'
|
|
293
|
-
'
|
|
294
|
-
'
|
|
295
|
-
'
|
|
100
|
+
'public/figma-tokens/bin/typography-fonts.json',
|
|
101
|
+
'public/figma-tokens/bin/typography-line-widths.json',
|
|
102
|
+
'public/figma-tokens/bin/typography-styles.json',
|
|
103
|
+
'public/figma-tokens/bin/sizes-breakpoints.json',
|
|
296
104
|
],
|
|
297
|
-
dest: '
|
|
105
|
+
dest: 'public/figma-tokens/breakpoint-styles.json',
|
|
298
106
|
},
|
|
299
107
|
},
|
|
300
108
|
'string-replace': {
|
|
@@ -302,16 +110,16 @@ module.exports = (grunt) => {
|
|
|
302
110
|
files: [{
|
|
303
111
|
flatten: true,
|
|
304
112
|
expand: true,
|
|
305
|
-
cwd: 'bin/',
|
|
113
|
+
cwd: 'public/figma-tokens/bin/',
|
|
306
114
|
src: 'pre/*.json',
|
|
307
|
-
dest: '
|
|
115
|
+
dest: 'public/figma-tokens/bin/',
|
|
308
116
|
}],
|
|
309
117
|
options: {
|
|
310
118
|
replacements: [{
|
|
311
119
|
pattern: /(--[a-z0-9-]+)/ig,
|
|
312
120
|
replacement(match) {
|
|
313
121
|
// console.log(match)
|
|
314
|
-
const cssvars = grunt.file.read('
|
|
122
|
+
const cssvars = grunt.file.read('public/figma-tokens/style.css');
|
|
315
123
|
const regex = new RegExp(`${match}: ([a-zA-Z0-9-#.,()]+)`);
|
|
316
124
|
const value = cssvars.match(regex);
|
|
317
125
|
if (value == null) {
|
|
@@ -326,9 +134,9 @@ module.exports = (grunt) => {
|
|
|
326
134
|
figmastyles: {
|
|
327
135
|
files: [{
|
|
328
136
|
expand: true,
|
|
329
|
-
cwd: 'bin/',
|
|
137
|
+
cwd: 'public/figma-tokens/bin/',
|
|
330
138
|
src: ['pre/breakpoint/*.json', 'pre/theme/*.json'],
|
|
331
|
-
dest: 'bin/',
|
|
139
|
+
dest: 'public/figma-tokens/bin/',
|
|
332
140
|
}],
|
|
333
141
|
options: {
|
|
334
142
|
replacements: [{
|
|
@@ -350,7 +158,7 @@ module.exports = (grunt) => {
|
|
|
350
158
|
|
|
351
159
|
// if matched value is not name, find display name i css vars file. Else return the filename.
|
|
352
160
|
if (value !== 'name') {
|
|
353
|
-
const cssvars = grunt.file.read('
|
|
161
|
+
const cssvars = grunt.file.read('public/figma-tokens/style.css');
|
|
354
162
|
const re2 = new RegExp(`--${foldername}-${filename}: ([a-zA-Z0-9-#. ]+)`);
|
|
355
163
|
const displayname = cssvars.match(re2);
|
|
356
164
|
if (displayname == null) {
|
|
@@ -372,50 +180,28 @@ module.exports = (grunt) => {
|
|
|
372
180
|
|
|
373
181
|
// load the tasks
|
|
374
182
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
375
|
-
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
376
183
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
377
|
-
grunt.loadNpmTasks('grunt-cleanempty');
|
|
378
|
-
grunt.loadNpmTasks('grunt-contrib-pug');
|
|
379
|
-
grunt.loadNpmTasks('grunt-sass');
|
|
380
|
-
grunt.loadNpmTasks('node-sass');
|
|
381
|
-
grunt.loadNpmTasks('grunt-contrib-connect');
|
|
382
|
-
grunt.loadNpmTasks('grunt-browser-sync');
|
|
383
|
-
grunt.loadNpmTasks('grunt-webpack');
|
|
384
|
-
grunt.loadNpmTasks('grunt-sftp-deploy');
|
|
385
184
|
grunt.loadNpmTasks('grunt-merge-json');
|
|
386
185
|
grunt.loadNpmTasks('grunt-string-replace');
|
|
387
186
|
|
|
388
187
|
// define the tasks
|
|
389
|
-
|
|
390
|
-
grunt.registerTask('build', [
|
|
391
|
-
'clean:prebuild',
|
|
392
|
-
'copy',
|
|
393
|
-
'pug',
|
|
394
|
-
'sass:dist',
|
|
395
|
-
'figma-tokens',
|
|
396
|
-
'clean:postbuild',
|
|
397
|
-
'cleanempty',
|
|
398
|
-
'webpack',
|
|
399
|
-
]);
|
|
400
|
-
|
|
401
|
-
grunt.registerTask('default', ['build', 'connect', 'browserSync', 'watch']);
|
|
402
|
-
|
|
403
|
-
grunt.registerTask('deploy', ['sftp-deploy:production']);
|
|
404
|
-
|
|
405
|
-
grunt.registerTask('dev-deploy', ['sftp-deploy:dev']);
|
|
406
|
-
|
|
407
|
-
grunt.registerTask('deploy-both', ['sftp-deploy']);
|
|
408
|
-
|
|
409
188
|
grunt.registerTask('figma-tokens', [
|
|
410
|
-
|
|
411
|
-
'
|
|
189
|
+
//start by deleting the temporary bin folder
|
|
190
|
+
'clean:figmatokensbin',
|
|
191
|
+
//the we copy some json files from the source folder to the temporary bin folder, we start by creating a json file for each breakpoint and then one for each color theme
|
|
412
192
|
'copy:figmastyles',
|
|
193
|
+
//the we also copy json files for our tokens from the source folder to the temporary bin folder
|
|
413
194
|
'copy:figmatokens',
|
|
195
|
+
//then we replace {{name}} in the breakpoint and color theme json files with the theme/breakpoint name from each json file
|
|
414
196
|
'string-replace:figmastyles',
|
|
197
|
+
//we then merge alle the breakpoint json files in to one file and the same for the color theme json files
|
|
415
198
|
'merge-json:breakpoints',
|
|
416
199
|
'merge-json:themes',
|
|
200
|
+
//finally we go through the json files and find all css variable names and replace them with the value from the css file we created in the beginning - this is done in a new copy of each json file
|
|
417
201
|
'string-replace:cssvars',
|
|
202
|
+
//lastly all json files are merged in to the four files we need for the design system, breakpoints, design file and color themes (these are placed on the build folder and can be deployed to delphinus site)
|
|
418
203
|
'merge-json',
|
|
419
|
-
|
|
204
|
+
//at the end we delete the temporary bin folder
|
|
205
|
+
'clean:figmatokensbin',
|
|
420
206
|
]);
|
|
421
207
|
};
|
package/app.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var createError = require('http-errors');
|
|
2
|
+
var express = require('express');
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var cookieParser = require('cookie-parser');
|
|
5
|
+
var logger = require('morgan');
|
|
6
|
+
|
|
7
|
+
var indexRouter = require('./routes/index');
|
|
8
|
+
var usersRouter = require('./routes/users');
|
|
9
|
+
|
|
10
|
+
var app = express();
|
|
11
|
+
|
|
12
|
+
// view engine setup
|
|
13
|
+
app.set('views', path.join(__dirname, 'source/markup'));
|
|
14
|
+
app.set('view engine', 'pug');
|
|
15
|
+
|
|
16
|
+
app.use(logger('dev'));
|
|
17
|
+
app.use(express.json());
|
|
18
|
+
app.use(express.urlencoded({ extended: false }));
|
|
19
|
+
app.use(cookieParser());
|
|
20
|
+
app.use(express.static(path.join(__dirname, 'public')));
|
|
21
|
+
|
|
22
|
+
app.use('/', indexRouter);
|
|
23
|
+
app.use('/users', usersRouter);
|
|
24
|
+
|
|
25
|
+
// catch 404 and forward to error handler
|
|
26
|
+
app.use(function(req, res, next) {
|
|
27
|
+
next(createError(404));
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// error handler
|
|
31
|
+
app.use(function(err, req, res, next) {
|
|
32
|
+
// set locals, only providing error in development
|
|
33
|
+
res.locals.message = err.message;
|
|
34
|
+
res.locals.error = req.app.get('env') === 'development' ? err : {};
|
|
35
|
+
|
|
36
|
+
// render the error page
|
|
37
|
+
res.status(err.status || 500);
|
|
38
|
+
res.render('error');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
module.exports = app;
|
package/bin/www
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Module dependencies.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var app = require('../app');
|
|
8
|
+
var debug = require('debug')('express:server');
|
|
9
|
+
var http = require('http');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get port from environment and store in Express.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var port = normalizePort(process.env.PORT || '3000');
|
|
16
|
+
app.set('port', port);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create HTTP server.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
var server = http.createServer(app);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Listen on provided port, on all network interfaces.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
server.listen(port);
|
|
29
|
+
server.on('error', onError);
|
|
30
|
+
server.on('listening', onListening);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Normalize a port into a number, string, or false.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
function normalizePort(val) {
|
|
37
|
+
var port = parseInt(val, 10);
|
|
38
|
+
|
|
39
|
+
if (isNaN(port)) {
|
|
40
|
+
// named pipe
|
|
41
|
+
return val;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (port >= 0) {
|
|
45
|
+
// port number
|
|
46
|
+
return port;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Event listener for HTTP server "error" event.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
function onError(error) {
|
|
57
|
+
if (error.syscall !== 'listen') {
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var bind = typeof port === 'string'
|
|
62
|
+
? 'Pipe ' + port
|
|
63
|
+
: 'Port ' + port;
|
|
64
|
+
|
|
65
|
+
// handle specific listen errors with friendly messages
|
|
66
|
+
switch (error.code) {
|
|
67
|
+
case 'EACCES':
|
|
68
|
+
console.error(bind + ' requires elevated privileges');
|
|
69
|
+
process.exit(1);
|
|
70
|
+
break;
|
|
71
|
+
case 'EADDRINUSE':
|
|
72
|
+
console.error(bind + ' is already in use');
|
|
73
|
+
process.exit(1);
|
|
74
|
+
break;
|
|
75
|
+
default:
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Event listener for HTTP server "listening" event.
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
function onListening() {
|
|
85
|
+
var addr = server.address();
|
|
86
|
+
var bind = typeof addr === 'string'
|
|
87
|
+
? 'pipe ' + addr
|
|
88
|
+
: 'port ' + addr.port;
|
|
89
|
+
debug('Listening on ' + bind);
|
|
90
|
+
}
|
package/esbuild.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import * as esbuild from 'esbuild';
|
|
4
|
+
|
|
5
|
+
await esbuild.build({
|
|
6
|
+
entryPoints: {
|
|
7
|
+
'js/app': './source/js/production/app.ts',
|
|
8
|
+
'js/demo': './source/js/demo/app.ts',
|
|
9
|
+
'projects/medarbejdere/js/app': './source/js/production/app.ts',
|
|
10
|
+
'projects/typo3/js/app': './source/js/production/typo3.ts',
|
|
11
|
+
'projects/mitstudie/js/app': './source/js/production/app.ts',
|
|
12
|
+
'projects/bachelor-applications/js/app': './source/js/production/app.ts',
|
|
13
|
+
'projects/course-catalogue/js/app': './source/js/production/app.ts',
|
|
14
|
+
},
|
|
15
|
+
bundle: true,
|
|
16
|
+
minify: true,
|
|
17
|
+
outdir: 'public',
|
|
18
|
+
});
|