Skip to content

Commit

Permalink
Drop the npm version requirement (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho authored Feb 13, 2023
1 parent 0964b88 commit 0fce66f
Show file tree
Hide file tree
Showing 26 changed files with 56 additions and 64 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@v3

# TODO: This is a temporary workaround for the failing GHCup installation on Ubuntu 20.04.
# The fix will be propagated in a few days, so we can remove this workaround then.
# https://github.com/actions/runner-images/issues/7061
- name: Workaround runner image issue
if: matrix.os == 'ubuntu-20.04'
run: sudo chown -R $USER /usr/local/.ghcup

- name: Set up Haskell
id: setup-haskell-cabal
uses: haskell/actions/setup@v2
Expand Down Expand Up @@ -100,9 +107,9 @@ jobs:
if: matrix.os == 'ubuntu-20.04'
run: ./run ormolu:check

- name: Build external dependencies
run: cabal build --enable-tests --enable-benchmarks --only-dependencies
- name: Build external dependencies
run: cabal build --enable-tests --enable-benchmarks --only-dependencies

- name: Build wasp code
run: cabal build all

Expand All @@ -123,7 +130,7 @@ jobs:
run: |
OS_NAME=`case "${{ runner.os }}" in Linux) echo "linux";; macOS) echo "macos";; *) exit 1;; esac`
mkdir artifacts
./tools/make_binary_package.sh "artifacts/wasp-$OS_NAME-x86_64.tar.gz"
./tools/make_binary_package.sh "artifacts/wasp-$OS_NAME-x86_64.tar.gz"
- name: Create Github release
uses: ncipollo/release-action@v1
Expand Down
16 changes: 11 additions & 5 deletions waspc/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.8.1

### Remove npm version constraint
We are removing the requirement for a specific npm version to enable following the Node.js LTS releases (Node.js LTS releases sometimes bump the major `npm` version).
We are still requiring Node.js to be version 18, but the `npm` version can be anything and for most of Wasp users it will be the version that comes with Node.js.

## v0.8.0

### BREAKING CHANGES
Expand Down Expand Up @@ -117,9 +123,9 @@ directory `foo`, you should:
// This previously resolved to ext/LoginPage.js
component: import Login from "@ext/LoginPage.js"
}

// ...

query getTasks {
// This previously resolved to ext/queries.js
fn: import { getTasks } from "@ext/queries.js",
Expand All @@ -133,16 +139,16 @@ directory `foo`, you should:
// This resolves to src/client/LoginPage.js
component: import Login from "@client/LoginPage"
}

// ...

query getTasks {
// This resolves to src/server/queries.js
fn: import { getTasks } from "@server/queries.js",
}
```
Do this for all external imports in your `.wasp` file. After you're done, there shouldn't be any occurences of the string `"@ext"`.

That's it! You should now have a fully working Wasp project in the `foo` directory.

### [NEW FEATURE] TypeScript support
Expand Down
3 changes: 1 addition & 2 deletions waspc/data/Generator/templates/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
},
"engineStrict": true,
"engines": {
"node": "{=& nodeVersionRange =}",
"npm": "{=& npmVersionRange =}"
"node": "{=& nodeVersionRange =}"
},
"browserslist": {
"production": [
Expand Down
3 changes: 1 addition & 2 deletions waspc/data/Generator/templates/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
{=/ overrides =}
},
"engines": {
"node": "{=& nodeVersionRange =}",
"npm": "{=& npmVersionRange =}"
"node": "{=& nodeVersionRange =}"
},
{=& depsChunk =},
{=& devDepsChunk =}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions waspc/src/Wasp/Generator/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Wasp.Generator.Common
( ProjectRootDir,
latestMajorNodeVersion,
nodeVersionRange,
npmVersionRange,
prismaVersion,
)
where
Expand All @@ -26,11 +25,5 @@ nodeVersionRange = SV.Range [SV.backwardsCompatibleWith latestNodeLTSVersion]
latestNodeLTSVersion :: SV.Version
latestNodeLTSVersion = SV.Version 18 12 0

-- | Range of npm versions that Wasp and generated projects work correctly with.
npmVersionRange :: SV.Range
npmVersionRange = SV.Range [SV.backwardsCompatibleWith latestLTSVersion]
where
latestLTSVersion = SV.Version 8 19 2 -- Goes with node 18 (but also higher versions too).

prismaVersion :: SV.Version
prismaVersion = SV.Version 4 5 0
3 changes: 1 addition & 2 deletions waspc/src/Wasp/Generator/ServerGenerator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import qualified Wasp.AppSpec.App.Server as AS.App.Server
import qualified Wasp.AppSpec.Entity as AS.Entity
import Wasp.AppSpec.Util (isPgBossJobExecutorUsed)
import Wasp.AppSpec.Valid (getApp, isAuthEnabled)
import Wasp.Generator.Common (latestMajorNodeVersion, nodeVersionRange, npmVersionRange, prismaVersion)
import Wasp.Generator.Common (latestMajorNodeVersion, nodeVersionRange, prismaVersion)
import Wasp.Generator.ExternalCodeGenerator (genExternalCodeDir)
import Wasp.Generator.ExternalCodeGenerator.Common (GeneratedExternalCodeDir)
import Wasp.Generator.FileDraft (FileDraft, createCopyFileDraft)
Expand Down Expand Up @@ -100,7 +100,6 @@ genPackageJson spec waspDependencies = do
[ "depsChunk" .= N.getDependenciesPackageJsonEntry combinedDependencies,
"devDepsChunk" .= N.getDevDependenciesPackageJsonEntry combinedDependencies,
"nodeVersionRange" .= show nodeVersionRange,
"npmVersionRange" .= show npmVersionRange,
"startProductionScript"
.= ( (if hasEntities then "npm run db-migrate-prod && " else "")
++ "NODE_ENV=production npm run build-and-start"
Expand Down
5 changes: 2 additions & 3 deletions waspc/src/Wasp/Generator/WebAppGenerator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import qualified Wasp.AppSpec.App.Auth as AS.App.Auth
import Wasp.AppSpec.App.Client as AS.App.Client
import qualified Wasp.AppSpec.App.Dependency as AS.Dependency
import Wasp.AppSpec.Valid (getApp)
import Wasp.Generator.Common (nodeVersionRange, npmVersionRange)
import Wasp.Generator.Common (nodeVersionRange)
import qualified Wasp.Generator.ConfigFile as G.CF
import Wasp.Generator.ExternalCodeGenerator (genExternalCodeDir)
import Wasp.Generator.ExternalCodeGenerator.Common (GeneratedExternalCodeDir)
Expand Down Expand Up @@ -90,8 +90,7 @@ genPackageJson spec waspDependencies = do
[ "appName" .= (fst (getApp spec) :: String),
"depsChunk" .= N.getDependenciesPackageJsonEntry combinedDependencies,
"devDepsChunk" .= N.getDevDependenciesPackageJsonEntry combinedDependencies,
"nodeVersionRange" .= show nodeVersionRange,
"npmVersionRange" .= show npmVersionRange
"nodeVersionRange" .= show nodeVersionRange
]
)

Expand Down
2 changes: 1 addition & 1 deletion waspc/waspc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cabal-version: 2.4
-- Consider using hpack, or maybe even hpack-dhall.

name: waspc
version: 0.8.0
version: 0.8.1
description: Please see the README on GitHub at <https://github.com/wasp-lang/wasp/waspc#readme>
homepage: https://github.com/wasp-lang/wasp/waspc#readme
bug-reports: https://github.com/wasp-lang/wasp/issues
Expand Down
Loading

0 comments on commit 0fce66f

Please sign in to comment.