Skip to content

Commit

Permalink
feat: add fortran support
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 29, 2024
1 parent 728240f commit 55706c3
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 68 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@shikijs/twoslash": "workspace:*",
"@unocss/reset": "^0.58.4",
"@vueuse/core": "^10.7.2",
"floating-vue": "^5.2.0",
"floating-vue": "^5.2.1",
"pinia": "^2.1.7",
"shiki": "workspace:*",
"unocss": "^0.58.4",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "module",
"version": "1.0.0-beta.0",
"private": true,
"packageManager": "pnpm@8.14.3",
"packageManager": "pnpm@8.15.1",
"scripts": {
"lint": "eslint .",
"release": "bumpp && pnpm -r publish",
Expand All @@ -29,8 +29,8 @@
"@shikijs/vitepress-twoslash": "workspace:*",
"@types/fs-extra": "^11.0.4",
"@types/hast": "^3.0.3",
"@types/node": "^20.11.7",
"@vitest/coverage-v8": "^1.2.1",
"@types/node": "^20.11.10",
"@vitest/coverage-v8": "^1.2.2",
"ansi-sequence-parser": "^1.1.1",
"bumpp": "^9.3.0",
"eslint": "npm:eslint-ts-patch@8.56.0-0",
Expand All @@ -46,7 +46,7 @@
"mdast-util-gfm": "^3.0.0",
"mdast-util-to-hast": "^13.1.0",
"ofetch": "^1.3.3",
"pnpm": "^8.14.3",
"pnpm": "^8.15.1",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"rollup": "^4.9.6",
Expand All @@ -61,9 +61,9 @@
"unbuild": "^2.0.0",
"vite": "^5.0.12",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.2.1",
"vitest": "^1.2.2",
"vue-tsc": "^1.8.27",
"wrangler": "^3.24.0"
"wrangler": "^3.25.0"
},
"resolutions": {
"@shikijs/compat": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"shiki": "workspace:*"
},
"devDependencies": {
"shiki-legacy": "npm:shiki@^0.14"
"shiki-legacy": "npm:shiki@^0.14.7"
}
}
2 changes: 1 addition & 1 deletion packages/shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@shikijs/core": "workspace:*"
},
"devDependencies": {
"tm-grammars": "^1.0.19",
"tm-grammars": "^1.1.0",
"tm-themes": "^1.1.1",
"vscode-oniguruma": "^1.7.0"
}
Expand Down
12 changes: 11 additions & 1 deletion packages/shiki/src/assets/langs-bundle-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,16 @@ export const bundledLanguagesInfo: BundledLanguageInfo[] = [
'name': 'Fish',
'import': (() => import('./langs/fish')) as DynamicImportLanguageRegistration
},
{
'id': 'fortran-fixed-form',
'name': 'Fortran (Fixed Form)',
'import': (() => import('./langs/fortran-fixed-form')) as DynamicImportLanguageRegistration
},
{
'id': 'fortran-free-form',
'name': 'Fortran (Free Form)',
'import': (() => import('./langs/fortran-free-form')) as DynamicImportLanguageRegistration
},
{
'id': 'fsharp',
'name': 'F#',
Expand Down Expand Up @@ -1031,7 +1041,7 @@ export const bundledLanguagesBase = Object.fromEntries(bundledLanguagesInfo.map(

export const bundledLanguagesAlias = Object.fromEntries(bundledLanguagesInfo.flatMap(i => i.aliases?.map(a => [a, i.import]) || []))

export type BundledLanguage = 'abap' | 'actionscript-3' | 'ada' | 'angular-html' | 'angular-ts' | 'apache' | 'apex' | 'apl' | 'applescript' | 'ara' | 'asm' | 'astro' | 'awk' | 'ballerina' | 'bash' | 'bat' | 'batch' | 'be' | 'beancount' | 'berry' | 'bibtex' | 'bicep' | 'blade' | 'c' | 'c#' | 'c++' | 'cadence' | 'cdc' | 'clarity' | 'clj' | 'clojure' | 'cmake' | 'cmd' | 'cobol' | 'codeql' | 'coffee' | 'coffeescript' | 'console' | 'cpp' | 'cql' | 'crystal' | 'cs' | 'csharp' | 'css' | 'csv' | 'cue' | 'cypher' | 'd' | 'dart' | 'dax' | 'diff' | 'docker' | 'dockerfile' | 'dream-maker' | 'elixir' | 'elm' | 'erb' | 'erl' | 'erlang' | 'f#' | 'fish' | 'fs' | 'fsharp' | 'fsl' | 'gdresource' | 'gdscript' | 'gdshader' | 'gherkin' | 'git-commit' | 'git-rebase' | 'gjs' | 'glimmer-js' | 'glimmer-ts' | 'glsl' | 'gnuplot' | 'go' | 'gql' | 'graphql' | 'groovy' | 'gts' | 'hack' | 'haml' | 'handlebars' | 'haskell' | 'hbs' | 'hcl' | 'hjson' | 'hlsl' | 'hs' | 'html' | 'http' | 'imba' | 'ini' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsonnet' | 'jssm' | 'jsx' | 'julia' | 'kotlin' | 'kql' | 'kt' | 'kts' | 'kusto' | 'latex' | 'less' | 'liquid' | 'lisp' | 'logo' | 'lua' | 'make' | 'makefile' | 'markdown' | 'marko' | 'matlab' | 'md' | 'mdc' | 'mdx' | 'mermaid' | 'mojo' | 'nar' | 'narrat' | 'nextflow' | 'nf' | 'nginx' | 'nim' | 'nix' | 'nu' | 'nushell' | 'objc' | 'objective-c' | 'objective-cpp' | 'ocaml' | 'pascal' | 'perl' | 'perl6' | 'php' | 'plsql' | 'postcss' | 'powerquery' | 'powershell' | 'prisma' | 'prolog' | 'properties' | 'proto' | 'ps' | 'ps1' | 'pug' | 'puppet' | 'purescript' | 'py' | 'python' | 'ql' | 'r' | 'raku' | 'razor' | 'rb' | 'reg' | 'rel' | 'riscv' | 'rs' | 'rst' | 'ruby' | 'rust' | 'sas' | 'sass' | 'scala' | 'scheme' | 'scss' | 'sh' | 'shader' | 'shaderlab' | 'shell' | 'shellscript' | 'shellsession' | 'smalltalk' | 'solidity' | 'sparql' | 'spl' | 'splunk' | 'sql' | 'ssh-config' | 'stata' | 'styl' | 'stylus' | 'svelte' | 'swift' | 'system-verilog' | 'tasl' | 'tcl' | 'tex' | 'toml' | 'ts' | 'tsx' | 'turtle' | 'twig' | 'typescript' | 'v' | 'vb' | 'verilog' | 'vhdl' | 'vim' | 'viml' | 'vimscript' | 'vue' | 'vue-html' | 'vy' | 'vyper' | 'wasm' | 'wenyan' | 'wgsl' | 'wl' | 'wolfram' | 'xml' | 'xsl' | 'yaml' | 'yml' | 'zenscript' | 'zig' | 'zsh' | '文言'
export type BundledLanguage = 'abap' | 'actionscript-3' | 'ada' | 'angular-html' | 'angular-ts' | 'apache' | 'apex' | 'apl' | 'applescript' | 'ara' | 'asm' | 'astro' | 'awk' | 'ballerina' | 'bash' | 'bat' | 'batch' | 'be' | 'beancount' | 'berry' | 'bibtex' | 'bicep' | 'blade' | 'c' | 'c#' | 'c++' | 'cadence' | 'cdc' | 'clarity' | 'clj' | 'clojure' | 'cmake' | 'cmd' | 'cobol' | 'codeql' | 'coffee' | 'coffeescript' | 'console' | 'cpp' | 'cql' | 'crystal' | 'cs' | 'csharp' | 'css' | 'csv' | 'cue' | 'cypher' | 'd' | 'dart' | 'dax' | 'diff' | 'docker' | 'dockerfile' | 'dream-maker' | 'elixir' | 'elm' | 'erb' | 'erl' | 'erlang' | 'f#' | 'fish' | 'fortran-fixed-form' | 'fortran-free-form' | 'fs' | 'fsharp' | 'fsl' | 'gdresource' | 'gdscript' | 'gdshader' | 'gherkin' | 'git-commit' | 'git-rebase' | 'gjs' | 'glimmer-js' | 'glimmer-ts' | 'glsl' | 'gnuplot' | 'go' | 'gql' | 'graphql' | 'groovy' | 'gts' | 'hack' | 'haml' | 'handlebars' | 'haskell' | 'hbs' | 'hcl' | 'hjson' | 'hlsl' | 'hs' | 'html' | 'http' | 'imba' | 'ini' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsonnet' | 'jssm' | 'jsx' | 'julia' | 'kotlin' | 'kql' | 'kt' | 'kts' | 'kusto' | 'latex' | 'less' | 'liquid' | 'lisp' | 'logo' | 'lua' | 'make' | 'makefile' | 'markdown' | 'marko' | 'matlab' | 'md' | 'mdc' | 'mdx' | 'mermaid' | 'mojo' | 'nar' | 'narrat' | 'nextflow' | 'nf' | 'nginx' | 'nim' | 'nix' | 'nu' | 'nushell' | 'objc' | 'objective-c' | 'objective-cpp' | 'ocaml' | 'pascal' | 'perl' | 'perl6' | 'php' | 'plsql' | 'postcss' | 'powerquery' | 'powershell' | 'prisma' | 'prolog' | 'properties' | 'proto' | 'ps' | 'ps1' | 'pug' | 'puppet' | 'purescript' | 'py' | 'python' | 'ql' | 'r' | 'raku' | 'razor' | 'rb' | 'reg' | 'rel' | 'riscv' | 'rs' | 'rst' | 'ruby' | 'rust' | 'sas' | 'sass' | 'scala' | 'scheme' | 'scss' | 'sh' | 'shader' | 'shaderlab' | 'shell' | 'shellscript' | 'shellsession' | 'smalltalk' | 'solidity' | 'sparql' | 'spl' | 'splunk' | 'sql' | 'ssh-config' | 'stata' | 'styl' | 'stylus' | 'svelte' | 'swift' | 'system-verilog' | 'tasl' | 'tcl' | 'tex' | 'toml' | 'ts' | 'tsx' | 'turtle' | 'twig' | 'typescript' | 'v' | 'vb' | 'verilog' | 'vhdl' | 'vim' | 'viml' | 'vimscript' | 'vue' | 'vue-html' | 'vy' | 'vyper' | 'wasm' | 'wenyan' | 'wgsl' | 'wl' | 'wolfram' | 'xml' | 'xsl' | 'yaml' | 'yml' | 'zenscript' | 'zig' | 'zsh' | '文言'

export const bundledLanguages = {
...bundledLanguagesBase,
Expand Down
2 changes: 1 addition & 1 deletion packages/shiki/test/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ it('bundle-full', async () => {
}))

expect(highlighter.getLoadedLanguages().length)
.toMatchInlineSnapshot(`240`)
.toMatchInlineSnapshot(`242`)
})

it('bundle-web', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress-twoslash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"dependencies": {
"@shikijs/twoslash": "workspace:*",
"floating-vue": "^5.2.0",
"floating-vue": "^5.2.1",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-gfm": "^3.0.0",
"mdast-util-to-hast": "^13.1.0",
Expand Down
Loading

0 comments on commit 55706c3

Please sign in to comment.