Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/.psc*
/.purs*
/.psa*
/.spago
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Fork or clone this repo to begin

## Install dependencies

`npm i && npx bower i`
`npm i && npx spago install`

## Develop

Expand Down
13 changes: 0 additions & 13 deletions bower.json

This file was deleted.

8,879 changes: 3,431 additions & 5,448 deletions package-lock.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,39 @@
"build": "webpack -p",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"build:purs": "pulp build",
"pscid:build": "pulp build",
"pscid:test": "pulp test",
"test": "pulp test",
"build:purs": "spago build",
"pscid:build": "spago build",
"pscid:test": "spago test",
"test": "spago test",
"clean": "rm -rf output build",
"clean:everything": "npm run clean && rm -rf node_modules bower_components"
"clean:everything": "npm run clean && rm -rf node_modules .spago"
},
"dependencies": {
"react": "16.6.1",
"react-dom": "16.6.1"
"react": "16.13.1",
"react-dom": "16.13.1"
},
"devDependencies": {
"bower": "^1.8.4",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "1.0.1",
"gh-pages": "2.0.1",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "0.4.4",
"optimize-css-assets-webpack-plugin": "5.0.1",
"pulp": "^12.3.0",
"purescript": "^0.12.0",
"purescript-psa": "0.7.3",
"purs-loader": "^3.2.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "3.5.3",
"gh-pages": "2.2.0",
"html-webpack-plugin": "^4.3.0",
"mini-css-extract-plugin": "0.9.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"purescript": "^0.13.6",
"purescript-psa": "^0.7.3",
"purs-loader": "^3.7.1",
"resource-hints-webpack-plugin": "0.0.2",
"sass-loader": "7.1.0",
"script-ext-html-webpack-plugin": "2.1.2",
"sass-loader": "8.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"source-map-loader": "0.2.4",
"style-loader": "0.23.1",
"webpack": "4.25.1",
"webpack-bundle-analyzer": "3.0.3",
"webpack-cli": "3.1.2",
"webpack-dev-server": "3.1.10",
"webpack-manifest-plugin": "2.0.4",
"webpack-subresource-integrity": "1.3.0"
"spago": "^0.15.2",
"style-loader": "1.2.1",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.43.0",
"webpack-bundle-analyzer": "^3.7.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0",
"webpack-manifest-plugin": "^2.2.0",
"webpack-subresource-integrity": "^1.4.1"
}
}
128 changes: 128 additions & 0 deletions packages.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{-
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"
}
}
-------------------------------
-}


let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.13.6-20200507/packages.dhall sha256:9c1e8951e721b79de1de551f31ecb5a339e82bbd43300eb5ccfb1bf8cf7bbd62

let overrides = {=}

let additions = {=}

in upstream // overrides // additions
10 changes: 10 additions & 0 deletions spago.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{-
Welcome to a Spago project!
You can edit this file as you like.
-}
{ name = "react-basic-starter"
, dependencies =
[ "console", "effect", "prelude", "psci-support", "react-basic" ]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
}
27 changes: 9 additions & 18 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require("path");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
Expand Down Expand Up @@ -65,7 +65,7 @@ module.exports = (_env, options) => ({
}
},
plugins: [
new CleanWebpackPlugin(["build"]),
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: "styles.css"
}),
Expand Down Expand Up @@ -93,7 +93,7 @@ module.exports = (_env, options) => ({
{
test: /\.js$/,
loader: "source-map-loader",
exclude: /node_modules|bower_components/
exclude: /node_modules/
},
{
oneOf: [
Expand All @@ -107,21 +107,12 @@ module.exports = (_env, options) => ({
use: {
loader: "purs-loader",
options: {
bundleOutput: "output/bundle.js",
// purs bundling breaks webpack's chunk splitting
bundle: false, // isProd(options),
warnings: true,
watch: options.watch,
pscArgs: {
// Set this to true and rebuild with
// `rm -rf output && npx pulp build -- --sourcemaps`
// to debug with sourcemaps.
// Disabled by default because it slow down
// and frequently breaks webpack/purs-loader,
// and the "locals" in the browser debugger don't
// make sense anyway.
sourceMaps: false
}
src: [
'src/**/*.purs'
],
spago: true,
watch: !isProd(options),
pscIde: true
}
}
}
Expand Down