Skip to content

Commit

Permalink
feat: 0.0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
theajack committed Aug 31, 2023
1 parent 0165637 commit c47527e
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 18 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"clear-dist": "node scripts/clear-dist.js",
"init:package": "node ./scripts/init-packages-info.js",
"init:mono": "node ./scripts/init-packages-info.js dev",
"init:dev": "node ./scripts/init-packages-info.js dev",
"release": "node scripts/push-release.js",
"eb:purge": "node scripts/purge-cdn.js",
"_serve": "npx nodemon scripts/dev/bundle.min.js",
Expand Down Expand Up @@ -67,6 +68,7 @@
"rollup-plugin-uglify": "^6.0.4",
"rollup-plugin-vue": "^6.0.0",
"serve": "^13.0.2",
"tslib": "^2.6.2",
"typescript": "^4.7.4"
},
"private": true
Expand Down
3 changes: 2 additions & 1 deletion packages/client-core/src/element/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export function parseAttributes (
if (!prop || prop === 'v') {
const r1 = v.matchAll(/(.*?)=(.*?)(&|$)/g);
v = {};
for (const item of r1)v[item[1]] = item[2];
// @ts-ignore
for (const item of r1) v[item[1]] = item[2];
const r2 = ov.matchAll(/(.*?)=(.*?)(&|$)/g);
ov = {};
for (const item of r2) ov[item[1]] = item[2];
Expand Down
3 changes: 2 additions & 1 deletion packages/client-core/src/element/dom-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ function reactiveBinding<T=string> (bind: IBindingReaction, onchange: IProxyList
if (typeof bind === 'function' || (isProxy(bind) && typeof bind.v !== 'undefined')) {
return watch(bind, onchange).v;
}
return bind;
// @ts-ignore
return bind as T;
}
1 change: 1 addition & 0 deletions packages/client-core/src/element/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export function transformOptionsToElement (opt: IJSXDomOptions): ITrueElement {
if (opt.attributes?.$html) {
console.warn('$html 属性的元素的子元素将失效');
} else {
// @ts-ignore
appendChildren(el, opt.children);
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/client-core/src/for.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ export function map (
if (i === 0) head = child;
} else if (Renderer.isFragment(child)) {
child = child as IFragment;
// @ts-ignore
const children = child.childNodes;
const n = children.length;
if (n === 0) {
end = Renderer.createEmptyMountNode();
// @ts-ignore
child.appendChild(end as any);
if (i === 0) head = end;
} else {
Expand Down
1 change: 1 addition & 0 deletions packages/client-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export function insertBefore (array: any[], node: any, child: any) {
node = [node];
}
if (index === 0) {
// @ts-ignore
array.unshift(...node);
} else {
array.splice(index - 1, 0, ...node);
Expand Down
1 change: 1 addition & 0 deletions packages/client-standalone/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function Dom (name: string, attributes: IAttributes = {}, children: any[]
children = attributes;
attributes = {};
}
// @ts-ignore
return ContextTool.ce(name, attributes, children);
}
// alins.component(fn, {}, [])
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "vite-plugin-alins",
"version": "0.0.24",
"description": "All-in-js Web UI Framework, No jsx/template/vdom/css/html",
"main": "dist/vite-plugin-alins.cjs.min.js",
"typings": "dist/vite-plugin-alins.d.ts",
"main": "src/index.ts",
"typings": "src/index.ts",
"repository": "[email protected]:alinsjs/alins.git",
"author": "tackchen <[email protected]>",
"scripts": {
Expand All @@ -24,5 +24,5 @@
"dependencies": {
"alins-compiler-node": "^0.0.24"
},
"module": "dist/vite-plugin-alins.esm.min.js"
"module": "src/index.ts"
}
17 changes: 10 additions & 7 deletions pnpm-lock.yaml

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

14 changes: 8 additions & 6 deletions scripts/build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ const packageInfo = {
},
};

const replacement = {
'__DEV__': 'false',
'__DEBUG__': 'false',
'__VERSION__': `"${version}"`
};

const createBaseConfig = (format) => {

const bundleName = `${packageName}.${format}.min.js`;
Expand Down Expand Up @@ -226,11 +232,7 @@ const createBaseConfig = (format) => {
extensions,
configFile: path.join(__dirname, './babel.config.js'),
}),
replace({
'__DEV__': 'false',
'__DEBUG__': 'false',
'__VERSION__': `"${version}"`
})
replace(replacement)
],
// external: [], // format === 'iife' ? [] : external,
external: format === 'iife' ? [] : external,
Expand All @@ -252,7 +254,7 @@ function createDTSConfig (name) {
file: resolvePackagePath(`${dirName}/dist/${name}.d.ts`),
format: 'es',
},
plugins: [dts(), json()],
plugins: [dts(), json(), replace(replacement)],
};
}

Expand Down

0 comments on commit c47527e

Please sign in to comment.