prepare for beta publish

This commit is contained in:
Ryan Haskell-Glatz 2021-01-16 13:39:53 -06:00
parent 941222d1da
commit 2135db8cfc
9 changed files with 29 additions and 44 deletions

3
.gitignore vendored
View File

@ -3,7 +3,6 @@
elm-stuff
node_modules
dist
Generated
elm-spa-*.tgz
# Local Netlify folder
.netlify

View File

@ -1,10 +1,8 @@
elm-stuff
/src
/node_modules
/tests
/elm.json
/examples
!.gitignore
.github
.netlify
*.tgz
/dist/elm.js
/jest.config.js
/tsconfig.json
/src/**
!/src/new/**
!/src/defaults/**

View File

@ -9,7 +9,8 @@
"build": "tsc",
"build:watch": "tsc --watch",
"test": "jest",
"test:watch": "jest --watchAll"
"test:watch": "jest --watchAll",
"publish:test": "npm run build && npm pack --dry-run"
},
"repository": {
"type": "git",

View File

@ -129,7 +129,7 @@ const compileMainElm = (env : Environment) => async () => {
await File.mkdir(config.folders.dist)
}
return Process.run(`${config.binaries.elm} make ${input} --output=${output} --report=json ${flags}`)
return Process.run(`${config.binaries.elm} make ${input} --output=${output} --report=json ${flags}`)
.catch(colorElmError)
}
@ -186,9 +186,6 @@ const compileMainElm = (env : Environment) => async () => {
const minify = () =>
Process.run(`${config.binaries.terser} ${output} --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' | ${config.binaries.terser} --mangle --output=${output}`)
const gzip = () =>
Process.run(`gzip --keep --force ${output}`)
return (env === 'development')
? elmMake()
.then(_ => success()).catch(error => error)

View File

@ -7,8 +7,9 @@ import { bold, reset } from "../terminal"
// Scaffold a new elm-spa project
export default {
run: () => {
File.copy(config.folders.init, process.cwd())
fs.mkdirSync(path.join(process.cwd(), 'src'))
const dest = process.cwd()
File.copy(config.folders.init, dest)
try { fs.renameSync(path.join(dest, '_gitignore'), path.join(dest, '.gitignore')) } catch (_) {}
return ` ${bold}New project created in:${reset}\n ${process.cwd()}`
}
}

View File

@ -33,7 +33,6 @@ const config = {
defaults: [
[ 'Main.elm' ],
[ 'Shared.elm' ],
[ `Pages`, `${reserved.homepage}.elm` ],
[ `Pages`, `${reserved.notFound}.elm` ],
[ 'Page.elm' ],
[ 'Request.elm' ],

View File

@ -1,26 +0,0 @@
module Pages.Home_ exposing (page)
import Html exposing (..)
import Html.Attributes exposing (attribute, href, style)
import View exposing (View)
page : View Never
page =
{ title = "Homepage"
, body =
[ div
[ style "font-family" "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif"
, style "color" "#333"
, style "padding" "4rem"
]
[ h1 [] [ text "🎉 Hooray it's working!" ]
, p []
[ strong [] [ text "Nice work! " ]
, text "Learn more at "
, a [ href "https://elm-spa.dev/guide", attribute "target" "_blank" ]
[ text "elm-spa.dev" ]
]
]
]
}

View File

@ -0,0 +1,5 @@
.DS_Store
.elm-spa
elm-stuff
node_modules
dist

View File

@ -0,0 +1,11 @@
module Pages.Home_ exposing (page)
import Html
import View exposing (View)
page : View Never
page =
{ title = "Homepage"
, body = [ Html.text "Hello, world!" ]
}