Skip to content

Add the project file of a managed project - #129

Closed
harmony7 wants to merge 1 commit into
feat/v8.1/09-ci-basicsfrom
feat/v8.1/10-project-file
Closed

harmony7 wants to merge 1 commit into
feat/v8.1/09-ci-basicsfrom
feat/v8.1/10-project-file

Conversation

@harmony7

Copy link
Copy Markdown
Member

Part 10 of 13 of the 8.1 stack (PR 10, item 13). Base: PR 9.

Summary

A managed project has one file, static-publish.project.js, in the project dir. It is the base of managed mode.

Changes

  • Detection by file name: a project file means managed mode, an rc means an ejected app, neither means scaffolding, and both is an error (exit 2, config-invalid).
  • The project file has the fields of static-publish.rc.js at the top level, the fields of publish-content.config.js in publishContent, and the settings of the generated app in managed (name, description, authors, serviceId, staticPublishVersion). Type: StaticPublishProject.
  • publish-content, collections, and clean read it in the project dir. publish-content --config replaces publishContent for one run.
  • managed.serviceId is a source of the Service ID for the purge, after the flag and FASTLY_SERVICE_ID, before fastly.toml.
  • scaffold --managed makes the same AppConfig as an ejected scaffold, and writes it as the project file (renderProjectFile()). It adds /.static-publish/ and the working dir to the .gitignore of the project dir, under a comment, and never changes the user's lines. appConfigFromProject() gives the same AppConfig back.
  • staticPublisherWorkingDir has a new rule in both modes: a relative path that starts with ./ or ../, and that is not the directory of the config file or a directory above it. A value that breaks the rule now stops the command. Before, the loader ignored the error.

Changes after the rebase onto 8.0.0

Review points

  • The rule for staticPublisherWorkingDir is security-relevant. Please review it. It is also a behavior change for an ejected app with a working dir that breaks the rule.
  • managed.authors: only authors[0] is used.

Tests

  • A unit test checks the round trip for each golden case, and that generateApp() then makes the same files.
  • npm test on this branch: 267 passed. managed-project.test.js: 9 passed.

Docs

CHANGELOG, README, the modes in CLAUDE.md, and "Managed projects" in src/cli/CLAUDE.md.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@harmony7

Copy link
Copy Markdown
Member Author

We close this PR. We will split the 8.1 work again into fewer and larger PRs, to make the review easier. A new PR will replace this PR. The branch stays.

@harmony7 harmony7 closed this Oct 28, 2026
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