Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const config = {
testEnvironment: 'node',
reporters: ['default', 'jest-junit'],
setupFilesAfterEnv: ['./jest.setup.js'],
testPathIgnorePatterns: ['/node_modules/'],
};

module.exports = config;
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/aio-cli-plugin-api-mesh",
"version": "5.7.0",
"version": "5.7.1-beta.0",
"description": "Adobe I/O CLI plugin to develop and manage API mesh sources",
"keywords": [
"oclif-plugin"
Expand Down Expand Up @@ -34,6 +34,7 @@
"postpack": "rm -f oclif.manifest.json",
"test": "jest",
"test:ci": "jest --ci",
"test:integration": "jest --testPathPattern=\\.integration\\.test\\.js",
"unit-tests": "jest --ci",
"version": "oclif-dev readme && git add README.md"
},
Expand All @@ -51,7 +52,7 @@
"@escape.tech/graphql-armor": "3.2.0",
"@graphql-mesh/cli": "0.82.30",
"@graphql-mesh/graphql": "0.34.13",
"@graphql-mesh/http": "^0.96.9",
"@graphql-mesh/http": "0.3.26",
"@graphql-mesh/json-schema": "0.35.38",
"@graphql-mesh/openapi": "0.33.39",
"@graphql-mesh/plugin-http-details-extensions": "^0.103.4",
Expand Down Expand Up @@ -129,7 +130,8 @@
"stdout-stderr": "^0.1.9"
},
"overrides": {
"plain-crypto-js": "./_EXCLUDE_UNSAFE_DEPENDENCIES_/plain-crypto-js"
"plain-crypto-js": "./_EXCLUDE_UNSAFE_DEPENDENCIES_/plain-crypto-js",
"@graphql-mesh/utils": "0.43.20"
},
"engines": {
"node": "^16.13 || >=18.0.0",
Expand Down
50 changes: 50 additions & 0 deletions src/commands/api-mesh/__tests__/init.integration.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
Copyright 2021 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
const os = require('os');

jest.setTimeout(120000);

describe('init template dependency resolution', () => {
let tmpDir;

beforeEach(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'mesh-init-'));
fs.copyFileSync(
path.resolve(__dirname, '../../../templates/package.json'),
path.join(tmpDir, 'package.json'),
);
});

afterEach(() => {
fs.rmSync(tmpDir, { recursive: true, force: true });
});

test('template package.json resolves without ERESOLVE errors', () => {
try {
execSync('npm install --dry-run --json', {
cwd: tmpDir,
encoding: 'utf8',
stdio: ['pipe', 'pipe', 'pipe'],
});
} catch (error) {
const stderr = error.stderr || '';
if (stderr.includes('ERESOLVE')) {
throw new Error(`Template package.json has dependency conflicts:\n${stderr}`);
}
throw error;
}
});
});
4 changes: 3 additions & 1 deletion src/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@graphql-mesh/transform-type-merging": "0.5.20",
"@graphql-mesh/types": "0.91.12",
"@graphql-mesh/soap": "0.14.25",
"@graphql-mesh/http": "^0.96.9",
"graphql": "^16.6.0",
"@adobe/plugin-hooks": "0.4.0",
"@adobe/plugin-on-fetch": "0.1.1",
Expand All @@ -35,6 +34,9 @@
"fastify": "^4.10.2",
"graphql-yoga": "3.1.1"
},
"overrides": {
"@graphql-mesh/utils": "0.43.20"
},
"engines": {
"node": ">=18.0.0"
},
Expand Down
Loading