diff --git a/rfcs/0000-template.md b/rfcs/0000-template.md deleted file mode 100644 index ded7a65..0000000 --- a/rfcs/0000-template.md +++ /dev/null @@ -1,23 +0,0 @@ -# {{TITLE: a human-readable title for this RFC!}} - -## Proposal - -{{What changes are you proposing to the buildpack?}} - -## Motivation - -{{Why are we doing this? What pain points does this resolve? What use cases does it support? What is the expected outcome? Use real, concrete examples to make your case!}} - -## Implementation (Optional) - -{{Give a high-level overview of implementation requirements and concerns. Be specific about areas of code that need to change, and what their potential effects are. Discuss which repositories and sub-components will be affected, and what its overall code effect might be.}} - -## Source Material (Optional) - -{{Any source material used in the creation of the RFC should be put here.}} - -## Unresolved Questions and Bikeshedding (Optional) - -{{Write about any arbitrary decisions that need to be made (syntax, colors, formatting, minor UX decisions), and any questions for the proposal that have not been answered.}} - -{{REMOVE THIS SECTION BEFORE RATIFICATION!}} diff --git a/rfcs/0001-start-command.md b/rfcs/0001-start-command.md index ff81814..a5940bc 100644 --- a/rfcs/0001-start-command.md +++ b/rfcs/0001-start-command.md @@ -1,37 +1,2 @@ -# Writing a Yarn Start Command - -## Proposal - -As part of the re-architecture of the Node.js metabuildpack outlined -[here](https://github.com/paketo-buildpacks/nodejs/blob/main/rfcs/0001-buildpacks-architecture.md), -there is need for a `yarn-start` buildpack with the single responsibility of -setting a start command which uses `tini` and `yarn`. - - -## Motivation - -Moving toward this single-responsibility architecture has a few advantages: - -* It enables greater modularity within the Node.js language family. - -* It sets the foundation for interoperability between buildpacks across - language families. - -* Using `tini` allows for more optimal process management within the container. - - `tini` is a process manager for containers which manages zombie processes and - performs signal forwarding. Using an app start command with `tini` ensures - that containers may be stopped gracefully once started. - -## Integration - -The buildpack will provide no dependencies and will require `node`, `tini`, -`yarn` and `node_modules` during the launch phase. - -## Implementation (Optional) - -Detection will pass once a `yarn.lock` file is present in the app's source -code, assuming all other buildplan requirements have been met. - -If detection is passed, the buildpack will set a start command using `tini` and -`yarn`. An example of a start command could be: `tini -g -- yarn start`. +This page has moved. The new location is: +https://github.com/paketo-buildpacks/rfcs/blob/main/text/nodejs/0010-yarn-start-command.md diff --git a/rfcs/0002-reimplement-start-command.md b/rfcs/0002-reimplement-start-command.md index 9f88c1a..c5b7ebe 100644 --- a/rfcs/0002-reimplement-start-command.md +++ b/rfcs/0002-reimplement-start-command.md @@ -1,109 +1,2 @@ -# Reimplement Yarn Start Command - -## Proposal - -The buildpack will no longer call `yarn start` directly, but instead will -reimplement the behavior of `yarn start` directly. - -## Motivation - -We've seen flakey issues with process signal handling once we implemented [RFC -0001](0001-start-command.md). Specifically, on some container managers, it -appears that `tini` is not waiting for the entire process group to exit before -exiting itself. This means that our tests that make assertions that log lines -appear in the output during process shutdown are unreliable. - -Furthermore, the maintainers of the `yarn` CLI have [openly -stated](https://github.com/yarnpkg/yarn/issues/4667#issuecomment-628241114) -that this issue is considered resolved if you upgrade to `yarn` v2, which the -buildpack has not. There is currently no backport of this functionality to v1 -and may never be. - -Given all of this, it seems to make more sense now to just take on the cost of -reimplementing the behavior of `yarn start` and removing the complexity of -using `yarn` and `tini` together. - -## Implementation - -The buildpack will still require `node` and `node_modules` during the `launch` -phase, but will no longer need to require `yarn` or `tini`. - -Detection will continue to pass once a `yarn.lock` file is present in the app's -source code, assuming all other buildplan requirements have been met. - -If detection is passed, the buildpack will set a start command, optionally also -running the prestart and poststart commands using using the contents of the -`package.json` as follows: - -* If `package.json` contains `scripts.start`, `scripts.prestart`, and - `scripts.poststart` fields, the start command will be ` && - && `. For example, given the following - `package.json`, - - ```json - { - "scripts": { - "poststart": "echo 'Done starting'", - "prestart": "echo 'Starting'", - "start": "node index.js" - } - } - ``` - - The start command will be `echo 'Starting' && node index.js && echo 'Done starting'`. - -* If `package.json` contains `scripts.start` and `scripts.prestart` fields, but - does not contain a `scripts.poststart` field, the start command will be - ` && `. For example, given the following - `package.json`, - - ```json - { - "scripts": { - "prestart": "echo 'Starting'", - "start": "node index.js" - } - } - ``` - - The start command will be `echo 'Starting' && node index.js`. - -* If `package.json` contains `scripts.start` and `scripts.poststart` fields, - but does not contain a `scripts.prestart` field, the start command will be - ` && `. For example, given the following - `package.json`, - - ```json - { - "scripts": { - "poststart": "echo 'Done starting'", - "start": "node index.js" - } - } - ``` - - The start command will be `node index.js && echo 'Done starting'`. - -* If `package.json` contains a `scripts.start`, but does not contain either a - `scripts.prestart` or `scripts.poststart` field, the start command will be - ``. For example, given the following `package.json`, - - ```json - { - "scripts": { - "start": "node index.js" - } - } - ``` - - The start command will be `node index.js`. - -* If `package.json` does not contain `scripts.start`, `scripts.prestart`, or - `scripts.poststart` fields, the start command will be `node server.js`. For - example, given the following `package.json`, - - ```json - {} - ``` - - The start command will be `node server.js`. +This page has moved. The new location is: +https://github.com/paketo-buildpacks/rfcs/blob/main/text/nodejs/0012-reimplement-yarn-start-command.md