Skip to content

Commit

Permalink
Merge pull request #136 from Hi-Windom/0.3.37
Browse files Browse the repository at this point in the history
0.3.37
  • Loading branch information
Soltus authored Feb 1, 2023
2 parents 25d44ea + 689fe4c commit 7ebbcda
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 10 deletions.
Binary file added .github/split.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Build Your Eternal Digital Garden
</p>

<p align="center">
<a href="README_zh_CN.md">中文</a>
<a href="README_zh_CN.md">中文</a>&emsp;|&emsp;<a href="README_Sillot.md">Sillot</a>
</p>

## 💡 Introduction
Expand Down
16 changes: 16 additions & 0 deletions README_Sillot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<p align="center">
<img alt="Sillot" src="./app/stage/icon.png">
</p>

<p align="center">
<a href="README.md">SiYuan</a>&emsp;|&emsp;<a href="README_zh_CN.md">思源</a>

</p>

## About

Sillot (汐洛)是开发者友好、社区优先、彖乄驱动的思源笔记发行版(分支)

<p align="center">
<img alt="Sillot" src="./.github/split.png">
</p>
2 changes: 1 addition & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>

<p align="center">
<a href="README.md">English</a>
<a href="README.md">English</a>&emsp;|&emsp;<a href="README_Sillot.md">汐洛</a>
</p>

## 💡 简介
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:desktop": "webpack --mode production --config webpack.desktop.js",
"build:export": "webpack --mode production --config webpack.export.js",
"build-sillot": "webpack --mode production && pnpm run build:desktop && pnpm run build:export",
"dev-sillot": "webpack --mode development && pnpm run dev:desktop && pnpm run dev:export",
"ABA": "NODE_ENV=production webpack --mode production --config webpack.ABA.js",
"start": "NODE_ENV=development electron ./electron/main.js",
"dist-appx": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --config electron-appx-builder.yml",
"dist": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --config electron-builder.yml",
Expand Down
6 changes: 3 additions & 3 deletions app/src/sillot/ace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import 'brace/mode/nsis'
import 'brace/mode/objectivec'
import 'brace/mode/perl'
import 'brace/mode/pgsql'
import 'brace/mode/php'
// import 'brace/mode/php'
import 'brace/mode/powershell'
import 'brace/mode/python'
import 'brace/mode/r'
Expand Down Expand Up @@ -73,7 +73,7 @@ import 'brace/snippets/nsis'
import 'brace/snippets/objectivec'
import 'brace/snippets/perl'
import 'brace/snippets/pgsql'
import 'brace/snippets/php'
// import 'brace/snippets/php'
import 'brace/snippets/powershell'
import 'brace/snippets/python'
import 'brace/snippets/r'
Expand Down Expand Up @@ -119,7 +119,7 @@ const ace_modes: any = {
objectivec: 'ace/mode/objectivec',
perl: 'ace/mode/perl',
pgsql: 'ace/mode/pgsql',
php: 'ace/mode/php',
// php: 'ace/mode/php',
powershell: 'ace/mode/powershell',
python: 'ace/mode/python',
r: 'ace/mode/r',
Expand Down
2 changes: 1 addition & 1 deletion app/src/sillot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const lodash = require('lodash');
const localforage = require('localforage');
import { exAce } from './ace'
import { exApp1 } from './vue-toast-notification'
import { Example } from './react-toastify.jsx'
import { Example } from './react-toastify'
import * as React from 'react'; // 兼容性好
import * as ReactDOM from 'react-dom'; // 兼容性好
import Swal from 'sweetalert2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { toast, ToastContainer } from 'react-toastify';
import "react-toastify/dist/ReactToastify.css";


export function Example(id) {
export function Example(id: string) {
// 在devtool运行 __.toastify() 测试
window.__.toastify = () => {
toast("Default Notification !");
Expand Down Expand Up @@ -39,3 +39,9 @@ export function Example(id) {
</>
));
}

// export class toastify {
// constructor(props) {
// this.root = ReactDOM.createRoot(document.getElementById(id)); // https://beta.reactjs.org/reference/react/createElement 示例
// }
// }
164 changes: 164 additions & 0 deletions app/webpack.ABA.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
const path = require("path");
const webpack = require("webpack");
const pkg = require("./package.json");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
// https://juejin.cn/post/7028768162355085326

module.exports = (env, argv) => {
return {
mode: argv.mode || "development",
watch: argv.mode !== "production",
devtool: argv.mode !== "production" ? "eval" : false,
target: "electron-renderer",
output: {
publicPath: "",
filename: "[name].[chunkhash].js",
path: path.resolve(__dirname, "stage/build/app"),
},
entry: {
main: "./src/index.ts",
window: "./src/window/index.ts",
},
resolve: {
extensions: [
".ts",
".js",
".jsx",
".tsx",
".tpl",
".scss",
".png",
".svg",
],
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
format: {
comments: false,
},
},
extractComments: false,
}),
],
},
module: {
rules: [
{
test: /\.tpl/,
include: [
path.resolve(__dirname, "src/assets/template/app/index.tpl"),
path.resolve(__dirname, "src/assets/template/app/window.tpl"),
],
loader: "html-loader",
options: {
sources: false,
},
},
{
test: /\.ts(x?)$/,
include: [path.resolve(__dirname, "src")],
use: [
{
loader: "ts-loader",
},
{
loader: "ifdef-loader",
options: {
BROWSER: false,
MOBILE: false,
},
},
],
},
{
test: /\.scss$/,
include: [path.resolve(__dirname, "src/assets/scss")],
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: "../../",
},
},
{
loader: "css-loader", // translates CSS into CommonJS
},
{
loader: "sass-loader", // compiles Sass to CSS
},
],
},
{
test: /\.css$/,
use: [
{
loader: "style-loader",
},
{
loader: "css-loader",
},
],
},
{
test: /\.jsx?$/,
include: path.join(__dirname, "src"),
loader: "babel-loader",
},
{
test: /\.woff$/,
type: "asset/resource",
generator: {
filename: "../fonts/JetBrainsMono-Regular.woff",
},
},
{
test: /\.(png|svg)$/,
use: [
{
loader: "file-loader",
options: {
name: "[name].[ext]",
outputPath: "../../",
},
},
],
},
],
},
plugins: [
new CleanWebpackPlugin({
cleanStaleWebpackAssets: false,
cleanOnceBeforeBuildPatterns: [path.join(__dirname, "stage/build/app")],
}),
new webpack.DefinePlugin({
SIYUAN_VERSION: JSON.stringify(pkg.version),
SIYUAN_ORIGIN_VERSION: JSON.stringify(pkg.syv),
NODE_ENV: JSON.stringify(argv.mode),
}),
new MiniCssExtractPlugin({
filename: "base.[contenthash].css",
}),
new HtmlWebpackPlugin({
inject: "head",
chunks: ["main"],
filename: "index.html",
template: "src/assets/template/app/index.tpl",
}),
new HtmlWebpackPlugin({
inject: "head",
chunks: ["window"],
filename: "window.html",
template: "src/assets/template/app/window.tpl",
}),
new BundleAnalyzerPlugin(),
],
};
};
2 changes: 1 addition & 1 deletion app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = (env, argv) => {
'window': './src/window/index.ts',
},
resolve: {
extensions: ['.ts', '.js', 'jsx', '.tpl', '.scss', '.png', '.svg'],
extensions: ['.ts', '.js', '.jsx', '.tsx', '.tpl', '.scss', '.png', '.svg'],
},
optimization: {
minimize: true,
Expand Down
2 changes: 1 addition & 1 deletion app/webpack.desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = (env, argv) => {
fallback: {
'path': require.resolve('path-browserify'),
},
extensions: ['.ts', '.js', 'jsx', '.tpl', '.scss'],
extensions: ['.ts', '.js', '.jsx', '.tsx', '.tpl', '.scss'],
},
module: {
rules: [
Expand Down

0 comments on commit 7ebbcda

Please sign in to comment.