@bf6mods/cli 1.0.0 → 1.0.2

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.
Files changed (26) hide show
  1. package/README.md +72 -0
  2. package/dist/cli/index.js +541 -76
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/resources/prepare/bf6.d.ts +2 -0
  5. package/dist/resources/prepare/tsconfig.json +14 -15
  6. package/dist/resources/prepare/types/config.ts +139 -4
  7. package/dist/resources/templates/All/package.json +1 -1
  8. package/dist/resources/templates/Basic/bf6.config.ts +5 -1
  9. package/package.json +48 -41
  10. package/dist/resources/templates/AcePursuit/src/index.ts +0 -3421
  11. package/dist/resources/templates/AcePursuit/src/levels.tscn +0 -6922
  12. package/dist/resources/templates/AcePursuit/src/strings.json +0 -191
  13. package/dist/resources/templates/All/bf6.config.ts +0 -6
  14. package/dist/resources/templates/BombSquad/src/index.ts +0 -3683
  15. package/dist/resources/templates/BombSquad/src/levels.tscn +0 -3212
  16. package/dist/resources/templates/BombSquad/src/strings.json +0 -123
  17. package/dist/resources/templates/Exfil/src/index.ts +0 -2393
  18. package/dist/resources/templates/Exfil/src/levels.tscn +0 -5600
  19. package/dist/resources/templates/Exfil/src/strings.json +0 -185
  20. package/dist/resources/templates/Vertigo/src/index.ts +0 -1948
  21. package/dist/resources/templates/Vertigo/src/levels.tscn +0 -6387
  22. package/dist/resources/templates/Vertigo/src/strings.json +0 -308
  23. /package/dist/resources/templates/{AcePursuit/src/config.json → AcePursuit.json} +0 -0
  24. /package/dist/resources/templates/{BombSquad/src/config.json → BombSquad.json} +0 -0
  25. /package/dist/resources/templates/{Exfil/src/config.json → Exfil.json} +0 -0
  26. /package/dist/resources/templates/{Vertigo/src/config.json → Vertigo.json} +0 -0
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # bf6mods
2
+
3
+ Create Battlefield 6 mods quickly with a vite like development experience.
4
+
5
+ ## Getting Started
6
+
7
+ To create a new project, simply run the following command and answer the questions
8
+
9
+ ```
10
+ npx @bf6mods/cli init
11
+ ```
12
+
13
+ ![Initializing a repo](https://raw.githubusercontent.com/bf6mods/bf6mods/refs/heads/main/media/terminal.gif "Initializing a repo")
14
+
15
+ ## Import from JSON
16
+
17
+ Already have a project? Just export your currently existing project in [portal.battlefield.com](https://portal.battlefield.com), and run...
18
+
19
+ ```
20
+ npx @bf6mods/cli import <input> <output>
21
+ ```
22
+
23
+ ## Deploying Project to Portal
24
+
25
+ Just run `npm run build` in your project dir, open [portal.battlefield.com](https://portal.battlefield.com), click import, and select the `dist/mod.json` file.
26
+
27
+ ## Features
28
+
29
+ - Use multiple different files, instead of just one large TypeScript file!
30
+ - Use a programatic interface for defining your gamemode.
31
+ - Extensive documentation
32
+ - Extended standard library
33
+ - Hot reload
34
+
35
+ ## Structure
36
+
37
+ `bf6mods` is very configurable, but the following structure is what can be expected from any mod.
38
+
39
+ ```
40
+ my-mod/
41
+ ├─ src/
42
+ │ ├─ index.ts
43
+ │ ├─ scenes/
44
+ │ │ └─ MyMap.spatial.json
45
+ ├─ bf6.config.ts
46
+ ├─ package.json
47
+ └─ dist/
48
+ └─ mod.json
49
+ ```
50
+
51
+ ## `bf6.config.ts`
52
+
53
+ Here is a short example of a `bf6.config.ts`.
54
+
55
+ ```ts
56
+ export default defineBf6Config({
57
+ name: "AcePursuit",
58
+ description: "A fast-paced race mod",
59
+ outDir: "dist",
60
+ entrypoint: "src/index.ts",
61
+ scenes: [[MapId.LiberationPeak, "src/scenes/AcePursuit.spatial.json"]],
62
+ game: {
63
+ mutators: {
64
+ // ...
65
+ },
66
+ },
67
+ });
68
+ ````
69
+
70
+ ## @bf6mods/sdk
71
+
72
+ This is a seperate library that exports the `PortalSdk`'s `mod` and `modlib`. Additionally it exports some stdlib helper functions and classes to help accelerate development.