Skip to content

Commit

Permalink
refactor: convert the rest of the project to ESM (#6092)
Browse files Browse the repository at this point in the history
* refactor: convert functions/telemetry to ESM

* refactor: convert commitlint config file

* refactor: convert local-ip.mjs

* refactor: convert 600.framework-detection test to ESM

* refactor: missed removing a require statement

* style: lint

* refactor: convert curl.cjs to ESM

* test: update file reference

* refactor: convert curl.cjs to ESM

* refactor: convert got.cjs to ESM

* refactor: convert cli-path to ESM

* fix: issues raised with linter

* refactor: convert tests/integration/utils/snapshots.cjs to ESM

* refactor: convert tests/integration/utils/mock-execa.cjs to ESM

* style: lint

* refactor: convert tests/integration/utils/external-server.cjs to ESM

* refactor: convert mock-api.cjs to ESM

* style: lint

* style: lint

* refactor: convert create-live-test-site to ESM

* refactor: convert utils/dev-server.cjs to ESM

* refactor: fix issues found by linter

* refactor: convert utils/handle-questons.cjs to ESM

* refactor: convert utils/process.cjs to ESM

* refactor: convert call-cli to ESM

* refactor: convert external-server-cli.cjs to ESM

* refactor: convert site-builder.cjs to ESM

* refactor: convert utils/pause.cjs to ESM

* fix: imports

* refactor: remove files that are no longer used

* style: lint issues

* refactor: update filenames

* test: fix import

* fix: import statement

* fix: import statement

* fix: more import statements

* fix: missed a file extension

* fix: specify default export

* fix: export

* test: see if removing the concurrency resolves the test server error

* test: remove unused variable

* test: try different approach to getting the dirname variable

* style: lint

* test: revert earlier change

* test: include changes from PR #5921

* style: lint

* fix: increase timeout

* test: add fetch method

* test: remove snapshot files that aren't used anymore

* test: try asserting substring rather than snapshot

* style: lint

* refactor: fix export

* Revert "refactor: fix export"

This reverts commit 55e97b6.

* test: fix snapshot test from docs change

* refactor: i need more coffee
  • Loading branch information
ericapisani authored Oct 30, 2023
1 parent e8d4b09 commit a1b3599
Show file tree
Hide file tree
Showing 75 changed files with 789 additions and 929 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
integration:
name: Integration
runs-on: ${{ matrix.os }}
timeout-minutes: 20
timeout-minutes: 40
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
Expand Down
1 change: 0 additions & 1 deletion commitlint.config.cjs

This file was deleted.

8 changes: 2 additions & 6 deletions functions/telemetry.cjs → functions/telemetry.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const fetch = require('node-fetch')
import fetch from 'node-fetch'

const TELEMETRY_SERVICE_URL = 'https://cli-telemetry.netlify.engineering'

// This function is a workaround for our inability to redirect traffic to a ntl function in another site
// using redirects (see https://github.com/netlify/cli-telemetry-service/issues/14)
const handler = async function ({ path, httpMethod, headers, body }) {
export const handler = async function ({ path, httpMethod, headers, body }) {
const upstreamPath = path.replace(/^\/telemetry\//, '/')

// Filter out some headers that shouldn't be fwded
Expand All @@ -31,7 +31,3 @@ const handler = async function ({ path, httpMethod, headers, body }) {
statusCode: 200,
}
}

module.exports = {
handler,
}
Loading

1 comment on commit a1b3599

@github-actions
Copy link

Choose a reason for hiding this comment

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

📊 Benchmark results

  • Dependency count: 1,372
  • Package size: 380 MB

Please sign in to comment.