rogeriochaves / spades

Start an Elm SPA ready to the real world
302 stars 19 forks source link

Add replacing of projectname #24

Closed brasilikum closed 5 years ago

brasilikum commented 5 years ago

So far it's just replacing projectname quick and dirty. It might be worth it to manually replace projectname with <projectname> or similar so it does not accidentally replaced.

I am not sure why dev: true got removed in my package lock.

brasilikum commented 5 years ago

npm run test succeeds for me, but it should not.

❯ cat temp/myapp/package.json
{
  "name": "myapp",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node server.js",
    "start:prod": "NODE_ENV=production node server.js",
    "build": "mkdir -p build && webpack --mode=production --progress --json > build/stats.json",
    "test": "elm-test"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "elm-test": "^0.19.0-beta9",
    "elm-webpack-loader": "^5.0.0",
    "webpack": "^4.17.0",
    "webpack-cli": "^3.1.0",
    "webpack-dev-middleware": "^3.1.3"
  },
  "dependencies": {
    "ejs": "^2.6.1",
    "express": "^4.16.3",
    "jsdom": "^11.12.0",
    "yargs": "^12.0.1"
  }
}
❯ cat boilerplate/package.json
{
  "name": "projectname",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node server.js",
    "start:prod": "NODE_ENV=production node server.js",
    "build": "mkdir -p build && webpack --mode=production --progress --json > build/stats.json",
    "test": "elm-test"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "elm-test": "^0.19.0-beta9",
    "elm-webpack-loader": "^5.0.0",
    "webpack": "^4.17.0",
    "webpack-cli": "^3.1.0",
    "webpack-dev-middleware": "^3.1.3"
  },
  "dependencies": {
    "ejs": "^2.6.1",
    "express": "^4.16.3",
    "jsdom": "^11.12.0",
    "yargs": "^12.0.1"
  }
}
rogeriochaves commented 5 years ago

Thank you very much for this PR, it is suuper helpful!

Why should the tests fail? The functional test actually don't check for the contents of the files, just the file list.

I'll merge this because it is working well and brings a lot of value already, feel free to send other PRs if you want to change anything

rogeriochaves commented 5 years ago

I've added a simple test for it https://github.com/rogeriochaves/spades/commit/e9f530ec69573dc5970992a2083b419ddc7b032f#diff-e623a7a647966064845a4e5828a58315R51