Renamed stic to waspc. (#82)

This commit is contained in:
Martin Šošić 2020-01-30 17:06:19 +01:00 committed by GitHub
parent 6ff026f318
commit 4ccc03baae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 31 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
.stack-work/
stic.cabal
waspc.cabal
*~
/.dir-locals.el
stack*.yaml.lock

View File

@ -1,3 +1,3 @@
# Changelog for stic
# Changelog
## Unreleased changes

View File

@ -1,12 +1,10 @@
```
________ _________ ___ ________
|\ ____\ |\___ ___\ |\ \ |\ ____\
\ \ \___|_\|___ \ \_| \ \ \ \ \ \___|
\ \_____ \ \ \ \ \ \ \ \ \ \
\|____|\ \ \ \ \ \ \ \ \ \ \
___\_\ \ \ \ \ \ \ \ \ \ \____
|\________\ \ \ \ \ \__\ \ \_______\
\|________| \|__| \|__| \|_______|
_ _
__ ____ _ ___ _ __ ___ | )/ )
\ \ /\ / / _` / __| '_ \ / __| \\ |//,' __
\ V V / (_| \__ \ |_) | (__ (")(_)-"()))=-
\_/\_/ \__,_|___/ .__/ \___| (\\
|_|
```
## Setup
@ -21,7 +19,7 @@ Stack installs GHC and packages automatically, in reproducible manner, in an iso
This project was created from `new-template` stack template and then modified inspired by `haskeleton` stack template.
Most important configuration file is `package.yaml`. Here we define what is what in our project, how is it built. Stack generates `stic.cabal` from this document.
Most important configuration file is `package.yaml`. Here we define what is what in our project, how is it built. Stack generates `waspc.cabal` from this document.
Also important is `stack.yaml` where we define Stack configuration for this project.
@ -42,12 +40,12 @@ If package you need is not in the Stack snapshot defined by `resolver`, add it t
## Building / development
You build the project with `stack build`. It uses `package.yaml`, `stic.yaml` (and possibly some other files in the future) and source files to generate files and build the project.
You build the project with `stack build`. It uses `package.yaml`, `waspc.yaml` (and possibly some other files in the future) and source files to generate files and build the project.
It is recommended using `stack build --pedantic` to turn on pedantic code checking (-Wall, -Werror).
`stack exec <my-executable>` will run executable in the context of stack project.
In our case, `stack exec stic-exe` will run Stic (build it first with `stack build`!).
In our case, `stack exec waspc-cli` will run waspc (build it first with `stack build`!).
Some useful command options when building:
- `stack build --test` -> same as `stack test`.
@ -75,7 +73,7 @@ The idea is that you normally use this for development, and you use `stack` dire
You can run `./run help` to learn how to use it.
Examples:
- `./run exec examples/todoMVC.wasp out/todoMVC` will run stic on todoMVC example.
- `./run exec examples/todoMVC.wasp out/todoMVC` will run waspc on todoMVC example.
## Tests
@ -106,3 +104,7 @@ Test are run with `stack test`. You can do `stack test --coverage` to see the co
For benchmarking we are using [**Criterion**](http://www.serpentine.com/criterion/).
You can run benchmark with `stack bench`.
## Other
Wasp ascii art used in the title is from https://www.asciiart.eu/animals/insects/bees, author: Stef00.

View File

@ -25,7 +25,7 @@ main = do
}
result <- compile absWaspFilePath absOutDirPath options
either putStrLn (\_ -> print ("Success!" :: String)) result
_ -> print ("Usage: ./stic <wasp_file_path> <out_dir>" :: String)
_ -> print ("Usage: ./waspc <wasp_file_path> <out_dir>" :: String)
where
-- | If path is not absolute, it is prefixed with given absolute directory.
ensurePathIsAbs :: Path.AbsDir -> FilePath -> FilePath

View File

@ -1,13 +1,13 @@
# This YAML file describes your package. Stack will automatically generate a
# Cabal file when you run `stack build`. See the hpack website for help with
# this file: <https://github.com/sol/hpack>.
name: stic
name: waspc
version: 0.1.0.0
github: "Martinsos/stic"
github: "Martinsos/waspc"
#license: BSD3
author: "Stic"
maintainer: "info@stic.dev"
copyright: "2019 Stic"
author: "wasp-lang"
maintainer: "sosic.martin@gmail.com, matija.sosic@gmail.com"
copyright: "2020 wasp-lang"
default-extensions:
- OverloadedStrings
@ -30,7 +30,7 @@ data-files:
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/Martinsos/stic#readme>
description: Please see the README on GitHub at <https://github.com/Martinsos/waspc#readme>
dependencies:
- base >= 4.7 && < 5
@ -53,7 +53,7 @@ library:
- regex-compat
executables:
stic-exe:
waspc-cli:
main: Main.hs
source-dirs: app
ghc-options:
@ -61,13 +61,13 @@ executables:
- -rtsopts
- -with-rtsopts=-N
dependencies:
- stic
- waspc
- filepath
- path
- directory
benchmarks:
stic-benchmarks:
waspc-benchmarks:
main: Main.hs
source-dirs: benchmark
ghc-options:
@ -75,11 +75,11 @@ benchmarks:
- -rtsopts
- -with-rtsopts=-N
dependencies:
- stic
- waspc
- criterion
tests:
stic-test:
waspc-test:
main: TastyDiscoverDriver.hs
source-dirs: test
ghc-options:
@ -91,7 +91,7 @@ tests:
- filepath
- text
- mtl
- stic
- waspc
- tasty
- tasty-hspec
- tasty-quickcheck

2
run
View File

@ -18,7 +18,7 @@ BUILD_CMD="stack build"
WATCH_CMD="$BUILD_CMD --file-watch"
TEST_CMD="$BUILD_CMD --test"
TEST_WATCH_CMD="$TEST_CMD --file-watch"
EXEC_CMD="stack exec stic-exe $ARGS"
EXEC_CMD="stack exec waspc-cli $ARGS"
GHCID_CMD="ghcid --command=stack ghci"
echo_and_eval () {

View File

@ -13,7 +13,7 @@ import Path ((</>), reldir)
import qualified Path
import qualified Path.Aliases as Path
import qualified Paths_stic
import qualified Paths_waspc
-- TODO: Write tests for this file! But first we need to decouple logic from IO
-- so that we can mock it.
@ -24,14 +24,14 @@ import qualified Paths_stic
-- overengineer for now.
getTemplatesDirAbsPath :: IO Path.AbsDir
getTemplatesDirAbsPath = do
absDataDirPath <- Paths_stic.getDataDir >>= Path.parseAbsDir
absDataDirPath <- Paths_waspc.getDataDir >>= Path.parseAbsDir
return $ absDataDirPath </> templatesDirPathInDataDir
-- | Takes template file path relative to templates root directory and returns
-- its absolute path.
getTemplateFileAbsPath :: Path.RelFile -> IO Path.AbsFile
getTemplateFileAbsPath tmplFilePathInTemplatesDir =
Paths_stic.getDataFileName (Path.toFilePath tmplFilePathInDataDir) >>= Path.parseAbsFile
Paths_waspc.getDataFileName (Path.toFilePath tmplFilePathInDataDir) >>= Path.parseAbsFile
where
tmplFilePathInDataDir = templatesDirPathInDataDir </> tmplFilePathInTemplatesDir