Skip to content

Commit

Permalink
feat(projects): Samples and starters (#33)
Browse files Browse the repository at this point in the history
* feat(projects): Samples and starters

- Add create, add, world, info CLI commands

* feat(projects): Improved drag and drop for files

* fix(editor): Update API references

* fix(gallery): Improve sample relevance, add robustness

- Remove unneeded code

* fix(various): Test and command improvements

- Remove add for now

* fix(samples): Fix some samples provisioning issues

* fix(editor): CreationType update fixes

* fix(editor): Small updates to UI

* feat(project): Split out mobs in gallery

* fix(projects): Remove unused items

- Remove directory picker on platforms that don't support it
- Make command versions a recommendation, not an error
  • Loading branch information
mammerla authored Sep 3, 2024
1 parent 7718910 commit 3d0720d
Show file tree
Hide file tree
Showing 127 changed files with 12,726 additions and 2,373 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ Builds the web app for production to the `build` folder. It correctly bundles Re

## Sample Command Lines

Once packaged, you can install the command line locally via `npx mctools-<version>.tgz`. Some sample command lines:
Once packaged, you can install the command line locally via `npm install minecraft-creator-tools-<version>.tgz`. If you'd like to make Minecraft Creator Tools available across your device, you can install it globally via `npm install -g minecraft-creator-tools-<version>.tgz`.

Some sample command lines:

`npx mct`

Expand All @@ -81,6 +83,14 @@ Loads the project folder `d:\mycontent\myprojectfolder`, validates using the 'ad

Loads the project file `d:\mycontent\packages\myaddon.mcaddon`, validates using the 'addon' suite of strict tests and shows validation results on the command line. Also displays verbose logging messages.


### New project creation

`npx mct create`

Asks a series of questions and creates a new project based on those preferences.


## Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
56 changes: 56 additions & 0 deletions app/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,48 @@
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"name": "cli (add)",
"cwd": "${workspaceRoot}/debugoutput/minecraft-gametests/",
"args": ["add", "-i", "../temp/test"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
"preLaunchTask": "gulp: jsncorebuild",
"sourceMaps":true,
"runtimeExecutable": null,
"localRoot": "${workspaceRoot}/src",
"runtimeArgs": ["--nolazy"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"name": "cli (info)",
"cwd": "${workspaceRoot}/debugoutput/gtbasicworld/",
"args": ["info"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
"preLaunchTask": "gulp: jsncorebuild",
"sourceMaps": true,
"runtimeExecutable": null,
"localRoot": "${workspaceRoot}/src",
"runtimeArgs": ["--nolazy"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"name": "cli (world)",
"cwd": "${workspaceRoot}/debugoutput/",
"args": ["world", "set", "-betaapis", "-o", "./worldtest/"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
"preLaunchTask": "gulp: jsncorebuild",
"sourceMaps": true,
"runtimeExecutable": null,
"localRoot": "${workspaceRoot}/src",
"runtimeArgs": ["--nolazy"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"name": "cli (val content1)",
"cwd": "${workspaceRoot}/../samplecontent/addon/build/content1/",
Expand Down Expand Up @@ -78,6 +120,20 @@
"runtimeArgs": ["--nolazy", "--max-old-space-size=32768"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"name": "cli (create)",
"cwd": "${workspaceRoot}/",
"args": ["create", "-o", "debugoutput", "custom_name", "addonStarter", "custom_creator", "florid description"],
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/src/cli/index.ts",
"preLaunchTask": "gulp: jsncorebuild",
"sourceMaps":true,
"runtimeExecutable": null,
"localRoot": "${workspaceRoot}/src",
"runtimeArgs": ["--nolazy"],
"outFiles": ["${workspaceFolder}/toolbuild/jsn/**/*.js"]
},
{
"type": "node",
"request": "launch",
Expand Down
10 changes: 2 additions & 8 deletions app/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,10 @@ function runUpdateVersions() {
return gulp
.src(versionSource, { base: "" })
.pipe(
updateVersions([
"./package.json",
"./package-lock.json",
"./jsnode/package.json",
"./src/core/Constants.ts",
])
updateVersions(["./package.json", "./package-lock.json", "./jsnode/package.json", "./src/core/Constants.ts"])
);
}


function runDownloadSamples() {
return gulp.src(mcreslistsamplesigs, { base: "" }).pipe(downloadResources("public/res/samples/microsoft/"));
}
Expand All @@ -277,7 +271,7 @@ function runDownloadVanillaResources() {
gulp.task("jsnwebbuild", gulp.series("clean-jsnwebbuild", compileJsnWebBuild, "postclean-jsnwebbuild"));

gulp.task("clean-webbuild", function () {
return del(["web"]);
return del(["out/web"]);
});

gulp.task("clean-res", function () {
Expand Down
172 changes: 85 additions & 87 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3d0720d

Please sign in to comment.