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 elm-stuff
node_modules node_modules
dist dist
Generated
elm-spa-*.tgz
# Local Netlify folder # Local Netlify folder
.netlify .netlify

View File

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

View File

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

View File

@ -129,7 +129,7 @@ const compileMainElm = (env : Environment) => async () => {
await File.mkdir(config.folders.dist) 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) .catch(colorElmError)
} }
@ -186,9 +186,6 @@ const compileMainElm = (env : Environment) => async () => {
const minify = () => 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}`) 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') return (env === 'development')
? elmMake() ? elmMake()
.then(_ => success()).catch(error => error) .then(_ => success()).catch(error => error)

View File

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

View File

@ -33,7 +33,6 @@ const config = {
defaults: [ defaults: [
[ 'Main.elm' ], [ 'Main.elm' ],
[ 'Shared.elm' ], [ 'Shared.elm' ],
[ `Pages`, `${reserved.homepage}.elm` ],
[ `Pages`, `${reserved.notFound}.elm` ], [ `Pages`, `${reserved.notFound}.elm` ],
[ 'Page.elm' ], [ 'Page.elm' ],
[ 'Request.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!" ]
}