Skip to content

Commit f24cd5b

Browse files
committed
ci: keep single quotes in website oxfmt output
oxfmt reads `quote_type` from `.editorconfig`; set it to `single` to match apify-docs and apify-core, and reformat the website code accordingly.
1 parent d443956 commit f24cd5b

13 files changed

Lines changed: 147 additions & 146 deletions

File tree

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99
end_of_line = lf
10+
quote_type = single
1011

1112
[Makefile]
1213
indent_style = tab

website/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
33
};

website/docusaurus.config.js

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
const { join, resolve } = require("node:path");
1+
const { join, resolve } = require('node:path');
22

3-
const { config } = require("@apify/docs-theme");
3+
const { config } = require('@apify/docs-theme');
44

5-
const { externalLinkProcessor } = require("./tools/utils/externalLink");
6-
const versions = require("./versions.json");
5+
const { externalLinkProcessor } = require('./tools/utils/externalLink');
6+
const versions = require('./versions.json');
77

88
const GROUP_ORDER = [
9-
"Apify API clients",
10-
"HTTP clients",
11-
"Resource clients",
12-
"Errors",
13-
"Models",
14-
"Typed dicts",
15-
"Other",
9+
'Apify API clients',
10+
'HTTP clients',
11+
'Resource clients',
12+
'Errors',
13+
'Models',
14+
'Typed dicts',
15+
'Other',
1616
];
1717

1818
const groupSort = (g1, g2) => {
@@ -46,57 +46,57 @@ module.exports = {
4646
useCssCascadeLayers: false,
4747
},
4848
},
49-
title: "API client for Python | Apify Documentation",
49+
title: 'API client for Python | Apify Documentation',
5050
url: absoluteUrl,
51-
baseUrl: "/api/client/python",
51+
baseUrl: '/api/client/python',
5252
trailingSlash: false,
53-
organizationName: "apify",
54-
projectName: "apify-client-python",
55-
favicon: "img/favicon.ico",
56-
scripts: ["/js/custom.js", ...(config.scripts ?? [])],
57-
onBrokenLinks: /** @type {import('@docusaurus/types').ReportingSeverity} */ ("warn"),
58-
onBrokenMarkdownLinks: /** @type {import('@docusaurus/types').ReportingSeverity} */ ("warn"),
53+
organizationName: 'apify',
54+
projectName: 'apify-client-python',
55+
favicon: 'img/favicon.ico',
56+
scripts: ['/js/custom.js', ...(config.scripts ?? [])],
57+
onBrokenLinks: /** @type {import('@docusaurus/types').ReportingSeverity} */ ('warn'),
58+
onBrokenMarkdownLinks: /** @type {import('@docusaurus/types').ReportingSeverity} */ ('warn'),
5959
themes: [
6060
[
61-
"@apify/docs-theme",
61+
'@apify/docs-theme',
6262
{
6363
changelogFromRoot: true,
6464
changelogDisplayedSidebar: `sidebar`,
6565
subNavbar: {
66-
title: "API Client for Python",
66+
title: 'API Client for Python',
6767
items: [
6868
{
69-
type: "doc",
70-
docId: "introduction/introduction",
71-
label: "Docs",
72-
position: "left",
73-
activeBaseRegex: "/docs(?!/changelog)",
69+
type: 'doc',
70+
docId: 'introduction/introduction',
71+
label: 'Docs',
72+
position: 'left',
73+
activeBaseRegex: '/docs(?!/changelog)',
7474
},
7575
{
76-
type: "custom-versioned-reference",
77-
label: "Reference",
78-
position: "left",
79-
activeBaseRegex: "/reference",
76+
type: 'custom-versioned-reference',
77+
label: 'Reference',
78+
position: 'left',
79+
activeBaseRegex: '/reference',
8080
},
8181
{
82-
type: "doc",
83-
docId: "changelog",
84-
label: "Changelog",
85-
position: "left",
86-
activeBaseRegex: "/docs/changelog",
82+
type: 'doc',
83+
docId: 'changelog',
84+
label: 'Changelog',
85+
position: 'left',
86+
activeBaseRegex: '/docs/changelog',
8787
},
8888
{
89-
href: "https://github.com/apify/apify-client-python",
90-
label: "GitHub",
91-
position: "left",
89+
href: 'https://github.com/apify/apify-client-python',
90+
label: 'GitHub',
91+
position: 'left',
9292
},
9393
{
94-
type: "docsVersionDropdown",
95-
position: "left",
96-
className: "navbar__item",
97-
"data-api-links": JSON.stringify([
98-
"reference/next",
99-
...versions.map((version, i) => (i === 0 ? "reference" : `reference/${version}`)),
94+
type: 'docsVersionDropdown',
95+
position: 'left',
96+
className: 'navbar__item',
97+
'data-api-links': JSON.stringify([
98+
'reference/next',
99+
...versions.map((version, i) => (i === 0 ? 'reference' : `reference/${version}`)),
100100
]),
101101
dropdownItemsBefore: [],
102102
dropdownItemsAfter: [],
@@ -108,47 +108,47 @@ module.exports = {
108108
],
109109
presets: /** @type {import('@docusaurus/types').PresetConfig[]} */ ([
110110
[
111-
"@docusaurus/preset-classic",
111+
'@docusaurus/preset-classic',
112112
/** @type {import('@docusaurus/preset-classic').Options} */
113113
({
114114
docs: {
115-
path: "../docs",
116-
sidebarPath: "./sidebars.js",
115+
path: '../docs',
116+
sidebarPath: './sidebars.js',
117117
rehypePlugins: [externalLinkProcessor],
118-
editUrl: "https://github.com/apify/apify-client-python/blob/master/website/",
118+
editUrl: 'https://github.com/apify/apify-client-python/blob/master/website/',
119119
},
120120
}),
121121
],
122122
]),
123123
plugins: [
124124
[
125-
"@apify/docusaurus-plugin-typedoc-api",
125+
'@apify/docusaurus-plugin-typedoc-api',
126126
{
127-
projectRoot: ".",
127+
projectRoot: '.',
128128
changelogs: false,
129129
readmes: false,
130-
packages: [{ path: "." }],
130+
packages: [{ path: '.' }],
131131
typedocOptions: {
132132
excludeExternals: false,
133133
},
134134
sortSidebar: groupSort,
135-
routeBasePath: "reference",
135+
routeBasePath: 'reference',
136136
python: true,
137137
pythonOptions: {
138-
pythonModulePath: join(__dirname, "../src/apify_client"),
139-
moduleShortcutsPath: join(__dirname, "module_shortcuts.json"),
138+
pythonModulePath: join(__dirname, '../src/apify_client'),
139+
moduleShortcutsPath: join(__dirname, 'module_shortcuts.json'),
140140
},
141141
},
142142
],
143143
[
144-
resolve(__dirname, "src/plugins/docusaurus-plugin-segment"),
144+
resolve(__dirname, 'src/plugins/docusaurus-plugin-segment'),
145145
{
146146
writeKey: process.env.SEGMENT_TOKEN,
147147
allowedInDev: false,
148148
},
149149
],
150150
[
151-
"@signalwire/docusaurus-plugin-llms-txt",
151+
'@signalwire/docusaurus-plugin-llms-txt',
152152
{
153153
content: {
154154
includeVersionedDocs: false,
@@ -158,10 +158,10 @@ module.exports = {
158158
includePages: true,
159159
relativePaths: false,
160160
excludeRoutes: [
161-
"/api/client/python/reference/[0-9]*/**",
162-
"/api/client/python/reference/[0-9]*",
163-
"/api/client/python/reference/next/**",
164-
"/api/client/python/reference/next",
161+
'/api/client/python/reference/[0-9]*/**',
162+
'/api/client/python/reference/[0-9]*',
163+
'/api/client/python/reference/next/**',
164+
'/api/client/python/reference/next',
165165
],
166166
},
167167
},
@@ -179,11 +179,11 @@ module.exports = {
179179
...config.themeConfig.footer,
180180
logo: {
181181
...config.themeConfig.footer.logo,
182-
href: "docs",
182+
href: 'docs',
183183
},
184184
},
185185
},
186-
staticDirectories: ["node_modules/@apify/docs-theme/static", "static"],
186+
staticDirectories: ['node_modules/@apify/docs-theme/static', 'static'],
187187
customFields: {
188188
...(config.customFields ?? []),
189189
},

website/oxlint.config.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { defineConfig } from "@apify/oxlint-config";
1+
import { defineConfig } from '@apify/oxlint-config';
22

33
export default defineConfig({
4-
plugins: ["react"],
4+
plugins: ['react'],
55
ignorePatterns: [
6-
"**/node_modules",
7-
".docusaurus",
8-
"build",
9-
"versioned_docs",
10-
"versioned_sidebars",
11-
"api-typedoc-generated.json",
12-
"module_shortcuts.json",
6+
'**/node_modules',
7+
'.docusaurus',
8+
'build',
9+
'versioned_docs',
10+
'versioned_sidebars',
11+
'api-typedoc-generated.json',
12+
'module_shortcuts.json',
1313
],
1414
rules: {
1515
// Docusaurus theme/plugin/page modules are loaded via their default export.
16-
"import/no-default-export": "off",
16+
'import/no-default-export': 'off',
1717
// Site code logs intentionally (plugin diagnostics, build-time helpers).
18-
"no-console": "off",
18+
'no-console': 'off',
1919
},
2020
});

website/sidebars.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
module.exports = {
22
sidebar: [
33
{
4-
type: "doc",
5-
id: "introduction/introduction",
4+
type: 'doc',
5+
id: 'introduction/introduction',
66
},
77
{
8-
type: "doc",
9-
id: "introduction/quick-start",
8+
type: 'doc',
9+
id: 'introduction/quick-start',
1010
},
1111
{
12-
type: "category",
13-
label: "Concepts",
12+
type: 'category',
13+
label: 'Concepts',
1414
collapsed: true,
1515
items: [
1616
{
17-
type: "autogenerated",
18-
dirName: "02_concepts",
17+
type: 'autogenerated',
18+
dirName: '02_concepts',
1919
},
2020
],
2121
},
2222
{
23-
type: "category",
24-
label: "Guides",
23+
type: 'category',
24+
label: 'Guides',
2525
collapsed: true,
2626
items: [
2727
{
28-
type: "autogenerated",
29-
dirName: "03_guides",
28+
type: 'autogenerated',
29+
dirName: '03_guides',
3030
},
3131
],
3232
},
3333
{
34-
type: "category",
35-
label: "Upgrading",
34+
type: 'category',
35+
label: 'Upgrading',
3636
collapsed: true,
3737
items: [
3838
{
39-
type: "autogenerated",
40-
dirName: "04_upgrading",
39+
type: 'autogenerated',
40+
dirName: '04_upgrading',
4141
},
4242
],
4343
},

website/src/pages/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { useEffect } from "react";
2-
import { useHistory } from "@docusaurus/router";
1+
import { useEffect } from 'react';
2+
import { useHistory } from '@docusaurus/router';
33

44
export default function Home() {
55
const history = useHistory();
66

77
useEffect(() => {
8-
history.replace("/api/client/python/docs");
8+
history.replace('/api/client/python/docs');
99
}, [history]);
1010

1111
return null;

website/src/plugins/docusaurus-plugin-segment/index.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
const path = require("node:path");
1+
const path = require('node:path');
22

33
module.exports = function (context, options) {
44
const { writeKey, allowedInDev = false } = options;
55

66
return {
7-
name: "docusaurus-plugin-segment",
7+
name: 'docusaurus-plugin-segment',
88

99
getClientModules() {
10-
return [path.resolve(__dirname, "./segment")];
10+
return [path.resolve(__dirname, './segment')];
1111
},
1212

1313
injectHtmlTags() {
14-
if (process.env.NODE_ENV !== "production" && !allowedInDev) {
14+
if (process.env.NODE_ENV !== 'production' && !allowedInDev) {
1515
return {};
1616
}
1717

1818
if (!writeKey) {
19-
console.warn("You need to specify a Segment writeKey in the plugin options");
19+
console.warn('You need to specify a Segment writeKey in the plugin options');
2020
return {};
2121
}
2222

2323
return {
2424
headTags: [
2525
{
26-
tagName: "script",
26+
tagName: 'script',
2727
attributes: {
28-
src: "https://cdn.cookielaw.org/scripttemplates/otSDKStub.js",
29-
type: "text/javascript",
30-
charset: "UTF-8",
31-
"data-domain-script": "7a8d334b-f744-4c02-9931-92861196dd3c",
28+
src: 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js',
29+
type: 'text/javascript',
30+
charset: 'UTF-8',
31+
'data-domain-script': '7a8d334b-f744-4c02-9931-92861196dd3c',
3232
},
3333
},
3434
{
35-
tagName: "script",
35+
tagName: 'script',
3636
attributes: {
37-
type: "text/javascript",
37+
type: 'text/javascript',
3838
},
39-
innerHTML: "function OptanonWrapper() {}",
39+
innerHTML: 'function OptanonWrapper() {}',
4040
},
4141
{
42-
tagName: "script",
42+
tagName: 'script',
4343
attributes: {
44-
src: "https://cdn.jsdelivr.net/npm/@segment/analytics-consent-wrapper-onetrust@latest/dist/umd/analytics-onetrust.umd.js",
44+
src: 'https://cdn.jsdelivr.net/npm/@segment/analytics-consent-wrapper-onetrust@latest/dist/umd/analytics-onetrust.umd.js',
4545
},
4646
},
4747
{
48-
tagName: "script",
48+
tagName: 'script',
4949
innerHTML: `
5050
!function(){var i="analytics",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");n.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.setAttribute("data-global-segment-analytics-key",i);t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey="${writeKey}";;analytics.SNIPPET_VERSION="5.2.0";
5151
withOneTrust(analytics.load("${writeKey}", { integrations: { "Segment.io": { apiHost: "analytics.apify.com/v1" } } }));

0 commit comments

Comments
 (0)