git.iko.soy/rowtype-yoga/psfp
on master help sign in
Server works
commitd78b06e6b55fe7997b1eb3ae30f8cf8e72515e7d authorMark Eibes <mark.eibes@gmail.com> dateFri 25 Oct 2019, 23:37 (7 years ago) parent557f5b0
99 files changed+1812−944
.gitignore+32−10 .storybook/preview-head.html−15 .storybook/config.js → client/.storybook/config.js .storybook/webpack.config.js → client/.storybook/webpack.config.js .vscode/settings.json → client/.vscode/settings.json LICENSE → client/LICENSE assets/icons/alternative.svg → client/assets/icons/alternative.svg assets/icons/ap.svg → client/assets/icons/ap.svg assets/icons/append.svg → client/assets/icons/append.svg assets/icons/apply.svg → client/assets/icons/apply.svg assets/icons/applyflipped.svg → client/assets/icons/applyflipped.svg assets/icons/bind.svg → client/assets/icons/bind.svg assets/icons/compose.svg → client/assets/icons/compose.svg assets/icons/composeflipped.svg → client/assets/icons/composeflipped.svg assets/icons/forall.svg → client/assets/icons/forall.svg assets/icons/kleisli.svg → client/assets/icons/kleisli.svg assets/icons/landingpagedark.svg → client/assets/icons/landingpagedark.svg assets/icons/landingpagelight.svg → client/assets/icons/landingpagelight.svg assets/icons/lovelogo.svg → client/assets/icons/lovelogo.svg assets/icons/map.svg → client/assets/icons/map.svg assets/icons/mapflipped.svg → client/assets/icons/mapflipped.svg assets/icons/menu.svg → client/assets/icons/menu.svg assets/icons/pslogo.svg → client/assets/icons/pslogo.svg assets/icons/trianglelogo.svg → client/assets/icons/trianglelogo.svg assets/images/landingpagedark.svg → client/assets/images/landingpagedark.svg assets/images/landingpagelight.svg → client/assets/images/landingpagelight.svg dist/bundle.js → client/dist/bundle.js dist/index.html → client/dist/index.html index.html → client/index.html package-lock.json → client/package-lock.json package.json → client/package.json client/packages.dhall+1 shell.nix → client/shell.nix spago.dhall → client/spago.dhall src/Button/Component.purs → client/src/Button/Component.purs src/CSS/Safer.purs → client/src/CSS/Safer.purs src/Card/Component.purs → client/src/Card/Component.purs src/Container/Component.purs → client/src/Container/Component.purs src/Container/Header.purs → client/src/Container/Header.purs src/Container/Landing.purs → client/src/Container/Landing.purs src/Container/Sidebar.purs → client/src/Container/Sidebar.purs src/DOM/Hook.purs → client/src/DOM/Hook.purs src/Example.js → client/src/Example.js src/Example.purs → client/src/Example.purs client/src/Monaco/Editor.js+1023 src/Monaco/Editor.purs → client/src/Monaco/Editor.purs+24−14 src/Polyfill/SmoothScrolling.js → client/src/Polyfill/SmoothScrolling.js src/Polyfill/SmoothScrolling.purs → client/src/Polyfill/SmoothScrolling.purs src/React/Helpers.purs → client/src/React/Helpers.purs src/SVG/Icon.js → client/src/SVG/Icon.js src/SVG/Icon.purs → client/src/SVG/Icon.purs src/SVG/Image.js → client/src/SVG/Image.js src/SVG/Image.purs → client/src/SVG/Image.purs src/Scroll/Hook.purs → client/src/Scroll/Hook.purs src/Scroll/Listener.purs → client/src/Scroll/Listener.purs client/src/Shared+1 src/Theme.purs → client/src/Theme.purs src/Theme/Default.purs → client/src/Theme/Default.purs src/Theme/Provider.js → client/src/Theme/Provider.js src/Theme/Provider.purs → client/src/Theme/Provider.purs src/Theme/Styles.js → client/src/Theme/Styles.js src/Theme/Styles.purs → client/src/Theme/Styles.purs src/Theme/Types.purs → client/src/Theme/Types.purs src/Typography/Header.purs → client/src/Typography/Header.purs src/Typography/Paragraph.purs → client/src/Typography/Paragraph.purs src/entrypoint.js → client/src/entrypoint.js src/logo.png → client/src/logo.png stories/ButtonStories.purs → client/stories/ButtonStories.purs stories/CardStories.purs → client/stories/CardStories.purs stories/ContainerStories.purs → client/stories/ContainerStories.purs stories/Decorator/FullScreen.purs → client/stories/Decorator/FullScreen.purs stories/EditorStories.purs → client/stories/EditorStories.purs stories/Storybook/React.js → client/stories/Storybook/React.js stories/Storybook/React.purs → client/stories/Storybook/React.purs stories/ThemeStories.purs → client/stories/ThemeStories.purs stories/TypographyStories.purs → client/stories/TypographyStories.purs test/Main.purs → client/test/Main.purs webpack.common.js → client/webpack.common.js webpack.dev.js → client/webpack.dev.js webpack.production.js → client/webpack.production.js playground/.gitignore+10 playground/packages.dhall+128 playground/run.js+1 playground/spago.dhall+13 playground/src/Main.purs+4 playground/test/Main.purs+11 server/.vscode/settings.json+20 server/package-lock.json+374 server/package.json+19 server/spago.dhall+4 server/src/Main.purs+104−11 server/src/Middleware/JsonBodyParser.js+3 server/src/Middleware/JsonBodyParser.purs+9 server/src/Shared+1−1 server/test.json+2 shared/Shared/Json.purs+19 shared/Shared/Models/Body.purs+9 src/Monaco/Editor.js−892 src/Shared−1
.gitignore+32−10
@@ -1,10 +1,32 @@
1−/bower_components/
2−/node_modules/
3−/.pulp-cache/
4−/output/
5−/generated-docs/
6−/.psc-package/
7−/.psc*
8−/.purs*
9−/.psa*
10−/.spago
1+client/bower_components/
2+client/node_modules/
3+client/.pulp-cache/
4+client/output/
5+client/generated-docs/
6+client/.psc-package/
7+client/.psc*
8+client/.purs*
9+client/.psa*
10+client/.spago
11+
12+server/bower_components/
13+server/node_modules/
14+server/.pulp-cache/
15+server/output/
16+server/generated-docs/
17+server/.psc-package/
18+server/.psc*
19+server/.purs*
20+server/.psa*
21+server/.spago
22+
23+playground/bower_components/
24+playground/node_modules/
25+playground/.pulp-cache/
26+playground/output/
27+playground/generated-docs/
28+playground/.psc-package/
29+playground/.psc*
30+playground/.purs*
31+playground/.psa*
32+playground/.spago
.storybook/preview-head.htmldeleted−15
@@ -1,15 +0,0 @@
1−<link href="https://fonts.googleapis.com/css?family=Overpass|Playfair+Display|Montserrat:300,400,500,600,700,800,900&display=swap" rel="stylesheet">
2−<style>
3− html, body, #app {
4− margin: 0;
5− padding: 0;
6− overscroll-behavior: none;
7− }
8− @font-face {
9− font-family: "PragmataPro";
10− src: url('./fonts/PragmataProLiga-Regular.woff2') format('woff2'),
11− url('./fonts/PragmataProLiga-Regular.woff') format('woff');
12− font-weight: normal;
13− font-style: normal;
14−}
15−</style>
.storybook/config.js → client/.storybook/config.jsrenamed

The content is the same.

.storybook/webpack.config.js → client/.storybook/webpack.config.jsrenamed

The content is the same.

.vscode/settings.json → client/.vscode/settings.jsonrenamed

The content is the same.

LICENSE → client/LICENSErenamed

The content is the same.

assets/icons/alternative.svg → client/assets/icons/alternative.svgrenamed

The content is the same.

assets/icons/ap.svg → client/assets/icons/ap.svgrenamed

The content is the same.

assets/icons/append.svg → client/assets/icons/append.svgrenamed

The content is the same.

assets/icons/apply.svg → client/assets/icons/apply.svgrenamed

The content is the same.

assets/icons/applyflipped.svg → client/assets/icons/applyflipped.svgrenamed

The content is the same.

assets/icons/bind.svg → client/assets/icons/bind.svgrenamed

The content is the same.

assets/icons/compose.svg → client/assets/icons/compose.svgrenamed

The content is the same.

assets/icons/composeflipped.svg → client/assets/icons/composeflipped.svgrenamed

The content is the same.

assets/icons/forall.svg → client/assets/icons/forall.svgrenamed

The content is the same.

assets/icons/kleisli.svg → client/assets/icons/kleisli.svgrenamed

The content is the same.

assets/icons/landingpagedark.svg → client/assets/icons/landingpagedark.svgrenamed

The content is the same.

assets/icons/landingpagelight.svg → client/assets/icons/landingpagelight.svgrenamed

The content is the same.

assets/icons/lovelogo.svg → client/assets/icons/lovelogo.svgrenamed

The content is the same.

assets/icons/map.svg → client/assets/icons/map.svgrenamed

The content is the same.

assets/icons/mapflipped.svg → client/assets/icons/mapflipped.svgrenamed

The content is the same.

assets/icons/menu.svg → client/assets/icons/menu.svgrenamed

The content is the same.

assets/icons/pslogo.svg → client/assets/icons/pslogo.svgrenamed

The content is the same.

assets/icons/trianglelogo.svg → client/assets/icons/trianglelogo.svgrenamed

The content is the same.

assets/images/landingpagedark.svg → client/assets/images/landingpagedark.svgrenamed

The content is the same.

assets/images/landingpagelight.svg → client/assets/images/landingpagelight.svgrenamed

The content is the same.

dist/bundle.js → client/dist/bundle.jsrenamed

The content is the same.

dist/index.html → client/dist/index.htmlrenamed

The content is the same.

index.html → client/index.htmlrenamed

The content is the same.

package-lock.json → client/package-lock.jsonrenamed

The content is the same.

package.json → client/package.jsonrenamed

The content is the same.

client/packages.dhallnew file+1
@@ -0,0 +1 @@
1+../packages.dhall
shell.nix → client/shell.nixrenamed

The content is the same.

spago.dhall → client/spago.dhallrenamed

The content is the same.

src/Button/Component.purs → client/src/Button/Component.pursrenamed

The content is the same.

src/CSS/Safer.purs → client/src/CSS/Safer.pursrenamed

The content is the same.

src/Card/Component.purs → client/src/Card/Component.pursrenamed

The content is the same.

src/Container/Component.purs → client/src/Container/Component.pursrenamed

The content is the same.

src/Container/Header.purs → client/src/Container/Header.pursrenamed

The content is the same.

src/Container/Landing.purs → client/src/Container/Landing.pursrenamed

The content is the same.

src/Container/Sidebar.purs → client/src/Container/Sidebar.pursrenamed

The content is the same.

src/DOM/Hook.purs → client/src/DOM/Hook.pursrenamed

The content is the same.

src/Example.js → client/src/Example.jsrenamed

The content is the same.

src/Example.purs → client/src/Example.pursrenamed

The content is the same.

client/src/Monaco/Editor.jsnew file+1023
@@ -0,0 +1,1023 @@
1+"use strict";
2+var monacoEditor = require("@monaco-editor/react");
3+
4+exports.editorImpl = monacoEditor.default;
5+
6+exports.initMonacoImpl = function() {
7+ return monacoEditor.monaco.init();
8+};
9+
10+exports.getValue = function(editor) {
11+ return function() {
12+ return editor.getValue();
13+ };
14+};
15+
16+exports.defineThemeImpl = function(monacoInstance) {
17+ return function(name) {
18+ return function(theme) {
19+ return function() {
20+ return monacoInstance.editor.defineTheme(name, theme);
21+ };
22+ };
23+ };
24+};
25+
26+exports.setThemeImpl = function(monacoInstance) {
27+ return function(theme) {
28+ return function() {
29+ return monacoInstance.editor.setTheme(theme);
30+ };
31+ };
32+};
33+
34+exports.registerLanguageImpl = function(monacoInstance) {
35+ return function(languageId) {
36+ return function() {
37+ monacoInstance.languages.register({ id: languageId });
38+ };
39+ };
40+};
41+
42+exports.setMonarchTokensProviderImpl = function(monacoInstance) {
43+ return function(name) {
44+ return function(monarchLanguage) {
45+ return function() {
46+ return monacoInstance.languages.setMonarchTokensProvider(
47+ name,
48+ monarchLanguage
49+ );
50+ };
51+ };
52+ };
53+};
54+
55+exports.vsCodeTheme = {
56+ base: "vs",
57+ inherit: true,
58+ rules: [
59+ {
60+ foreground: "008e00",
61+ token: "comment"
62+ },
63+ {
64+ foreground: "7d4726",
65+ token: "meta.preprocessor"
66+ },
67+ {
68+ foreground: "7d4726",
69+ token: "keyword.control.import"
70+ },
71+ {
72+ foreground: "df0002",
73+ token: "string"
74+ },
75+ {
76+ foreground: "3a00dc",
77+ token: "constant.numeric"
78+ },
79+ {
80+ foreground: "c800a4",
81+ token: "constant.language"
82+ },
83+ {
84+ foreground: "275a5e",
85+ token: "constant.character"
86+ },
87+ {
88+ foreground: "275a5e",
89+ token: "constant.other"
90+ },
91+ {
92+ foreground: "c800a4",
93+ token: "variable.language"
94+ },
95+ {
96+ foreground: "c800a4",
97+ token: "variable.other"
98+ },
99+ {
100+ foreground: "c800a4",
101+ token: "keyword"
102+ },
103+ {
104+ foreground: "c900a4",
105+ token: "storage"
106+ },
107+ {
108+ foreground: "438288",
109+ token: "entity.name.class"
110+ },
111+ {
112+ foreground: "790ead",
113+ token: "entity.name.tag"
114+ },
115+ {
116+ foreground: "450084",
117+ token: "entity.other.attribute-name"
118+ },
119+ {
120+ foreground: "450084",
121+ token: "support.function"
122+ },
123+ {
124+ foreground: "450084",
125+ token: "support.constant"
126+ },
127+ {
128+ foreground: "790ead",
129+ token: "support.type"
130+ },
131+ {
132+ foreground: "790ead",
133+ token: "support.class"
134+ },
135+ {
136+ foreground: "790ead",
137+ token: "support.other.variable"
138+ }
139+ ],
140+ colors: {
141+ "editor.foreground": "#000000",
142+ "editor.background": "#FFFFFF",
143+ "editor.selectionBackground": "#B5D5FF",
144+ "editor.lineHighlightBackground": "#00000012",
145+ "editorCursor.foreground": "#000000",
146+ "editorWhitespace.foreground": "#BFBFBF"
147+ }
148+};
149+
150+exports.nightOwlTheme = {
151+ base: "vs-dark",
152+ inherit: true,
153+ rules: [
154+ {
155+ foreground: "637777",
156+ token: "comment"
157+ },
158+ {
159+ foreground: "addb67",
160+ token: "string"
161+ },
162+ {
163+ foreground: "ecc48d",
164+ token: "vstring.quoted"
165+ },
166+ {
167+ foreground: "ecc48d",
168+ token: "variable.other.readwrite.js"
169+ },
170+ {
171+ foreground: "5ca7e4",
172+ token: "string.regexp"
173+ },
174+ {
175+ foreground: "5ca7e4",
176+ token: "string.regexp keyword.other"
177+ },
178+ {
179+ foreground: "5f7e97",
180+ token: "meta.function punctuation.separator.comma"
181+ },
182+ {
183+ foreground: "f78c6c",
184+ token: "constant.numeric"
185+ },
186+ {
187+ foreground: "f78c6c",
188+ token: "constant.character.numeric"
189+ },
190+ {
191+ foreground: "addb67",
192+ token: "variable"
193+ },
194+ {
195+ foreground: "c792ea",
196+ token: "keyword"
197+ },
198+ {
199+ foreground: "c792ea",
200+ token: "punctuation.accessor"
201+ },
202+ {
203+ foreground: "c792ea",
204+ token: "storage"
205+ },
206+ {
207+ foreground: "c792ea",
208+ token: "meta.var.expr"
209+ },
210+ {
211+ foreground: "c792ea",
212+ token: "meta.class meta.method.declaration meta.var.expr storage.type.jsm"
213+ },
214+ {
215+ foreground: "c792ea",
216+ token: "storage.type.property.js"
217+ },
218+ {
219+ foreground: "c792ea",
220+ token: "storage.type.property.ts"
221+ },
222+ {
223+ foreground: "c792ea",
224+ token: "storage.type.property.tsx"
225+ },
226+ {
227+ foreground: "82aaff",
228+ token: "storage.type"
229+ },
230+ {
231+ foreground: "ffcb8b",
232+ token: "entity.name.class"
233+ },
234+ {
235+ foreground: "ffcb8b",
236+ token: "meta.class entity.name.type.class"
237+ },
238+ {
239+ foreground: "addb67",
240+ token: "entity.other.inherited-class"
241+ },
242+ {
243+ foreground: "82aaff",
244+ token: "entity.name.function"
245+ },
246+ {
247+ foreground: "addb67",
248+ token: "punctuation.definition.variable"
249+ },
250+ {
251+ foreground: "d3423e",
252+ token: "punctuation.section.embedded"
253+ },
254+ {
255+ foreground: "d6deeb",
256+ token: "punctuation.terminator.expression"
257+ },
258+ {
259+ foreground: "d6deeb",
260+ token: "punctuation.definition.arguments"
261+ },
262+ {
263+ foreground: "d6deeb",
264+ token: "punctuation.definition.array"
265+ },
266+ {
267+ foreground: "d6deeb",
268+ token: "punctuation.section.array"
269+ },
270+ {
271+ foreground: "d6deeb",
272+ token: "meta.array"
273+ },
274+ {
275+ foreground: "d9f5dd",
276+ token: "punctuation.definition.list.begin"
277+ },
278+ {
279+ foreground: "d9f5dd",
280+ token: "punctuation.definition.list.end"
281+ },
282+ {
283+ foreground: "d9f5dd",
284+ token: "punctuation.separator.arguments"
285+ },
286+ {
287+ foreground: "d9f5dd",
288+ token: "punctuation.definition.list"
289+ },
290+ {
291+ foreground: "d3423e",
292+ token: "string.template meta.template.expression"
293+ },
294+ {
295+ foreground: "d6deeb",
296+ token: "string.template punctuation.definition.string"
297+ },
298+ {
299+ foreground: "c792ea",
300+ fontStyle: "italic",
301+ token: "italic"
302+ },
303+ {
304+ foreground: "addb67",
305+ fontStyle: "bold",
306+ token: "bold"
307+ },
308+ {
309+ foreground: "82aaff",
310+ token: "constant.language"
311+ },
312+ {
313+ foreground: "82aaff",
314+ token: "punctuation.definition.constant"
315+ },
316+ {
317+ foreground: "82aaff",
318+ token: "variable.other.constant"
319+ },
320+ {
321+ foreground: "7fdbca",
322+ token: "support.function.construct"
323+ },
324+ {
325+ foreground: "7fdbca",
326+ token: "keyword.other.new"
327+ },
328+ {
329+ foreground: "82aaff",
330+ token: "constant.character"
331+ },
332+ {
333+ foreground: "82aaff",
334+ token: "constant.other"
335+ },
336+ {
337+ foreground: "f78c6c",
338+ token: "constant.character.escape"
339+ },
340+ {
341+ foreground: "addb67",
342+ token: "entity.other.inherited-class"
343+ },
344+ {
345+ foreground: "d7dbe0",
346+ token: "variable.parameter"
347+ },
348+ {
349+ foreground: "7fdbca",
350+ token: "entity.name.tag"
351+ },
352+ {
353+ foreground: "cc2996",
354+ token: "punctuation.definition.tag.html"
355+ },
356+ {
357+ foreground: "cc2996",
358+ token: "punctuation.definition.tag.begin"
359+ },
360+ {
361+ foreground: "cc2996",
362+ token: "punctuation.definition.tag.end"
363+ },
364+ {
365+ foreground: "addb67",
366+ token: "entity.other.attribute-name"
367+ },
368+ {
369+ foreground: "addb67",
370+ token: "entity.name.tag.custom"
371+ },
372+ {
373+ foreground: "82aaff",
374+ token: "support.function"
375+ },
376+ {
377+ foreground: "82aaff",
378+ token: "support.constant"
379+ },
380+ {
381+ foreground: "7fdbca",
382+ token: "upport.constant.meta.property-value"
383+ },
384+ {
385+ foreground: "addb67",
386+ token: "support.type"
387+ },
388+ {
389+ foreground: "addb67",
390+ token: "support.class"
391+ },
392+ {
393+ foreground: "addb67",
394+ token: "support.variable.dom"
395+ },
396+ {
397+ foreground: "7fdbca",
398+ token: "support.constant"
399+ },
400+ {
401+ foreground: "7fdbca",
402+ token: "keyword.other.special-method"
403+ },
404+ {
405+ foreground: "7fdbca",
406+ token: "keyword.other.new"
407+ },
408+ {
409+ foreground: "7fdbca",
410+ token: "keyword.other.debugger"
411+ },
412+ {
413+ foreground: "7fdbca",
414+ token: "keyword.control"
415+ },
416+ {
417+ foreground: "c792ea",
418+ token: "keyword.operator.comparison"
419+ },
420+ {
421+ foreground: "c792ea",
422+ token: "keyword.control.flow.js"
423+ },
424+ {
425+ foreground: "c792ea",
426+ token: "keyword.control.flow.ts"
427+ },
428+ {
429+ foreground: "c792ea",
430+ token: "keyword.control.flow.tsx"
431+ },
432+ {
433+ foreground: "c792ea",
434+ token: "keyword.control.ruby"
435+ },
436+ {
437+ foreground: "c792ea",
438+ token: "keyword.control.module.ruby"
439+ },
440+ {
441+ foreground: "c792ea",
442+ token: "keyword.control.class.ruby"
443+ },
444+ {
445+ foreground: "c792ea",
446+ token: "keyword.control.def.ruby"
447+ },
448+ {
449+ foreground: "c792ea",
450+ token: "keyword.control.loop.js"
451+ },
452+ {
453+ foreground: "c792ea",
454+ token: "keyword.control.loop.ts"
455+ },
456+ {
457+ foreground: "c792ea",
458+ token: "keyword.control.import.js"
459+ },
460+ {
461+ foreground: "c792ea",
462+ token: "keyword.control.import.ts"
463+ },
464+ {
465+ foreground: "c792ea",
466+ token: "keyword.control.import.tsx"
467+ },
468+ {
469+ foreground: "c792ea",
470+ token: "keyword.control.from.js"
471+ },
472+ {
473+ foreground: "c792ea",
474+ token: "keyword.control.from.ts"
475+ },
476+ {
477+ foreground: "c792ea",
478+ token: "keyword.control.from.tsx"
479+ },
480+ {
481+ foreground: "ffffff",
482+ background: "ff2c83",
483+ token: "invalid"
484+ },
485+ {
486+ foreground: "ffffff",
487+ background: "d3423e",
488+ token: "invalid.deprecated"
489+ },
490+ {
491+ foreground: "7fdbca",
492+ token: "keyword.operator"
493+ },
494+ {
495+ foreground: "c792ea",
496+ token: "keyword.operator.relational"
497+ },
498+ {
499+ foreground: "c792ea",
500+ token: "keyword.operator.assignement"
501+ },
502+ {
503+ foreground: "c792ea",
504+ token: "keyword.operator.arithmetic"
505+ },
506+ {
507+ foreground: "c792ea",
508+ token: "keyword.operator.bitwise"
509+ },
510+ {
511+ foreground: "c792ea",
512+ token: "keyword.operator.increment"
513+ },
514+ {
515+ foreground: "c792ea",
516+ token: "keyword.operator.ternary"
517+ },
518+ {
519+ foreground: "637777",
520+ token: "comment.line.double-slash"
521+ },
522+ {
523+ foreground: "cdebf7",
524+ token: "object"
525+ },
526+ {
527+ foreground: "ff5874",
528+ token: "constant.language.null"
529+ },
530+ {
531+ foreground: "d6deeb",
532+ token: "meta.brace"
533+ },
534+ {
535+ foreground: "c792ea",
536+ token: "meta.delimiter.period"
537+ },
538+ {
539+ foreground: "d9f5dd",
540+ token: "punctuation.definition.string"
541+ },
542+ {
543+ foreground: "ff5874",
544+ token: "constant.language.boolean"
545+ },
546+ {
547+ foreground: "ffffff",
548+ token: "object.comma"
549+ },
550+ {
551+ foreground: "7fdbca",
552+ token: "variable.parameter.function"
553+ },
554+ {
555+ foreground: "80cbc4",
556+ token: "support.type.vendor.property-name"
557+ },
558+ {
559+ foreground: "80cbc4",
560+ token: "support.constant.vendor.property-value"
561+ },
562+ {
563+ foreground: "80cbc4",
564+ token: "support.type.property-name"
565+ },
566+ {
567+ foreground: "80cbc4",
568+ token: "meta.property-list entity.name.tag"
569+ },
570+ {
571+ foreground: "57eaf1",
572+ token: "meta.property-list entity.name.tag.reference"
573+ },
574+ {
575+ foreground: "f78c6c",
576+ token: "constant.other.color.rgb-value punctuation.definition.constant"
577+ },
578+ {
579+ foreground: "ffeb95",
580+ token: "constant.other.color"
581+ },
582+ {
583+ foreground: "ffeb95",
584+ token: "keyword.other.unit"
585+ },
586+ {
587+ foreground: "c792ea",
588+ token: "meta.selector"
589+ },
590+ {
591+ foreground: "fad430",
592+ token: "entity.other.attribute-name.id"
593+ },
594+ {
595+ foreground: "80cbc4",
596+ token: "meta.property-name"
597+ },
598+ {
599+ foreground: "c792ea",
600+ token: "entity.name.tag.doctype"
601+ },
602+ {
603+ foreground: "c792ea",
604+ token: "meta.tag.sgml.doctype"
605+ },
606+ {
607+ foreground: "d9f5dd",
608+ token: "punctuation.definition.parameters"
609+ },
610+ {
611+ foreground: "ecc48d",
612+ token: "string.quoted"
613+ },
614+ {
615+ foreground: "ecc48d",
616+ token: "string.quoted.double"
617+ },
618+ {
619+ foreground: "ecc48d",
620+ token: "string.quoted.single"
621+ },
622+ {
623+ foreground: "addb67",
624+ token: "support.constant.math"
625+ },
626+ {
627+ foreground: "addb67",
628+ token: "support.type.property-name.json"
629+ },
630+ {
631+ foreground: "addb67",
632+ token: "support.constant.json"
633+ },
634+ {
635+ foreground: "c789d6",
636+ token: "meta.structure.dictionary.value.json string.quoted.double"
637+ },
638+ {
639+ foreground: "80cbc4",
640+ token: "string.quoted.double.json punctuation.definition.string.json"
641+ },
642+ {
643+ foreground: "ff5874",
644+ token:
645+ "meta.structure.dictionary.json meta.structure.dictionary.value constant.language"
646+ },
647+ {
648+ foreground: "d6deeb",
649+ token: "variable.other.ruby"
650+ },
651+ {
652+ foreground: "ecc48d",
653+ token: "entity.name.type.class.ruby"
654+ },
655+ {
656+ foreground: "ecc48d",
657+ token: "keyword.control.class.ruby"
658+ },
659+ {
660+ foreground: "ecc48d",
661+ token: "meta.class.ruby"
662+ },
663+ {
664+ foreground: "7fdbca",
665+ token: "constant.language.symbol.hashkey.ruby"
666+ },
667+ {
668+ foreground: "e0eddd",
669+ background: "a57706",
670+ fontStyle: "italic",
671+ token: "meta.diff"
672+ },
673+ {
674+ foreground: "e0eddd",
675+ background: "a57706",
676+ fontStyle: "italic",
677+ token: "meta.diff.header"
678+ },
679+ {
680+ foreground: "ef535090",
681+ fontStyle: "italic",
682+ token: "markup.deleted"
683+ },
684+ {
685+ foreground: "a2bffc",
686+ fontStyle: "italic",
687+ token: "markup.changed"
688+ },
689+ {
690+ foreground: "a2bffc",
691+ fontStyle: "italic",
692+ token: "meta.diff.header.git"
693+ },
694+ {
695+ foreground: "a2bffc",
696+ fontStyle: "italic",
697+ token: "meta.diff.header.from-file"
698+ },
699+ {
700+ foreground: "a2bffc",
701+ fontStyle: "italic",
702+ token: "meta.diff.header.to-file"
703+ },
704+ {
705+ foreground: "219186",
706+ background: "eae3ca",
707+ token: "markup.inserted"
708+ },
709+ {
710+ foreground: "d3201f",
711+ token: "other.package.exclude"
712+ },
713+ {
714+ foreground: "d3201f",
715+ token: "other.remove"
716+ },
717+ {
718+ foreground: "269186",
719+ token: "other.add"
720+ },
721+ {
722+ foreground: "ff5874",
723+ token: "constant.language.python"
724+ },
725+ {
726+ foreground: "82aaff",
727+ token: "variable.parameter.function.python"
728+ },
729+ {
730+ foreground: "82aaff",
731+ token: "meta.function-call.arguments.python"
732+ },
733+ {
734+ foreground: "b2ccd6",
735+ token: "meta.function-call.python"
736+ },
737+ {
738+ foreground: "b2ccd6",
739+ token: "meta.function-call.generic.python"
740+ },
741+ {
742+ foreground: "d6deeb",
743+ token: "punctuation.python"
744+ },
745+ {
746+ foreground: "addb67",
747+ token: "entity.name.function.decorator.python"
748+ },
749+ {
750+ foreground: "8eace3",
751+ token: "source.python variable.language.special"
752+ },
753+ {
754+ foreground: "82b1ff",
755+ token: "markup.heading.markdown"
756+ },
757+ {
758+ foreground: "c792ea",
759+ fontStyle: "italic",
760+ token: "markup.italic.markdown"
761+ },
762+ {
763+ foreground: "addb67",
764+ fontStyle: "bold",
765+ token: "markup.bold.markdown"
766+ },
767+ {
768+ foreground: "697098",
769+ token: "markup.quote.markdown"
770+ },
771+ {
772+ foreground: "80cbc4",
773+ token: "markup.inline.raw.markdown"
774+ },
775+ {
776+ foreground: "ff869a",
777+ token: "markup.underline.link.markdown"
778+ },
779+ {
780+ foreground: "ff869a",
781+ token: "markup.underline.link.image.markdown"
782+ },
783+ {
784+ foreground: "d6deeb",
785+ token: "string.other.link.title.markdown"
786+ },
787+ {
788+ foreground: "d6deeb",
789+ token: "string.other.link.description.markdown"
790+ },
791+ {
792+ foreground: "82b1ff",
793+ token: "punctuation.definition.string.markdown"
794+ },
795+ {
796+ foreground: "82b1ff",
797+ token: "punctuation.definition.string.begin.markdown"
798+ },
799+ {
800+ foreground: "82b1ff",
801+ token: "punctuation.definition.string.end.markdown"
802+ },
803+ {
804+ foreground: "82b1ff",
805+ token: "meta.link.inline.markdown punctuation.definition.string"
806+ },
807+ {
808+ foreground: "7fdbca",
809+ token: "punctuation.definition.metadata.markdown"
810+ },
811+ {
812+ foreground: "82b1ff",
813+ token: "beginning.punctuation.definition.list.markdown"
814+ }
815+ ],
816+ colors: {
817+ "editor.foreground": "#d6deeb",
818+ "editor.background": "#011627",
819+ "editor.selectionBackground": "#5f7e9779",
820+ "editor.lineHighlightBackground": "#010E17",
821+ "editorCursor.foreground": "#80a4c2",
822+ "editorWhitespace.foreground": "#2e2040",
823+ "editorIndentGuide.background": "#5e81ce52",
824+ "editor.selectionHighlightBorder": "#122d42"
825+ }
826+};
827+
828+exports.purescriptSyntax = {
829+ displayName: "Purescript",
830+ name: "purescrript",
831+ mimeTypes: ["text/purescript"],
832+ fileExtensions: ["purs"],
833+
834+ editorOptions: { tabSize: 2, insertSpaces: true },
835+
836+ lineComment: "--",
837+ blockCommentStart: "{-",
838+ blockCommentEnd: "-}",
839+
840+ keywords: [
841+ "case",
842+ "class",
843+ "data",
844+ "derive",
845+ "do",
846+ "else",
847+ "if",
848+ "import",
849+ "in",
850+ "infix",
851+ "infixl",
852+ "infixr",
853+ "instance",
854+ "let",
855+ "module",
856+ "newtype",
857+ "of",
858+ "then",
859+ "type",
860+ "where",
861+ "->",
862+ "|",
863+ "=>",
864+ "::",
865+ "\\",
866+ "=",
867+ "|",
868+ "foreign",
869+ "forall",
870+ "∷"
871+ ],
872+
873+ extraKeywords: [],
874+
875+ typeKeywords: [],
876+
877+ dataStart: ["^data"],
878+
879+ typeStart: ["class", "instance", "type", "derive"],
880+
881+ escapes:
882+ "\\\\(?:[nrt\\\\\"'\\?]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{6})",
883+ symbols0: "[\\$%&\\*\\+@!\\/\\\\\\^~=\\.:\\-\\?]",
884+ symbols: "(?:@symbols0|[\\|<>])+",
885+ idchars: "(?:[\\w'])*",
886+
887+ tokenizer: {
888+ root: [
889+ [
890+ "((?:[A-Z]@idchars\\.)+)([a-z]@idchars)",
891+ ["identifier.namespace", "identifier"]
892+ ],
893+ [
894+ "((?:[A-Z]@idchars\\.)+)([A-Z]@idchars)",
895+ ["identifier.namespace", "constructor"]
896+ ],
897+
898+ [
899+ "[a-z]@idchars(?!\\.)",
900+ {
901+ cases: {
902+ "@dataStart": { token: "keyword", next: "@type_data" },
903+ "@typeStart": { token: "keyword", next: "@type_type" },
904+ "@keywords": "keyword",
905+ "@extraKeywords": "keyword",
906+ "@default": "identifier"
907+ }
908+ }
909+ ],
910+
911+ ["[A-Z]@idchars", "type.identifier"],
912+
913+ ["_@idchars", "identifier.wildcard"],
914+
915+ ["([a-z]@idchars\\.)+", "identifier.namespace"],
916+
917+ { include: "@whitespace" },
918+
919+ ["[{}()\\[\\]]", "@brackets"],
920+ ["[,`]", "delimiter"],
921+
922+ ["::(?!@symbols0)", "type.operator", "@type_line"],
923+ [
924+ "@symbols",
925+ {
926+ cases: {
927+ "@keywords": "keyword.operator",
928+ "@extraKeywords": "keyword.operator",
929+ "@default": "operator"
930+ }
931+ }
932+ ],
933+
934+ ["[0-9]+\\.[0-9]+([eE][\\-+]?[0-9]+)?", "number.float"],
935+ ["0[xX][0-9a-fA-F]+", "number.hex"],
936+ ["[0-9]+", "number"],
937+
938+ ['"([^"\\\\]|\\\\.)*$', "string.invalid"],
939+ ['"', { token: "string.quote", bracket: "@open", next: "@string" }],
940+
941+ ["'[^\\\\']'", "string"],
942+ ["(')(@escapes)(')", ["string", "string.escape", "string"]],
943+ ["'", "string.invalid"],
944+
945+ ["^[ ]*#.*", "namespace"]
946+ ],
947+
948+ whitespace: [
949+ ["[ \\r\\n]+", ""],
950+ ["{-", "comment", "@comment"],
951+ ["--.*$", "comment"]
952+ ],
953+
954+ comment: [
955+ ["[^\\{\\-]+", "comment"],
956+ ["{-", "comment", "@push"],
957+ ["-}", "comment", "@pop"],
958+ ["[\\{\\-]", "comment"]
959+ ],
960+
961+ string: [
962+ ['[^\\\\"]+', "string"],
963+ ["@escapes", "string.escape"],
964+ ["\\\\.", "string.escape.invalid"],
965+ ['"', { token: "string.quote", bracket: "@close", next: "@pop" }]
966+ ],
967+
968+ type_type: [
969+ ["\\=", "keyword"],
970+ ["^\\s*(?!\\-\\-|\\{\\-)[^\\s]", { token: "@rematch", next: "@pop" }],
971+ { include: "@type" }
972+ ],
973+
974+ type_data: [
975+ ["([=|])(\\s*)([A-Z]@idchars)", ["keyword.operator", "", "constructor"]],
976+ ["^\\s*$", { token: "", next: "@pop" }],
977+ { include: "@type" }
978+ ],
979+
980+ type_line: [
981+ ["^\\s*(?!\\-\\-|\\{\\-)[_a-z]", { token: "@rematch", next: "@pop" }],
982+ ["[^=]*=", { token: "@rematch", next: "@pop" }],
983+ { include: "@type" }
984+ ],
985+
986+ type: [
987+ ["[(\\[]", { token: "@brackets.type" }, "@type_nested"],
988+ { include: "@type_content" }
989+ ],
990+
991+ type_nested: [
992+ ["[)\\]]", { token: "@brackets.type" }, "@pop"],
993+ ["[(\\[]", { token: "@brackets.type" }, "@push"],
994+ [",", "delimiter.type"],
995+ { include: "@type_content" }
996+ ],
997+
998+ type_content: [
999+ { include: "@whitespace" },
1000+
1001+ ["[a-z]\\d*\\b", "type.identifier.typevar"],
1002+ ["_@idchars", "type.identifier.typevar"],
1003+
1004+ [
1005+ "((?:[A-Z]@idchars\\.)*)([A-Z]@idchars)",
1006+ ["type.identifier.namespace", "type.identifier"]
1007+ ],
1008+ [
1009+ "((?:[A-Z]@idchars\\.)*)([a-z]@idchars)",
1010+ {
1011+ cases: {
1012+ "@typeKeywords": ["type.identifier.namespace", "type.keyword"],
1013+ "@keywords": { token: "@rematch", next: "@pop" },
1014+ "@default": ["type.identifier.namespace", "type.identifier"]
1015+ }
1016+ }
1017+ ],
1018+
1019+ ["::|->|[\\.:|]", "type.operator"],
1020+ ["[\\s\\S]", "@rematch", "@pop"]
1021+ ]
1022+ }
1023+};
src/Monaco/Editor.purs → client/src/Monaco/Editor.pursrenamed+24−14
@@ -1,6 +1,7 @@
11module Editor where
22
33import Prelude
4+
45import CSS.Safer (cssSafer)
56import Control.Promise (Promise)
67import Control.Promise as Promise
@@ -20,7 +21,8 @@ import React.Basic.Hooks (component, readRefMaybe, useRef, writeRef)
2021import React.Basic.Hooks as React
2122import React.Basic.Hooks.Aff (useAff)
2223import React.Helpers (wrapperDiv)
23−import Theme.Styles (makeStyles_)
24+import Theme.Styles (makeStyles, useTheme)
25+import Theme.Types (CSSTheme)
2426import Web.DOM (Node)
2527
2628type EditorProps
@@ -45,6 +47,8 @@ foreign import setThemeImpl ∷ Monaco -> String -> Effect Unit
4547
4648foreign import nightOwlTheme ∷ MonacoTheme
4749
50+foreign import vsCodeTheme ∷ MonacoTheme
51+
4852foreign import getValue ∷ Editor -> Effect String
4953
5054foreign import data Monaco ∷ Type
@@ -53,15 +57,17 @@ foreign import data Editor ∷ Type
5357
5458foreign import data MonacoTheme ∷ Type
5559
56−editor ∷
57− ∀ attrs attrs_. Union attrs attrs_ EditorProps => ReactComponent { | attrs }
60+editor ∷ ∀ attrs attrs_. Union attrs attrs_ EditorProps => ReactComponent { | attrs }
5861editor = editorImpl
5962
6063initMonaco ∷ Aff Monaco
6164initMonaco = liftEffect initMonacoImpl >>= Promise.toAff
6265
63−themeName ∷ String
64−themeName = "NightOwl"
66+darkThemeName ∷ String
67+darkThemeName = "NightOwl"
68+
69+lightThemeName ∷ String
70+lightThemeName = "VSCode"
6571
6672foreign import data MonarchLanguage ∷ Type
6773
@@ -71,10 +77,18 @@ foreign import registerLanguageImpl ∷ Monaco -> String -> Effect Unit
7177
7278foreign import setMonarchTokensProviderImpl ∷ Monaco -> String -> MonarchLanguage -> Effect Unit
7379
80+initEditor ∷ Aff Unit
81+initEditor = do
82+ monaco <- initMonaco
83+ defineThemeImpl monaco darkThemeName nightOwlTheme # liftEffect
84+ defineThemeImpl monaco lightThemeName vsCodeTheme # liftEffect
85+ registerLanguageImpl monaco "purescript" # liftEffect
86+ setMonarchTokensProviderImpl monaco "purescript" purescriptSyntax # liftEffect
87+
7488mkEditor ∷ Effect (ReactComponent {})
7589mkEditor = do
7690 useStyles <-
77− makeStyles_
91+ makeStyles \(theme ∷ CSSTheme) ->
7892 { wrapper:
7993 cssSafer
8094 { margin: "0"
@@ -83,19 +97,15 @@ mkEditor = do
8397 , width: "100%"
8498 , height: "100%"
8599 , borderRadius: "32px"
86− , backgroundColor: "#011627"
100+ , backgroundColor: theme.backgroundColour
87101 }
88102 }
89103 component "Editor" \{} -> React.do
90104 classes <- useStyles
91105 ref <- useRef null
92− useAff unit
93− $ do
94− monaco <- initMonaco
95− defineThemeImpl monaco themeName nightOwlTheme # liftEffect
96− setThemeImpl monaco themeName # liftEffect
97− registerLanguageImpl monaco "purescript" # liftEffect
98− setMonarchTokensProviderImpl monaco "purescript" purescriptSyntax # liftEffect
106+ useAff unit initEditor
107+ theme <- useTheme
108+ let themeName = if theme.isLight then lightThemeName else darkThemeName
99109 pure
100110 $ fragment
101111 [ R.button
src/Polyfill/SmoothScrolling.js → client/src/Polyfill/SmoothScrolling.jsrenamed

The content is the same.

src/Polyfill/SmoothScrolling.purs → client/src/Polyfill/SmoothScrolling.pursrenamed

The content is the same.

src/React/Helpers.purs → client/src/React/Helpers.pursrenamed

The content is the same.

src/SVG/Icon.js → client/src/SVG/Icon.jsrenamed

The content is the same.

src/SVG/Icon.purs → client/src/SVG/Icon.pursrenamed

The content is the same.

src/SVG/Image.js → client/src/SVG/Image.jsrenamed

The content is the same.

src/SVG/Image.purs → client/src/SVG/Image.pursrenamed

The content is the same.

src/Scroll/Hook.purs → client/src/Scroll/Hook.pursrenamed

The content is the same.

src/Scroll/Listener.purs → client/src/Scroll/Listener.pursrenamed

The content is the same.

client/src/Sharednew file+1
@@ -0,0 +1 @@
1+../../shared/Shared
src/Theme.purs → client/src/Theme.pursrenamed

The content is the same.

src/Theme/Default.purs → client/src/Theme/Default.pursrenamed

The content is the same.

src/Theme/Provider.js → client/src/Theme/Provider.jsrenamed

The content is the same.

src/Theme/Provider.purs → client/src/Theme/Provider.pursrenamed

The content is the same.

src/Theme/Styles.js → client/src/Theme/Styles.jsrenamed

The content is the same.

src/Theme/Styles.purs → client/src/Theme/Styles.pursrenamed

The content is the same.

src/Theme/Types.purs → client/src/Theme/Types.pursrenamed

The content is the same.

src/Typography/Header.purs → client/src/Typography/Header.pursrenamed

The content is the same.

src/Typography/Paragraph.purs → client/src/Typography/Paragraph.pursrenamed

The content is the same.

src/entrypoint.js → client/src/entrypoint.jsrenamed

The content is the same.

src/logo.png → client/src/logo.pngrenamed

Binary file not shown.

stories/ButtonStories.purs → client/stories/ButtonStories.pursrenamed

The content is the same.

stories/CardStories.purs → client/stories/CardStories.pursrenamed

The content is the same.

stories/ContainerStories.purs → client/stories/ContainerStories.pursrenamed

The content is the same.

stories/Decorator/FullScreen.purs → client/stories/Decorator/FullScreen.pursrenamed

The content is the same.

stories/EditorStories.purs → client/stories/EditorStories.pursrenamed

The content is the same.

stories/Storybook/React.js → client/stories/Storybook/React.jsrenamed

The content is the same.

stories/Storybook/React.purs → client/stories/Storybook/React.pursrenamed

The content is the same.

stories/ThemeStories.purs → client/stories/ThemeStories.pursrenamed

The content is the same.

stories/TypographyStories.purs → client/stories/TypographyStories.pursrenamed

The content is the same.

test/Main.purs → client/test/Main.pursrenamed

The content is the same.

webpack.common.js → client/webpack.common.jsrenamed

The content is the same.

webpack.dev.js → client/webpack.dev.jsrenamed

The content is the same.

webpack.production.js → client/webpack.production.jsrenamed

The content is the same.

playground/.gitignorenew file+10
@@ -0,0 +1,10 @@
1+/bower_components/
2+/node_modules/
3+/.pulp-cache/
4+/output/
5+/generated-docs/
6+/.psc-package/
7+/.psc*
8+/.purs*
9+/.psa*
10+/.spago
playground/packages.dhallnew file+128
@@ -0,0 +1,128 @@
1+{-
2+Welcome to your new Dhall package-set!
3+
4+Below are instructions for how to edit this file for most use
5+cases, so that you don't need to know Dhall to use it.
6+
7+## Warning: Don't Move This Top-Level Comment!
8+
9+Due to how `dhall format` currently works, this comment's
10+instructions cannot appear near corresponding sections below
11+because `dhall format` will delete the comment. However,
12+it will not delete a top-level comment like this one.
13+
14+## Use Cases
15+
16+Most will want to do one or both of these options:
17+1. Override/Patch a package's dependency
18+2. Add a package not already in the default package set
19+
20+This file will continue to work whether you use one or both options.
21+Instructions for each option are explained below.
22+
23+### Overriding/Patching a package
24+
25+Purpose:
26+- Change a package's dependency to a newer/older release than the
27+ default package set's release
28+- Use your own modified version of some dependency that may
29+ include new API, changed API, removed API by
30+ using your custom git repo of the library rather than
31+ the package set's repo
32+
33+Syntax:
34+Replace the overrides' "{=}" (an empty record) with the following idea
35+The "//" or "⫽" means "merge these two records and
36+ when they have the same value, use the one on the right:"
37+-------------------------------
38+let override =
39+ { packageName =
40+ upstream.packageName // { updateEntity1 = "new value", updateEntity2 = "new value" }
41+ , packageName =
42+ upstream.packageName // { version = "v4.0.0" }
43+ , packageName =
44+ upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" }
45+ }
46+-------------------------------
47+
48+Example:
49+-------------------------------
50+let overrides =
51+ { halogen =
52+ upstream.halogen // { version = "master" }
53+ , halogen-vdom =
54+ upstream.halogen-vdom // { version = "v4.0.0" }
55+ }
56+-------------------------------
57+
58+### Additions
59+
60+Purpose:
61+- Add packages that aren't already included in the default package set
62+
63+Syntax:
64+Replace the additions' "{=}" (an empty record) with the following idea:
65+-------------------------------
66+let additions =
67+ { "package-name" =
68+ { dependencies =
69+ [ "dependency1"
70+ , "dependency2"
71+ ]
72+ , repo =
73+ "https://example.com/path/to/git/repo.git"
74+ , version =
75+ "tag ('v4.0.0') or branch ('master')"
76+ }
77+ , "package-name" =
78+ { dependencies =
79+ [ "dependency1"
80+ , "dependency2"
81+ ]
82+ , repo =
83+ "https://example.com/path/to/git/repo.git"
84+ , version =
85+ "tag ('v4.0.0') or branch ('master')"
86+ }
87+ , etc.
88+ }
89+-------------------------------
90+
91+Example:
92+-------------------------------
93+let additions =
94+ { benchotron =
95+ { dependencies =
96+ [ "arrays"
97+ , "exists"
98+ , "profunctor"
99+ , "strings"
100+ , "quickcheck"
101+ , "lcg"
102+ , "transformers"
103+ , "foldable-traversable"
104+ , "exceptions"
105+ , "node-fs"
106+ , "node-buffer"
107+ , "node-readline"
108+ , "datetime"
109+ , "now"
110+ ],
111+ , repo =
112+ "https://github.com/hdgarrood/purescript-benchotron.git"
113+ , version =
114+ "v7.0.0"
115+ }
116+ }
117+-------------------------------
118+-}
119+
120+
121+let upstream =
122+ https://github.com/purescript/package-sets/releases/download/psc-0.13.3-20190920/packages.dhall sha256:53873cf2fc4a343a41f335ee47c1706ecf755ac7c5a336e8eb03ad23165dfd28
123+
124+let overrides = {=}
125+
126+let additions = {=}
127+
128+in upstream // overrides // additions
playground/run.jsnew file+1
@@ -0,0 +1 @@
1+require ("./output/Main").main()
playground/spago.dhallnew file+13
@@ -0,0 +1,13 @@
1+{-
2+Welcome to a Spago project!
3+You can edit this file as you like.
4+-}
5+{ name =
6+ "my-project"
7+, dependencies =
8+ [ "effect", "console", "psci-support" ]
9+, packages =
10+ ./packages.dhall
11+, sources =
12+ [ "src/**/*.purs", "test/**/*.purs" ]
13+}
playground/src/Main.pursnew file+4
@@ -0,0 +1,4 @@
1+module Main where
2+import Prelude
3+import Effect.Console (log)
4+main = log "Freddy"
playground/test/Main.pursnew file+11
@@ -0,0 +1,11 @@
1+module Test.Main where
2+
3+import Prelude
4+
5+import Effect (Effect)
6+import Effect.Class.Console (log)
7+
8+main :: Effect Unit
9+main = do
10+ log "🍝"
11+ log "You should add some tests."
server/.vscode/settings.jsonnew file+20
@@ -0,0 +1,20 @@
1+{
2+ "editor.formatOnSave": false,
3+ "regreplace.commands": [
4+ {
5+ "name": "replace double colon with unicode version",
6+ "match": "\\.purs?$",
7+ "regexp": " ::(\\s)",
8+ "global": true,
9+ "replace": " ∷$1"
10+ },
11+ {
12+ "name": "replace forall with unicode version",
13+ "match": "\\.purs?$",
14+ "regexp": "forall(\\s)",
15+ "global": true,
16+ "replace": "∀$1"
17+ },
18+],
19+"purescript.buildCommand": "spago build --purs-args '--json-errors'",
20+}
server/package-lock.jsonnew file+374
@@ -0,0 +1,374 @@
1+{
2+ "name": "server",
3+ "version": "1.0.0",
4+ "lockfileVersion": 1,
5+ "requires": true,
6+ "dependencies": {
7+ "accepts": {
8+ "version": "1.3.7",
9+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
10+ "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
11+ "requires": {
12+ "mime-types": "~2.1.24",
13+ "negotiator": "0.6.2"
14+ }
15+ },
16+ "array-flatten": {
17+ "version": "1.1.1",
18+ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
19+ "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
20+ },
21+ "body-parser": {
22+ "version": "1.19.0",
23+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
24+ "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
25+ "requires": {
26+ "bytes": "3.1.0",
27+ "content-type": "~1.0.4",
28+ "debug": "2.6.9",
29+ "depd": "~1.1.2",
30+ "http-errors": "1.7.2",
31+ "iconv-lite": "0.4.24",
32+ "on-finished": "~2.3.0",
33+ "qs": "6.7.0",
34+ "raw-body": "2.4.0",
35+ "type-is": "~1.6.17"
36+ }
37+ },
38+ "bytes": {
39+ "version": "3.1.0",
40+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
41+ "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
42+ },
43+ "content-disposition": {
44+ "version": "0.5.3",
45+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
46+ "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
47+ "requires": {
48+ "safe-buffer": "5.1.2"
49+ }
50+ },
51+ "content-type": {
52+ "version": "1.0.4",
53+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
54+ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
55+ },
56+ "cookie": {
57+ "version": "0.4.0",
58+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
59+ "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
60+ },
61+ "cookie-signature": {
62+ "version": "1.0.6",
63+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
64+ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
65+ },
66+ "debug": {
67+ "version": "2.6.9",
68+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
69+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
70+ "requires": {
71+ "ms": "2.0.0"
72+ }
73+ },
74+ "depd": {
75+ "version": "1.1.2",
76+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
77+ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
78+ },
79+ "destroy": {
80+ "version": "1.0.4",
81+ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
82+ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
83+ },
84+ "ee-first": {
85+ "version": "1.1.1",
86+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
87+ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
88+ },
89+ "encodeurl": {
90+ "version": "1.0.2",
91+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
92+ "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
93+ },
94+ "escape-html": {
95+ "version": "1.0.3",
96+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
97+ "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
98+ },
99+ "etag": {
100+ "version": "1.8.1",
101+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
102+ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
103+ },
104+ "express": {
105+ "version": "4.17.1",
106+ "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
107+ "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
108+ "requires": {
109+ "accepts": "~1.3.7",
110+ "array-flatten": "1.1.1",
111+ "body-parser": "1.19.0",
112+ "content-disposition": "0.5.3",
113+ "content-type": "~1.0.4",
114+ "cookie": "0.4.0",
115+ "cookie-signature": "1.0.6",
116+ "debug": "2.6.9",
117+ "depd": "~1.1.2",
118+ "encodeurl": "~1.0.2",
119+ "escape-html": "~1.0.3",
120+ "etag": "~1.8.1",
121+ "finalhandler": "~1.1.2",
122+ "fresh": "0.5.2",
123+ "merge-descriptors": "1.0.1",
124+ "methods": "~1.1.2",
125+ "on-finished": "~2.3.0",
126+ "parseurl": "~1.3.3",
127+ "path-to-regexp": "0.1.7",
128+ "proxy-addr": "~2.0.5",
129+ "qs": "6.7.0",
130+ "range-parser": "~1.2.1",
131+ "safe-buffer": "5.1.2",
132+ "send": "0.17.1",
133+ "serve-static": "1.14.1",
134+ "setprototypeof": "1.1.1",
135+ "statuses": "~1.5.0",
136+ "type-is": "~1.6.18",
137+ "utils-merge": "1.0.1",
138+ "vary": "~1.1.2"
139+ }
140+ },
141+ "finalhandler": {
142+ "version": "1.1.2",
143+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
144+ "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
145+ "requires": {
146+ "debug": "2.6.9",
147+ "encodeurl": "~1.0.2",
148+ "escape-html": "~1.0.3",
149+ "on-finished": "~2.3.0",
150+ "parseurl": "~1.3.3",
151+ "statuses": "~1.5.0",
152+ "unpipe": "~1.0.0"
153+ }
154+ },
155+ "forwarded": {
156+ "version": "0.1.2",
157+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
158+ "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
159+ },
160+ "fresh": {
161+ "version": "0.5.2",
162+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
163+ "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
164+ },
165+ "http-errors": {
166+ "version": "1.7.2",
167+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
168+ "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
169+ "requires": {
170+ "depd": "~1.1.2",
171+ "inherits": "2.0.3",
172+ "setprototypeof": "1.1.1",
173+ "statuses": ">= 1.5.0 < 2",
174+ "toidentifier": "1.0.0"
175+ }
176+ },
177+ "iconv-lite": {
178+ "version": "0.4.24",
179+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
180+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
181+ "requires": {
182+ "safer-buffer": ">= 2.1.2 < 3"
183+ }
184+ },
185+ "inherits": {
186+ "version": "2.0.3",
187+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
188+ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
189+ },
190+ "ipaddr.js": {
191+ "version": "1.9.0",
192+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz",
193+ "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA=="
194+ },
195+ "media-typer": {
196+ "version": "0.3.0",
197+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
198+ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
199+ },
200+ "merge-descriptors": {
201+ "version": "1.0.1",
202+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
203+ "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
204+ },
205+ "methods": {
206+ "version": "1.1.2",
207+ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
208+ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
209+ },
210+ "mime": {
211+ "version": "1.6.0",
212+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
213+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
214+ },
215+ "mime-db": {
216+ "version": "1.40.0",
217+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
218+ "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA=="
219+ },
220+ "mime-types": {
221+ "version": "2.1.24",
222+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
223+ "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
224+ "requires": {
225+ "mime-db": "1.40.0"
226+ }
227+ },
228+ "ms": {
229+ "version": "2.0.0",
230+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
231+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
232+ },
233+ "negotiator": {
234+ "version": "0.6.2",
235+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
236+ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
237+ },
238+ "on-finished": {
239+ "version": "2.3.0",
240+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
241+ "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
242+ "requires": {
243+ "ee-first": "1.1.1"
244+ }
245+ },
246+ "parseurl": {
247+ "version": "1.3.3",
248+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
249+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
250+ },
251+ "path-to-regexp": {
252+ "version": "0.1.7",
253+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
254+ "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
255+ },
256+ "proxy-addr": {
257+ "version": "2.0.5",
258+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz",
259+ "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==",
260+ "requires": {
261+ "forwarded": "~0.1.2",
262+ "ipaddr.js": "1.9.0"
263+ }
264+ },
265+ "qs": {
266+ "version": "6.7.0",
267+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
268+ "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
269+ },
270+ "range-parser": {
271+ "version": "1.2.1",
272+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
273+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
274+ },
275+ "raw-body": {
276+ "version": "2.4.0",
277+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
278+ "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
279+ "requires": {
280+ "bytes": "3.1.0",
281+ "http-errors": "1.7.2",
282+ "iconv-lite": "0.4.24",
283+ "unpipe": "1.0.0"
284+ }
285+ },
286+ "safe-buffer": {
287+ "version": "5.1.2",
288+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
289+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
290+ },
291+ "safer-buffer": {
292+ "version": "2.1.2",
293+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
294+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
295+ },
296+ "send": {
297+ "version": "0.17.1",
298+ "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
299+ "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
300+ "requires": {
301+ "debug": "2.6.9",
302+ "depd": "~1.1.2",
303+ "destroy": "~1.0.4",
304+ "encodeurl": "~1.0.2",
305+ "escape-html": "~1.0.3",
306+ "etag": "~1.8.1",
307+ "fresh": "0.5.2",
308+ "http-errors": "~1.7.2",
309+ "mime": "1.6.0",
310+ "ms": "2.1.1",
311+ "on-finished": "~2.3.0",
312+ "range-parser": "~1.2.1",
313+ "statuses": "~1.5.0"
314+ },
315+ "dependencies": {
316+ "ms": {
317+ "version": "2.1.1",
318+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
319+ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
320+ }
321+ }
322+ },
323+ "serve-static": {
324+ "version": "1.14.1",
325+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
326+ "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
327+ "requires": {
328+ "encodeurl": "~1.0.2",
329+ "escape-html": "~1.0.3",
330+ "parseurl": "~1.3.3",
331+ "send": "0.17.1"
332+ }
333+ },
334+ "setprototypeof": {
335+ "version": "1.1.1",
336+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
337+ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
338+ },
339+ "statuses": {
340+ "version": "1.5.0",
341+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
342+ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
343+ },
344+ "toidentifier": {
345+ "version": "1.0.0",
346+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
347+ "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
348+ },
349+ "type-is": {
350+ "version": "1.6.18",
351+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
352+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
353+ "requires": {
354+ "media-typer": "0.3.0",
355+ "mime-types": "~2.1.24"
356+ }
357+ },
358+ "unpipe": {
359+ "version": "1.0.0",
360+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
361+ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
362+ },
363+ "utils-merge": {
364+ "version": "1.0.1",
365+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
366+ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
367+ },
368+ "vary": {
369+ "version": "1.1.2",
370+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
371+ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
372+ }
373+ }
374+}
server/package.jsonnew file+19
@@ -0,0 +1,19 @@
1+{
2+ "name": "server",
3+ "version": "1.0.0",
4+ "description": "",
5+ "main": "index.js",
6+ "directories": {
7+ "test": "test"
8+ },
9+ "scripts": {
10+ "start": "spago run",
11+ "test": "spago test"
12+ },
13+ "author": "mark.eibes@gmail.com",
14+ "license": "ISC",
15+ "dependencies": {
16+ "body-parser": "^1.19.0",
17+ "express": "^4.17.1"
18+ }
19+}
server/spago.dhall+4
@@ -9,9 +9,13 @@ You can edit this file as you like.
99 , "effect"
1010 , "express"
1111 , "maybe"
12+ , "node-child-process"
1213 , "node-fs"
14+ , "node-fs-aff"
1315 , "node-process"
1416 , "psci-support"
17+ , "simple-json"
18+ , "stringutils"
1519 ]
1620, packages =
1721 ./packages.dhall
server/src/Main.purs+104−11
@@ -2,48 +2,141 @@ module Main where
22
33import Prelude
44
5+import Data.Array (unsafeIndex)
6+import Data.Either (Either(..))
57import Data.Int (fromString)
6−import Data.Maybe (fromMaybe)
8+import Data.Maybe (Maybe(..), fromMaybe)
9+import Data.Posix.Signal (Signal(..))
10+import Data.String.Utils (lines)
711import Effect (Effect)
12+import Effect.Aff (Aff, effectCanceler, launchAff_, makeAff)
13+import Effect.Aff.Class (liftAff)
14+import Effect.Class (class MonadEffect, liftEffect)
815import Effect.Class.Console (info)
16+import Foreign (unsafeToForeign)
17+import Middleware.JsonBodyParser (jsonBodyParser)
18+import Node.Buffer (Buffer)
19+import Node.Buffer as Buffer
20+import Node.ChildProcess (ExecResult, defaultExecOptions, exec, kill)
921import Node.Encoding (Encoding(..))
10−import Node.Express.App (App, listenHttp, listenHttps, use)
11−
22+import Node.Express.App (App, listenHttp, listenHttps, use, useExternal)
23+import Node.Express.App as E
24+import Node.Express.Handler (HandlerM)
1225import Node.Express.Middleware.Static (static)
13−import Node.FS.Sync (readTextFile)
26+import Node.Express.Request (getBody')
27+import Node.Express.Response as Response
28+import Node.FS.Aff (readTextFile, writeTextFile)
1429import Node.HTTP (Server)
1530import Node.Process (lookupEnv)
31+import Partial.Unsafe (unsafePartial)
32+import Shared.Json (readAff)
33+import Shared.Models.Body (RunResult)
34+import Shared.Models.Body as Body
35+import Simple.JSON (read_, write)
36+
37+toBody ∷ ∀ r m. MonadEffect m => { stdout ∷ Buffer, stderr ∷ Buffer | r } -> m RunResult
38+toBody result = liftEffect $ ado
39+ stdout <- Buffer.toString UTF8 result.stdout
40+ stderr <- Buffer.toString UTF8 result.stderr
41+ let (code ∷ Maybe Int) = asErrorWithCode result >>= _.code
42+ in { code, stdout, stderr } ∷ RunResult
43+
44+type ErrorWithCode = { code ∷ Maybe Int }
45+
46+asErrorWithCode ∷ ∀ a. a -> Maybe ErrorWithCode
47+asErrorWithCode = read_ <<< unsafeToForeign
48+
49+compileCode ∷ String -> Aff String
50+compileCode code = do
51+ saveMainFile code
52+ { stderr } <- execCommand "spago build -- --json-errors"
53+ errorString <- liftEffect $ Buffer.toString UTF8 stderr
54+ pure $ unsafePartial (unsafeIndex (lines errorString) 0)
55+
56+runCode ∷ Aff ExecResult
57+runCode = execCommand "node run.js"
58+
59+playground ∷ String
60+playground = "../playground"
61+
62+saveMainFile ∷ String -> Aff Unit
63+saveMainFile code =
64+ writeTextFile UTF8 (playground <> "/src/Main.purs") code
1665
17−main ∷ Effect Server
18−main = do
66+execCommand ∷ String -> Aff ExecResult
67+execCommand command =
68+ makeAff \callback -> do
69+ let options = defaultExecOptions { cwd = Just playground }
70+ childProcess <- exec command options (callback <<< Right)
71+ pure $ effectCanceler (kill SIGKILL childProcess)
72+
73+compileHandler ∷ HandlerM Unit
74+compileHandler = do
75+ body <- getBody'
76+ json <- readAff body # liftAff
77+ result <- compileCode (json ∷ Body.CompileRequest).code # liftAff
78+ Response.send $ write ({ result } ∷ Body.CompileResult)
79+
80+runHandler ∷ HandlerM Unit
81+runHandler = do
82+ result <- liftAff do
83+ result <- runCode
84+ toBody result
85+ Response.send $ write (result ∷ Body.RunResult)
86+
87+main ∷ Effect Unit
88+main = launchAff_ do
1989 serverSetup makeApp
2090
2191makeApp ∷ App
2292makeApp = do
2393 use $ static "assets"
94+ useExternal jsonBodyParser
95+ E.post "/compile" compileHandler
96+ E.post "/run" runHandler
2497 -- useOnError (errorHandler log)
98+ -- { method: HTTPure.Post, path: ["_compile"], body } -> do
99+ -- result <- compileCode body
100+ -- HTTPure.ok' (HTTPure.header "Content-Type" "application/json") result
101+
102+ -- { method: HTTPure.Post, path: ["_run"] } -> do
103+ -- result <- runCode
104+ -- response <- toBody result
105+ -- okJson response
106+
107+ -- { method: HTTPure.Get, path } | elem path [[], [""], ["/"]] -> do
108+ -- content <- readTextFile UTF8 "index.html"
109+ -- HTTPure.ok' (HTTPure.header "Content-Type" "text/html") content
110+
111+ -- { method: HTTPure.Get, path } -> do
112+ -- let filePath = intercalate "/" path
113+ -- let mimeType = guessMimeType filePath
114+ -- content <- readTextFile UTF8 filePath
115+ -- HTTPure.ok' (HTTPure.header "Content-Type" mimeType) content
116+
117+ -- _ -> HTTPure.notFound
25118
26119data CertificatesToUse
27120 = UseLocalCertificates
28121 | DoNotUseLocalCertificates
29122
30−parseCertificatesToUse :: String -> CertificatesToUse
123+parseCertificatesToUse ∷ String -> CertificatesToUse
31124parseCertificatesToUse = case _ of
32125 "LOCAL" -> UseLocalCertificates
33126 _ -> DoNotUseLocalCertificates
34127
35−serverSetup ∷ App -> Effect Server
128+serverSetup ∷ App -> Aff Server
36129serverSetup app = do
37− maybePortString <- lookupEnv "PORT"
130+ maybePortString <- lookupEnv "PORT" # liftEffect
38131 let port = maybePortString >>= fromString # fromMaybe 14188
39− useLocalCertificates <- fromMaybe DoNotUseLocalCertificates <<< map parseCertificatesToUse <$> lookupEnv "CERTS"
132+ useLocalCertificates <- fromMaybe DoNotUseLocalCertificates <<< map parseCertificatesToUse <$> lookupEnv "CERTS" # liftEffect
40133 listen <- case useLocalCertificates of
41134 UseLocalCertificates -> do
42135 httpsOptions <- makeHttpsOptions
43136 pure $ listenHttps app (port ∷ Int) httpsOptions
44137 DoNotUseLocalCertificates ->
45138 pure $ listenHttp app port
46− listen \_ -> info $ "psfp server started on port " <> show port
139+ liftEffect $ listen \_ -> info $ "psfp server started on port " <> show port
47140 where
48141 makeHttpsOptions = do
49142 key <- readTextFile UTF8 "server.key"
server/src/Middleware/JsonBodyParser.jsnew file+3
@@ -0,0 +1,3 @@
1+"use strict";
2+
3+exports.jsonBodyParser = require('body-parser').json()
server/src/Middleware/JsonBodyParser.pursnew file+9
@@ -0,0 +1,9 @@
1+module Middleware.JsonBodyParser where
2+
3+import Prelude
4+
5+import Data.Function.Uncurried (Fn3)
6+import Effect (Effect)
7+import Node.Express.Types (Request, Response)
8+
9+foreign import jsonBodyParser :: Fn3 Request Response (Effect Unit) (Effect Unit)
server/src/Shared+1−1
@@ -1 +1 @@
1−../../Shared/
1+../../shared/Shared
server/test.jsonnew file+2
@@ -0,0 +1,2 @@
1+{ "code":"module Main where\nimport Prelude\nimport Effect.Console (log)\nmain = log \"Freddy\""
2+}
shared/Shared/Json.pursnew file+19
@@ -0,0 +1,19 @@
1+module Shared.Json (readJsonAff, readAff) where
2+
3+import Prelude
4+
5+import Data.Either (Either, either)
6+import Effect.Aff (Aff)
7+import Effect.Class (liftEffect)
8+import Effect.Exception (throw)
9+import Foreign (Foreign)
10+import Simple.JSON (class ReadForeign, read, readJSON)
11+
12+readJsonAff ∷ ∀ a. ReadForeign a => String -> Aff a
13+readJsonAff = readJSON >>> orThrow
14+
15+readAff ∷ ∀ a. ReadForeign a => Foreign -> Aff a
16+readAff = read >>> orThrow
17+
18+orThrow ∷ ∀ a s. Show s => Either s a -> Aff a
19+orThrow = either (show >>> throw >>> liftEffect) pure
shared/Shared/Models/Body.pursnew file+9
@@ -0,0 +1,9 @@
1+module Shared.Models.Body where
2+
3+import Data.Maybe (Maybe)
4+
5+type CompileRequest = { code ∷ String }
6+
7+type CompileResult = { result ∷ String }
8+
9+type RunResult = { code ∷ Maybe Int, stdout ∷ String, stderr ∷ String }
src/Monaco/Editor.jsdeleted−892
@@ -1,892 +0,0 @@
1−'use strict'
2−var monacoEditor = require('@monaco-editor/react');
3−
4−exports.editorImpl = monacoEditor.default;
5−
6−exports.initMonacoImpl = function() {
7− return monacoEditor.monaco.init();
8−}
9−
10−exports.getValue = function(editor) {
11− return function() {
12− return editor.getValue();
13− }
14−}
15−
16−exports.defineThemeImpl = function(monacoInstance) {
17− return function(name) {
18− return function(theme) {
19− return function() {
20− return monacoInstance.editor.defineTheme(name, theme);
21− }
22− }
23− }
24−}
25−
26−exports.setThemeImpl = function(monacoInstance) {
27− return function(theme) {
28− return function() {
29− return monacoInstance.editor.setTheme(theme);
30− }
31− }
32−}
33−
34−exports.registerLanguageImpl = function(monacoInstance) {
35− return function(languageId) {
36− return function() {
37− monacoInstance.languages.register({ id: languageId})
38− }
39− }
40−}
41−
42−exports.setMonarchTokensProviderImpl = function(monacoInstance) {
43− return function(name) {
44− return function(monarchLanguage) {
45− return function() {
46− return monacoInstance.languages.setMonarchTokensProvider(name, monarchLanguage);
47− }
48− }
49− }
50−}
51−
52−exports.nightOwlTheme = {
53− "base": "vs-dark",
54− "inherit": true,
55− "rules": [
56− {
57− "foreground": "637777",
58− "token": "comment"
59− },
60− {
61− "foreground": "addb67",
62− "token": "string"
63− },
64− {
65− "foreground": "ecc48d",
66− "token": "vstring.quoted"
67− },
68− {
69− "foreground": "ecc48d",
70− "token": "variable.other.readwrite.js"
71− },
72− {
73− "foreground": "5ca7e4",
74− "token": "string.regexp"
75− },
76− {
77− "foreground": "5ca7e4",
78− "token": "string.regexp keyword.other"
79− },
80− {
81− "foreground": "5f7e97",
82− "token": "meta.function punctuation.separator.comma"
83− },
84− {
85− "foreground": "f78c6c",
86− "token": "constant.numeric"
87− },
88− {
89− "foreground": "f78c6c",
90− "token": "constant.character.numeric"
91− },
92− {
93− "foreground": "addb67",
94− "token": "variable"
95− },
96− {
97− "foreground": "c792ea",
98− "token": "keyword"
99− },
100− {
101− "foreground": "c792ea",
102− "token": "punctuation.accessor"
103− },
104− {
105− "foreground": "c792ea",
106− "token": "storage"
107− },
108− {
109− "foreground": "c792ea",
110− "token": "meta.var.expr"
111− },
112− {
113− "foreground": "c792ea",
114− "token": "meta.class meta.method.declaration meta.var.expr storage.type.jsm"
115− },
116− {
117− "foreground": "c792ea",
118− "token": "storage.type.property.js"
119− },
120− {
121− "foreground": "c792ea",
122− "token": "storage.type.property.ts"
123− },
124− {
125− "foreground": "c792ea",
126− "token": "storage.type.property.tsx"
127− },
128− {
129− "foreground": "82aaff",
130− "token": "storage.type"
131− },
132− {
133− "foreground": "ffcb8b",
134− "token": "entity.name.class"
135− },
136− {
137− "foreground": "ffcb8b",
138− "token": "meta.class entity.name.type.class"
139− },
140− {
141− "foreground": "addb67",
142− "token": "entity.other.inherited-class"
143− },
144− {
145− "foreground": "82aaff",
146− "token": "entity.name.function"
147− },
148− {
149− "foreground": "addb67",
150− "token": "punctuation.definition.variable"
151− },
152− {
153− "foreground": "d3423e",
154− "token": "punctuation.section.embedded"
155− },
156− {
157− "foreground": "d6deeb",
158− "token": "punctuation.terminator.expression"
159− },
160− {
161− "foreground": "d6deeb",
162− "token": "punctuation.definition.arguments"
163− },
164− {
165− "foreground": "d6deeb",
166− "token": "punctuation.definition.array"
167− },
168− {
169− "foreground": "d6deeb",
170− "token": "punctuation.section.array"
171− },
172− {
173− "foreground": "d6deeb",
174− "token": "meta.array"
175− },
176− {
177− "foreground": "d9f5dd",
178− "token": "punctuation.definition.list.begin"
179− },
180− {
181− "foreground": "d9f5dd",
182− "token": "punctuation.definition.list.end"
183− },
184− {
185− "foreground": "d9f5dd",
186− "token": "punctuation.separator.arguments"
187− },
188− {
189− "foreground": "d9f5dd",
190− "token": "punctuation.definition.list"
191− },
192− {
193− "foreground": "d3423e",
194− "token": "string.template meta.template.expression"
195− },
196− {
197− "foreground": "d6deeb",
198− "token": "string.template punctuation.definition.string"
199− },
200− {
201− "foreground": "c792ea",
202− "fontStyle": "italic",
203− "token": "italic"
204− },
205− {
206− "foreground": "addb67",
207− "fontStyle": "bold",
208− "token": "bold"
209− },
210− {
211− "foreground": "82aaff",
212− "token": "constant.language"
213− },
214− {
215− "foreground": "82aaff",
216− "token": "punctuation.definition.constant"
217− },
218− {
219− "foreground": "82aaff",
220− "token": "variable.other.constant"
221− },
222− {
223− "foreground": "7fdbca",
224− "token": "support.function.construct"
225− },
226− {
227− "foreground": "7fdbca",
228− "token": "keyword.other.new"
229− },
230− {
231− "foreground": "82aaff",
232− "token": "constant.character"
233− },
234− {
235− "foreground": "82aaff",
236− "token": "constant.other"
237− },
238− {
239− "foreground": "f78c6c",
240− "token": "constant.character.escape"
241− },
242− {
243− "foreground": "addb67",
244− "token": "entity.other.inherited-class"
245− },
246− {
247− "foreground": "d7dbe0",
248− "token": "variable.parameter"
249− },
250− {
251− "foreground": "7fdbca",
252− "token": "entity.name.tag"
253− },
254− {
255− "foreground": "cc2996",
256− "token": "punctuation.definition.tag.html"
257− },
258− {
259− "foreground": "cc2996",
260− "token": "punctuation.definition.tag.begin"
261− },
262− {
263− "foreground": "cc2996",
264− "token": "punctuation.definition.tag.end"
265− },
266− {
267− "foreground": "addb67",
268− "token": "entity.other.attribute-name"
269− },
270− {
271− "foreground": "addb67",
272− "token": "entity.name.tag.custom"
273− },
274− {
275− "foreground": "82aaff",
276− "token": "support.function"
277− },
278− {
279− "foreground": "82aaff",
280− "token": "support.constant"
281− },
282− {
283− "foreground": "7fdbca",
284− "token": "upport.constant.meta.property-value"
285− },
286− {
287− "foreground": "addb67",
288− "token": "support.type"
289− },
290− {
291− "foreground": "addb67",
292− "token": "support.class"
293− },
294− {
295− "foreground": "addb67",
296− "token": "support.variable.dom"
297− },
298− {
299− "foreground": "7fdbca",
300− "token": "support.constant"
301− },
302− {
303− "foreground": "7fdbca",
304− "token": "keyword.other.special-method"
305− },
306− {
307− "foreground": "7fdbca",
308− "token": "keyword.other.new"
309− },
310− {
311− "foreground": "7fdbca",
312− "token": "keyword.other.debugger"
313− },
314− {
315− "foreground": "7fdbca",
316− "token": "keyword.control"
317− },
318− {
319− "foreground": "c792ea",
320− "token": "keyword.operator.comparison"
321− },
322− {
323− "foreground": "c792ea",
324− "token": "keyword.control.flow.js"
325− },
326− {
327− "foreground": "c792ea",
328− "token": "keyword.control.flow.ts"
329− },
330− {
331− "foreground": "c792ea",
332− "token": "keyword.control.flow.tsx"
333− },
334− {
335− "foreground": "c792ea",
336− "token": "keyword.control.ruby"
337− },
338− {
339− "foreground": "c792ea",
340− "token": "keyword.control.module.ruby"
341− },
342− {
343− "foreground": "c792ea",
344− "token": "keyword.control.class.ruby"
345− },
346− {
347− "foreground": "c792ea",
348− "token": "keyword.control.def.ruby"
349− },
350− {
351− "foreground": "c792ea",
352− "token": "keyword.control.loop.js"
353− },
354− {
355− "foreground": "c792ea",
356− "token": "keyword.control.loop.ts"
357− },
358− {
359− "foreground": "c792ea",
360− "token": "keyword.control.import.js"
361− },
362− {
363− "foreground": "c792ea",
364− "token": "keyword.control.import.ts"
365− },
366− {
367− "foreground": "c792ea",
368− "token": "keyword.control.import.tsx"
369− },
370− {
371− "foreground": "c792ea",
372− "token": "keyword.control.from.js"
373− },
374− {
375− "foreground": "c792ea",
376− "token": "keyword.control.from.ts"
377− },
378− {
379− "foreground": "c792ea",
380− "token": "keyword.control.from.tsx"
381− },
382− {
383− "foreground": "ffffff",
384− "background": "ff2c83",
385− "token": "invalid"
386− },
387− {
388− "foreground": "ffffff",
389− "background": "d3423e",
390− "token": "invalid.deprecated"
391− },
392− {
393− "foreground": "7fdbca",
394− "token": "keyword.operator"
395− },
396− {
397− "foreground": "c792ea",
398− "token": "keyword.operator.relational"
399− },
400− {
401− "foreground": "c792ea",
402− "token": "keyword.operator.assignement"
403− },
404− {
405− "foreground": "c792ea",
406− "token": "keyword.operator.arithmetic"
407− },
408− {
409− "foreground": "c792ea",
410− "token": "keyword.operator.bitwise"
411− },
412− {
413− "foreground": "c792ea",
414− "token": "keyword.operator.increment"
415− },
416− {
417− "foreground": "c792ea",
418− "token": "keyword.operator.ternary"
419− },
420− {
421− "foreground": "637777",
422− "token": "comment.line.double-slash"
423− },
424− {
425− "foreground": "cdebf7",
426− "token": "object"
427− },
428− {
429− "foreground": "ff5874",
430− "token": "constant.language.null"
431− },
432− {
433− "foreground": "d6deeb",
434− "token": "meta.brace"
435− },
436− {
437− "foreground": "c792ea",
438− "token": "meta.delimiter.period"
439− },
440− {
441− "foreground": "d9f5dd",
442− "token": "punctuation.definition.string"
443− },
444− {
445− "foreground": "ff5874",
446− "token": "constant.language.boolean"
447− },
448− {
449− "foreground": "ffffff",
450− "token": "object.comma"
451− },
452− {
453− "foreground": "7fdbca",
454− "token": "variable.parameter.function"
455− },
456− {
457− "foreground": "80cbc4",
458− "token": "support.type.vendor.property-name"
459− },
460− {
461− "foreground": "80cbc4",
462− "token": "support.constant.vendor.property-value"
463− },
464− {
465− "foreground": "80cbc4",
466− "token": "support.type.property-name"
467− },
468− {
469− "foreground": "80cbc4",
470− "token": "meta.property-list entity.name.tag"
471− },
472− {
473− "foreground": "57eaf1",
474− "token": "meta.property-list entity.name.tag.reference"
475− },
476− {
477− "foreground": "f78c6c",
478− "token": "constant.other.color.rgb-value punctuation.definition.constant"
479− },
480− {
481− "foreground": "ffeb95",
482− "token": "constant.other.color"
483− },
484− {
485− "foreground": "ffeb95",
486− "token": "keyword.other.unit"
487− },
488− {
489− "foreground": "c792ea",
490− "token": "meta.selector"
491− },
492− {
493− "foreground": "fad430",
494− "token": "entity.other.attribute-name.id"
495− },
496− {
497− "foreground": "80cbc4",
498− "token": "meta.property-name"
499− },
500− {
501− "foreground": "c792ea",
502− "token": "entity.name.tag.doctype"
503− },
504− {
505− "foreground": "c792ea",
506− "token": "meta.tag.sgml.doctype"
507− },
508− {
509− "foreground": "d9f5dd",
510− "token": "punctuation.definition.parameters"
511− },
512− {
513− "foreground": "ecc48d",
514− "token": "string.quoted"
515− },
516− {
517− "foreground": "ecc48d",
518− "token": "string.quoted.double"
519− },
520− {
521− "foreground": "ecc48d",
522− "token": "string.quoted.single"
523− },
524− {
525− "foreground": "addb67",
526− "token": "support.constant.math"
527− },
528− {
529− "foreground": "addb67",
530− "token": "support.type.property-name.json"
531− },
532− {
533− "foreground": "addb67",
534− "token": "support.constant.json"
535− },
536− {
537− "foreground": "c789d6",
538− "token": "meta.structure.dictionary.value.json string.quoted.double"
539− },
540− {
541− "foreground": "80cbc4",
542− "token": "string.quoted.double.json punctuation.definition.string.json"
543− },
544− {
545− "foreground": "ff5874",
546− "token": "meta.structure.dictionary.json meta.structure.dictionary.value constant.language"
547− },
548− {
549− "foreground": "d6deeb",
550− "token": "variable.other.ruby"
551− },
552− {
553− "foreground": "ecc48d",
554− "token": "entity.name.type.class.ruby"
555− },
556− {
557− "foreground": "ecc48d",
558− "token": "keyword.control.class.ruby"
559− },
560− {
561− "foreground": "ecc48d",
562− "token": "meta.class.ruby"
563− },
564− {
565− "foreground": "7fdbca",
566− "token": "constant.language.symbol.hashkey.ruby"
567− },
568− {
569− "foreground": "e0eddd",
570− "background": "a57706",
571− "fontStyle": "italic",
572− "token": "meta.diff"
573− },
574− {
575− "foreground": "e0eddd",
576− "background": "a57706",
577− "fontStyle": "italic",
578− "token": "meta.diff.header"
579− },
580− {
581− "foreground": "ef535090",
582− "fontStyle": "italic",
583− "token": "markup.deleted"
584− },
585− {
586− "foreground": "a2bffc",
587− "fontStyle": "italic",
588− "token": "markup.changed"
589− },
590− {
591− "foreground": "a2bffc",
592− "fontStyle": "italic",
593− "token": "meta.diff.header.git"
594− },
595− {
596− "foreground": "a2bffc",
597− "fontStyle": "italic",
598− "token": "meta.diff.header.from-file"
599− },
600− {
601− "foreground": "a2bffc",
602− "fontStyle": "italic",
603− "token": "meta.diff.header.to-file"
604− },
605− {
606− "foreground": "219186",
607− "background": "eae3ca",
608− "token": "markup.inserted"
609− },
610− {
611− "foreground": "d3201f",
612− "token": "other.package.exclude"
613− },
614− {
615− "foreground": "d3201f",
616− "token": "other.remove"
617− },
618− {
619− "foreground": "269186",
620− "token": "other.add"
621− },
622− {
623− "foreground": "ff5874",
624− "token": "constant.language.python"
625− },
626− {
627− "foreground": "82aaff",
628− "token": "variable.parameter.function.python"
629− },
630− {
631− "foreground": "82aaff",
632− "token": "meta.function-call.arguments.python"
633− },
634− {
635− "foreground": "b2ccd6",
636− "token": "meta.function-call.python"
637− },
638− {
639− "foreground": "b2ccd6",
640− "token": "meta.function-call.generic.python"
641− },
642− {
643− "foreground": "d6deeb",
644− "token": "punctuation.python"
645− },
646− {
647− "foreground": "addb67",
648− "token": "entity.name.function.decorator.python"
649− },
650− {
651− "foreground": "8eace3",
652− "token": "source.python variable.language.special"
653− },
654− {
655− "foreground": "82b1ff",
656− "token": "markup.heading.markdown"
657− },
658− {
659− "foreground": "c792ea",
660− "fontStyle": "italic",
661− "token": "markup.italic.markdown"
662− },
663− {
664− "foreground": "addb67",
665− "fontStyle": "bold",
666− "token": "markup.bold.markdown"
667− },
668− {
669− "foreground": "697098",
670− "token": "markup.quote.markdown"
671− },
672− {
673− "foreground": "80cbc4",
674− "token": "markup.inline.raw.markdown"
675− },
676− {
677− "foreground": "ff869a",
678− "token": "markup.underline.link.markdown"
679− },
680− {
681− "foreground": "ff869a",
682− "token": "markup.underline.link.image.markdown"
683− },
684− {
685− "foreground": "d6deeb",
686− "token": "string.other.link.title.markdown"
687− },
688− {
689− "foreground": "d6deeb",
690− "token": "string.other.link.description.markdown"
691− },
692− {
693− "foreground": "82b1ff",
694− "token": "punctuation.definition.string.markdown"
695− },
696− {
697− "foreground": "82b1ff",
698− "token": "punctuation.definition.string.begin.markdown"
699− },
700− {
701− "foreground": "82b1ff",
702− "token": "punctuation.definition.string.end.markdown"
703− },
704− {
705− "foreground": "82b1ff",
706− "token": "meta.link.inline.markdown punctuation.definition.string"
707− },
708− {
709− "foreground": "7fdbca",
710− "token": "punctuation.definition.metadata.markdown"
711− },
712− {
713− "foreground": "82b1ff",
714− "token": "beginning.punctuation.definition.list.markdown"
715− }
716− ],
717− "colors": {
718− "editor.foreground": "#d6deeb",
719− "editor.background": "#011627",
720− "editor.selectionBackground": "#5f7e9779",
721− "editor.lineHighlightBackground": "#010E17",
722− "editorCursor.foreground": "#80a4c2",
723− "editorWhitespace.foreground": "#2e2040",
724− "editorIndentGuide.background": "#5e81ce52",
725− "editor.selectionHighlightBorder": "#122d42"
726− }
727−}
728−
729−exports.purescriptSyntax = {
730− "displayName": "Purescript",
731− "name": "purescrript",
732− "mimeTypes": ["text/purescript"],
733− "fileExtensions": ["purs"],
734−
735− "editorOptions": { "tabSize": 2, "insertSpaces": true },
736−
737− "lineComment": "--",
738− "blockCommentStart": "{-",
739− "blockCommentEnd": "-}",
740−
741− "keywords": [
742− "case", "class", "data", "derive", "do", "else",
743− "if", "import", "in", "infix", "infixl", "infixr", "instance",
744− "let", "module", "newtype", "of", "then", "type", "where",
745− "->", "|", "=>", "::", "\\", "=", "|", "foreign", "forall", "∷"
746− ],
747−
748− "extraKeywords": [
749− ],
750−
751− "typeKeywords": [
752− ],
753−
754− "dataStart": [
755− "^data"
756− ],
757−
758− "typeStart": [
759− "class","instance","type", "derive"
760− ],
761−
762−
763− "escapes" : "\\\\(?:[nrt\\\\\"'\\?]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{6})",
764− "symbols0": "[\\$%&\\*\\+@!\\/\\\\\\^~=\\.:\\-\\?]",
765− "symbols" : "(?:@symbols0|[\\|<>])+",
766− "idchars" : "(?:[\\w'])*",
767−
768− "tokenizer": {
769− "root": [
770−
771− ["((?:[A-Z]@idchars\\.)+)([a-z]@idchars)", ["identifier.namespace","identifier"]],
772− ["((?:[A-Z]@idchars\\.)+)([A-Z]@idchars)", ["identifier.namespace","constructor"]],
773−
774− ["[a-z]@idchars(?!\\.)",
775− { "cases":{ "@dataStart": { "token": "keyword", "next" : "@type_data" },
776− "@typeStart": { "token": "keyword", "next" : "@type_type" },
777− "@keywords": "keyword",
778− "@extraKeywords": "keyword",
779− "@default" : "identifier" }
780− }
781− ],
782−
783− ["[A-Z]@idchars", "type.identifier" ],
784−
785− ["_@idchars", "identifier.wildcard"],
786−
787−
788− ["([a-z]@idchars\\.)+", "identifier.namespace" ],
789−
790−
791− { "include": "@whitespace" },
792−
793− ["[{}()\\[\\]]", "@brackets"],
794− ["[,`]", "delimiter"],
795−
796−
797− ["::(?!@symbols0)", "type.operator", "@type_line"],
798− ["@symbols", { "cases": { "@keywords": "keyword.operator",
799− "@extraKeywords": "keyword.operator",
800− "@default": "operator" }}
801− ],
802−
803−
804− ["[0-9]+\\.[0-9]+([eE][\\-+]?[0-9]+)?", "number.float"],
805− ["0[xX][0-9a-fA-F]+", "number.hex"],
806− ["[0-9]+", "number"],
807−
808−
809− ["\"([^\"\\\\]|\\\\.)*$", "string.invalid" ],
810− ["\"", { "token": "string.quote", "bracket": "@open", "next": "@string" } ],
811−
812−
813− ["'[^\\\\']'", "string"],
814− ["(')(@escapes)(')", ["string","string.escape","string"]],
815− ["'", "string.invalid"],
816−
817−
818− ["^[ ]*#.*", "namespace"]
819− ],
820−
821− "whitespace": [
822− ["[ \\r\\n]+", ""],
823− ["{-", "comment", "@comment" ],
824− ["--.*$", "comment"]
825− ],
826−
827− "comment": [
828− ["[^\\{\\-]+", "comment" ],
829− ["{-", "comment", "@push" ],
830− ["-}", "comment", "@pop" ],
831− ["[\\{\\-]", "comment"]
832− ],
833−
834− "string": [
835− ["[^\\\\\"]+", "string"],
836− ["@escapes", "string.escape"],
837− ["\\\\.", "string.escape.invalid"],
838− ["\"", { "token": "string.quote", "bracket": "@close", "next": "@pop" } ]
839− ],
840−
841− "type_type": [
842− [ "\\=", "keyword"],
843− ["^\\s*(?!\\-\\-|\\{\\-)[^\\s]", { "token": "@rematch", "next": "@pop" } ],
844− { "include": "@type" }
845− ],
846−
847− "type_data": [
848− [ "([=|])(\\s*)([A-Z]@idchars)", ["keyword.operator","","constructor"]],
849− ["^\\s*$", { "token": "", "next": "@pop" } ],
850− { "include": "@type" }
851− ],
852−
853− "type_line": [
854− ["^\\s*(?!\\-\\-|\\{\\-)[_a-z]", { "token": "@rematch", "next": "@pop" } ],
855− ["[^=]*=", { "token": "@rematch", "next": "@pop" } ],
856− { "include": "@type" }
857− ],
858−
859− "type": [
860− [ "[(\\[]", { "token": "@brackets.type" }, "@type_nested"],
861− { "include": "@type_content" }
862− ],
863−
864− "type_nested": [
865− ["[)\\]]", { "token": "@brackets.type" }, "@pop" ],
866− ["[(\\[]", { "token": "@brackets.type" }, "@push"],
867− [",", "delimiter.type"],
868− { "include": "@type_content" }
869− ],
870−
871− "type_content": [
872− { "include": "@whitespace" },
873−
874−
875− ["[a-z]\\d*\\b", "type.identifier.typevar"],
876− ["_@idchars", "type.identifier.typevar"],
877−
878− ["((?:[A-Z]@idchars\\.)*)([A-Z]@idchars)",
879− ["type.identifier.namespace","type.identifier"]
880− ],
881− ["((?:[A-Z]@idchars\\.)*)([a-z]@idchars)",
882− { "cases": { "@typeKeywords": ["type.identifier.namespace","type.keyword"],
883− "@keywords": { "token": "@rematch", "next": "@pop" },
884− "@default": ["type.identifier.namespace","type.identifier"]
885− }}
886− ],
887−
888− ["::|->|[\\.:|]", "type.operator"],
889− ["[\\s\\S]","@rematch","@pop"]
890− ]
891− }
892− }
src/Shareddeleted−1
@@ -1 +0,0 @@
1−../Shared