Skip to content

Releases: vapor/toolbox

Allow dynamic file names in template manifest

20 May 09:30
dbccf23
Compare
Choose a tag to compare
This patch was authored by @s-k and released by @0xTim.

By adding dynamic_name parameters to files or folders in manifest.yml, their names in the created package can depend on variables or the name of the new package.

Example:

- folder: xcschemes
  files:
    - file: Server.xcscheme
      dynamic_name: "{{name}}.xcscheme"

In this case, the original name of the file in the template repository is 'Server.xscheme'. In the created package, its name will be '[Package Name].xscheme'. The dynamic file name may also depend on variables defined in manifest.yml.

Allow not adding a Git repo when creating a new project

19 May 14:29
7c0b3b3
Compare
Choose a tag to compare
This patch was authored by @s-k and released by @0xTim.

This change allows users to create a project without automatically creating a Git repository in the new folder. This can be helpful when creating the project inside another project already using Git.

To use the new feature, add --no-git to the vapor new command.

Remove backslash from Procfile created by `vapor heroku init`

09 Mar 14:16
1639da6
Compare
Choose a tag to compare
This patch was authored by @e28eta and released by @0xTim.

Running vapor heroku init, and choosing to use the buildpack (vs docker), creates a Procfile with the following:

web: Run serve --env production --hostname 0.0.0.0 --port \$PORT

This works okay when deployed to heroku (note the --port \4386):

2022-03-08T07:07:33.775125+00:00 heroku[web.1]: Starting process with command `Run serve --env production --hostname 0.0.0.0 --port \4386`
2022-03-08T07:07:35.820116+00:00 app[web.1]: [ NOTICE ] Server starting on http://0.0.0.0:4386

However, it doesn't work when using the heroku local command:

$ heroku local
10:54:26 PM web.1 |  [1/1] Planning build
10:54:31 PM web.1 |  [0/0] Build complete!
10:54:31 PM web.1 |  [ WARNING ] Could not convert option for `port` to Int
10:54:31 PM web.1 |  Swift/ErrorType.swift:200: Fatal error: Error raised at top level: .invalidOptionType("port", type: Int)
[DONE] Killing all processes with signal  SIGILL
10:54:31 PM web.1 Exited with exit code SIGILL

This PR removes the backslash. The new Procfile contents are simply:

web: Run serve --env production --hostname 0.0.0.0 --port $PORT

I've verified this works with heroku remote & local.

2022-03-08T07:18:31.543631+00:00 heroku[web.1]: Starting process with command `Run serve --env production --hostname 0.0.0.0 --port 32664`
2022-03-08T07:18:32.671361+00:00 app[web.1]: [ NOTICE ] Server starting on http://0.0.0.0:32664
2022-03-08T07:18:33.310530+00:00 heroku[web.1]: State changed from starting to up
2022-03-08T07:19:57.000000+00:00 app[api]: Build succeeded

18.3.5

01 Mar 11:17
1b26e51
Compare
Choose a tag to compare

What's Changed

  • Changing info screen to instruct user to open Package.swift by @dannflor in #372
  • Removed deprecated --enable-test-discovery flag from build and run commands by @Ventus218 in #373

New Contributors

Full Changelog: 18.3.4...18.3.5

Improve the messaging for the version command

28 Feb 13:37
8302c18
Compare
Choose a tag to compare
This patch was authored by @BennyDeBock and released by @0xTim.

When using vapor --version, the output in a non vapor directory would be

# note: no Package.resolved was found.
# framework: not found
# toolbox: 18.3.3

This pr changes those framework and note texts to:

# note: no Package.resolved file was found. Possibly not currently in a Swift package directory
# framework: vapor framework for this project: no Package.resolved file found. Please ensure you are in a Vapor project directory. If you are, ensure you have built the project with 'swift build'. You can create a new project with 'vapor new MyProject'

in projects that have no Package.resolved.
in projects that do have a Package.resolved but that aren't Vapor projects it changes the framework text to:

# framework: vapor framework for this project: this Swift project does not depend on Vapor. Please ensure you are in a Vapor project directory. If you are, ensure you have built the project with 'swift build'. You can create a new project with 'vapor new MyProject'

closes #345

Add Kebab case support to TemplateScaffolder context

06 Apr 15:52
4a2b9ed
Compare
Choose a tag to compare
This patch was authored by @marzvrover and released by @0xTim.

This adds support for kebab_names in templates to avoid issues where certain contexts require lowercase variables (such as Docker compose).

Fixes #334

Fix default branch name

12 Mar 22:32
1d858e3
Compare
Choose a tag to compare

Renames the branch used from master to main #356

Don't try to build the app when using only the `-h` or `--help` flags on the `run` command

08 Mar 11:23
6518e9d
Compare
Choose a tag to compare
This patch was authored by @tkrajacic and released by @0xTim.

Also add an explanatory line to the output with the equivalent swift package manager command.

image

Fixes #341

Add better support for --feature and --no-feature

17 Nov 12:56
50832a0
Compare
Choose a tag to compare

In the past, "positive" options passed to vapor new, such as --fluent, would only work if the type of the variable in the manifest.yml corresponding to the option was nested. This update adds the following capabilities:

  • Variables of type bool will now recognize positive option flags as well, and will no longer throw an error.
  • Both bool and nested variables now also recognize an inverted "negative" option flag, e.g. --no-fluent. A negative option flag has the same effect on a single variable that --no has on all of them.
  • bool variables are now correctly handled by the if: condition in a manifest.yml, rather than acting as if they're always true.

Not all of these changes are immediately visible in the toolbox by itself, but when combined with updates to vapor/template, it is now possible to request relatively complex configurations for a new Vapor project with no user interaction required at all. Some examples:

$ vapor new test_simple --no-fluent --no-leaf
Cloning template...
name: test_simple
fluent: No
leaf: No
Generating project files

$ vapor new test_with_db --fluent.db postgres --no-leaf
Cloning template...
name: test_with_db
fluent: Yes
db: Postgres
leaf: No
Generating project files

$ vapor new test_with_leaf --no-fluent --leaf
Cloning template...
name: test_with_leaf
fluent: No
leaf: Yes
Generating project files

$ vapor new test_with_everything --fluent.db sqlite --leaf
Cloning template...
name: test_with_everything
fluent: Yes
db: SQLite
leaf: Yes
Generating project files

Add Makefile + optional static version

20 Aug 23:08
7edba49
Compare
Choose a tag to compare
This patch was authored and released by @tanner0101.

Adds a Makefile with build, install, and uninstall commands (#340, #339, fixes #338)

Using make build will attempt to infer the current toolbox version number and compile it into the executable for lookup via --version.

Sample output:

$ vapor --version
framework: 4.27.1
toolbox: master (90e3d12)