diff --git a/packages/build/src/install/missing.js b/packages/build/src/install/missing.js index cf7daf08e6..45c60b810b 100644 --- a/packages/build/src/install/missing.js +++ b/packages/build/src/install/missing.js @@ -98,7 +98,7 @@ const getIntegrationPackage = async function ({ throw new Error(`Failed to build integration. Error:\n\n${e.stack}`) } - return resolve(integrationDir, '.ntli/site/static/packages/buildhooks.tgz') + return undefined } return undefined diff --git a/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/.gitkeep b/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/index.js b/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/index.js index e69de29bb2..8c1f901340 100644 --- a/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/index.js +++ b/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/index.js @@ -0,0 +1,3 @@ +export const onPreBuild = function () { + console.log("Hello world"); +} diff --git a/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/manifest.yml b/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/manifest.yml new file mode 100644 index 0000000000..bbc1fee978 --- /dev/null +++ b/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/manifest.yml @@ -0,0 +1,2 @@ +name: abc-integration +inputs: [] diff --git a/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/package.json b/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/package.json new file mode 100644 index 0000000000..507b311db0 --- /dev/null +++ b/packages/build/tests/install/fixtures/local_missing_integration/integration/.ntli/build/package.json @@ -0,0 +1,7 @@ +{ + "main": "index.js", + "type": "module", + "version": "0.0.0", + "name": "abc-integration", + "dependencies": {} +} diff --git a/packages/build/tests/install/fixtures/local_missing_integration/integration/manifest.yml b/packages/build/tests/install/fixtures/local_missing_integration/integration/manifest.yml index a3512f0259..bbc1fee978 100644 --- a/packages/build/tests/install/fixtures/local_missing_integration/integration/manifest.yml +++ b/packages/build/tests/install/fixtures/local_missing_integration/integration/manifest.yml @@ -1,2 +1,2 @@ -name: test +name: abc-integration inputs: [] diff --git a/packages/build/tests/install/fixtures/local_missing_integration/integration/package.json b/packages/build/tests/install/fixtures/local_missing_integration/integration/package.json index 8521f0f9aa..26fafe3703 100644 --- a/packages/build/tests/install/fixtures/local_missing_integration/integration/package.json +++ b/packages/build/tests/install/fixtures/local_missing_integration/integration/package.json @@ -1,5 +1,5 @@ { - "name": "plugin_deps_plugin", + "name": "abc-integration", "version": "0.0.1", "type": "module", "scripts": { diff --git a/packages/build/tests/install/fixtures/local_missing_integration/netlify.toml b/packages/build/tests/install/fixtures/local_missing_integration/netlify.toml index c7204d2e8c..45a6d67bac 100644 --- a/packages/build/tests/install/fixtures/local_missing_integration/netlify.toml +++ b/packages/build/tests/install/fixtures/local_missing_integration/netlify.toml @@ -1,5 +1,5 @@ [[integrations]] -name = "abc-integration" +name = "test" [integrations.dev] path = "./integration" diff --git a/packages/build/tests/install/snapshots/tests.js.md b/packages/build/tests/install/snapshots/tests.js.md index 9b23f807b5..5f3ce01703 100644 --- a/packages/build/tests/install/snapshots/tests.js.md +++ b/packages/build/tests/install/snapshots/tests.js.md @@ -1051,7 +1051,6 @@ Generated by [AVA](https://avajs.dev). debug: true␊ repositoryRoot: packages/build/tests/install/fixtures/local_missing_integration␊ testOpts:␊ - cwd: ./tests/install/fixtures/local_missing_integration/␊ pluginsListUrl: test␊ silentLingeringProcesses: true␊ ␊ @@ -1070,10 +1069,18 @@ Generated by [AVA](https://avajs.dev). dev␊ ␊ > Building integrations␊ - - abc-integration from ./integration␊ + - test from ./integration␊ ␊ > Loading integrations␊ - - abc-integration␊ + - test␊ + ␊ + test (onPreBuild event) ␊ + ────────────────────────────────────────────────────────────────␊ + ␊ + Hello world␊ + ␊ + (test onPreBuild completed in 1ms)␊ + Build step duration: test onPreBuild completed in 1ms␊ ␊ Netlify Build Complete ␊ ────────────────────────────────────────────────────────────────␊ diff --git a/packages/build/tests/install/snapshots/tests.js.snap b/packages/build/tests/install/snapshots/tests.js.snap index 8828ee6096..490600bcfb 100644 Binary files a/packages/build/tests/install/snapshots/tests.js.snap and b/packages/build/tests/install/snapshots/tests.js.snap differ diff --git a/packages/build/tests/install/tests.js b/packages/build/tests/install/tests.js index 343da99ad0..3e69408b17 100644 --- a/packages/build/tests/install/tests.js +++ b/packages/build/tests/install/tests.js @@ -153,15 +153,8 @@ test('Install local plugin dependencies: missing plugin in netlify.toml', async t.snapshot(normalizeOutput(output)) }) -test('In integration dev mode, install local plugins and install the integration when forcing build', async (t) => { - const output = await new Fixture('./fixtures/local_missing_integration') - .withFlags({ - context: 'dev', - testOpts: { - cwd: './tests/install/fixtures/local_missing_integration/', - }, - }) - .runWithBuild() +test.only('In integration dev mode, install local plugins and install the integration when forcing build', async (t) => { + const output = await new Fixture('./fixtures/local_missing_integration').withFlags({ context: 'dev' }).runWithBuild() t.snapshot(normalizeOutput(output)) })