Skip to content

Commit

Permalink
chore: add opensumi-libro repo
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshinesmilelk committed Jan 15, 2025
1 parent 2e6af5b commit c06b363
Show file tree
Hide file tree
Showing 102 changed files with 6,645 additions and 0 deletions.
28 changes: 28 additions & 0 deletions opensumi-module-libro/.dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from 'dumi';
import path from 'path';

export default defineConfig({
outputPath: 'docs-dist',
themeConfig: {
name: 'opensumi-module-libro',
},
theme: {
'@s-content-width': '100%', //https://github.com/umijs/dumi/blob/31fd13cd8cbf52a1ac00275078e3b93934c3d1cf/src/client/theme-default/styles/variables.less#L3
},
alias: {
modules: path.resolve(__dirname, 'modules'),
},
extraBabelPlugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-flow-strip-types', { allowDeclareFields: true }],
['@babel/plugin-transform-class-properties', { loose: true }],
['@babel/plugin-transform-private-methods', { loose: true }],
['@babel/plugin-transform-private-property-in-object', { loose: true }],
'babel-plugin-parameter-decorator',
],
mfsu: false,
define: {
'process.env.WORKSPACE_DIR': path.join(process.cwd(), 'example'),
'process.env.EXTENSION_DIR': path.join(process.cwd(), 'extensions'),
},
});
13 changes: 13 additions & 0 deletions opensumi-module-libro/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions opensumi-module-libro/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
modules/**/*
3 changes: 3 additions & 0 deletions opensumi-module-libro/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/lint/dist/config/eslint'),
};
20 changes: 20 additions & 0 deletions opensumi-module-libro/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export default {
platform: 'browser',
esm: {
output: 'es',
},
cjs: {
output: 'lib',
},
extraBabelPlugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-flow-strip-types'],
['@babel/plugin-transform-class-properties', { loose: true }],
['@babel/plugin-transform-private-methods', { loose: true }],
['@babel/plugin-transform-private-property-in-object', { loose: true }],
['babel-plugin-parameter-decorator'],
],
extraBabelPresets: [
['@babel/preset-typescript', { onlyRemoveTypeImports: true }],
],
};
4 changes: 4 additions & 0 deletions opensumi-module-libro/.husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx commitlint --edit "${1}"
4 changes: 4 additions & 0 deletions opensumi-module-libro/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions opensumi-module-libro/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
1 change: 1 addition & 0 deletions opensumi-module-libro/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# registry=https://registry.npmmirror.com
2 changes: 2 additions & 0 deletions opensumi-module-libro/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist
*.yaml
19 changes: 19 additions & 0 deletions opensumi-module-libro/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
pluginSearchDirs: false,
plugins: [
require.resolve('prettier-plugin-organize-imports'),
require.resolve('prettier-plugin-packagejson'),
],
printWidth: 80,
proseWrap: 'never',
singleQuote: true,
trailingComma: 'all',
overrides: [
{
files: '*.md',
options: {
proseWrap: 'preserve',
},
},
],
};
1 change: 1 addition & 0 deletions opensumi-module-libro/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
modules/**/*.less
3 changes: 3 additions & 0 deletions opensumi-module-libro/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@umijs/lint/dist/config/stylelint"
}
18 changes: 18 additions & 0 deletions opensumi-module-libro/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach", // Attach 模式
"name": "Attach to Extension Host",
"port": 9889, // 插件进程端口,不可修改
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true, // 开启 SourceMap,便于源码映射
"outFiles": ["extensions/ryannz.datavisor/dist/*/.js"] // 指定插件代码输出目录
}
]
}
3 changes: 3 additions & 0 deletions opensumi-module-libro/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
21 changes: 21 additions & 0 deletions opensumi-module-libro/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
32 changes: 32 additions & 0 deletions opensumi-module-libro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# @difizen/opensumi-module-libro

[![NPM version](https://img.shields.io/npm/v/@difizen/opensumi-module-libro.svg?style=flat)](https://npmjs.org/package/@difizen/opensumi-module-libro)
[![NPM downloads](http://img.shields.io/npm/dm/@difizen/opensumi-module-libro.svg?style=flat)](https://npmjs.org/package/@difizen/opensumi-module-libro)

Use Libro as default notebook editor in Opensumi IDE

![alt text](./assets/image.png)

![alt text](./assets/arch.png)

## Usage

see [opensumi-libro-demo](./example/src/browser/render-app.ts)

## Development

```bash
# install dependencies
$ npm install

# start server
$ npm run start:opensumi

# start demo, visit http://localhost:9000
$ npm run dev

```

## LICENSE

MIT
Binary file added opensumi-module-libro/assets/arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opensumi-module-libro/assets/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions opensumi-module-libro/docs/guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a guide example.
22 changes: 22 additions & 0 deletions opensumi-module-libro/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
hero:
title: library
description: libro on opensumi
actions:
- text: Hello
link: /
- text: World
link: /
features:
- title: Hello
emoji: 💎
description: Put hello description here
- title: World
emoji: 🌈
description: Put world description here
- title: '!'
emoji: 🚀
description: Put ! description here
---

@difizen/opensumi-module-libro
16 changes: 16 additions & 0 deletions opensumi-module-libro/docs/opensumi-demo-app/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## libro

<!-- <code src="./app.tsx" 配置项="值"></code> -->

```jsx
import React from 'react';
import { useEffect } from 'react';
import { startApp } from '../../example/src/browser';

export default () => {
useEffect(() => {
startApp();
}, []);
return <div id="main" style={{ height: '100vh' }}></div>;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"dependencies": {
"nsfw": "1.2.7",
"node-pty": "0.9.0",
"spdlog": "0.9.0",
"vscode-ripgrep": "1.3.1",
"keytar": "^7.7.0"
}
}
Loading

0 comments on commit c06b363

Please sign in to comment.