Skip to content

Decouple save command #9

@vegastyle

Description

@vegastyle

Issue

Currently the save command is a higher-level command that effectively performs the following 4 different operations

  • Copies files to the package from their current location on the workspace (this is the behaviour of the pack command)
  • Updates the index and package yaml files based on the current content of the package (this should be its own command)
  • Syncs files across your workspace to the available platform directories ( this is the behaviour of the install command )
  • Updates the current version (this should be a flag or part of the name that you use in the pack command)

This creates more friction when authoring packages if you don't want all those operations to take place at the same time as you have to manually perform them.

Proposed Solution

Add/change the following low-level commands so that developers can perform the required steps for building a package programmatically

New Command

  • freeze command
    • This command updates the index.yaml file to match the current contents of the package.
    • This would be the same as recursively going through the current directory and performing the add command on every file found.
    • You can also think of this is as how pip freeze works in python in that its main use is to get a list of all the packages currently installed in the python environment except that here it is what is in the package.

Updates to Existing Commands

  • update pack to support setting version

    • Update the pack command so that it either takes a version flag for setting the version of the package or that it prompts you to set a version.
    • If you use it as part of the name, for example my-package@0.1.0, it should then target and pack that version of the package.
  • update save command to only update to dev or add a --dev flag to pack command to keep existing behaviour of the save command for existing users.

Example Usage

# Go to the package that has the package.yml and package.index.yml and wip structure
cd my/package

# Move/create files some

# run freeze to update the index with the new file locations. 
openpackage freeze

 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions