From 17f40dff3006e5929d6ac4122923eee38a260ef9 Mon Sep 17 00:00:00 2001 From: Judah Meek Date: Wed, 27 Apr 2022 23:49:29 -0500 Subject: [PATCH] initial draft --- .gitignore | 4 ++++ app/javascript/packs/rescript.js | 5 ++++ app/javascript/rescript/random.css | 19 +++++++++++++++ app/javascript/rescript/random.res | 7 ++++++ bsconfig.json | 34 +++++++++++++++++++++++++++ package.json | 9 ++++++++ yarn.lock | 37 ++++++++++++++++++++++++++++++ 7 files changed, 115 insertions(+) create mode 100644 app/javascript/packs/rescript.js create mode 100644 app/javascript/rescript/random.css create mode 100644 app/javascript/rescript/random.res create mode 100644 bsconfig.json diff --git a/.gitignore b/.gitignore index 790502d..066f535 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,7 @@ /yarn-error.log yarn-debug.log* .yarn-integrity + +.merlin +.bsb.lock +*.bs.js diff --git a/app/javascript/packs/rescript.js b/app/javascript/packs/rescript.js new file mode 100644 index 0000000..5bc06fd --- /dev/null +++ b/app/javascript/packs/rescript.js @@ -0,0 +1,5 @@ +import * as React from 'react'; + +import Random from './random.bs.js'; + +export default ({ context, ...props }) => ; diff --git a/app/javascript/rescript/random.css b/app/javascript/rescript/random.css new file mode 100644 index 0000000..afc3762 --- /dev/null +++ b/app/javascript/rescript/random.css @@ -0,0 +1,19 @@ +.aboutSectionHeadContainer { + .subtitle { + max-width: 900px; + margin: 0 auto; + font-size: 18px; + color: $gray-text; + line-height: 25px; + text-align: center; + } + + h2 { + color: $black; + font-size: 32px; + font-weight: 600; + line-height: 40px; + margin-bottom: 15px; + text-align: center; + } +} diff --git a/app/javascript/rescript/random.res b/app/javascript/rescript/random.res new file mode 100644 index 0000000..b4be025 --- /dev/null +++ b/app/javascript/rescript/random.res @@ -0,0 +1,7 @@ +@module external css: {..} = "./random.css" + +@react.component +let make = () => +
+

"Test"

+
diff --git a/bsconfig.json b/bsconfig.json new file mode 100644 index 0000000..dd93183 --- /dev/null +++ b/bsconfig.json @@ -0,0 +1,34 @@ +{ + "name": "quick-search-rescript", + "sources": [ + { + "dir": "src", + "subdirs": true + } + ], + "bs-dependencies": [ + "@rescript/react", + "rescript-react-update", + "rescript-classnames", + "rescript-debounce-react", + "rescript-logger", + "bs-webapi" + ], + "reason": { + "react-jsx": 3 + }, + "package-specs": [ + { + "module": "es6", + "in-source": true + } + ], + "suffix": ".bs.js", + "bsc-flags": [ + "-open Belt", + "-open Cx" + ], + "ppx-flags": [ + "rescript-logger/ppx" + ] +} diff --git a/package.json b/package.json index 5b01735..4b99e49 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,17 @@ }, "devDependencies": { "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1", + "@rescript/react": "0.10.3", "fork-ts-checker-webpack-plugin": "^6.0.1", "react-refresh": "^0.9.0", + "rescript": "9.1.2", + "rescript-classnames": "6.0.0", + "rescript-debounce-react": "1.0.0", + "rescript-logger": "2.0.2", + "rescript-react-update": "3.0.2", "webpack-dev-server": "^4.7.3" + }, + "scripts": { + "res:watch": "rescript build -w" } } diff --git a/yarn.lock b/yarn.lock index 00d1d0d..d61ca00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1221,6 +1221,11 @@ schema-utils "^3.0.0" source-map "^0.7.3" +"@rescript/react@0.10.3": + version "0.10.3" + resolved "https://registry.yarnpkg.com/@rescript/react/-/react-0.10.3.tgz#a2a8bed6b017940ec26c2154764b350f50348889" + integrity sha512-Lf9rzrR3bQPKJjOK3PBRa/B3xrJ7CqQ1HYr9VHPVxJidarIJJFZBhj0Dg1uZURX+Wg/xiP0PHFxXmdj2bK8Vxw== + "@trysound/sax@0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.1.1.tgz#3348564048e7a2d7398c935d466c0414ebb6a669" @@ -4390,6 +4395,38 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= +rescript-classnames@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/rescript-classnames/-/rescript-classnames-6.0.0.tgz#e833d9fc88e0e494c2ef39862721a80ab75fae32" + integrity sha512-hfOffijzIPnULtRZW3Kf0DCfCaw9lhGaMxf81WYlREieyBS2KNMcdI/8g5uSXFj0j4Ci21xkf70EFCKjuCTqpw== + +rescript-debounce-react@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/rescript-debounce-react/-/rescript-debounce-react-1.0.0.tgz#8dd45967b818745dcb840439fd07bee10d06afde" + integrity sha512-WUgn8qGxWDXUHgOR4dDwI+h+FCWKdmZTBwCznvxTq/GiJZcusMr3fenazKiGIKzmxTUnnCCR2vcv43lq8YxZYA== + dependencies: + rescript-debounce "^1.0.0" + +rescript-debounce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/rescript-debounce/-/rescript-debounce-1.0.0.tgz#943ba92f4f8560b6dba387f0f2614db87ae47eb1" + integrity sha512-vb1UlJvReXl9+p6TubaoEF06VBfAXdw+GPtDOPflce2IrqwCgwBVRn6mvImNFktPvyYvvDFDi36lihDamAM48w== + +rescript-logger@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/rescript-logger/-/rescript-logger-2.0.2.tgz#fdcd564f0c04310cb673f475d501072d371bdeed" + integrity sha512-jbml41IgTyuiA7jnEYUqFeAKWnXAnlg5INCOpRPvhu99cLKFyFLl2B4GO04jznEDOgcpisJmwjm4WhfwhZETsQ== + +rescript-react-update@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rescript-react-update/-/rescript-react-update-3.0.2.tgz#8efece4c578110a35fdb1389d890a186dcdf03c6" + integrity sha512-oOOaeWma6XEhfZwlB/hB6u+UfYtuHjWS4RpoBeE8NbPX60GYLx5BLoVjEqLKoqXFPJv/2ZgghOKBn2LZo0VaJg== + +rescript@9.1.2: + version "9.1.2" + resolved "https://registry.yarnpkg.com/rescript/-/rescript-9.1.2.tgz#a81f8a735f1a7006233bfc72eb081ca7182a0d79" + integrity sha512-4wHvTDv3nyYnAPJHcg1RGG8z7u3HDiBf6RN3P/dITDv859Qo35aKOzJWQtfBzbAs0EKNafLqei3TnUqiAv6BwQ== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d"