mirror of
https://github.com/revanced/revanced-website.git
synced 2025-04-29 22:24:31 +02:00
chore: bump everything (#56)
This commit is contained in:
parent
e1b8445b59
commit
c9e0edf842
@ -1,5 +1,7 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
|
/public
|
||||||
|
/images
|
||||||
/build
|
/build
|
||||||
/.svelte-kit
|
/.svelte-kit
|
||||||
/package
|
/package
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
/build
|
/build
|
||||||
|
/testing-docs
|
||||||
|
/public
|
||||||
/.svelte-kit
|
/.svelte-kit
|
||||||
/package
|
/package
|
||||||
.env
|
.env
|
||||||
|
@ -2,5 +2,8 @@
|
|||||||
"useTabs": true,
|
"useTabs": true,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"printWidth": 100
|
"printWidth": 100,
|
||||||
|
"plugins": ["prettier-plugin-svelte"],
|
||||||
|
"pluginSearchDirs": ["."],
|
||||||
|
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||||
}
|
}
|
||||||
|
1585
package-lock.json
generated
1585
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -7,30 +7,30 @@
|
|||||||
"package": "svelte-kit package",
|
"package": "svelte-kit package",
|
||||||
"preview": "sirv ./public --no-clear",
|
"preview": "sirv ./public --no-clear",
|
||||||
"vite:preview": "vite preview",
|
"vite:preview": "vite preview",
|
||||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
"lint": "prettier --check --plugin-search-dir=. . && eslint .",
|
"lint": "prettier --check --plugin-search-dir=. . && eslint .",
|
||||||
"format": "prettier --write --plugin-search-dir=. ."
|
"format": "prettier --write --plugin-search-dir=. ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-static": "next",
|
"@sveltejs/adapter-static": "^1.0.0",
|
||||||
"@sveltejs/kit": "next",
|
"@sveltejs/kit": "^1.0.0",
|
||||||
"@types/marked": "^4.0.7",
|
"@types/marked": "^4.0.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
||||||
"@typescript-eslint/parser": "^5.27.0",
|
"@typescript-eslint/parser": "^5.27.0",
|
||||||
"eslint": "^8.16.0",
|
"eslint": "^8.28.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-svelte3": "^4.0.0",
|
"eslint-plugin-svelte3": "^4.0.0",
|
||||||
"prettier": "^2.6.2",
|
"imagetools-core": "^3.2.3",
|
||||||
"prettier-plugin-svelte": "^2.7.0",
|
"prettier": "^2.8.0",
|
||||||
|
"prettier-plugin-svelte": "^2.8.1",
|
||||||
"sass": "^1.55.0",
|
"sass": "^1.55.0",
|
||||||
"sirv-cli": "^2.0.2",
|
"sirv-cli": "^2.0.2",
|
||||||
"svelte": "^3.44.0",
|
"svelte": "^3.54.0",
|
||||||
"svelte-check": "^2.7.1",
|
"svelte-check": "^2.9.2",
|
||||||
"svelte-preprocess": "^4.10.6",
|
"tslib": "^2.4.1",
|
||||||
"tslib": "^2.3.1",
|
"typescript": "^4.9.3",
|
||||||
"typescript": "^4.7.4",
|
"vite": "^4.0.0",
|
||||||
"vite": "^3.0.0",
|
|
||||||
"vite-imagetools": "^4.0.11"
|
"vite-imagetools": "^4.0.11"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
@ -2,7 +2,7 @@ import type { Readable, Subscriber, Unsubscriber, Writable } from 'svelte/store'
|
|||||||
import { writable } from 'svelte/store';
|
import { writable } from 'svelte/store';
|
||||||
import { error } from '@sveltejs/kit';
|
import { error } from '@sveltejs/kit';
|
||||||
|
|
||||||
import { prerendering, browser, dev } from '$app/environment';
|
import { building, browser, dev } from '$app/environment';
|
||||||
|
|
||||||
import * as settings from './settings';
|
import * as settings from './settings';
|
||||||
import * as cache from './cache';
|
import * as cache from './cache';
|
||||||
@ -64,12 +64,12 @@ export class API<T> implements Readable<T> {
|
|||||||
// Implements the load function found in `+page/layout.ts` files.
|
// Implements the load function found in `+page/layout.ts` files.
|
||||||
page_load_impl() {
|
page_load_impl() {
|
||||||
return async ({ fetch }) => {
|
return async ({ fetch }) => {
|
||||||
if (prerendering) {
|
if (building) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Might be better to actually return some data from the load function and use that on the client.
|
// Might be better to actually return some data from the load function and use that on the client.
|
||||||
if (!(dev || browser || prerendering)) {
|
if (!(dev || browser || building)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'The API client is not optimized for production server-side rendering. Please change that :)'
|
'The API client is not optimized for production server-side rendering. Please change that :)'
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import '../app.scss';
|
||||||
import { derived } from 'svelte/store';
|
import { derived } from 'svelte/store';
|
||||||
|
|
||||||
import NavHost from '$layout/Navbar/NavHost.svelte';
|
import NavHost from '$layout/Navbar/NavHost.svelte';
|
||||||
@ -32,6 +33,3 @@
|
|||||||
afn if you are moving the footer here, please make it not use the repositories store directly and instead use component props :) -->
|
afn if you are moving the footer here, please make it not use the repositories store directly and instead use component props :) -->
|
||||||
|
|
||||||
<!-- <Footer repos={$repositories}> -->
|
<!-- <Footer repos={$repositories}> -->
|
||||||
<style lang="scss" global>
|
|
||||||
@import '../app.scss';
|
|
||||||
</style>
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { is_tree } from './documentation.shared';
|
import { is_tree } from './documentation.shared';
|
||||||
import type { Document, DocsTree, DocsTreeNode, DocumentInfo } from './documentation.shared';
|
import type { Document, DocsTree, DocsTreeNode, DocumentInfo } from './documentation.shared';
|
||||||
|
|
||||||
import { browser, prerendering } from '$app/environment';
|
import { browser, building } from '$app/environment';
|
||||||
|
|
||||||
import fs, { existsSync as exists } from 'fs';
|
import fs, { existsSync as exists } from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
import { parse as parse_md } from 'marked';
|
import { parse as parse_md } from 'marked';
|
||||||
import AsciiDocProcessor from 'asciidoctor'
|
import AsciiDocProcessor from 'asciidoctor';
|
||||||
|
|
||||||
// This file does not work in a browser.
|
// This file does not work in a browser.
|
||||||
if (browser) {
|
if (browser) {
|
||||||
@ -18,7 +18,7 @@ if (browser) {
|
|||||||
|
|
||||||
const supported_formats: Map<string, (markup: string) => Document> = new Map();
|
const supported_formats: Map<string, (markup: string) => Document> = new Map();
|
||||||
|
|
||||||
supported_formats.set("md", markup => {
|
supported_formats.set('md', (markup) => {
|
||||||
let lines = markup.split('\n');
|
let lines = markup.split('\n');
|
||||||
|
|
||||||
// Get and remove the first line.
|
// Get and remove the first line.
|
||||||
@ -33,7 +33,7 @@ supported_formats.set("md", markup => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const asciidoctor = AsciiDocProcessor();
|
const asciidoctor = AsciiDocProcessor();
|
||||||
const adoc_fn = markup => {
|
const adoc_fn = (markup) => {
|
||||||
// Get first line.
|
// Get first line.
|
||||||
const first_line = markup.split('\n')[0];
|
const first_line = markup.split('\n')[0];
|
||||||
// Remove `= `.
|
// Remove `= `.
|
||||||
@ -41,23 +41,25 @@ const adoc_fn = markup => {
|
|||||||
|
|
||||||
// Convert it to html. Unlike markdown, we do not need to remove the first title heading.
|
// Convert it to html. Unlike markdown, we do not need to remove the first title heading.
|
||||||
// NOTE: Maybe consider change the safe mode value.
|
// NOTE: Maybe consider change the safe mode value.
|
||||||
const content = asciidoctor.convert(markup, { doctype: "book" })
|
const content = asciidoctor.convert(markup, { doctype: 'book' });
|
||||||
|
|
||||||
return { title, content };
|
return { title, content };
|
||||||
}
|
};
|
||||||
|
|
||||||
supported_formats.set("adoc", adoc_fn)
|
supported_formats.set('adoc', adoc_fn);
|
||||||
supported_formats.set("asciidoc", adoc_fn)
|
supported_formats.set('asciidoc', adoc_fn);
|
||||||
|
|
||||||
const supported_filetypes = [...supported_formats.keys()];
|
const supported_filetypes = [...supported_formats.keys()];
|
||||||
|
|
||||||
let docs_folder = process.env.REVANCED_DOCS_FOLDER;
|
let docs_folder = process.env.REVANCED_DOCS_FOLDER;
|
||||||
if (docs_folder === undefined) {
|
if (docs_folder === undefined) {
|
||||||
if (prerendering) { console.warn("Using testing docs in production build") }
|
if (building) {
|
||||||
docs_folder = "testing-docs";
|
console.warn('Using testing docs in production build');
|
||||||
|
}
|
||||||
|
docs_folder = 'testing-docs';
|
||||||
}
|
}
|
||||||
|
|
||||||
const ignored_items = ["assets"];
|
const ignored_items = ['assets'];
|
||||||
|
|
||||||
/// Utility functions
|
/// Utility functions
|
||||||
|
|
||||||
@ -85,7 +87,7 @@ export function get(slug: string): Document|null {
|
|||||||
let target = path.join(docs_folder, slug);
|
let target = path.join(docs_folder, slug);
|
||||||
// Handle index (readme) file for folder.
|
// Handle index (readme) file for folder.
|
||||||
if (exists(target) && is_directory(target)) {
|
if (exists(target) && is_directory(target)) {
|
||||||
target += "/README";
|
target += '/README';
|
||||||
}
|
}
|
||||||
|
|
||||||
const dir = path.dirname(target);
|
const dir = path.dirname(target);
|
||||||
@ -93,7 +95,9 @@ export function get(slug: string): Document|null {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let full_path, ext, found = false;
|
let full_path,
|
||||||
|
ext,
|
||||||
|
found = false;
|
||||||
// We are looking for the file `${target}.(any_supported_extension)`. Try to find it.
|
// We are looking for the file `${target}.(any_supported_extension)`. Try to find it.
|
||||||
for (const item of fs.readdirSync(dir)) {
|
for (const item of fs.readdirSync(dir)) {
|
||||||
full_path = path.join(dir, item);
|
full_path = path.join(dir, item);
|
||||||
@ -126,15 +130,15 @@ function process_file(fname: string): DocumentInfo {
|
|||||||
// Remove docs folder prefix and file extension suffix, then split it.
|
// Remove docs folder prefix and file extension suffix, then split it.
|
||||||
const parts = fname
|
const parts = fname
|
||||||
.substring(`${docs_folder}/`.length, fname.length - (get_ext(fname).length + 1))
|
.substring(`${docs_folder}/`.length, fname.length - (get_ext(fname).length + 1))
|
||||||
.split("/");
|
.split('/');
|
||||||
|
|
||||||
// Remove `README` suffix if present.
|
// Remove `README` suffix if present.
|
||||||
const last_part_index = parts.length - 1;
|
const last_part_index = parts.length - 1;
|
||||||
if (parts[last_part_index] == "README") {
|
if (parts[last_part_index] == 'README') {
|
||||||
parts.pop();
|
parts.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
const slug = parts.join("/");
|
const slug = parts.join('/');
|
||||||
const title = get(slug).title;
|
const title = get(slug).title;
|
||||||
|
|
||||||
return { slug, title };
|
return { slug, title };
|
||||||
@ -151,7 +155,7 @@ function process_folder(dir: string): DocsTree|null {
|
|||||||
const items = fs.readdirSync(dir);
|
const items = fs.readdirSync(dir);
|
||||||
|
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
if (ignored_items.includes(item) || [".", "_"].includes(item[0])) {
|
if (ignored_items.includes(item) || ['.', '_'].includes(item[0])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +179,7 @@ function process_folder(dir: string): DocsTree|null {
|
|||||||
|
|
||||||
const node = is_dir ? process_folder(itemPath) : process_file(itemPath);
|
const node = is_dir ? process_folder(itemPath) : process_file(itemPath);
|
||||||
if (node === null) {
|
if (node === null) {
|
||||||
console.error(`The ${itemPath} directory does not have a README/index file! ignoring...`)
|
console.error(`The ${itemPath} directory does not have a README/index file! ignoring...`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,8 +196,8 @@ function process_folder(dir: string): DocsTree|null {
|
|||||||
|
|
||||||
// `numeric: true` because we want to be able to specify
|
// `numeric: true` because we want to be able to specify
|
||||||
// the order if necessary by prepending a number to the file name.
|
// the order if necessary by prepending a number to the file name.
|
||||||
tree.nodes.sort(
|
tree.nodes.sort((a, b) =>
|
||||||
(a, b) => get_slug_of_node(a).localeCompare(get_slug_of_node(b), "en", { numeric: true })
|
get_slug_of_node(a).localeCompare(get_slug_of_node(b), 'en', { numeric: true })
|
||||||
);
|
);
|
||||||
|
|
||||||
return tree;
|
return tree;
|
||||||
@ -203,7 +207,7 @@ function process_folder(dir: string): DocsTree|null {
|
|||||||
export function index_content(): DocsTree {
|
export function index_content(): DocsTree {
|
||||||
const tree = process_folder(docs_folder);
|
const tree = process_folder(docs_folder);
|
||||||
if (tree === null) {
|
if (tree === null) {
|
||||||
throw new Error("Root must have index (README) file.")
|
throw new Error('Root must have index (README) file.');
|
||||||
}
|
}
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import adapter from '@sveltejs/adapter-static';
|
import adapter from '@sveltejs/adapter-static';
|
||||||
import preprocess from 'svelte-preprocess';
|
import { vitePreprocess } from '@sveltejs/kit/vite';
|
||||||
import path from 'path';
|
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
// Consult https://github.com/sveltejs/svelte-preprocess
|
preprocess: [vitePreprocess()],
|
||||||
// for more information about preprocessors
|
|
||||||
preprocess: preprocess(),
|
|
||||||
|
|
||||||
kit: {
|
kit: {
|
||||||
// adapter-static has vercel detection, but that does not let you set a custom 404 page easily.
|
// adapter-static has vercel detection, but that does not let you set a custom 404 page easily.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user