Skip to content

feat: expressjs framework#784

Merged
tigarmo merged 103 commits intocanonical:mainfrom
yanksyoon:feat/expressjs-framework
Mar 10, 2025
Merged

feat: expressjs framework#784
tigarmo merged 103 commits intocanonical:mainfrom
yanksyoon:feat/expressjs-framework

Conversation

@yanksyoon
Copy link
Member

@yanksyoon yanksyoon commented Jan 2, 2025

  • Have you signed the CLA?

Adds support for ExpressJS framework.

Key Decisions

  • Support for bare and 24.04 only. Drop support for 22.04 (jammy)
    • Jammy comes with an old version of Node which does not support ?? operator commonly used in JS projects. This means that the projects initialized with express-generator tooling (assumed to be the case) would not work.
  • Include runtime slices in the expressjs-framework/install-app > stage-packages part.
  • Do not include user customizable part for runtime slices/packages in the template
  • Provide Ubuntu packaged Node/NPM by default, allow user to specify Node version if desired.
    • To follow the principles of Ubuntu LTS, by default use the NodeJS and NPM provided by apt/slices but allow users to customize the behavior through overriding the NPM plugin's npm-include-node and npm-node-version fields.
  • Include all paths under the app/ directory.
    • Users should not include/add paths which are not desired in the app path (e.g. .env files)

@yanksyoon yanksyoon mentioned this pull request Jan 2, 2025
1 task
@yanksyoon yanksyoon changed the title feat: expressjs framework [WIP] feat: expressjs framework Jan 2, 2025
@yanksyoon yanksyoon force-pushed the feat/expressjs-framework branch from 056fbc1 to 8afa87e Compare January 2, 2025 03:55
@yanksyoon yanksyoon requested review from medubelko March 3, 2025 09:16
@yanksyoon
Copy link
Member Author

@medubelko

I'm still confused, sorry. The updated text reads:

the application is installed and run via NodeJS

Which is what I put in my suggestion:

Node.js installs and runs the app

Those two sentences are equivalent.

If the npm plugin performs the installation, the text should read:

... the npm plugin installs the app and Node.js, while Node.js runs the app.

Thanks for the comment! To clarify, the application "installation" is done by the NPM plugin - which involves two things:

  1. Copying over the source files (done by rockcraft NPM plugin)
  2. Installing the libraries in the package.json (done by npm tool)

Then, NodeJS provides a runtime in which the application is loaded and served. Would this make a difference in how we phrase the above?

@medubelko
Copy link
Contributor

@yanksyoon

Would this make a difference in how we phrase the above?

Yes. :)

Let me try again:

In this case, the NPM plugin copies the app's files and installs its dependencies. Node.js then provides a runtime and launches the app.

For different possible values for the npm-node-version key...

Copy link
Contributor

@medubelko medubelko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yanksyoon!

Copy link
Collaborator

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Approved pending the linting fix

@tigarmo
Copy link
Collaborator

tigarmo commented Mar 6, 2025

I think the breakage came in from the update in main:

/home/docs/checkouts/readthedocs.org/user_builds/canonical-rockcraft/checkouts/784/docs/tutorial/expressjs.rst:24: CRITICAL: Problems with "include" directive path:
InputError: [Errno 2] No such file or directory: 'reuse/tutorial/setup.rst'.

@yanksyoon yanksyoon force-pushed the feat/expressjs-framework branch from 88937b5 to 5374920 Compare March 10, 2025 06:31
@tigarmo tigarmo merged commit adb3031 into canonical:main Mar 10, 2025
17 of 18 checks passed
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.

5 participants