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

fix(c3): ensure shell scripts work on Windows #4445

Merged
merged 24 commits into from
Nov 24, 2023

Commits on Nov 24, 2023

  1. fix: ensure C3 shell scripts work on Windows

    Our use of `shell-quote` was causing problems on Windows where it was
    escaping character (such as `@`) by placing a backslash in front.
    This made Windows think that such path arguments, were at the root.
    
    For example, `npm install -D @cloudflare/workers-types` was being converted to
    `npm install -D \@cloudflare/workers-types`, which resulted in errors like:
    
    ```
    npm ERR! enoent ENOENT: no such file or directory, open 'D:\@cloudflare\workers-types\package.json'
    ```
    
    Now we just rely directly on the Node.js `spawn` API to avoid any shell quoting
    concerns. This has resulted in a slightly less streamlined experience for people
    writing C3 plugins, but has the benefit that the developer doesn't have to worry
    about quoting spawn arguments.
    
    Closes #4282
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    f30cd75 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    02a3da6 View commit details
    Browse the repository at this point in the history
  3. C3 e2e - clean up test projects according to their type

    Previously we only deleted Pages projects - in fact we were trying to delete
    the Hono (non-Pages) Worker as a Pages project.
    
    Now we delete the project based on its type.
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    ba452a4 View commit details
    Browse the repository at this point in the history
  4. C3 - framework template fixes for Windows

    - do not use bash-style environment variable setting in Docusaurus scripts
    - do not run TTY interactive e2e tests on Windows
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    ed7fd0f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1cbc0f7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ed9761a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    92f02cc View commit details
    Browse the repository at this point in the history
  8. C3 e2e - Only cleanup workers and projects that are over 1 hour old

    These e2e test workers and projects should be cleaned up as part of the normal test completion.
    But if the test crashes they may be left orphaned.
    This change ensures that we do not clean up projects to early while they are still being used.
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    13c6c4e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    898b2e3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e366929 View commit details
    Browse the repository at this point in the history
  11. C3 e2e - recreate test folders for each e2e retry

    Previously we were reusing folders after clearing them when retrying a
    failed test. But this could lead to problems, especially on Windows where
    clearing out the folder did not always work.
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    4725c5c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    adf2022 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1af8026 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    6e8dcb8 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    f77d164 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    a77cbed View commit details
    Browse the repository at this point in the history
  17. C3 e2e - disable global caches for package managers

    This commit uses environment variables to tell package managers to put
    cached files in a local directory rather than a global shared one, which
    can cause problems with race conditions when running multiple installs
    at the same time.
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    0dcb6cf View commit details
    Browse the repository at this point in the history
  18. C3 e2e - don't cancel other matrix jobs if one fails

    It is a false optimization to cancel jobs that are likely to pass when
    another job flakes out.
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    e658af7 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    5d322d4 View commit details
    Browse the repository at this point in the history
  20. C3 e2e - drop docusaurus and react tests

    These jobs tend to flake out and are not providing much of a useful signal.
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    880bc45 View commit details
    Browse the repository at this point in the history
  21. ci: skip fixture tests that exercise the "dev registry"

    Reenable when #4241 lands and improves reliability of this test.
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    9d82d89 View commit details
    Browse the repository at this point in the history
  22. C3 - ensure shell commands in logging are reasonably quoted

    C3 often outputs log messages to the user of commands that are being
    executed. Users tend to cut and paste these into their terminal to run
    themselves. This makes sure that these are likely to just work went
    pasted into their shell.
    petebacondarwin committed Nov 24, 2023
    Configuration menu
    Copy the full SHA
    799d3fa View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    aed7c14 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    c06c331 View commit details
    Browse the repository at this point in the history