Skip to content

Support nested config and globIgnorePaths - #526

Open
xethlyx wants to merge 1 commit into
roblox-ts:masterfrom
xethlyx:master
Open

Support nested config and globIgnorePaths#526
xethlyx wants to merge 1 commit into
roblox-ts:masterfrom
xethlyx:master

Conversation

@xethlyx

@xethlyx xethlyx commented Oct 16, 2024

Copy link
Copy Markdown

Supports the following configurations:

{
	"name": "roblox-ts-game",
	"tree": {
		"$path": "another.project.json"
	}
}
{
	"name": "roblox-ts-game",
	"globIgnorePaths": ["out/my-folder"]
	"tree": {
		"$path": "out/"
	}
}

Both features are necessary to implement a folder-per-feature project structure in roblox-ts.

Folder-per-feature example
src/
    my-feature/
        server/
            server-code.ts
        client/
            client-code.ts
        shared/
            shared-code.ts
    my-other-feature/
        server/
            server-code.ts
        client/
            client-code.ts
        shared/
            shared-code.ts
default.project.json
client.project.json
server.project.json
shared.project.json

default.project.json

{
	"name": "roblox-ts-game",
	"globIgnorePaths": [
		"**/package.json",
		"**/tsconfig.json"
	],
	"tree": {
		"$className": "DataModel",
		"ServerScriptService": {
			"$className": "ServerScriptService",
			"TS": {
				"$path": "server.project.json"
			}
		},
		"ReplicatedStorage": {
			"$className": "ReplicatedStorage",
			"rbxts_include": {
				"$path": "include",
				"node_modules": {
					"$className": "Folder",
					"@rbxts": {
						"$path": "node_modules/@rbxts"
					}
				}
			},
			"TS": {
				"$path": "shared.project.json"
			},
		},
		"StarterPlayer": {
			"$className": "StarterPlayer",
			"StarterPlayerScripts": {
				"$className": "StarterPlayerScripts",
				"TS": {
					"$path": "client.project.json"
				}
			}
		},
	}
}

client.project.json

{
	"name": "roblox-ts-game",
	"globIgnorePaths": [
		"**/server",
		"**/shared",
	],
	"tree": {
		"$path": "out"
	}
}

server.project.json

{
	"name": "roblox-ts-game",
	"globIgnorePaths": [
		"**/client",
		"**/shared",
	],
	"tree": {
		"$path": "out"
	}
}

shared.project.json

{
	"name": "roblox-ts-game",
	"globIgnorePaths": [
		"**/client",
		"**/server",
	],
	"tree": {
		"$path": "out"
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant