codesandbox / codesandbox/codesandbox-client

Set initial opened file, skip deps install & do not run start scripts as options in sandbox.config.json

Open
#514 30 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🤔 Improvement To Be Fixed
Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

Is there a way that the settings inference could be done without the main field in the package.json. This requirement is blocking me, as specifying a main field will conflict with other tools I use, messing up their configuration (https://github.com/firebase/firebase-tools/issues/662).

With an empty main field my other tooling works as expected, but then I receive this error:

An error occured when fetching the sandbox:
Cannot find the specified entry point: 'src/index.js'. Please specify one in 'package.json#main' or create a file at the specified entry point.

Since other templates require specific dependencies, could it check if those templates apply first, then upon failing, infer that the repo being cloned is just an arbitrary folder structure?

As discussed here https://github.com/CompuIves/codesandbox-client/issues/43 and https://codeburst.io/github-medium-with-embedly-30d9115af585, I don't wish to execute the code from the repo in CodeSandbox, but merely use it as a way to keep blog code snippets in sync across my Medium blog (using gists for snippets in Medium is unmanagable).

Feat requests resolved

  • open specific file (specified in url)
  • do not automatically install package.json deps
  • do not automatically run scripts in package.json
  • do not require main field in package.json as it conflicts with other tools

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sandbox.config.json and package.json behavior described in the issue, then trace the settings-inference entry point that reports the missing src/index.js. Define how configuration should select an initial file, skip dependency installation, and suppress package scripts, while preserving existing template detection. Done means each requested option works without requiring package.json#main.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.