-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Started testing the mume 0.7.8 * feat: Switched to esbuild to bundle the package. * feat: Supported MathJax V3 * ci: Added github workflow to test packaging * feat: Added editor-light/dark and system-light/dark class to preview * ci: Updated yarn.lock * ci: Fixed the CI build * ci: Fixed the CI build * ci: Fixed the CI build * ci: Fixed the CI build
- Loading branch information
Showing
23 changed files
with
4,588 additions
and
2,269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ out | |
|
||
|
||
## special cases | ||
mume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
{ | ||
"env": { | ||
"browser": false, | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"no-const-assign": "warn", | ||
"no-this-before-super": "warn", | ||
"no-undef": "warn", | ||
"no-unreachable": "warn", | ||
"no-unused-vars": "warn", | ||
"constructor-super": "warn", | ||
"valid-typeof": "warn" | ||
} | ||
"@typescript-eslint/naming-convention": "warn", | ||
"@typescript-eslint/semi": "warn", | ||
"curly": "warn", | ||
"eqeqeq": "warn", | ||
"no-throw-literal": "warn", | ||
"semi": "off" | ||
}, | ||
"ignorePatterns": ["**/*.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Test" | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
test: | ||
name: "Test" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: 'Install nodejs 18' | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
- name: 'Build and test' | ||
run: | | ||
corepack enable | ||
yarn global add @vscode/vsce | ||
yarn install | ||
yarn run check:all | ||
yarn run build | ||
# yarn test | ||
vsce package | ||
ls -lah *.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
node_modules | ||
out | ||
.direnv | ||
mume | ||
crossnote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ out | |
|
||
|
||
## special cases | ||
mume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"tabWidth": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the extensions.json format | ||
"recommendations": ["dbaeumer.vscode-eslint"] | ||
} | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"connor4312.esbuild-problem-matchers" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
// Check https://github.com/microsoft/vscode-test-adapter-converter for reference | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"problemMatcher": "$tsc-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never" | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"group": "build", | ||
"problemMatcher": "$esbuild-watch", | ||
"isBackground": true, | ||
"label": "npm: watch", | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "build", | ||
"group": "build", | ||
"problemMatcher": "$esbuild", | ||
"label": "npm: build", | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const { context, build } = require('esbuild'); | ||
|
||
/** | ||
* @type {import('esbuild').BuildOptions} | ||
*/ | ||
const sharedConfig = { | ||
entryPoints: ['./src/extension.ts'], | ||
bundle: true, | ||
minify: true, | ||
}; | ||
|
||
/** | ||
* @type {import('esbuild').BuildOptions} | ||
*/ | ||
const cjsConfig = { | ||
...sharedConfig, | ||
platform: 'node', // For CJS | ||
outfile: './out/native/extension.js', | ||
target: 'node16', | ||
format: 'cjs', | ||
external: ['vscode'], | ||
}; | ||
|
||
async function main() { | ||
try { | ||
// Watch mode | ||
if (process.argv.includes('--watch')) { | ||
// CommonJS | ||
const cjsContext = await context({ | ||
...cjsConfig, | ||
sourcemap: true, | ||
minify: false, | ||
// bundle: false, | ||
// external: undefined, | ||
}); | ||
await cjsContext.watch(); | ||
} else { | ||
// Build mode | ||
// CommonJS | ||
await build(cjsConfig); | ||
} | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copy files from | ||
* - ./node_modules/@shd101wyy/mume/out/dependencies/. to ./mume/dependencies/ | ||
* - ./node_modules/@shd101wyy/mume/out/styles/. to ./mume/styles/ | ||
* - ./node_modules/@shd101wyy/mume/out/webview/. to ./mume/webview/ | ||
*/ | ||
const fs = require('fs'); | ||
|
||
const copyData = [ | ||
{ | ||
source: './node_modules/@shd101wyy/mume/out/dependencies/', | ||
target: './mume/dependencies/', | ||
}, | ||
{ | ||
source: './node_modules/@shd101wyy/mume/out/styles/', | ||
target: './mume/styles/', | ||
}, | ||
{ | ||
source: './node_modules/@shd101wyy/mume/out/webview/', | ||
target: './mume/webview/', | ||
}, | ||
]; | ||
|
||
// Delete ./mume directory | ||
if (fs.existsSync('./mume')) { | ||
fs.rmdirSync('./mume', { recursive: true }); | ||
} | ||
|
||
// Make source directories | ||
copyData.forEach(data => { | ||
fs.mkdirSync(data.target, { recursive: true }); | ||
}); | ||
|
||
// Copy directories | ||
copyData.forEach(data => { | ||
fs.cpSync(data.source, data.target, { recursive: true }); | ||
}); | ||
|
||
console.log('Copy files done.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
arrowParens: "always", | ||
endOfLine: "lf", | ||
quoteProps: "consistent", | ||
trailingComma: "all", | ||
arrowParens: 'always', | ||
endOfLine: 'lf', | ||
quoteProps: 'consistent', | ||
trailingComma: 'all', | ||
}; |
Oops, something went wrong.