psdk-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0e1c68b5b558c65d5b9befc52c67bb126daa9375154ee17a0c51ba7f849061c3
4
+ data.tar.gz: 915b045d732b8eb562aee73ed431a0fb3f5ee195a4676876ca68d9140ddb726e
5
+ SHA512:
6
+ metadata.gz: a70f48b02327d705364a89464f49666969707cd62c90aa2ee2f87997443433b95f06d0274c060fa8544646f2e9f1dec02c87ec3e2460183503290c1a75fee61a
7
+ data.tar.gz: b7501d4824fde0501759909b134bb9731f29705b57d9c3319dbf2f8d74674009bb60801534bf219415b658f65acdd22546f144bf9cbe6bc1f01b590e5d2663a3
@@ -0,0 +1,184 @@
1
+ # PSDK CLI
2
+
3
+ ## Goal
4
+
5
+ Utility cli that would help people perform several actions related to PSDK.
6
+
7
+ List of actions:
8
+
9
+ - Plugin development
10
+ - Documentation generation
11
+ - SDK release
12
+ - Static binary compilation
13
+ - Project compilation optimization
14
+ - Project data management
15
+ - Project PSDK version management
16
+ - CLI PSDK version management
17
+ - CLI Update
18
+
19
+ ## Dependencies
20
+
21
+ In order to be able to work in a stand alone mode, the PSDK CLI will use its own PSDK version that will be located in ~/.psdk-cli. It'll do the same for most of the repository it will depend on.
22
+
23
+ List of dependencies:
24
+
25
+ - pokemonsdk (mandatory)
26
+ - [GameDataPacks](https://github.com/PokemonWorkshop/GameDataPacks) for data management
27
+ - [PSDKTechnicalDemo](https://github.com/PokemonWorkshop/PSDKTechnicalDemo) for data management
28
+ - [unparse](https://github.com/NuriYuri/unparse) for compilation matters
29
+ - [static-ruby-experiment](https://github.com/NuriYuri/static-ruby-experiment) for static binary compilation
30
+
31
+ PSDK CLI will also depend on known tools:
32
+
33
+ - git
34
+ - ruby
35
+ - yard-doc
36
+ - gcc
37
+ - cmake
38
+
39
+ ## Action details
40
+
41
+ ### Plugin development
42
+
43
+ The plugin development action is triggered with `psdk-plugin` and exposes the same arguments as the psdk plugin manager.
44
+
45
+ Note: If the command is used outside of a PSDK project, the psdk-cli will use it's own PSDK version and the additional resources will be assumed as in the plugin's folder instead of project's folder.
46
+
47
+ ### Documentation generation
48
+
49
+ The documentation generation action is triggered with `psdk-doc`.
50
+
51
+ This action does the following:
52
+
53
+ 1. Checkout psdk to the specified commit (or last development commit if not specified)
54
+ 2. Merge the PSDK scripts by category
55
+ 3. Eliminate module/class redefinition for each category
56
+ 4. Remove function bodies
57
+ 5. Run the yard-doc command
58
+ 6. If credentials provided: publish the doc to the FTP
59
+
60
+ Some steps can be skipped:
61
+
62
+ - `psdk-doc skip_script`: skips the step 2 to 4.
63
+ - `psdk-doc skip_yard`: skips the yard step
64
+ - `psdk-doc skip_ftp`: skips the ftp step
65
+
66
+ Skips can be provided together, eg. `psdk-doc skip_script skip_yard` => uploads the existing docs
67
+
68
+ To specify the psdk commit to checkout, use the `--commit=` argument, eg. `psdk-doc --commit=deadcafe skip_ftp`
69
+
70
+ ### SDK Release
71
+
72
+ The SDK Release action is triggered with `psdk-release`.
73
+
74
+ This action does the following:
75
+
76
+ 1. Checkout psdk to the last development commit.
77
+ 2. Merge the PSDK scripts by category
78
+ 3. Eliminate module/class redefinition for each category
79
+ 4. Generate the mega-deflate file
80
+ 5. Bump the PSDK version (patch if not specified)
81
+ 6. If credentials provided: publish the mega-deflate and release info to the FTP
82
+ 7. Create a new version commit on development
83
+ 8. Create a new release commit on release
84
+
85
+ Some steps can be skipped:
86
+
87
+ - `psdk-release skip_script`: skips step 2 to 4
88
+ - `psdk-release skip_bump`: skips the bump version step
89
+ - `psdk-release skip_commits`: skips the commit steps
90
+ - `psdk-release skip_ftp`: skip the ftp step
91
+
92
+ To specify how to bump the version you can use the `--bump=` argument with:
93
+
94
+ - `major` to bump the major version (.1.25.3 -> .2.0.0)
95
+ - `minor` to bump the minor version (.1.26.47 -> .1.27.0)
96
+ - `patch` to bump the patch version (.1.26.47 -> .1.26.48)
97
+
98
+ Note: PSDK uses a 32 bit unsigned integer to represent version, bumping above 255 leads to unexpected behavior.
99
+
100
+ ### Static binary compilation
101
+
102
+ The Static binary compilation action allows the maker to generate a static binary with additional functionality for its project. This is all based on the [static-ruby-experiment](https://github.com/NuriYuri/static-ruby-experiment). This action is triggered with `psdk-static` and is platform dependent.
103
+
104
+ Note: as of now, this action will not be developed.
105
+
106
+ ### Project compilation optimization
107
+
108
+ The project compilation optimization is triggered with `psdk-compile` and allow the maker to perform additional compilation optimizations using plugins that would be in `<project_dir>/plugins` and that would be loaded via arguments.
109
+
110
+ Eg. `psdk-compile --with=custom_yuki_vd_encryption --with=custom_image_format` will start the project compilation after loading `<project_dir>/plugins/custom_yuki_vd_encryption.rb` and `<project_dir>/plugins/custom_image_format`
111
+
112
+ This command accepts all the skips from the og project compilation command.
113
+
114
+ ### Project data management
115
+
116
+ The Project data management action is triggered with `psdk-data`. It has several sub actions.
117
+
118
+ #### Data pack installation
119
+
120
+ The data pack installation is triggered with `psdk-data pack add <generation>` where generation is the generation to install; demo will use the [PSDKTechnicalDemo](https://github.com/PokemonWorkshop/PSDKTechnicalDemo) as source of data.
121
+
122
+ You can also update the data pack installation with `psdk-data pack update <generation>`.
123
+
124
+ #### Git Synchronization
125
+
126
+ To ensure the data is correctly synchronized with data pull via git, you can use `psdk-data sync`. This command will force regenerate the `psdk.dat` file.
127
+
128
+ (TODO: think how we can deal with tiled map synchronization between people)
129
+
130
+ #### Conflict management
131
+
132
+ When using data pack or demo pack, you might have conflicts here's all the arguments to deal with conflicts:
133
+
134
+ - `--source-of-truth=<generation>` : specify the source of truth for checking file SHA-1
135
+ - `--source-of-truth-commit=<commit>` : specify the commit to use in order to compare file SHA-1
136
+ - `--remove-extra=<type>` : tell the command to remove extra files of a type (eg. `--remove-extra=dex` will remove all the extra dex)
137
+ - `--overwrite=<type>` : tell the command to overwrite all the files of a type without comparison. If type is all, it'll overwrite all the data.
138
+
139
+ Note: if no conflict management is specified, the command will work in `--overwrite=all` mode.
140
+
141
+ TODO: check all scenarios and redefine conflict management
142
+
143
+ ### Project PSDK version management
144
+
145
+ The Project PSDK version management action is triggered with `psdk-use`.
146
+
147
+ Here's all the variations of `psdk-use`
148
+
149
+ - `psdk-use studio` Use the Pokémon Studio PSDK version
150
+ - `psdk-use studio delete` Use the Pokémon Studio PSDK version and delete recursively the pokemonsdk folder (instead of renaming it .pokemonsdk)
151
+ - `psdk-use version <id>` Use a specific PSDK version
152
+ - `psdk-use commit <id>` Use a specific PSDK commit
153
+ - `psdk-use mr <id>` Use a specific PSDK based on the Merge Request ID or Merge Request URL
154
+ - `psdk-use latest` Use the last PSDK commit from development
155
+
156
+ ### CLI PSDK version management
157
+
158
+ By default the CLI always use the last commit of development for plugin management or project compilation. If you need to use a different commit or PSDK version, you can use `psdk-cli-use` to specify the version to use. It works like `psdk-use` but without the studio version.
159
+
160
+ ### CLI Update
161
+
162
+ To update the CLI, you can run the command `psdk-cli update`, it will fetch and install the updates for the psdk cli tool.
163
+
164
+ ## Q & A
165
+
166
+ > How do we use the PSDK's ruby version with the CLI?
167
+
168
+ The PSDK CLI is stand alone, the only time it'll use the Ruby version from PSDK will be during the project compilation (so LiteRGSS can be used and Ruby scripts can be compiled to target version).
169
+
170
+ > How do we install the CLI?
171
+
172
+ The PSDK CLI will be install using Ruby Gems, this makes the process easier for everyone.
173
+
174
+ > What do we do with PSDK's tools as they may do similar things as PSDK-CLI?
175
+
176
+ Most of the PSDK tools are for in-game debugging but some of them will be split between CLI and Tools. For example, creating a plugin will be in PSDK CLI exclusively, loading all the plugins will be in PSDK tools exclusively.
177
+
178
+ > Shall we use [Thor](https://github.com/rails/thor) to implement PSDK-CLI?
179
+
180
+ Yes, let's go with that.
181
+
182
+ > Will we be forced to use the FTP for the SDK Release action?
183
+
184
+ As soon as all the tools around PSDK are able to fetch PSDK updates from gitlab releases, we can remove the FTP step from SDK Release action. Regarding the docs, we have to keep using FTP to send it the the website.
data/.solargraph.yml ADDED
@@ -0,0 +1,25 @@
1
+ ---
2
+ include:
3
+ - Rakefile
4
+ - Gemfile
5
+ - "*.gemspec"
6
+ - "**/*.rb"
7
+ exclude:
8
+ - spec/**/*
9
+ - test/**/*
10
+ - vendor/**/*
11
+ - ".bundle/**/*"
12
+ require: []
13
+ domains: []
14
+ reporters:
15
+ - rubocop
16
+ - require_not_found
17
+ formatter:
18
+ rubocop:
19
+ cops: safe
20
+ except: []
21
+ only: []
22
+ extra_args: []
23
+ require_paths: []
24
+ plugins: []
25
+ max_files: 5000
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2025-11-12
4
+
5
+ - Initial release
data/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Pokémon Workshop
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # psdk-cli
2
+
3
+ A CLI that helps people perform actions with PSDK
4
+
5
+ ## Installation
6
+
7
+ To be able to use the psdk-cli you must install Ruby and Git and then run the following command:
8
+
9
+ ```bash
10
+ gem install psdk-cli
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ In a terminal you can run `psdk-cli` it will list all the available commands.
16
+
17
+ Please note that sub command (such as `psdk-cli plugin`) can be executed using the shortcut `psdk-<sub>` (eg. `psdk-plugin` for `psdk-cli plugin`).
18
+
19
+ ## Development
20
+
21
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
22
+
23
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
24
+
25
+ ## Contributing
26
+
27
+ Bug reports and pull requests are welcome on GitHub at https://github.com/PokemonWorkshop/psdk-cli.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require 'rubocop/rake_task'
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/exe/psdk-cli ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'psdk/cli'
6
+
7
+ Psdk::Cli::Main.start
data/exe/psdk-plugin ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'psdk/cli/plugin'
6
+
7
+ Psdk::Cli::Plugin.start
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+
5
+ module Psdk
6
+ module Cli
7
+ # Class responsible of handling the psdk-plugin cli commands
8
+ class Plugin < Thor
9
+ package_name 'psdk-plugin'
10
+
11
+ # TODO: remove this and actually implement the plugin cli
12
+ desc 'fake ARG1', 'run a fake command with ARG1 as first argument'
13
+ def fake(arg1)
14
+ puts "Fake called with ARG1=#{arg1}"
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Psdk
4
+ module Cli
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
data/lib/psdk/cli.rb ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+ require_relative 'cli/version'
5
+ require_relative 'cli/plugin'
6
+
7
+ module Psdk
8
+ module Cli
9
+ # Main PSDK CLI class
10
+ #
11
+ # Must be used for the general psdk-cli command
12
+ class Main < Thor
13
+ package_name 'psdk-cli'
14
+
15
+ desc('version', 'show the psdk-cli version')
16
+ def version
17
+ puts "psdk-cli v#{VERSION}"
18
+ end
19
+
20
+ desc 'plugin', 'manage PSDK plugins'
21
+ subcommand 'plugin', Plugin
22
+ end
23
+ end
24
+ end
data/sig/psdk/cli.rbs ADDED
@@ -0,0 +1,6 @@
1
+ module Psdk
2
+ module Cli
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: psdk-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pokémon Workshop
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ email:
13
+ - hostmaster@pokemonworkshop.com
14
+ executables:
15
+ - psdk-cli
16
+ - psdk-plugin
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".idea/# PSDK CLI.md"
21
+ - ".solargraph.yml"
22
+ - CHANGELOG.md
23
+ - LICENSE
24
+ - README.md
25
+ - Rakefile
26
+ - exe/psdk-cli
27
+ - exe/psdk-plugin
28
+ - lib/psdk/cli.rb
29
+ - lib/psdk/cli/plugin.rb
30
+ - lib/psdk/cli/version.rb
31
+ - sig/psdk/cli.rbs
32
+ homepage: https://github.com/PokemonWorkshop/psdk-cli
33
+ licenses: []
34
+ metadata:
35
+ homepage_uri: https://github.com/PokemonWorkshop/psdk-cli
36
+ source_code_uri: https://github.com/PokemonWorkshop/psdk-cli
37
+ changelog_uri: https://github.com/PokemonWorkshop/psdk-cli/blob/main/CHANGELOG.md
38
+ rubygems_mfa_required: 'true'
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 3.2.0
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubygems_version: 3.6.9
54
+ specification_version: 4
55
+ summary: Utility cli that would help people perform several actions related to PSDK.
56
+ test_files: []