railpack

Configure and troubleshoot Railpack builds, with emphasis on RAILPACK_* environment variables, railpack.json overlays, build-plan inspection, local CLI installation and usage, and local BuildKit containers. Use for Railpack provider configuration, custom install/build/start commands, Mise or Apt packages, build or runtime variables and secrets, generated-plan debugging, BUILDKIT_HOST errors, or running Railpack from a release or source checkout.

Install
npx skills add 'https://github.com/railwayapp/railpack/tree/main/.'
Incomplete bundle · no download
main · 21a254fScanned 2026-09-17

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗

core/app/app_test.go

core/app/app_test.goBrowse 1970 files
View on GitHub
← Back to SKILL.md
package app import (	"path/filepath"	"regexp"	"testing" 	"github.com/stretchr/testify/require") // TestPackageJSON represents the package.json structure for testingtype PackageJSON struct {	Name    string `json:"name"`	Engines struct {		Node string `json:"node"`	} `json:"engines"`	Scripts struct {		PostStart string		PreStart  string		Start     string	}	Dependencies    map[string]string `json:"dependencies"`	DevDependencies map[string]string `json:"devDependencies"` 	AllScripts map[string]string `json:"scripts"`} func TestApp(t *testing.T) {	app, err := NewApp("../../examples/node-bun")	require.NoError(t, err) 	content, err := app.ReadFile("package.json")	require.NoError(t, err)	require.Contains(t, content, "node-bun") 	var packageJSON PackageJSON	err = app.ReadJSON("package.json", &packageJSON)	require.NoError(t, err)	require.Equal(t, packageJSON.Name, "node-bun") 	files, err := app.FindFiles("*.ts")	require.NoError(t, err)	require.Equal(t, len(files), 1)	require.Equal(t, files[0], "index.ts")} func TestAppAbsolutePath(t *testing.T) {	relPath := "../../examples/node-bun"	absPath, err := filepath.Abs(relPath)	require.NoError(t, err) 	app, err := NewApp(absPath)	require.NoError(t, err) 	require.Equal(t, app.Source, absPath)} func TestAppReadJsonWithComments(t *testing.T) {	app, err := NewApp("../../examples/config-file")	require.NoError(t, err) 	var config map[string]any	err = app.ReadJSON("hello.jsonc", &config)	require.NoError(t, err)	require.Equal(t, config["hello"], "world")} func TestFindFilesWithContent(t *testing.T) {	app, err := NewApp("../../examples/node-bun")	require.NoError(t, err) 	// Test finding files containing "process.stdout.write"	regex := regexp.MustCompile(`process\.stdout\.write`)	matches := app.FindFilesWithContent("*.ts", regex)	require.Equal(t, len(matches), 1)	require.Equal(t, matches[0], "index.ts") 	// Test finding files with non-existent pattern	regex = regexp.MustCompile(`nonexistent`)	matches = app.FindFilesWithContent("*.ts", regex)	require.Empty(t, matches) 	// Test with invalid glob pattern	regex = regexp.MustCompile(`test`)	matches = app.FindFilesWithContent("[invalid", regex)	require.Empty(t, matches)}