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

Add ES module option. #316

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Commits on Apr 4, 2024

  1. Add ES module support.

    Add --esm switch that generates a project using ES modules by default.
    drjeffjackson committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    ae46832 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b74e582 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    066c607 View commit details
    Browse the repository at this point in the history
  4. Update app.js.ejs

    Eliminate whitespace differences in the generated app.js.
    drjeffjackson committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    e9d9dcc View commit details
    Browse the repository at this point in the history
  5. Add tests

    Adding testing. Necessitated adding .js extension to generated bin/www filename.
    drjeffjackson committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    967aae2 View commit details
    Browse the repository at this point in the history
  6. Update cmd.js

    Remove commented-out code.
    drjeffjackson committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    20a2a7d View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2024

  1. Exit if --esm switch is not supported

    Modify the --esm switch processing to error out of the generator if the Node version is less than 14. Update documentation and testing to reflect this change.
    drjeffjackson committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    1a70274 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2024

  1. Test fix, update ESM code

    Fix esm 'should export an express app from app.js; test failures for early Node versions by moving import into a call to eval(). Also correct two errors in this test and include error handling.
    
    In addition, update all generated code when --esm is active to use const rather than var and arrow syntax rather than function expression syntax for callbacks.
    drjeffjackson committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    5f3c3c0 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2024

  1. esm -> es6

    Change switch from esm to es6 to better reflect what the switch does.
    drjeffjackson committed Apr 7, 2024
    Configuration menu
    Copy the full SHA
    ee6cc50 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2024

  1. parallel templates, .mjs, fix "should export" test

    Use parallel template files for non-es6 and es6 versions of app and www. In es6 mode, use .mjs extension on all generated JavaScript files. Remove node: in the es6 "should export" test's require of url.
    drjeffjackson committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    9c3a1fb View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2024

  1. Remove type:commonjs.

    The type field is now added to package.json only when the generator is run with the --es6 switch.
    drjeffjackson committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    ed2910b View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2024

  1. Remove node: from generated files

    The node: URL scheme was not available in v14 until v14.13.1. So, removing this scheme to stay compatible with all releases of v14.
    drjeffjackson committed Apr 10, 2024
    Configuration menu
    Copy the full SHA
    462d202 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2024

  1. Configuration menu
    Copy the full SHA
    8c122a2 View commit details
    Browse the repository at this point in the history
  2. Group Node imports at top of files.

    Per recommendation by aagamezl.
    drjeffjackson committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    a225474 View commit details
    Browse the repository at this point in the history