Merge 3486a8e48a
into 8d15ad986d
This commit is contained in:
commit
4aa426def3
|
@ -15,7 +15,7 @@ module.exports = {
|
|||
'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
|
||||
|
||||
// imports
|
||||
'import/extensions': ['warn', 'never'],
|
||||
'import/extensions': ['warn', 'always'], // "always" is most compatible with default vanilla ES Modules
|
||||
'import/order': [
|
||||
'warn',
|
||||
{
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"Xrequire": "@babel/register",
|
||||
"Xexperimental-specifier-resolution=node": "",
|
||||
"node-option": [
|
||||
"loader=ts-node/esm"
|
||||
]
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
require: '@babel/register'
|
|
@ -5,10 +5,10 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
import { gitP } from 'simple-git';
|
||||
import { argv } from 'yargs';
|
||||
import { parseLanguageNames } from '../tests/helper/test-case';
|
||||
import { config as baseConfig } from './config';
|
||||
import type { Prism } from '../src/core';
|
||||
import type { Config, ConfigOptions } from './config';
|
||||
import { parseLanguageNames } from '../tests/helper/test-case.js';
|
||||
import { config as baseConfig } from './config.js';
|
||||
import type { Prism } from '../src/core.js';
|
||||
import type { Config, ConfigOptions } from './config.js';
|
||||
import type { Options, Stats } from 'benchmark';
|
||||
|
||||
|
||||
|
|
|
@ -2,14 +2,16 @@
|
|||
"name": "prismjs",
|
||||
"version": "1.29.0",
|
||||
"description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.",
|
||||
"main": "prism.js",
|
||||
"type": "module",
|
||||
"main": "dist/core/prism.js",
|
||||
"style": "themes/prism.css",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"scripts": {
|
||||
"benchmark": "ts-node benchmark/benchmark.ts",
|
||||
"build": "ts-node scripts/build.ts",
|
||||
"build": "ts-node-esm scripts/build.ts && npm run tsc",
|
||||
"prepare": "npm run build",
|
||||
"lint": "eslint . --cache",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"lint:ci": "eslint . --max-warnings 0",
|
||||
|
@ -23,7 +25,8 @@
|
|||
"test:plugins": "ts-mocha tests/plugins/**/*.ts",
|
||||
"test:runner": "ts-mocha tests/testrunner-tests.ts",
|
||||
"test": "npm-run-all test:*",
|
||||
"tsc": "tsc && tsc -p tests/tsconfig.json"
|
||||
"typecheck": "tsc --noEmit && tsc -p tests/tsconfig.json --noEmit",
|
||||
"tsc": "tsc"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
401
scripts/build.ts
401
scripts/build.ts
|
@ -1,34 +1,36 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import rollupTerser from '@rollup/plugin-terser';
|
||||
import rollupTypescript from '@rollup/plugin-typescript';
|
||||
// import rollupTerser from '@rollup/plugin-terser';
|
||||
// import rollupTypescript from '@rollup/plugin-typescript';
|
||||
import CleanCSS from 'clean-css';
|
||||
import fs from 'fs';
|
||||
import { mkdir, readFile, readdir, rm, writeFile, } from 'fs/promises';
|
||||
import MagicString from 'magic-string';
|
||||
// import MagicString from 'magic-string';
|
||||
import path from 'path';
|
||||
import { rollup } from 'rollup';
|
||||
// import { rollup } from 'rollup';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { webfont } from 'webfont';
|
||||
import { toArray } from '../src/shared/util';
|
||||
import { components } from './components';
|
||||
import { parallel, runTask, series } from './tasks';
|
||||
import type { ComponentProto } from '../src/types';
|
||||
import type { Plugin, SourceMapInput } from 'rollup';
|
||||
// import { toArray } from '../src/shared/util.js';
|
||||
// import { components } from './components.js';
|
||||
import { parallel, runTask, series } from './tasks.js';
|
||||
// import type { ComponentProto } from '../src/types';
|
||||
// import type { Plugin, SourceMapInput } from 'rollup';
|
||||
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const SRC_DIR = path.join(__dirname, '../src/');
|
||||
const languageIds = fs.readdirSync(path.join(SRC_DIR, 'languages')).map((f) => f.slice('prism-'.length).slice(0, -'.js'.length)).sort();
|
||||
// const languageIds = fs.readdirSync(path.join(SRC_DIR, 'languages')).map((f) => f.slice('prism-'.length).slice(0, -'.js'.length)).sort();
|
||||
const pluginIds = fs.readdirSync(path.join(SRC_DIR, 'plugins')).sort();
|
||||
|
||||
async function loadComponent(id: string) {
|
||||
let file;
|
||||
if (pluginIds.includes(id)) {
|
||||
file = path.join(SRC_DIR, `plugins/${id}/prism-${id}.ts`);
|
||||
} else {
|
||||
file = path.join(SRC_DIR, `languages/prism-${id}.ts`);
|
||||
}
|
||||
const exports = (await import(file)) as { default: ComponentProto };
|
||||
return exports.default;
|
||||
}
|
||||
// async function loadComponent(id: string) {
|
||||
// let file;
|
||||
// if (pluginIds.includes(id)) {
|
||||
// file = path.join(SRC_DIR, `plugins/${id}/prism-${id}.ts`);
|
||||
// } else {
|
||||
// file = path.join(SRC_DIR, `languages/prism-${id}.ts`);
|
||||
// }
|
||||
// const exports = (await import(file)) as { default: ComponentProto };
|
||||
// return exports.default;
|
||||
// }
|
||||
|
||||
async function minifyCSS() {
|
||||
const input: Record<string, string> = {};
|
||||
|
@ -42,7 +44,7 @@ async function minifyCSS() {
|
|||
for (const id of pluginIds) {
|
||||
const file = path.join(SRC_DIR, `plugins/${id}/prism-${id}.css`);
|
||||
if (fs.existsSync(file)) {
|
||||
input[`plugins/prism-${id}.css`] = file;
|
||||
input[`plugins/${id}/prism-${id}.css`] = file;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,119 +118,119 @@ async function treeviewIconFont() {
|
|||
fs.writeFileSync(cssPath, css.replace(fontFaceRegex, fontFace), 'utf-8');
|
||||
}
|
||||
|
||||
const dataToInsert = {
|
||||
aliases_placeholder: async () => {
|
||||
const data = await Promise.all([...languageIds, ...pluginIds].map(async (id) => {
|
||||
const proto = await loadComponent(id);
|
||||
return { id, alias: toArray(proto.alias) };
|
||||
}));
|
||||
return Object.fromEntries(data.flatMap(({ id, alias }) => alias.map((a) => [a, id])));
|
||||
},
|
||||
all_languages_placeholder: () => Promise.resolve(languageIds),
|
||||
title_placeholder: async () => {
|
||||
const rawTitles = new Map<string, string>();
|
||||
for (const [id, entry] of Object.entries(components.languages)) {
|
||||
if (id === 'meta') {
|
||||
continue;
|
||||
}
|
||||
// const dataToInsert = {
|
||||
// aliases_placeholder: async () => {
|
||||
// const data = await Promise.all([...languageIds, ...pluginIds].map(async (id) => {
|
||||
// const proto = await loadComponent(id);
|
||||
// return { id, alias: toArray(proto.alias) };
|
||||
// }));
|
||||
// return Object.fromEntries(data.flatMap(({ id, alias }) => alias.map((a) => [a, id])));
|
||||
// },
|
||||
// all_languages_placeholder: () => Promise.resolve(languageIds),
|
||||
// title_placeholder: async () => {
|
||||
// const rawTitles = new Map<string, string>();
|
||||
// for (const [id, entry] of Object.entries(components.languages)) {
|
||||
// if (id === 'meta') {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
rawTitles.set(id, entry.title);
|
||||
for (const [alias, title] of Object.entries(entry.aliasTitles || {})) {
|
||||
rawTitles.set(alias, title);
|
||||
}
|
||||
}
|
||||
// rawTitles.set(id, entry.title);
|
||||
// for (const [alias, title] of Object.entries(entry.aliasTitles || {})) {
|
||||
// rawTitles.set(alias, title);
|
||||
// }
|
||||
// }
|
||||
|
||||
const data = (await Promise.all(languageIds.map(async (id) => {
|
||||
const proto = await loadComponent(id);
|
||||
const title = rawTitles.get(id);
|
||||
if (!title) {
|
||||
throw new Error(`No title for ${id}`);
|
||||
}
|
||||
return [id, ...toArray(proto.alias)].map((name) => ({ name, title: rawTitles.get(id) ?? title }));
|
||||
}))).flat();
|
||||
data.push({ name: 'none', title: 'Plain text' });
|
||||
// const data = (await Promise.all(languageIds.map(async (id) => {
|
||||
// const proto = await loadComponent(id);
|
||||
// const title = rawTitles.get(id);
|
||||
// if (!title) {
|
||||
// throw new Error(`No title for ${id}`);
|
||||
// }
|
||||
// return [id, ...toArray(proto.alias)].map((name) => ({ name, title: rawTitles.get(id) ?? title }));
|
||||
// }))).flat();
|
||||
// data.push({ name: 'none', title: 'Plain text' });
|
||||
|
||||
/**
|
||||
* Tries to guess the name of a language given its id.
|
||||
*
|
||||
* @param name The language id.
|
||||
*/
|
||||
function guessTitle(name: string) {
|
||||
return (name.substring(0, 1).toUpperCase() + name.substring(1)).replace(/s(?=cript)/, 'S');
|
||||
}
|
||||
// /**
|
||||
// * Tries to guess the name of a language given its id.
|
||||
// *
|
||||
// * @param name The language id.
|
||||
// */
|
||||
// function guessTitle(name: string) {
|
||||
// return (name.substring(0, 1).toUpperCase() + name.substring(1)).replace(/s(?=cript)/, 'S');
|
||||
// }
|
||||
|
||||
return Object.fromEntries(
|
||||
data.filter(({ name, title }) => guessTitle(name) !== title).map(({ name, title }) => [name, title])
|
||||
);
|
||||
}
|
||||
};
|
||||
// return Object.fromEntries(
|
||||
// data.filter(({ name, title }) => guessTitle(name) !== title).map(({ name, title }) => [name, title])
|
||||
// );
|
||||
// }
|
||||
// };
|
||||
|
||||
const dataInsertPlugin: Plugin = {
|
||||
name: 'data-insert',
|
||||
async renderChunk(code, chunk) {
|
||||
const pattern = /\/\*\s*(\w+)\[\s*\*\/[\s\S]*?\/\*\s*\]\s*\*\//g;
|
||||
// const dataInsertPlugin: Plugin = {
|
||||
// name: 'data-insert',
|
||||
// async renderChunk(code, chunk) {
|
||||
// const pattern = /\/\*\s*(\w+)\[\s*\*\/[\s\S]*?\/\*\s*\]\s*\*\//g;
|
||||
|
||||
// search for placeholders
|
||||
const contained = new Set<string>();
|
||||
let m;
|
||||
while ((m = pattern.exec(code))) {
|
||||
contained.add(m[1]);
|
||||
}
|
||||
// // search for placeholders
|
||||
// const contained = new Set<string>();
|
||||
// let m;
|
||||
// while ((m = pattern.exec(code))) {
|
||||
// contained.add(m[1]);
|
||||
// }
|
||||
|
||||
if (contained.size === 0) {
|
||||
return null;
|
||||
}
|
||||
// if (contained.size === 0) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// fetch placeholder data
|
||||
const dataByName: Record<string, unknown> = {};
|
||||
for (const name of contained) {
|
||||
if (name in dataToInsert) {
|
||||
dataByName[name] = await dataToInsert[name as keyof typeof dataToInsert]();
|
||||
} else {
|
||||
throw new Error(`Unknown placeholder ${name} in ${chunk.fileName}`);
|
||||
}
|
||||
}
|
||||
// // fetch placeholder data
|
||||
// const dataByName: Record<string, unknown> = {};
|
||||
// for (const name of contained) {
|
||||
// if (name in dataToInsert) {
|
||||
// dataByName[name] = await dataToInsert[name as keyof typeof dataToInsert]();
|
||||
// } else {
|
||||
// throw new Error(`Unknown placeholder ${name} in ${chunk.fileName}`);
|
||||
// }
|
||||
// }
|
||||
|
||||
// replace placeholders
|
||||
const str = new MagicString(code);
|
||||
str.replace(pattern, (_, name: string) => {
|
||||
return JSON.stringify(dataByName[name]);
|
||||
});
|
||||
return toRenderedChunk(str);
|
||||
},
|
||||
};
|
||||
// // replace placeholders
|
||||
// const str = new MagicString(code);
|
||||
// str.replace(pattern, (_, name: string) => {
|
||||
// return JSON.stringify(dataByName[name]);
|
||||
// });
|
||||
// return toRenderedChunk(str);
|
||||
// },
|
||||
// };
|
||||
|
||||
const inlineRegexSourcePlugin: Plugin = {
|
||||
name: 'inline-regex-source',
|
||||
renderChunk(code) {
|
||||
const str = new MagicString(code);
|
||||
str.replace(
|
||||
/\/((?:[^\n\r[\\\/]|\\.|\[(?:[^\n\r\\\]]|\\.)*\])+)\/\s*\.\s*source\b/g,
|
||||
(m, source: string) => {
|
||||
// escape backslashes
|
||||
source = source.replace(/\\(.)|\[(?:\\s\\S|\\S\\s)\]/g, (m, g1: string) => {
|
||||
if (g1) {
|
||||
// characters like /\n/ can just be kept as "\n" instead of being escaped to "\\n"
|
||||
if (/[nrt0/]/.test(g1)) {
|
||||
return m;
|
||||
}
|
||||
if ('\\' === g1) {
|
||||
return '\\\\\\\\'; // escape using 4 backslashes
|
||||
}
|
||||
return '\\\\' + g1;
|
||||
} else {
|
||||
return '[^]';
|
||||
}
|
||||
});
|
||||
// escape single quotes
|
||||
source = source.replace(/'/g, "\\'");
|
||||
// wrap source in single quotes
|
||||
return "'" + source + "'";
|
||||
}
|
||||
);
|
||||
return toRenderedChunk(str);
|
||||
},
|
||||
};
|
||||
// const inlineRegexSourcePlugin: Plugin = {
|
||||
// name: 'inline-regex-source',
|
||||
// renderChunk(code) {
|
||||
// const str = new MagicString(code);
|
||||
// str.replace(
|
||||
// /\/((?:[^\n\r[\\\/]|\\.|\[(?:[^\n\r\\\]]|\\.)*\])+)\/\s*\.\s*source\b/g,
|
||||
// (m, source: string) => {
|
||||
// // escape backslashes
|
||||
// source = source.replace(/\\(.)|\[(?:\\s\\S|\\S\\s)\]/g, (m, g1: string) => {
|
||||
// if (g1) {
|
||||
// // characters like /\n/ can just be kept as "\n" instead of being escaped to "\\n"
|
||||
// if (/[nrt0/]/.test(g1)) {
|
||||
// return m;
|
||||
// }
|
||||
// if ('\\' === g1) {
|
||||
// return '\\\\\\\\'; // escape using 4 backslashes
|
||||
// }
|
||||
// return '\\\\' + g1;
|
||||
// } else {
|
||||
// return '[^]';
|
||||
// }
|
||||
// });
|
||||
// // escape single quotes
|
||||
// source = source.replace(/'/g, "\\'");
|
||||
// // wrap source in single quotes
|
||||
// return "'" + source + "'";
|
||||
// }
|
||||
// );
|
||||
// return toRenderedChunk(str);
|
||||
// },
|
||||
// };
|
||||
|
||||
/**
|
||||
* This plugin wraps bare grammar objects into functions.
|
||||
|
@ -239,97 +241,82 @@ const inlineRegexSourcePlugin: Plugin = {
|
|||
*
|
||||
* @see https://github.com/PrismJS/prism/issues/2768
|
||||
*/
|
||||
const lazyGrammarPlugin: Plugin = {
|
||||
name: 'lazy-grammar',
|
||||
renderChunk(code) {
|
||||
const str = new MagicString(code);
|
||||
str.replace(
|
||||
/^(?<indent>[ \t]+)grammar: (\{[\s\S]*?^\k<indent>\})/m,
|
||||
(m, _, grammar: string) => `\tgrammar: () => (${grammar})`
|
||||
);
|
||||
return toRenderedChunk(str);
|
||||
},
|
||||
};
|
||||
// const lazyGrammarPlugin: Plugin = {
|
||||
// name: 'lazy-grammar',
|
||||
// renderChunk(code) {
|
||||
// const str = new MagicString(code);
|
||||
// str.replace(
|
||||
// /^(?<indent>[ \t]+)grammar: (\{[\s\S]*?^\k<indent>\})/m,
|
||||
// (m, _, grammar: string) => `\tgrammar: () => (${grammar})`
|
||||
// );
|
||||
// return toRenderedChunk(str);
|
||||
// },
|
||||
// };
|
||||
|
||||
function toRenderedChunk(s: MagicString): { code: string; map: SourceMapInput } {
|
||||
return {
|
||||
code: s.toString(),
|
||||
map: s.generateMap({ hires: true }) as SourceMapInput,
|
||||
};
|
||||
}
|
||||
// function toRenderedChunk(s: MagicString): { code: string; map: SourceMapInput } {
|
||||
// return {
|
||||
// code: s.toString(),
|
||||
// map: s.generateMap({ hires: true }) as SourceMapInput,
|
||||
// };
|
||||
// }
|
||||
|
||||
const terserPlugin = rollupTerser({
|
||||
ecma: 2020,
|
||||
module: true,
|
||||
compress: {
|
||||
passes: 4,
|
||||
unsafe: true,
|
||||
unsafe_arrows: true,
|
||||
unsafe_math: true,
|
||||
unsafe_regexp: true,
|
||||
},
|
||||
format: {
|
||||
comments: false
|
||||
},
|
||||
keep_classnames: true
|
||||
});
|
||||
// const terserPlugin = rollupTerser({
|
||||
// ecma: 2020,
|
||||
// module: true,
|
||||
// compress: {
|
||||
// passes: 4,
|
||||
// unsafe: true,
|
||||
// unsafe_arrows: true,
|
||||
// unsafe_math: true,
|
||||
// unsafe_regexp: true,
|
||||
// },
|
||||
// format: {
|
||||
// comments: false
|
||||
// },
|
||||
// keep_classnames: true
|
||||
// });
|
||||
|
||||
async function clean() {
|
||||
const outputDir = path.join(__dirname, '../dist');
|
||||
await rm(outputDir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
async function buildJS() {
|
||||
const input: Record<string, string> = {
|
||||
'core': path.join(SRC_DIR, 'core.ts'),
|
||||
'shared': path.join(SRC_DIR, 'shared.ts'),
|
||||
};
|
||||
for (const id of languageIds) {
|
||||
input[`languages/prism-${id}`] = path.join(SRC_DIR, `languages/prism-${id}.ts`);
|
||||
}
|
||||
for (const id of pluginIds) {
|
||||
input[`plugins/prism-${id}`] = path.join(SRC_DIR, `plugins/${id}/prism-${id}.ts`);
|
||||
}
|
||||
// async function buildJS() {
|
||||
// const input: Record<string, string> = {
|
||||
// 'core': path.join(SRC_DIR, 'core.ts'),
|
||||
// 'shared': path.join(SRC_DIR, 'shared.ts'),
|
||||
// };
|
||||
// for (const id of languageIds) {
|
||||
// input[`languages/prism-${id}`] = path.join(SRC_DIR, `languages/prism-${id}.ts`);
|
||||
// }
|
||||
// for (const id of pluginIds) {
|
||||
// input[`plugins/prism-${id}`] = path.join(SRC_DIR, `plugins/${id}/prism-${id}.ts`);
|
||||
// }
|
||||
|
||||
let bundle;
|
||||
try {
|
||||
bundle = await rollup({
|
||||
input,
|
||||
plugins: [rollupTypescript({ module: 'esnext' })],
|
||||
});
|
||||
// let bundle;
|
||||
// try {
|
||||
// bundle = await rollup({
|
||||
// input,
|
||||
// plugins: [rollupTypescript({ module: 'esnext' })],
|
||||
// });
|
||||
|
||||
// ESM
|
||||
await bundle.write({
|
||||
dir: 'dist/esm',
|
||||
chunkFileNames: '_chunks/[name]-[hash].js',
|
||||
validate: true,
|
||||
sourcemap: 'hidden',
|
||||
plugins: [
|
||||
lazyGrammarPlugin,
|
||||
dataInsertPlugin,
|
||||
inlineRegexSourcePlugin,
|
||||
terserPlugin
|
||||
]
|
||||
});
|
||||
// // ESM
|
||||
// await bundle.write({
|
||||
// dir: 'dist/',
|
||||
// chunkFileNames: '_chunks/[name]-[hash].js',
|
||||
// validate: true,
|
||||
// sourcemap: 'hidden',
|
||||
// plugins: [
|
||||
// lazyGrammarPlugin,
|
||||
// dataInsertPlugin,
|
||||
// inlineRegexSourcePlugin,
|
||||
// terserPlugin
|
||||
// ]
|
||||
// });
|
||||
// } finally {
|
||||
// await bundle?.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
// CommonJS
|
||||
await bundle.write({
|
||||
dir: 'dist/cjs',
|
||||
chunkFileNames: '_chunks/[name]-[hash].js',
|
||||
validate: true,
|
||||
sourcemap: 'hidden',
|
||||
format: 'cjs',
|
||||
exports: 'named',
|
||||
plugins: [
|
||||
lazyGrammarPlugin,
|
||||
dataInsertPlugin,
|
||||
inlineRegexSourcePlugin,
|
||||
terserPlugin
|
||||
]
|
||||
});
|
||||
} finally {
|
||||
await bundle?.close();
|
||||
}
|
||||
}
|
||||
|
||||
runTask(series(clean, parallel(buildJS, series(treeviewIconFont, minifyCSS))));
|
||||
// runTask(series(clean, parallel(buildJS, series(treeviewIconFont, minifyCSS))));
|
||||
runTask(series(clean, treeviewIconFont, minifyCSS));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import simpleGit from 'simple-git';
|
||||
import { components } from './components';
|
||||
import { runTask } from './tasks';
|
||||
import { components } from './components.js';
|
||||
import { runTask } from './tasks.js';
|
||||
|
||||
const git = simpleGit(__dirname);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import fs from 'fs/promises';
|
||||
import { runTask } from './tasks';
|
||||
import { runTask } from './tasks.js';
|
||||
|
||||
runTask(async () => {
|
||||
const changelog = 'CHANGELOG.md';
|
||||
|
|
|
@ -1,78 +1,7 @@
|
|||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||
|
||||
/* Projects */
|
||||
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
||||
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
||||
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
||||
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
||||
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
|
||||
/* Language and Environment */
|
||||
"target": "ES2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
||||
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||
|
||||
/* Modules */
|
||||
"module": "CommonJS", /* Specify what module code is generated. */
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
||||
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
||||
|
||||
/* JavaScript Support */
|
||||
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
||||
"checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
||||
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
||||
|
||||
/* Emit */
|
||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
"noEmit": true, /* Disable emitting files from a compilation. */
|
||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
||||
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
||||
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
||||
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
||||
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
||||
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
||||
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
||||
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
||||
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
||||
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
||||
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
||||
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
||||
|
||||
/* Interop Constraints */
|
||||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
||||
},
|
||||
"include": ["./**/*"]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Prism from './global';
|
||||
import autoloader from './plugins/autoloader/prism-autoloader';
|
||||
import Prism from './global.js';
|
||||
import autoloader from './plugins/autoloader/prism-autoloader.js';
|
||||
|
||||
Prism.components.add(autoloader);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Grammar, TokenName } from '../types';
|
||||
import type { HookState } from './hook-state';
|
||||
import type { TokenStream } from './token';
|
||||
import type { HookState } from './hook-state.js';
|
||||
import type { TokenStream } from './token.js';
|
||||
|
||||
export class Hooks {
|
||||
// eslint-disable-next-line func-call-spacing
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { getLanguage, setLanguage } from '../shared/dom-util';
|
||||
import { rest, tokenize } from '../shared/symbols';
|
||||
import { htmlEncode } from '../shared/util';
|
||||
import { HookState } from './hook-state';
|
||||
import { Hooks } from './hooks';
|
||||
import { LinkedList } from './linked-list';
|
||||
import { Registry } from './registry';
|
||||
import { Token } from './token';
|
||||
import { getLanguage, setLanguage } from '../shared/dom-util.js';
|
||||
import { rest, tokenize } from '../shared/symbols.js';
|
||||
import { htmlEncode } from '../shared/util.js';
|
||||
import { HookState } from './hook-state.js';
|
||||
import { Hooks } from './hooks.js';
|
||||
import { LinkedList } from './linked-list.js';
|
||||
import { Registry } from './registry.js';
|
||||
import { Token } from './token.js';
|
||||
import type { KnownPlugins } from '../known-plugins';
|
||||
import type { Grammar, GrammarToken, GrammarTokens } from '../types';
|
||||
import type { HookEnvMap } from './hooks';
|
||||
import type { LinkedListHeadNode, LinkedListMiddleNode, LinkedListTailNode } from './linked-list';
|
||||
import type { TokenStream } from './token';
|
||||
import type { HookEnvMap } from './hooks.js';
|
||||
import type { LinkedListHeadNode, LinkedListMiddleNode, LinkedListTailNode } from './linked-list.js';
|
||||
import type { TokenStream } from './token.js';
|
||||
|
||||
/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { extend } from '../shared/language-util';
|
||||
import { forEach, kebabToCamelCase } from '../shared/util';
|
||||
import { extend } from '../shared/language-util.js';
|
||||
import { forEach, kebabToCamelCase } from '../shared/util.js';
|
||||
import type { ComponentProto, Grammar } from '../types';
|
||||
import type { Prism } from './prism';
|
||||
import type { Prism } from './prism.js';
|
||||
|
||||
interface Entry {
|
||||
proto: ComponentProto;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Prism } from './core/prism';
|
||||
import { Prism } from './core/prism.js';
|
||||
|
||||
const globalSymbol = Symbol.for('Prism global');
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import type { Autoloader } from './plugins/autoloader/prism-autoloader';
|
||||
import type { CustomClass } from './plugins/custom-class/prism-custom-class';
|
||||
import type { FileHighlight } from './plugins/file-highlight/prism-file-highlight';
|
||||
import type { FilterHighlightAll } from './plugins/filter-highlight-all/prism-filter-highlight-all';
|
||||
import type { JsonpHighlight } from './plugins/jsonp-highlight/prism-jsonp-highlight';
|
||||
import type { LineHighlight } from './plugins/line-highlight/prism-line-highlight';
|
||||
import type { LineNumbers } from './plugins/line-numbers/prism-line-numbers';
|
||||
import type { NormalizeWhitespace } from './plugins/normalize-whitespace/prism-normalize-whitespace';
|
||||
import type { PreviewerCollection } from './plugins/previewers/prism-previewers';
|
||||
import type { Toolbar } from './plugins/toolbar/prism-toolbar';
|
||||
import type { Autoloader } from './plugins/autoloader/prism-autoloader.js';
|
||||
import type { CustomClass } from './plugins/custom-class/prism-custom-class.js';
|
||||
import type { FileHighlight } from './plugins/file-highlight/prism-file-highlight.js';
|
||||
import type { FilterHighlightAll } from './plugins/filter-highlight-all/prism-filter-highlight-all.js';
|
||||
import type { JsonpHighlight } from './plugins/jsonp-highlight/prism-jsonp-highlight.js';
|
||||
import type { LineHighlight } from './plugins/line-highlight/prism-line-highlight.js';
|
||||
import type { LineNumbers } from './plugins/line-numbers/prism-line-numbers.js';
|
||||
import type { NormalizeWhitespace } from './plugins/normalize-whitespace/prism-normalize-whitespace.js';
|
||||
import type { PreviewerCollection } from './plugins/previewers/prism-previewers.js';
|
||||
import type { Toolbar } from './plugins/toolbar/prism-toolbar.js';
|
||||
|
||||
declare interface KnownPlugins {
|
||||
autoloader: Autoloader;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import javascript from './prism-javascript';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import type { GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import clike from './prism-clike';
|
||||
import sql from './prism-sql';
|
||||
import clike from './prism-clike.js';
|
||||
import sql from './prism-sql.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import cpp from './prism-cpp';
|
||||
import cpp from './prism-cpp.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { Grammar, GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { rest } from '../shared/symbols';
|
||||
import csharp from './prism-csharp';
|
||||
import markup from './prism-markup';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import csharp from './prism-csharp.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { Grammar, GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { rest } from '../shared/symbols';
|
||||
import c from './prism-c';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import c from './prism-c.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { toArray } from '../shared/util';
|
||||
import clike from './prism-clike';
|
||||
import cpp from './prism-cpp';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { toArray } from '../shared/util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import cpp from './prism-cpp.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import c from './prism-c';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import c from './prism-c.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import cpp from './prism-cpp';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import cpp from './prism-cpp.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import javascript from './prism-javascript';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import c from './prism-c';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import c from './prism-c.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { toArray } from '../shared/util';
|
||||
import ruby from './prism-ruby';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { toArray } from '../shared/util.js';
|
||||
import ruby from './prism-ruby.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import csharp from './prism-csharp';
|
||||
import markup from './prism-markup';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import csharp from './prism-csharp.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { Grammar, GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import cssSelector from './prism-css-selector';
|
||||
import cssSelector from './prism-css-selector.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { rest } from '../shared/symbols';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import markup from './prism-markup';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
// Django/Jinja2 syntax definition for Prism.js <http://prismjs.com> syntax highlighter.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import javascript from './prism-javascript';
|
||||
import markup from './prism-markup';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import markup from './prism-markup';
|
||||
import ruby from './prism-ruby';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import markup from './prism-markup.js';
|
||||
import ruby from './prism-ruby.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import lua from './prism-lua';
|
||||
import markup from './prism-markup';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import lua from './prism-lua.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { regexEscape } from '../shared/util';
|
||||
import { regexEscape } from '../shared/util.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { toArray } from '../shared/util';
|
||||
import javascript from './prism-javascript';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { toArray } from '../shared/util.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import type { GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { rest, tokenize } from '../shared/symbols';
|
||||
import markup from './prism-markup';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { rest, tokenize } from '../shared/symbols.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { Grammar, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import c from './prism-c';
|
||||
import c from './prism-c.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import clike from './prism-clike';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { withoutTokenize } from '../shared/language-util';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import type { Token } from '../core';
|
||||
import { withoutTokenize } from '../shared/language-util.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import type { Token } from '../core.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import ruby from './prism-ruby';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import ruby from './prism-ruby.js';
|
||||
import type { Grammar, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import markup from './prism-markup';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { toArray } from '../shared/util';
|
||||
import c from './prism-c';
|
||||
import { toArray } from '../shared/util.js';
|
||||
import c from './prism-c.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import type { Grammar, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import haskell from './prism-haskell';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import haskell from './prism-haskell.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { Grammar, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { toArray } from '../shared/util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { toArray } from '../shared/util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import java from './prism-java';
|
||||
import javadoclike from './prism-javadoclike';
|
||||
import markup from './prism-markup';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import java from './prism-java.js';
|
||||
import javadoclike from './prism-javadoclike.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { JS_TEMPLATE, JS_TEMPLATE_INTERPOLATION } from '../shared/languages/patterns';
|
||||
import { rest } from '../shared/symbols';
|
||||
import { toArray } from '../shared/util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { JS_TEMPLATE, JS_TEMPLATE_INTERPOLATION } from '../shared/languages/patterns.js';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import { toArray } from '../shared/util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { JS_TEMPLATE, JS_TEMPLATE_INTERPOLATION } from '../shared/languages/patterns';
|
||||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { rest, tokenize } from '../shared/symbols';
|
||||
import { JS_TEMPLATE, JS_TEMPLATE_INTERPOLATION } from '../shared/languages/patterns.js';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { rest, tokenize } from '../shared/symbols.js';
|
||||
import type { GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import javadoclike from './prism-javadoclike';
|
||||
import javascript from './prism-javascript';
|
||||
import typescript from './prism-typescript';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import javadoclike from './prism-javadoclike.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import typescript from './prism-typescript.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import json from './prism-json';
|
||||
import json from './prism-json.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import json from './prism-json';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import json from './prism-json.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Token, getTextContent } from '../core/token';
|
||||
import { insertBefore, withoutTokenize } from '../shared/language-util';
|
||||
import { rest, tokenize } from '../shared/symbols';
|
||||
import javascript from './prism-javascript';
|
||||
import markup from './prism-markup';
|
||||
import type { TokenStream } from '../core/token';
|
||||
import { Token, getTextContent } from '../core/token.js';
|
||||
import { insertBefore, withoutTokenize } from '../shared/language-util.js';
|
||||
import { rest, tokenize } from '../shared/symbols.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { TokenStream } from '../core/token.js';
|
||||
import type { Grammar, GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
function stringifyToken(token: string | Token | TokenStream | undefined): string {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import markup from './prism-markup';
|
||||
import php from './prism-php';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import markup from './prism-markup.js';
|
||||
import php from './prism-php.js';
|
||||
import type { Grammar, GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import css from './prism-css';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import css from './prism-css.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import scheme from './prism-scheme';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import scheme from './prism-scheme.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import markup from './prism-markup';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { getTextContent } from '../core/token';
|
||||
import { insertBefore, withoutTokenize } from '../shared/language-util';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import markup from './prism-markup';
|
||||
import { getTextContent } from '../core/token.js';
|
||||
import { insertBefore, withoutTokenize } from '../shared/language-util.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { Grammar, GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import xml from './prism-xml';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import xml from './prism-xml.js';
|
||||
import type { Grammar, GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import javascript from './prism-javascript';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import type { GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import javascript from './prism-javascript';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { getTextContent } from '../core/token';
|
||||
import { withoutTokenize } from '../shared/language-util';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import { getTextContent } from '../core/token.js';
|
||||
import { withoutTokenize } from '../shared/language-util.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
function isBracketsBalanced(input: string): boolean {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import c from './prism-c';
|
||||
import c from './prism-c.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import c from './prism-c';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import c from './prism-c.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import markup from './prism-markup';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { Grammar, GrammarToken, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { embeddedIn } from '../shared/languages/templating';
|
||||
import { tokenize } from '../shared/symbols';
|
||||
import markup from './prism-markup';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { embeddedIn } from '../shared/languages/templating.js';
|
||||
import { tokenize } from '../shared/symbols.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import javadoclike from './prism-javadoclike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import javadoclike from './prism-javadoclike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import sql from './prism-sql';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import sql from './prism-sql.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { rest } from '../shared/symbols';
|
||||
import javascript from './prism-javascript';
|
||||
import markup from './prism-markup';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import javascript from './prism-javascript.js';
|
||||
import markup from './prism-markup.js';
|
||||
import type { GrammarTokens, LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import { rest } from '../shared/symbols';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import haskell, { asciiOperator, infixOperator } from './prism-haskell';
|
||||
import haskell, { asciiOperator, infixOperator } from './prism-haskell.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { rest } from '../shared/symbols';
|
||||
import { rest } from '../shared/symbols.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import javascript from './prism-javascript';
|
||||
import javascript from './prism-javascript.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import clike from './prism-clike';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import scheme from './prism-scheme';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import scheme from './prism-scheme.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { insertBefore } from '../shared/language-util';
|
||||
import clike from './prism-clike';
|
||||
import { insertBefore } from '../shared/language-util.js';
|
||||
import clike from './prism-clike.js';
|
||||
import type { LanguageProto } from '../types';
|
||||
|
||||
export default {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue