Skip to content

Update Node.js & NPM #952

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

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2ca8f8a
Update Node.js & NPM in project's engines
marinaaisa Jul 2, 2025
a554a18
Update @vue/test-utils
marinaaisa Jul 3, 2025
20dea36
Update tree-sitter-vue
marinaaisa Jul 3, 2025
ee7b097
Fix LanguageSwitcher.spec.js
marinaaisa Jul 14, 2025
4fa24a9
Fix Column.spec.js
marinaaisa Jul 14, 2025
7f17ebc
Fix Hero.spec.js
marinaaisa Jul 14, 2025
0c05b53
Fix ColorSchemeToggle.spec.js
marinaaisa Jul 4, 2025
502b540
Fix ImageAsset.spec.js
marinaaisa Jul 4, 2025
85c2cc6
Fix Pager.spec.js
marinaaisa Jul 4, 2025
d449f10
Fix Assessments.spec.js
marinaaisa Jul 4, 2025
7c4184e
Fix swift.spec.js
marinaaisa Jul 7, 2025
2eb5a31
Fix FilterInput.spec.js
marinaaisa Jul 7, 2025
45170d2
Replace wrapper.find
marinaaisa Jul 8, 2025
5b93d5d
Wait for wrapper.setProps
marinaaisa Jul 8, 2025
4b79305
Wait for wrapper.setData
marinaaisa Jul 8, 2025
b44b0f6
Await after .trigger() function
marinaaisa Jul 8, 2025
ed3ccbd
Fix Navigator.spec.js
marinaaisa Jul 8, 2025
aaf6053
Fix ReplayableVideoAsset.spec.js
marinaaisa Jul 8, 2025
7e59a11
Replace 'Contains'
marinaaisa Jul 8, 2025
932d547
Wait for nextTick after emitting an event
marinaaisa Jul 8, 2025
22a5279
Fix TopicsLinkCardGridItem.spec.js
marinaaisa Jul 9, 2025
1587c43
Fix components/DocumentationTopic.spec.js
marinaaisa Jul 9, 2025
88a7500
Fix Chapter.spec.js
marinaaisa Jul 9, 2025
0149bb1
Fix AdjustableSidebarWidth.spec.js
marinaaisa Jul 9, 2025
707d78d
Fix Availability.spec.js
marinaaisa Jul 9, 2025
fba8b80
Fix Hierarchy.spec.js
marinaaisa Jul 9, 2025
c4de3b3
Fix NavBase.spec.js
marinaaisa Jul 9, 2025
fcb3575
Fix DocumentationLayout.spec.js
marinaaisa Jul 9, 2025
b7f1370
Fix TopicsLinkBlock.spec.js
marinaaisa Jul 9, 2025
3d6daee
Fix CodePreview.spec.js
marinaaisa Jul 9, 2025
1886bc3
Fix App.spec.js
marinaaisa Jul 9, 2025
dec3083
Fix DropdownCustom.spec.js
marinaaisa Jul 9, 2025
c187452
Wait for .setValue()
marinaaisa Jul 9, 2025
a11ab20
Fix GenericModal.spec.js
marinaaisa Jul 9, 2025
729d1c2
Fix LinksBlock.spec.js
marinaaisa Jul 9, 2025
cb02316
Fix ResourcesTile.spec.js
marinaaisa Jul 9, 2025
9e02743
Fix RelationshipsList.spec.js
marinaaisa Jul 9, 2025
dbc9332
Fix all deprecated .is() method warnings
marinaaisa Jul 11, 2025
692d271
Fix .find() and .get() deprecation warnings
marinaaisa Jul 11, 2025
4d2e106
Fix .findAll() deprecation warnings
marinaaisa Jul 11, 2025
eaa5a4d
Fix .contains() deprecation warnings
marinaaisa Jul 11, 2025
bce9a30
Fix .isEmpty() deprecation warnings
marinaaisa Jul 11, 2025
552fabc
Fix attachToDocument deprecation warnings
marinaaisa Jul 11, 2025
2eec831
Fix QuickNavigationModal.spec.js
marinaaisa Jul 11, 2025
00d1cc9
Fix console error warnings for TopicsLinkBlock.spec.js
marinaaisa Jul 11, 2025
9b39890
Fix DocumentationTopic.spec.js
marinaaisa Jul 11, 2025
78d3323
Fix ResourcesTileGroup.spec.js
marinaaisa Jul 11, 2025
8516742
Fix DeclarationTokenGroup.spec.js
marinaaisa Jul 14, 2025
2f81cb8
Remove redundant nextTick
marinaaisa Jul 24, 2025
3acc738
Update tree-sitter-javascript and tree-sitter-jsdoc
marinaaisa Jul 25, 2025
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.1
22.17.0
4 changes: 2 additions & 2 deletions build-script-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def ensure_npm_is_installed(verbose=False):
fatal_error('-- Error: %s' % error_msg)
try:
node_version = check_output(['node', '--version'], verbose=verbose)
if not node_version.startswith('v18.16.'):
warn_msg = "Unexpected version of 'node' installed. Swift-DocC-Render requires node 18.16.1. "\
if not node_version.startswith('v22.17.'):
warn_msg = "Unexpected version of 'node' installed. Swift-DocC-Render requires node 22.17.0. "\
"See the README.md file for more information about building Swift-DocC-Render."
printerr('-- Warning: %s' % warn_msg)
except:
Expand Down
26,337 changes: 7,278 additions & 19,059 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@vue/cli-plugin-unit-jest": "^5.0.8",
"@vue/cli-service": "^5.0.8",
"@vue/eslint-config-airbnb": "^6.0.0",
"@vue/test-utils": "1.0.0-beta.27",
"@vue/test-utils": "1.3.6",
"@vue/vue2-jest": "^27.0.0-alpha.2",
"babel-jest": "^27.0.6",
"eslint": "^7.32.0",
Expand All @@ -50,9 +50,9 @@
"jest": "^27.0.5",
"sass": "^1.55.0",
"sass-loader": "^12.0.0",
"tree-sitter": "^0.20.6",
"tree-sitter-javascript": "^0.20.4",
"tree-sitter-jsdoc": "^0.19.0",
"tree-sitter": "^0.21.1",
"tree-sitter-javascript": "^0.23.1",
"tree-sitter-jsdoc": "^0.23.2",
"tree-sitter-vue": "^0.2.1",
"vue": "^2.7.10",
"vue-router": "^3.5.2",
Expand All @@ -63,7 +63,12 @@
"vue-router": "^3.5.2"
},
"engines": {
"node": ">=18.16.1 <21",
"npm": ">=9.5.1"
"node": ">=22.17.0 <23",
"npm": ">=10.9.2"
},
"overrides": {
"tree-sitter-vue": {
"nan": "^2.22.2"
}
}
}
10 changes: 0 additions & 10 deletions src/utils/custom-highlight-lang/swift.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ import swift from 'highlight.js/lib/languages/swift';
export default function swiftOverride(hljs) {
const language = swift(hljs);

// Temporarily patch the Swift language syntax to recognize `distributed` as
// a keyword until the next version of highlight.js (v11.6) is released, which
// will have built-in support for this [1]
//
// [1]: https://github.com/highlightjs/highlight.js/pull/3523
language.keywords.keyword = [
...language.keywords.keyword,
'distributed',
];

const isClassMode = ({ beginKeywords = '' }) => beginKeywords
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you may have accidentally removed too much code here. Probably the lines above this can be removed since the associated PR was merged and likely included with the newer version of highlight.js used here, but I don't think any of the code below this was.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! I just fixed it.
In the future it would be good to add tests to those overrides.

.split(' ')
.includes('class');
Expand Down
70 changes: 36 additions & 34 deletions tests/unit/App.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ describe('App', () => {
const wrapper = createWrapper();
expect(wrapper.classes('hascustomheader')).toBe(false);

const header = wrapper.find('custom-header-stub');
const header = wrapper.findComponent('custom-header-stub');
expect(header.exists()).toBe(false);

const footer = wrapper.find('custom-footer-stub');
const footer = wrapper.findComponent('custom-footer-stub');
expect(footer.exists()).toBe(false);
});

Expand All @@ -115,7 +115,7 @@ describe('App', () => {

it('renders Skip Navigation', () => {
const wrapper = createWrapper();
const skipNavigation = wrapper.find('#skip-nav');
const skipNavigation = wrapper.findComponent('#skip-nav');
expect(skipNavigation.text()).toBe('accessibility.skip-navigation');
expect(skipNavigation.attributes('href')).toBe('#app-main');
});
Expand All @@ -126,7 +126,7 @@ describe('App', () => {
header: '<div class="header">Header</div>',
},
});
const header = wrapper.find('.header');
const header = wrapper.findComponent('.header');
expect(header.text()).toBe('Header');
});

Expand All @@ -135,49 +135,49 @@ describe('App', () => {
getSetting.mockReturnValue(true);

const wrapper = createWrapper();
wrapper.setData({
await wrapper.setData({
appState: {
...wrapper.vm.appState,
availableLocales,
},
});

const SuggestLangComponent = wrapper.find(SuggestLang);
const SuggestLangComponent = wrapper.findComponent(SuggestLang);
expect(SuggestLangComponent.exists()).toBe(true);
});

it('renders LocaleSelector if enablei18n is true', () => {
it('renders LocaleSelector if enablei18n is true', async () => {
const { LocaleSelector } = App.components;
({ getSetting } = require('docc-render/utils/theme-settings'));
getSetting.mockReturnValue(true);

const wrapper = createWrapper();
expect(wrapper.find(LocaleSelector).exists()).toBe(false);
wrapper.setData({
expect(wrapper.findComponent(LocaleSelector).exists()).toBe(false);
await wrapper.setData({
appState: {
...wrapper.vm.appState,
availableLocales,
},
});

expect(wrapper.find(LocaleSelector).exists()).toBe(true);
expect(wrapper.findComponent(LocaleSelector).exists()).toBe(true);
});

it('does not render LocaleSelector if there is less than two available locales', () => {
it('does not render LocaleSelector if there is less than two available locales', async () => {
const { LocaleSelector } = App.components;
({ getSetting } = require('docc-render/utils/theme-settings'));
getSetting.mockReturnValue(true);

const wrapper = createWrapper();
expect(wrapper.find(LocaleSelector).exists()).toBe(false);
wrapper.setData({
expect(wrapper.findComponent(LocaleSelector).exists()).toBe(false);
await wrapper.setData({
appState: {
...wrapper.vm.appState,
availableLocales: ['en-US'],
},
});

expect(wrapper.find(LocaleSelector).exists()).toBe(false);
expect(wrapper.findComponent(LocaleSelector).exists()).toBe(false);
});

it('renders the `#nav-sticky-anchor` between the header and loading placeholder', () => {
Expand All @@ -186,9 +186,9 @@ describe('App', () => {
header: '<div class="header">Footer</div>',
},
});
const header = wrapper.find('.header');
const stickyAnchor = wrapper.find(`#${baseNavStickyAnchorId}`);
const loadingPlaceholder = wrapper.find(InitialLoadingPlaceholder);
const header = wrapper.findComponent('.header');
const stickyAnchor = wrapper.findComponent(`#${baseNavStickyAnchorId}`);
const loadingPlaceholder = wrapper.findComponent(InitialLoadingPlaceholder);

// make sure the anchor is below the header and above the content
expect(header.element.nextElementSibling).toBe(stickyAnchor.element);
Expand All @@ -201,9 +201,9 @@ describe('App', () => {
default: '<div class="default">Default</div>',
},
});
const stickyAnchor = wrapper.find(`#${baseNavStickyAnchorId}`);
const content = wrapper.find('.default');
const placeholder = wrapper.find(InitialLoadingPlaceholder);
const stickyAnchor = wrapper.findComponent(`#${baseNavStickyAnchorId}`);
const content = wrapper.findComponent('.default');
const placeholder = wrapper.findComponent(InitialLoadingPlaceholder);
// make sure the anchor is below the header and above the content
expect(placeholder.exists()).toBe(true);
expect(stickyAnchor.element.nextElementSibling).toBe(placeholder.element);
Expand All @@ -216,7 +216,7 @@ describe('App', () => {
footer: '<div class="footer-slot">Footer</div>',
},
});
const footer = wrapper.find('.footer-slot');
const footer = wrapper.findComponent('.footer-slot');
expect(footer.text()).toBe('Footer');
});

Expand All @@ -226,22 +226,22 @@ describe('App', () => {
default: '<div class="default">Default</div>',
},
});
const slotContent = wrapper.find('.default');
const slotContent = wrapper.findComponent('.default');
expect(slotContent.text()).toBe('Default');
expect(wrapper.find('router-view-stub').exists()).toBe(false);
expect(wrapper.findComponent('router-view-stub').exists()).toBe(false);
});

it('renders a default `Footer` for non-IDE targets', () => {
it('renders a default `Footer` for non-IDE targets', async () => {
const wrapper = createWrapper();
expect(wrapper.contains(Footer)).toBe(true);
expect(wrapper.findComponent(Footer).exists()).toBe(true);

wrapper.setData({ isTargetIDE: true });
expect(wrapper.contains(Footer)).toBe(false);
await wrapper.setData({ isTargetIDE: true });
expect(wrapper.findComponent(Footer).exists()).toBe(false);
});

it('renders the app-top element', () => {
const wrapper = createWrapper();
expect(wrapper.find(`#${AppTopID}`).exists()).toBe(true);
expect(wrapper.findComponent(`#${AppTopID}`).exists()).toBe(true);
});

describe('Custom CSS Properties', () => {
Expand Down Expand Up @@ -295,7 +295,7 @@ describe('App', () => {
matches: true,
});
const wrapper = createWrapper();
wrapper.setData({
await wrapper.setData({
appState: {
...wrapper.vm.appState,
preferredColorScheme: ColorScheme.auto,
Expand All @@ -308,7 +308,7 @@ describe('App', () => {

it('dynamically changes the data, upon color scheme change (in auto mode)', async () => {
const wrapper = createWrapper();
wrapper.setData({
await wrapper.setData({
appState: {
...wrapper.vm.appState,
preferredColorScheme: ColorScheme.auto,
Expand All @@ -317,13 +317,14 @@ describe('App', () => {
await flushPromises();
expect(setPropertySpy).toHaveBeenCalledWith('--text', LightDarkModeCSSSettings.text.light);
matchMedia.addListener.mock.calls[0][0].call(wrapper.vm, { matches: true });
await wrapper.vm.$nextTick();
expect(setPropertySpy).toHaveBeenCalledTimes(2);
expect(setPropertySpy).toHaveBeenCalledWith('--text', LightDarkModeCSSSettings.text.dark);
});

it('updates the values applied to the root, if the colors update', async () => {
const wrapper = createWrapper();
wrapper.setData({
await wrapper.setData({
appState: {
...wrapper.vm.appState,
preferredColorScheme: ColorScheme.auto,
Expand All @@ -334,6 +335,7 @@ describe('App', () => {
expect(setPropertySpy).toHaveBeenCalledTimes(1);
expect(setPropertySpy).toHaveBeenCalledWith('--text', 'light');
matchMedia.addListener.mock.calls[0][0].call(wrapper.vm, { matches: true });
await wrapper.vm.$nextTick();
expect(removePropertySpy).toHaveBeenCalledTimes(2);
expect(removePropertySpy).toHaveBeenLastCalledWith('--text');
expect(setPropertySpy).toHaveBeenCalledWith('--text', 'dark');
Expand Down Expand Up @@ -365,7 +367,7 @@ describe('App', () => {
});

it('renders a <custom-header>', () => {
const header = wrapper.find('custom-header-stub');
const header = wrapper.findComponent('custom-header-stub');
expect(header.exists()).toBe(true);
expect(header.attributes('data-color-scheme')).toBeDefined();
});
Expand All @@ -376,15 +378,15 @@ describe('App', () => {
header: '<div class="header">Header</div>',
},
});
const header = wrapper.find('custom-header-stub');
const header = wrapper.findComponent('custom-header-stub');
expect(header.exists()).toBe(false);
});
});

it('renders a <custom-footer> if one has been defined', () => {
window.customElements.get.mockImplementation(name => name === 'custom-footer');
const wrapper = createWrapper();
const footer = wrapper.find('custom-footer-stub');
const footer = wrapper.findComponent('custom-footer-stub');
expect(footer.exists()).toBe(true);
expect(footer.attributes('data-color-scheme')).toBeDefined();
});
Expand Down
Loading