diff --git a/.circleci/config.yml b/.circleci/config.yml index 8afe0e7d..f12ce8ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,12 +21,12 @@ jobs: - restore_cache: keys: - - v5-bower-cache-{{ .Branch }}-{{ checksum "bower.json" }} - - v5-bower-cache-{{ .Branch }} - - v5-bower-cache + - v1-spago-cache-{{ .Branch }}-{{ checksum "spago.dhall" }} + - v1-spago-cache-{{ .Branch }} + - v1-spago-cache - run: - name: Install Bower and Node dependencies + name: Install Spago and Node dependencies command: yarn # postinstall runs Bower - run: @@ -39,9 +39,9 @@ jobs: - ~/ocelot/node_modules - save_cache: - key: v5-bower-cache-{{ .Branch }}-{{ checksum "bower.json" }} + key: v1-spago-cache-{{ .Branch }}-{{ checksum "spago.dhall" }} paths: - - ~/ocelot/bower_components + - ~/ocelot/.spago - ~/ocelot/output # Persist generated JS into the workspace diff --git a/.gitignore b/.gitignore index 0c93043e..94b81174 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ generated-docs package-lock.json yarn.lock *.tix +.spago +.purs-repl + # Allow the CSS file only; Circle CI will overwrite whatever you # put so feel free to handle merge conflicts however you want. diff --git a/bower.json b/bower.json deleted file mode 100644 index b9e29646..00000000 --- a/bower.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "purescript-ocelot", - "homepage": "https://github.com/citizennet/purescript-ocelot", - "authors": [ - "Dave Zuch ", - "Chris Cornwell ", - "Thomas Honeyman ", - "Forest Toney ", - "Hardy Jones ", - "Vance Palacio " - ], - "description": "An opinionated component library for Halogen apps", - "keywords": [ - "purescript", - "halogen", - "ui" - ], - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "git@github.com:citizennet/purescript-ocelot.git" - }, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "output", - "css", - "ui-guide", - "docs" - ], - "dependencies": { - "purescript-halogen": "^5.0.0", - "purescript-svg-parser-halogen": "https://github.com/rnons/purescript-svg-parser-halogen.git#ac16a7af82d739b1f9773fbc28fc7e24f0d24550", - "purescript-halogen-select": "^5.0.0", - "purescript-fuzzy": "^0.2.1", - "purescript-remotedata": "4.2.0", - "purescript-formatters": "^4.0.0", - "purescript-read": "^1.0.1", - "purescript-halogen-renderless": "^0.0.4", - "purescript-aff-promise": "^2.0.0", - "purescript-html-parser-halogen": "https://github.com/rnons/purescript-html-parser-halogen.git#7d37fd6a29bff2a143d91c2ebfe5ca582ca76018", - "purescript-bigints": "^4.0.0", - "purescript-variant": "^6.0.1" - }, - "devDependencies": { - "purescript-affjax": "^10.0.0", - "purescript-argonaut": "^6.0.0", - "purescript-halogen-storybook": "https://github.com/rnons/purescript-halogen-storybook.git#de336410dde6e59ad4930f7e4296d066cb236628", - "purescript-email-validate": "^5.0.0", - "purescript-numbers": "^6.0.0", - "purescript-js-timers": "^4.0.0", - "purescript-test-unit": "^14.0.0", - "purescript-debug": "^4.0.0" - }, - "resolutions": { - "purescript-foreign-object": "^2.0.0", - "purescript-record": "^2.0.0", - "purescript-typelevel-prelude": ">= 4.0.0 < 6.0.0" - } -} diff --git a/package.json b/package.json index 5f4493e7..7c26d777 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "private": true, "scripts": { "build-all": "yarn run build-ui && yarn run build-css", - "postinstall": "bower install", - "clean": "rm -rf output bower_components node_modules && cd css && rm -rf node_modules", - "build-ui": "yarn run pulp -- build -I ui-guide --to dist/example.js -- $RTS_ARGS", - "watch-ui": "yarn run pulp -w --then 'yarn run build-css' build -I ui-guide --to dist/example.js", + "postinstall": "cd css && npm i", + "clean": "rm -rf output .spago node_modules && cd css && rm -rf node_modules", + "build-ui": "yarn run spago build -p \"ui-guide/**/*.purs\" -u \"$RTS_ARGS\" && purs bundle output/*/*.js -o dist/example.js $RTS_ARGS", + "watch-ui": "yarn run spago bundle-app -w -u \"$RTS_ARGS\" --then 'yarn run build-css' -p \"ui-guide/**/*.purs\" --to dist/example.js", "install-css": "cd css && yarn install", "build-css": "cd css && yarn run build-all" }, @@ -15,7 +15,7 @@ "bower": "^1.8.8", "pulp": "^13.0.0", "purescript": "^0.13.6", - "webpack-cli": "^3.0.6" + "spago": "^0.15.2" }, "dependencies": { "big-integer": "^1.6.31", diff --git a/packages.dhall b/packages.dhall new file mode 100644 index 00000000..91443f7d --- /dev/null +++ b/packages.dhall @@ -0,0 +1,145 @@ +{- +Welcome to your new Dhall package-set! + +Below are instructions for how to edit this file for most use +cases, so that you don't need to know Dhall to use it. + +## Warning: Don't Move This Top-Level Comment! + +Due to how `dhall format` currently works, this comment's +instructions cannot appear near corresponding sections below +because `dhall format` will delete the comment. However, +it will not delete a top-level comment like this one. + +## Use Cases + +Most will want to do one or both of these options: +1. Override/Patch a package's dependency +2. Add a package not already in the default package set + +This file will continue to work whether you use one or both options. +Instructions for each option are explained below. + +### Overriding/Patching a package + +Purpose: +- Change a package's dependency to a newer/older release than the + default package set's release +- Use your own modified version of some dependency that may + include new API, changed API, removed API by + using your custom git repo of the library rather than + the package set's repo + +Syntax: +Replace the overrides' "{=}" (an empty record) with the following idea +The "//" or "⫽" means "merge these two records and + when they have the same value, use the one on the right:" +------------------------------- +let overrides = + { packageName = + upstream.packageName // { updateEntity1 = "new value", updateEntity2 = "new value" } + , packageName = + upstream.packageName // { version = "v4.0.0" } + , packageName = + upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" } + } +------------------------------- + +Example: +------------------------------- +let overrides = + { halogen = + upstream.halogen // { version = "master" } + , halogen-vdom = + upstream.halogen-vdom // { version = "v4.0.0" } + } +------------------------------- + +### Additions + +Purpose: +- Add packages that aren't already included in the default package set + +Syntax: +Replace the additions' "{=}" (an empty record) with the following idea: +------------------------------- +let additions = + { package-name = + { dependencies = + [ "dependency1" + , "dependency2" + ] + , repo = + "https://example.com/path/to/git/repo.git" + , version = + "tag ('v4.0.0') or branch ('master')" + } + , package-name = + { dependencies = + [ "dependency1" + , "dependency2" + ] + , repo = + "https://example.com/path/to/git/repo.git" + , version = + "tag ('v4.0.0') or branch ('master')" + } + , etc. + } +------------------------------- + +Example: +------------------------------- +let additions = + { benchotron = + { dependencies = + [ "arrays" + , "exists" + , "profunctor" + , "strings" + , "quickcheck" + , "lcg" + , "transformers" + , "foldable-traversable" + , "exceptions" + , "node-fs" + , "node-buffer" + , "node-readline" + , "datetime" + , "now" + ] + , repo = + "https://github.com/hdgarrood/purescript-benchotron.git" + , version = + "v7.0.0" + } + } +------------------------------- +-} +------------------------- +-- Additional Packages -- +------------------------- +let halogen-renderless = + { dependencies = + [ "prelude" + , "control" + ] + , repo = + "https://github.com/purescript-deprecated/purescript-halogen-renderless" + , version = + "v0.0.4" + } + +----------------- +-- Main Config -- +----------------- + +let upstream = + https://github.com/purescript/package-sets/releases/download/psc-0.13.6-20200507/packages.dhall sha256:9c1e8951e721b79de1de551f31ecb5a339e82bbd43300eb5ccfb1bf8cf7bbd62 + +let overrides = {=} + +let additions = + { halogen-renderless } + +in upstream // overrides // additions diff --git a/spago.dhall b/spago.dhall new file mode 100644 index 00000000..340720c4 --- /dev/null +++ b/spago.dhall @@ -0,0 +1,43 @@ +{- +Welcome to a Spago project! +You can edit this file as you like. + +Authors: + "Dave Zuch ", + "Chris Cornwell ", + "Thomas Honeyman ", + "Forest Toney ", + "Hardy Jones ", + "Vance Palacio " +-} + +{ name = "ocelot" +, dependencies = + [ "aff-promise" + , "affjax" + , "argonaut" + , "bigints" + , "console" + , "debug" + , "effect" + , "email-validate" + , "formatters" + , "fuzzy" + , "halogen" + , "halogen-renderless" + , "halogen-select" + , "halogen-storybook" + , "html-parser-halogen" + , "js-timers" + , "numbers" + , "psci-support" + , "read" + , "remotedata" + , "svg-parser" + , "svg-parser-halogen" + , "test-unit" + , "variant" + ] +, packages = ./packages.dhall +, sources = [ "src/**/*.purs", "test/**/*.purs" ] +}