mirror of
https://github.com/revanced/revanced-website.git
synced 2025-04-29 14:14:30 +02:00
chore: bump everything (#56)
This commit is contained in:
parent
e1b8445b59
commit
c9e0edf842
@ -1,5 +1,7 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/public
|
||||
/images
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
|
@ -1,6 +1,8 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/testing-docs
|
||||
/public
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
|
@ -2,5 +2,8 @@
|
||||
"useTabs": true,
|
||||
"singleQuote": true,
|
||||
"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",
|
||||
"preview": "sirv ./public --no-clear",
|
||||
"vite:preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"lint": "prettier --check --plugin-search-dir=. . && eslint .",
|
||||
"format": "prettier --write --plugin-search-dir=. ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-static": "next",
|
||||
"@sveltejs/kit": "next",
|
||||
"@sveltejs/adapter-static": "^1.0.0",
|
||||
"@sveltejs/kit": "^1.0.0",
|
||||
"@types/marked": "^4.0.7",
|
||||
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
||||
"@typescript-eslint/parser": "^5.27.0",
|
||||
"eslint": "^8.16.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint": "^8.28.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-svelte3": "^4.0.0",
|
||||
"prettier": "^2.6.2",
|
||||
"prettier-plugin-svelte": "^2.7.0",
|
||||
"imagetools-core": "^3.2.3",
|
||||
"prettier": "^2.8.0",
|
||||
"prettier-plugin-svelte": "^2.8.1",
|
||||
"sass": "^1.55.0",
|
||||
"sirv-cli": "^2.0.2",
|
||||
"svelte": "^3.44.0",
|
||||
"svelte-check": "^2.7.1",
|
||||
"svelte-preprocess": "^4.10.6",
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "^4.7.4",
|
||||
"vite": "^3.0.0",
|
||||
"svelte": "^3.54.0",
|
||||
"svelte-check": "^2.9.2",
|
||||
"tslib": "^2.4.1",
|
||||
"typescript": "^4.9.3",
|
||||
"vite": "^4.0.0",
|
||||
"vite-imagetools": "^4.0.11"
|
||||
},
|
||||
"type": "module",
|
||||
|
@ -2,7 +2,7 @@ import type { Readable, Subscriber, Unsubscriber, Writable } from 'svelte/store'
|
||||
import { writable } from 'svelte/store';
|
||||
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 cache from './cache';
|
||||
@ -64,12 +64,12 @@ export class API<T> implements Readable<T> {
|
||||
// Implements the load function found in `+page/layout.ts` files.
|
||||
page_load_impl() {
|
||||
return async ({ fetch }) => {
|
||||
if (prerendering) {
|
||||
if (building) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// 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(
|
||||
'The API client is not optimized for production server-side rendering. Please change that :)'
|
||||
);
|
||||
|
@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import '../app.scss';
|
||||
import { derived } from 'svelte/store';
|
||||
|
||||
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 :) -->
|
||||
|
||||
<!-- <Footer repos={$repositories}> -->
|
||||
<style lang="scss" global>
|
||||
@import '../app.scss';
|
||||
</style>
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { is_tree } 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 path from 'path';
|
||||
|
||||
import { parse as parse_md } from 'marked';
|
||||
import AsciiDocProcessor from 'asciidoctor'
|
||||
import AsciiDocProcessor from 'asciidoctor';
|
||||
|
||||
// This file does not work in a browser.
|
||||
if (browser) {
|
||||
@ -18,7 +18,7 @@ if (browser) {
|
||||
|
||||
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');
|
||||
|
||||
// Get and remove the first line.
|
||||
@ -33,7 +33,7 @@ supported_formats.set("md", markup => {
|
||||
});
|
||||
|
||||
const asciidoctor = AsciiDocProcessor();
|
||||
const adoc_fn = markup => {
|
||||
const adoc_fn = (markup) => {
|
||||
// Get first line.
|
||||
const first_line = markup.split('\n')[0];
|
||||
// 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.
|
||||
// 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 };
|
||||
}
|
||||
};
|
||||
|
||||
supported_formats.set("adoc", adoc_fn)
|
||||
supported_formats.set("asciidoc", adoc_fn)
|
||||
supported_formats.set('adoc', adoc_fn);
|
||||
supported_formats.set('asciidoc', adoc_fn);
|
||||
|
||||
const supported_filetypes = [...supported_formats.keys()];
|
||||
|
||||
let docs_folder = process.env.REVANCED_DOCS_FOLDER;
|
||||
if (docs_folder === undefined) {
|
||||
if (prerendering) { console.warn("Using testing docs in production build") }
|
||||
docs_folder = "testing-docs";
|
||||
if (building) {
|
||||
console.warn('Using testing docs in production build');
|
||||
}
|
||||
docs_folder = 'testing-docs';
|
||||
}
|
||||
|
||||
const ignored_items = ["assets"];
|
||||
const ignored_items = ['assets'];
|
||||
|
||||
/// Utility functions
|
||||
|
||||
@ -81,11 +83,11 @@ function get_slug_of_node(node: DocsTreeNode): string {
|
||||
/// Important functions
|
||||
|
||||
// Get a document. Returns null if it does not exist.
|
||||
export function get(slug: string): Document|null {
|
||||
export function get(slug: string): Document | null {
|
||||
let target = path.join(docs_folder, slug);
|
||||
// Handle index (readme) file for folder.
|
||||
if (exists(target) && is_directory(target)) {
|
||||
target += "/README";
|
||||
target += '/README';
|
||||
}
|
||||
|
||||
const dir = path.dirname(target);
|
||||
@ -93,7 +95,9 @@ export function get(slug: string): Document|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.
|
||||
for (const item of fs.readdirSync(dir)) {
|
||||
full_path = path.join(dir, item);
|
||||
@ -126,22 +130,22 @@ function process_file(fname: string): DocumentInfo {
|
||||
// Remove docs folder prefix and file extension suffix, then split it.
|
||||
const parts = fname
|
||||
.substring(`${docs_folder}/`.length, fname.length - (get_ext(fname).length + 1))
|
||||
.split("/");
|
||||
.split('/');
|
||||
|
||||
// Remove `README` suffix if present.
|
||||
const last_part_index = parts.length - 1;
|
||||
if (parts[last_part_index] == "README") {
|
||||
if (parts[last_part_index] == 'README') {
|
||||
parts.pop();
|
||||
}
|
||||
|
||||
const slug = parts.join("/");
|
||||
const slug = parts.join('/');
|
||||
const title = get(slug).title;
|
||||
|
||||
return { slug, title };
|
||||
}
|
||||
|
||||
// Returns a document tree.
|
||||
function process_folder(dir: string): DocsTree|null {
|
||||
function process_folder(dir: string): DocsTree | null {
|
||||
let tree: DocsTree = {
|
||||
index: null,
|
||||
nodes: []
|
||||
@ -151,7 +155,7 @@ function process_folder(dir: string): DocsTree|null {
|
||||
const items = fs.readdirSync(dir);
|
||||
|
||||
for (const item of items) {
|
||||
if (ignored_items.includes(item) || [".", "_"].includes(item[0])) {
|
||||
if (ignored_items.includes(item) || ['.', '_'].includes(item[0])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -175,7 +179,7 @@ function process_folder(dir: string): DocsTree|null {
|
||||
|
||||
const node = is_dir ? process_folder(itemPath) : process_file(itemPath);
|
||||
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;
|
||||
}
|
||||
|
||||
@ -192,8 +196,8 @@ function process_folder(dir: string): DocsTree|null {
|
||||
|
||||
// `numeric: true` because we want to be able to specify
|
||||
// the order if necessary by prepending a number to the file name.
|
||||
tree.nodes.sort(
|
||||
(a, b) => get_slug_of_node(a).localeCompare(get_slug_of_node(b), "en", { numeric: true })
|
||||
tree.nodes.sort((a, b) =>
|
||||
get_slug_of_node(a).localeCompare(get_slug_of_node(b), 'en', { numeric: true })
|
||||
);
|
||||
|
||||
return tree;
|
||||
@ -203,7 +207,7 @@ function process_folder(dir: string): DocsTree|null {
|
||||
export function index_content(): DocsTree {
|
||||
const tree = process_folder(docs_folder);
|
||||
if (tree === null) {
|
||||
throw new Error("Root must have index (README) file.")
|
||||
throw new Error('Root must have index (README) file.');
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
@ -1,12 +1,9 @@
|
||||
import adapter from '@sveltejs/adapter-static';
|
||||
import preprocess from 'svelte-preprocess';
|
||||
import path from 'path';
|
||||
import { vitePreprocess } from '@sveltejs/kit/vite';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
// Consult https://github.com/sveltejs/svelte-preprocess
|
||||
// for more information about preprocessors
|
||||
preprocess: preprocess(),
|
||||
preprocess: [vitePreprocess()],
|
||||
|
||||
kit: {
|
||||
// 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