Drop the npm version requirement (#1002)

This commit is contained in:
Mihovil Ilakovac 2023-02-13 16:10:40 +01:00 committed by GitHub
parent 0964b883ef
commit 0fce66f21e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 56 additions and 64 deletions

View File

@ -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
@ -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
@ -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

View File

@ -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
@ -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",
@ -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

View File

@ -16,8 +16,7 @@
},
"engineStrict": true,
"engines": {
"node": "{=& nodeVersionRange =}",
"npm": "{=& npmVersionRange =}"
"node": "{=& nodeVersionRange =}"
},
"browserslist": {
"production": [

View File

@ -27,8 +27,7 @@
{=/ overrides =}
},
"engines": {
"node": "{=& nodeVersionRange =}",
"npm": "{=& npmVersionRange =}"
"node": "{=& nodeVersionRange =}"
},
{=& depsChunk =},
{=& devDepsChunk =}

View File

@ -53,7 +53,7 @@
"file",
"server/package.json"
],
"a25c784008e936018cc8f5fe0a35fdd6dfc86d7762fcad40bed04e6af294b87f"
"944ae7609fb9b3ff6f84ea9212e2f82b4fe70f716f31685fee9cc3cf232f67da"
],
[
[
@ -200,7 +200,7 @@
"file",
"web-app/package.json"
],
"68c241389188ef0e6ec2397c89914d62e5a8f458543d08bfefeff49655e87c43"
"89690c80f0daed510b6d561345f3035d2b9f078188f9b875c3e6b88bdd6807d3"
],
[
[

View File

@ -23,8 +23,7 @@
},
"engineStrict": true,
"engines": {
"node": "^18.12.0",
"npm": "^8.19.2"
"node": "^18.12.0"
},
"name": "server",
"nodemonConfig": {

View File

@ -28,8 +28,7 @@
},
"engineStrict": true,
"engines": {
"node": "^18.12.0",
"npm": "^8.19.2"
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "react-app"

View File

@ -1,7 +1,7 @@
app waspBuild {
db: { system: PostgreSQL },
wasp: {
version: "^0.8.0"
version: "^0.8.1"
},
title: "waspBuild"
}

View File

@ -53,7 +53,7 @@
"file",
"server/package.json"
],
"a25c784008e936018cc8f5fe0a35fdd6dfc86d7762fcad40bed04e6af294b87f"
"944ae7609fb9b3ff6f84ea9212e2f82b4fe70f716f31685fee9cc3cf232f67da"
],
[
[
@ -200,7 +200,7 @@
"file",
"web-app/package.json"
],
"56ead359017cdbb350a4e609af2fa75a0411642cfb1734a6e8d6e53991bd54b3"
"05fab99540aa45be16b9e18807608563af2015fa3d65e40ffe43f1d71721a004"
],
[
[

View File

@ -23,8 +23,7 @@
},
"engineStrict": true,
"engines": {
"node": "^18.12.0",
"npm": "^8.19.2"
"node": "^18.12.0"
},
"name": "server",
"nodemonConfig": {

View File

@ -28,8 +28,7 @@
},
"engineStrict": true,
"engines": {
"node": "^18.12.0",
"npm": "^8.19.2"
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "react-app"

View File

@ -1,6 +1,6 @@
app waspCompile {
wasp: {
version: "^0.8.0"
version: "^0.8.1"
},
title: "waspCompile"
}

View File

@ -53,7 +53,7 @@
"file",
"server/package.json"
],
"522cb04643a3062418b54fe7dcf58c4c36b2439ccefe71047bc81fd04c2b4757"
"3e6985d644af90e8a9329298fd3ffd50235526abebe1b63b5bb300b396745ee7"
],
[
[
@ -214,7 +214,7 @@
"file",
"web-app/package.json"
],
"855d82b845cc7b96898013f78c0f5eff9a8b9b03a0c39536be69f9dfbc551da5"
"53dc579c28cab9ae137cb8da8b1b72de185157898cfe062020aaa31868bc9982"
],
[
[

View File

@ -24,8 +24,7 @@
},
"engineStrict": true,
"engines": {
"node": "^18.12.0",
"npm": "^8.19.2"
"node": "^18.12.0"
},
"name": "server",
"nodemonConfig": {

View File

@ -28,8 +28,7 @@
},
"engineStrict": true,
"engines": {
"node": "^18.12.0",
"npm": "^8.19.2"
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "react-app"

View File

@ -1,7 +1,7 @@
app waspJob {
db: { system: PostgreSQL },
wasp: {
version: "^0.8.0"
version: "^0.8.1"
},
title: "waspJob"
}

View File

@ -53,7 +53,7 @@
"file",
"server/package.json"
],
"c9ace6d614519e0534c06f2c84af1cf7dfbff5361f2aad5010b8eaf0a84c965c"
"d5df9887d57283d8c3dfff1613affa4c06f26f2c9ab60feeef0d79773bb519e4"
],
[
[
@ -200,7 +200,7 @@
"file",
"web-app/package.json"
],
"15dac783a05b96e341b491a40368f4cfed4784967ca6a7980583b33d080986fa"
"fd6941246dd2e2ea8bb82fcb9a4f9b1e4eda69fff0b62f045bf27376477bc647"
],
[
[

View File

@ -23,8 +23,7 @@
},
"engineStrict": true,
"engines": {
"node": "^18.12.0",
"npm": "^8.19.2"
"node": "^18.12.0"
},
"name": "server",
"nodemonConfig": {

View File

@ -28,8 +28,7 @@
},
"engineStrict": true,
"engines": {
"node": "^18.12.0",
"npm": "^8.19.2"
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "react-app"

View File

@ -1,6 +1,6 @@
app waspMigrate {
wasp: {
version: "^0.8.0"
version: "^0.8.1"
},
title: "waspMigrate"
}

View File

@ -1,6 +1,6 @@
app waspNew {
wasp: {
version: "^0.8.0"
version: "^0.8.1"
},
title: "waspNew"
}

View File

@ -2,7 +2,6 @@ module Wasp.Generator.Common
( ProjectRootDir,
latestMajorNodeVersion,
nodeVersionRange,
npmVersionRange,
prismaVersion,
)
where
@ -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

View File

@ -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)
@ -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"

View File

@ -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)
@ -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
]
)

View File

@ -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

View File

@ -14,14 +14,12 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
## 1. Requirements
You need to have `node` (and `npm`) installed on your machine and available in `PATH`.
- `node`: ^18.12.0
- `npm`: ^8.19.2
You need to have `node` (and `npm`) installed on your machine and available in `PATH`. We rely on the latest Node.js LTS version, and currently that's version `v18.14.0`.
You can check `node` and `npm` versions by running:
You can check the `node` version by running:
```shell-session
node -v
npm -v
$ node -v
v18.14.0
```
We recommend using [nvm](https://github.com/nvm-sh/nvm) for managing your Node.js installation version(s).
@ -111,7 +109,7 @@ If the installer is not working for you or your OS is not supported, you can try
To install from source, you need to clone the [wasp repo](https://github.com/wasp-lang/wasp), install [cabal](https://cabal.readthedocs.io/en/stable/getting-started.html) on your machine and then run `cabal install` from the `waspc/` dir.
If you have never built Wasp before, this might take some time due to `cabal` downloading dependencies for the first time.
If you have never built Wasp before, this might take some time due to `cabal` downloading dependencies for the first time.
Check [waspc/](https://github.com/wasp-lang/wasp/tree/main/waspc) for more details on building.
@ -132,7 +130,7 @@ That's it :tada:! You have successfully created and served a new web app at <htt
:::info For Visual Studio Code
If you are using VSCode, install our [Wasp language extension](https://marketplace.visualstudio.com/items?itemName=wasp-lang.wasp).
If you are using VSCode, install our [Wasp language extension](https://marketplace.visualstudio.com/items?itemName=wasp-lang.wasp).
The extension brings the following functionality:
@ -149,6 +147,6 @@ The extension brings the following functionality:
**Check out the 🤓 [Todo App tutorial](tutorials/todo-app.md) 🤓 , which will take you through all the core features of Wasp!**
Also, we would be excited to have you **join our community on [Discord](https://discord.gg/rzdnErX)!** Any feedback or questions you have, we are there for you.
Also, we would be excited to have you **join our community on [Discord](https://discord.gg/rzdnErX)!** Any feedback or questions you have, we are there for you.
Finally, to stay up to date with updates in Wasp, you can **subscribe to our newsletter: https://wasp-lang.dev/#signup ** . We usually send 1 per month, and Matija does his best to unleash his creativity to make them engaging and fun to read :D!