Skip to content

Commit

Permalink
feat: 支持$匿名类
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Jan 5, 2022
1 parent c6511fb commit 0e1a763
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
10 changes: 8 additions & 2 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yurine",
"version": "0.4.1",
"version": "0.5.0",
"description": "A csx transformer for karas",
"author": "army8735 <army8735@qq.com>",
"maintainers": [
Expand Down Expand Up @@ -30,6 +30,7 @@
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@rollup/plugin-json": "^4.1.0",
"expect.js": "^0.3.1",
"mocha": "^6.2.1",
"rollup": "^1.21.2",
Expand Down
3 changes: 3 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import babel from 'rollup-plugin-babel';
import { uglify } from 'rollup-plugin-uglify';
import json from '@rollup/plugin-json';

export default [{
input: 'src/index.js',
Expand All @@ -17,6 +18,7 @@ export default [{
exclude: 'node_modules/**', // 只编译我们的源代码
runtimeHelpers: true
}),
json(),
],
}, {
input: 'src/index.js',
Expand All @@ -34,6 +36,7 @@ export default [{
exclude: 'node_modules/**', // 只编译我们的源代码
runtimeHelpers: true
}),
json(),
uglify({
sourcemap: true,
}),
Expand Down
4 changes: 4 additions & 0 deletions src/csx.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ function selfClose(node, isClose) {
res += 'karas.createCp(';
res += name;
}
else if(name === '$') {
res += 'karas.createGm(';
res += name;
}
else if(/^\$/.test(name)) {
res += 'karas.createGm(';
res += '"' + name + '"';
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import homunculus from 'homunculus';
import Tree from './Tree';
import { version } from '../package.json';

class Yurine {
constructor() {
Expand All @@ -24,4 +25,7 @@ class Yurine {
}
}

export default new Yurine();
let o = new Yurine();
o.version = version;

export default o;

0 comments on commit 0e1a763

Please sign in to comment.