Skip to content

Commit

Permalink
chore(deps): update node.js to v20.5.1 (#4607)
Browse files Browse the repository at this point in the history
* chore(deps): update node.js to v20.5.1

* add import path to suppress error

* fix `loadConfig` tests

* fix validate config sourcemaps tests

* normalize path for Windows

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tanner Reits <[email protected]>
  • Loading branch information
renovate[bot] and tanner-reits authored Sep 8, 2023
1 parent 4d8ff00 commit dd1fe1d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
],
"prettier": "@ionic/prettier-config",
"volta": {
"node": "20.4.0",
"node": "20.5.1",
"npm": "9.8.1"
}
}
17 changes: 8 additions & 9 deletions src/compiler/config/test/load-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { normalizePath } from '../../../utils';
import { loadConfig } from '../load-config';

describe('load config', () => {
const configPath = 'fixtures/stencil.config.ts';
const configPath2 = 'fixtures/stencil.config2.ts';
const configPath = require.resolve('./fixtures/stencil.config.ts');
const configPath2 = require.resolve('./fixtures/stencil.config2.ts');

let sys: d.CompilerSystem;
const noTsConfigPath = 'no-ts-dir/stencil.config.ts';

beforeEach(() => {
sys = createNodeSys();
Expand Down Expand Up @@ -41,7 +41,6 @@ describe('load config', () => {
[configPath]: mock.load(path.resolve(__dirname, configPath)),
[configPath2]: mock.load(path.resolve(__dirname, configPath2)),
'fixtures/tsconfig.json': tsconfig,
[noTsConfigPath]: mock.load(path.resolve(__dirname, configPath)),
...getMockFSPatch(mock),
});
});
Expand Down Expand Up @@ -103,23 +102,23 @@ describe('load config', () => {
});

it('creates a tsconfig file when "initTsConfig" set', async () => {
const tsconfigPath = path.resolve(path.dirname(noTsConfigPath), 'tsconfig.json');
const tsconfigPath = path.resolve(path.dirname(configPath), 'tsconfig.json');
expect(fs.existsSync(tsconfigPath)).toBe(false);
const loadedConfig = await loadConfig({ initTsConfig: true, configPath: noTsConfigPath });
const loadedConfig = await loadConfig({ initTsConfig: true, configPath });
expect(fs.existsSync(tsconfigPath)).toBe(true);
expect(loadedConfig.diagnostics).toHaveLength(0);
});

it('errors that a tsconfig file could not be created when "initTsConfig" isn\'t present', async () => {
const loadedConfig = await loadConfig({ configPath: noTsConfigPath });
const loadedConfig = await loadConfig({ configPath });
expect(loadedConfig.diagnostics).toHaveLength(1);
expect<d.Diagnostic>(loadedConfig.diagnostics[0]).toEqual({
absFilePath: undefined,
header: 'Missing tsconfig.json',
level: 'error',
lines: [],
messageText: `Unable to load TypeScript config file. Please create a "tsconfig.json" file within the "./${path.dirname(
noTsConfigPath,
messageText: `Unable to load TypeScript config file. Please create a "tsconfig.json" file within the "${normalizePath(
path.dirname(configPath),
)}" directory.`,
relFilePath: undefined,
type: 'build',
Expand Down
5 changes: 2 additions & 3 deletions src/compiler/config/test/validate-config-sourcemap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import type * as d from '../../../declarations';
import { loadConfig } from '../load-config';

describe('stencil config - sourceMap option', () => {
const fixturesDir = 'fixtures';
const configPath = path.join(fixturesDir, 'stencil.config.ts');
const configPath = require.resolve('./fixtures/stencil.config.ts');
let sys: d.CompilerSystem;

/**
Expand All @@ -21,7 +20,7 @@ describe('stencil config - sourceMap option', () => {
*/
const getLoadConfigForTests = (overrides?: Partial<d.LoadConfigInit>): d.LoadConfigInit => {
const defaults: d.LoadConfigInit = {
configPath: configPath,
configPath,
sys,
config: {},
initTsConfig: true,
Expand Down
35 changes: 9 additions & 26 deletions src/testing/tsconfig.internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"jsxFactory": "h",
"lib": [
"dom",
"es2017",
"esnext.array"
],
"lib": ["dom", "es2017", "esnext.array"],
"module": "esnext",
"moduleResolution": "node",
"noImplicitAny": true,
Expand All @@ -24,27 +20,14 @@
"useUnknownInCatchVariables": true,
"baseUrl": ".",
"paths": {
"@stencil/core/cli": [
"../cli/index.ts"
],
"@stencil/core/compiler": [
"../compiler/index.ts"
],
"@stencil/core/declarations": [
"../declarations/index.ts"
],
"@stencil/core/mock-doc": [
"../mock-doc/index.ts"
],
"@stencil/core/testing": [
"../testing/index.ts"
],
"@stencil/core": [
"../index.ts"
],
"@utils": [
"../utils/index.ts"
]
"@stencil/core/cli": ["../cli/index.ts"],
"@stencil/core/compiler": ["../compiler/index.ts"],
"@stencil/core/declarations": ["../declarations/index.ts"],
"@stencil/core/mock-doc": ["../mock-doc/index.ts"],
"@stencil/core/testing": ["../testing/index.ts"],
"@stencil/core": ["../index.ts"],
"@sys-api-node": ["../sys/node/index.ts"],
"@utils": ["../utils/index.ts"]
}
}
}

0 comments on commit dd1fe1d

Please sign in to comment.