diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bedcfbb..107bf0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: - 'test/**/*.purs' - 'test/**/*.js' - '*.json' - - '*.dhall' + - 'spago.yaml' - '.github/workflows/ci.yml' pull_request: branches: [master] @@ -23,7 +23,7 @@ on: - 'test/**/*.purs' - 'test/**/*.js' - '*.json' - - '*.dhall' + - 'spago.yaml' - '.github/workflows/ci.yml' jobs: @@ -35,16 +35,21 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 22 + - name: Set up a PureScript toolchain uses: purescript-contrib/setup-purescript@main with: purescript: "unstable" + spago: "1.0.5" purs-tidy: "latest" - name: Cache PureScript dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: - key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }} + key: ${{ runner.os }}-spago-${{ hashFiles('spago.yaml') }} path: | .spago output @@ -53,19 +58,13 @@ jobs: run: purs-tidy check examples src test - name: Install PureScript dependencies - run: spago install + run: spago fetch - name: Build source - run: spago build --no-install --purs-args '--censor-lib --strict' + run: spago build --strict - name: Run tests - run: spago -x test.dhall test + run: spago test - name: Build examples - run: spago -x example.dhall build - - - name: Verify Bower & Pulp - run: | - npm install bower pulp@16.0.0-0 - npx bower install - npx pulp build -- --censor-lib --strict + run: spago build --purs-args 'examples/**/*.purs' diff --git a/.gitignore b/.gitignore index 44852cc..f52049c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ /.purs* /.psa* /.spago +/.spec-results *.swp +/spago.lock diff --git a/README.md b/README.md index 8835709..644ef1f 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,8 @@ To run the [examples](./examples), clone the repository and run one of the follo [spago](https://github.com/spacchetti/spago): ``` -spago run -p example/.purs -m Example. +spago build --purs-args 'examples/**/*.purs' +node --input-type=module -e "import { main } from './output/Example./index.js'; main();" ``` ### Other ```dotenv``` implementations diff --git a/bower.json b/bower.json deleted file mode 100644 index c15534b..0000000 --- a/bower.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "purescript-dotenv", - "license": ["MIT"], - "repository": { - "type": "git", - "url": "https://github.com/nsaunders/purescript-dotenv.git" - }, - "ignore": ["**/.*", "node_modules", "bower_components", "output"], - "dependencies": { - "purescript-aff": "^v7.1.0", - "purescript-arrays": "^v7.2.1", - "purescript-control": "^v6.0.0", - "purescript-effect": "^v4.0.0", - "purescript-either": "^v6.1.0", - "purescript-exceptions": "^v6.0.0", - "purescript-foldable-traversable": "^v6.0.0", - "purescript-lists": "^v7.0.0", - "purescript-maybe": "^v6.0.0", - "purescript-node-buffer": "^v9.0.0", - "purescript-node-child-process": "^v11.0.0", - "purescript-node-event-emitter": "https://github.com/purescript-node/purescript-node-event-emitter.git#v3.0.0", - "purescript-node-fs": "^v9.1.0", - "purescript-node-os": "^v5.1.0", - "purescript-node-process": "^v11.2.0", - "purescript-node-streams": "^v9.0.0", - "purescript-parsing": "^v10.2.0", - "purescript-prelude": "^v6.0.1", - "purescript-refs": "^v6.0.0", - "purescript-run": "^v5.0.0", - "purescript-strings": "^v6.0.1", - "purescript-transformers": "^v6.0.0", - "purescript-tuples": "^v7.0.0", - "purescript-typelevel-prelude": "^v7.0.0" - }, - "resolutions": { - "purescript-node-buffer": "^v9.0.0", - "purescript-node-streams": "^v9.0.0", - "purescript-node-child-process": "^v11.0.0", - "purescript-node-fs": "^v9.1.0" - } -} diff --git a/example.dhall b/example.dhall deleted file mode 100644 index 8d09f79..0000000 --- a/example.dhall +++ /dev/null @@ -1,8 +0,0 @@ -let conf = ./spago.dhall - -in conf // { - sources = conf.sources # [ "examples/**/*.purs" ], - dependencies = conf.dependencies # - [ "console" - ] -} diff --git a/packages.dhall b/packages.dhall deleted file mode 100644 index e10c7c4..0000000 --- a/packages.dhall +++ /dev/null @@ -1,10 +0,0 @@ -let upstream = - https://github.com/purescript/package-sets/releases/download/psc-0.15.10-20230802/packages.dhall - sha256:7304ec70da54602347b6dfeaf80121a2c35330e709234f0eb1d66406be6b5b58 - -in upstream - with node-buffer.version = "v9.0.0" - with node-child-process.version = "v11.0.0" - with node-fs.version = "v9.1.0" - with node-process.version = "v11.2.0" - with node-streams.version = "v9.0.0" \ No newline at end of file diff --git a/spago.dhall b/spago.dhall deleted file mode 100644 index ac4019d..0000000 --- a/spago.dhall +++ /dev/null @@ -1,32 +0,0 @@ -{ name = "dotenv" -, license = "MIT" -, repository = "https://github.com/nsaunders/purescript-dotenv.git" -, dependencies = - [ "aff" - , "arrays" - , "control" - , "effect" - , "either" - , "exceptions" - , "foldable-traversable" - , "lists" - , "maybe" - , "node-buffer" - , "node-child-process" - , "node-event-emitter" - , "node-fs" - , "node-os" - , "node-process" - , "node-streams" - , "parsing" - , "prelude" - , "refs" - , "run" - , "strings" - , "transformers" - , "tuples" - , "typelevel-prelude" - ] -, sources = [ "src/**/*.purs" ] -, packages = ./packages.dhall -} diff --git a/spago.yaml b/spago.yaml new file mode 100644 index 0000000..27922f7 --- /dev/null +++ b/spago.yaml @@ -0,0 +1,41 @@ +package: + name: dotenv + publish: + version: 4.0.4 + license: MIT + location: + githubOwner: nsaunders + githubRepo: purescript-dotenv + dependencies: + - aff: ">=7.1.0 <9.0.0" + - arrays: ">=7.2.1 <8.0.0" + - control: ">=6.0.0 <7.0.0" + - effect: ">=4.0.0 <5.0.0" + - either: ">=6.1.0 <7.0.0" + - exceptions: ">=6.0.0 <7.0.0" + - foldable-traversable: ">=6.0.0 <7.0.0" + - lists: ">=7.0.0 <8.0.0" + - maybe: ">=6.0.0 <7.0.0" + - node-buffer: ">=9.0.0 <10.0.0" + - node-child-process: ">=11.0.0 <12.0.0" + - node-event-emitter: ">=3.0.0 <4.0.0" + - node-fs: ">=9.1.0 <10.0.0" + - node-os: ">=5.1.0 <6.0.0" + - node-process: ">=11.2.0 <12.0.0" + - node-streams: ">=9.0.0 <10.0.0" + - parsing: ">=10.2.0 <12.0.0" + - prelude: ">=6.0.1 <7.0.0" + - refs: ">=6.0.0 <7.0.0" + - run: ">=5.0.0 <6.0.0" + - strings: ">=6.0.1 <7.0.0" + - transformers: ">=6.0.0 <7.0.0" + - tuples: ">=7.0.0 <8.0.0" + - typelevel-prelude: ">=7.0.0 <8.0.0" + test: + main: Test.Main + dependencies: + - console: ">=6.0.0 <7.0.0" + - ordered-collections: ">=3.0.0 <4.0.0" + - spec: ">=7.5.4 <9.0.0" + - spec-node: ">=0.0.3 <0.0.4" +workspace: {} diff --git a/test.dhall b/test.dhall deleted file mode 100644 index 4a8699a..0000000 --- a/test.dhall +++ /dev/null @@ -1,6 +0,0 @@ -let conf = ./spago.dhall - -in conf // { - sources = conf.sources # [ "test/**/*.purs" ], - dependencies = conf.dependencies # [ "ordered-collections", "spec" ] -} diff --git a/test/Main.purs b/test/Main.purs index 13ee3ab..4307372 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -3,15 +3,14 @@ module Test.Main where import Prelude import Effect (Effect) -import Effect.Aff (launchAff_) import Test.Apply as Apply import Test.Parser as Parser import Test.Resolve as Resolve import Test.Spec.Reporter.Console (consoleReporter) -import Test.Spec.Runner (runSpec) +import Test.Spec.Runner.Node (runSpecAndExitProcess) main :: Effect Unit -main = launchAff_ $ runSpec [ consoleReporter ] do +main = runSpecAndExitProcess [ consoleReporter ] do Apply.tests Parser.tests Resolve.tests