Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move language to top-level attr on session #159

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Conversation

benjreinhart
Copy link
Contributor

I'm working towards a better type for a srcbook object (currently called session):

export type SessionType = {
  id: string;
  dir: string;
  cells: CellType[];
  language: CodeLanguageType;
  'package.json': Record<string, any>;
  'tsconfig.json'?: Record<string, any>;
  openedAt: number;
};

This PR moves language top-level and gets rid of 'metadata' which seems unnecessary with the exception of the header in .src.md. This came about because I'm trying to make tsconfig.json and package.json behave consistently (eventually) and I started thinking I'd put it in the metadata but then they really aren't metadata. However, tsconfig might be put in the "metadata" header in .src.md. So my thinking is to put everything we have today top-level in the session object and only treat the header in .src.md as "metadata".

@benjreinhart benjreinhart requested a review from nichochar July 26, 2024 20:56
@benjreinhart benjreinhart merged commit 24e537c into main Jul 26, 2024
1 check passed
@benjreinhart benjreinhart deleted the srcbook-metadata branch July 26, 2024 20:58
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