Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d09fa99
Update Node.js & NPM in project's engines
marinaaisa Jul 2, 2025
1ebd60f
Update @vue/test-utils
marinaaisa Jul 3, 2025
9d9cbbb
Update tree-sitter-vue
marinaaisa Jul 3, 2025
6c25dff
Fix LanguageSwitcher.spec.js
marinaaisa Jul 14, 2025
7cb53fe
Fix Column.spec.js
marinaaisa Jul 14, 2025
25082b4
Fix Hero.spec.js
marinaaisa Jul 14, 2025
951a1ef
Fix ColorSchemeToggle.spec.js
marinaaisa Jul 4, 2025
0f15841
Fix ImageAsset.spec.js
marinaaisa Jul 4, 2025
899e335
Fix Pager.spec.js
marinaaisa Jul 4, 2025
991e588
Fix Assessments.spec.js
marinaaisa Jul 4, 2025
0da2c38
Fix swift.spec.js
marinaaisa Jul 7, 2025
5a3e5b8
Fix FilterInput.spec.js
marinaaisa Jul 7, 2025
888d7d9
Replace wrapper.find
marinaaisa Jul 8, 2025
38fa2a6
Wait for wrapper.setProps
marinaaisa Jul 8, 2025
623be47
Wait for wrapper.setData
marinaaisa Jul 8, 2025
26b7e5d
Await after .trigger() function
marinaaisa Jul 8, 2025
957197a
Fix Navigator.spec.js
marinaaisa Jul 8, 2025
f5ebd67
Fix ReplayableVideoAsset.spec.js
marinaaisa Jul 8, 2025
fb461a9
Replace 'Contains'
marinaaisa Jul 8, 2025
0edc7ba
Wait for nextTick after emitting an event
marinaaisa Jul 8, 2025
1f695d9
Fix TopicsLinkCardGridItem.spec.js
marinaaisa Jul 9, 2025
9e69141
Fix components/DocumentationTopic.spec.js
marinaaisa Jul 9, 2025
9f6a0a3
Fix Chapter.spec.js
marinaaisa Jul 9, 2025
0818f1a
Fix AdjustableSidebarWidth.spec.js
marinaaisa Jul 9, 2025
5d7958f
Fix Availability.spec.js
marinaaisa Jul 9, 2025
b07e5bf
Fix Hierarchy.spec.js
marinaaisa Jul 9, 2025
9d333e3
Fix NavBase.spec.js
marinaaisa Jul 9, 2025
934b0d0
Fix DocumentationLayout.spec.js
marinaaisa Jul 9, 2025
44e008f
Fix TopicsLinkBlock.spec.js
marinaaisa Jul 9, 2025
e370309
Fix CodePreview.spec.js
marinaaisa Jul 9, 2025
1047bb0
Fix App.spec.js
marinaaisa Jul 9, 2025
2133eaa
Fix DropdownCustom.spec.js
marinaaisa Jul 9, 2025
8aeb88e
Wait for .setValue()
marinaaisa Jul 9, 2025
3049140
Fix GenericModal.spec.js
marinaaisa Jul 9, 2025
e871d46
Fix LinksBlock.spec.js
marinaaisa Jul 9, 2025
e725e90
Fix ResourcesTile.spec.js
marinaaisa Jul 9, 2025
d0b4642
Fix RelationshipsList.spec.js
marinaaisa Jul 9, 2025
a41d73d
Fix all deprecated .is() method warnings
marinaaisa Jul 11, 2025
9e827de
Fix .find() and .get() deprecation warnings
marinaaisa Jul 11, 2025
9e977e1
Fix .findAll() deprecation warnings
marinaaisa Jul 11, 2025
0d964fd
Fix .contains() deprecation warnings
marinaaisa Jul 11, 2025
917c27e
Fix .isEmpty() deprecation warnings
marinaaisa Jul 11, 2025
687772b
Fix attachToDocument deprecation warnings
marinaaisa Jul 11, 2025
f4e2bf0
Fix QuickNavigationModal.spec.js
marinaaisa Jul 11, 2025
fd7283b
Fix console error warnings for TopicsLinkBlock.spec.js
marinaaisa Jul 11, 2025
64b9265
Fix ResourcesTileGroup.spec.js
marinaaisa Jul 11, 2025
290a213
Fix DeclarationTokenGroup.spec.js
marinaaisa Jul 14, 2025
c736eca
Remove redundant nextTick
marinaaisa Jul 24, 2025
529ae65
Update tree-sitter-javascript and tree-sitter-jsdoc
marinaaisa Jul 25, 2025
69df5fc
Make build-script-helper.py use python3
marinaaisa Jul 28, 2025
50d70a6
Update build-script helper.
mportiz08 Sep 16, 2025
29d8457
Merge remote-tracking branch 'swiftlang/main' into update-node
mportiz08 Sep 16, 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 @@ -76,8 +76,8 @@ def ensure_npm_is_installed(verbose=False):
# Ensure node_version is a string (decode if it's bytes)
if isinstance(node_version, bytes):
node_version = node_version.decode('utf-8')
if not node_version.strip().startswith('v18.16.'):
warn_msg = "Unexpected version of 'node' installed. Swift-DocC-Render requires node 18.16.1. "\
if not node_version.strip().startswith('v22.17.'):
warn_msg = "Unexpected version of 'node' installed. Swift-DocC-Render requires node v22.17 "\
"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
.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