@htmlplus/element 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/decorators/event.d.ts +1 -1
- package/client/helpers/direction.d.ts +1 -1
- package/client/helpers/slots.d.ts +1 -1
- package/client/services/link.d.ts +1 -1
- package/client/utils/typeOf.d.ts +1 -1
- package/compiler/plugins/assets.d.ts +1 -1
- package/compiler/plugins/extract.js +5 -1
- package/compiler/plugins/parse.d.ts +1 -1
- package/compiler/plugins/parse.js +2 -2
- package/compiler/plugins/read.d.ts +1 -1
- package/compiler/plugins/readme.d.ts +1 -1
- package/compiler/plugins/style.d.ts +1 -1
- package/compiler/utils/tags.js +5 -3
- package/package.json +6 -6
- package/types/plugin.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlusElement } from '../../types';
|
|
2
|
-
export
|
|
2
|
+
export type EventEmitter<T = any> = (data?: T) => CustomEvent<T>;
|
|
3
3
|
export interface EventOptions {
|
|
4
4
|
/**
|
|
5
5
|
* A string custom event name to override the default.
|
package/client/utils/typeOf.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from '../../types';
|
|
2
2
|
export declare const ASSETS_OPTIONS: Partial<AssetsOptions>;
|
|
3
|
-
export
|
|
3
|
+
export type AssetsOptions = {
|
|
4
4
|
once?: boolean;
|
|
5
5
|
destination: (context: Context) => string;
|
|
6
6
|
source?: (context: Context) => string;
|
|
@@ -12,9 +12,13 @@ export const extract = (options) => {
|
|
|
12
12
|
visitor(context.fileAST, {
|
|
13
13
|
ClassDeclaration: {
|
|
14
14
|
exit(path) {
|
|
15
|
-
var _a, _b;
|
|
15
|
+
var _a, _b, _c;
|
|
16
16
|
context.class = path.node;
|
|
17
17
|
context.classMembers = ((_b = (_a = context.class) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.body) || [];
|
|
18
|
+
// TODO
|
|
19
|
+
if (path.parentPath.isExportNamedDeclaration() && !((_c = context.class) === null || _c === void 0 ? void 0 : _c.leadingComments)) {
|
|
20
|
+
context.class['_leadingComments'] = t.cloneNode(path.parentPath.node, true).leadingComments || [];
|
|
21
|
+
}
|
|
18
22
|
path.skip();
|
|
19
23
|
}
|
|
20
24
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ParserOptions } from '@babel/parser';
|
|
2
2
|
import { Context } from '../../types';
|
|
3
3
|
export declare const PARSE_OPTIONS: Partial<ParseOptions>;
|
|
4
|
-
export
|
|
4
|
+
export type ParseOptions = ParserOptions;
|
|
5
5
|
export declare const parse: (options?: ParseOptions) => {
|
|
6
6
|
name: string;
|
|
7
7
|
next: (context: Context) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parse as parser } from '@babel/parser';
|
|
2
2
|
export const PARSE_OPTIONS = {
|
|
3
|
-
|
|
4
|
-
plugins: ['
|
|
3
|
+
sourceType: 'module',
|
|
4
|
+
plugins: [['decorators', { decoratorsBeforeExport: true }], 'jsx', 'typescript']
|
|
5
5
|
};
|
|
6
6
|
export const parse = (options) => {
|
|
7
7
|
const name = 'parse';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Global } from '../../types';
|
|
2
2
|
export declare const README_OPTIONS: Partial<ReadmeOptions>;
|
|
3
|
-
export
|
|
3
|
+
export type ReadmeOptions = {
|
|
4
4
|
source?: (context: Context) => string;
|
|
5
5
|
};
|
|
6
6
|
export declare const readme: (options: ReadmeOptions) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from '../../types';
|
|
2
2
|
export declare const STYLE_OPTIONS: Partial<StyleOptions>;
|
|
3
|
-
export
|
|
3
|
+
export type StyleOptions = {
|
|
4
4
|
source?: (context: Context) => string | string[];
|
|
5
5
|
};
|
|
6
6
|
export declare const style: (options?: StyleOptions) => {
|
package/compiler/utils/tags.js
CHANGED
|
@@ -2,14 +2,16 @@ export const getTag = (node, key) => {
|
|
|
2
2
|
return getTags(node, key).pop();
|
|
3
3
|
};
|
|
4
4
|
export const getTags = (node, filter) => {
|
|
5
|
-
var _a, _b, _c
|
|
5
|
+
var _a, _b, _c;
|
|
6
6
|
const tags = [];
|
|
7
|
-
|
|
7
|
+
// TODO
|
|
8
|
+
const comments = node['_leadingComments'] || node.leadingComments;
|
|
9
|
+
const lines = (_c = (_b = (_a = comments === null || comments === void 0 ? void 0 : comments.map((comment) => {
|
|
8
10
|
const { type, value } = comment;
|
|
9
11
|
if (type == 'CommentLine')
|
|
10
12
|
return value;
|
|
11
13
|
return value.replace(/\r\n/g, '\n').split('\n');
|
|
12
|
-
})) === null ||
|
|
14
|
+
})) === null || _a === void 0 ? void 0 : _a.flat()) === null || _b === void 0 ? void 0 : _b.filter((line) => line.trim().replace(/\*/g, ''))) === null || _c === void 0 ? void 0 : _c.map((line) => line.replace(/^( +)?(\*+)?( +)?/, ''));
|
|
13
15
|
for (const line of lines || []) {
|
|
14
16
|
const has = !!tags.length;
|
|
15
17
|
const isTag = line.startsWith('@');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@htmlplus/element",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Masood Abdolian <m.abdolian@gmail.com>",
|
|
6
6
|
"description": "A powerful library for building scalable, reusable, fast, tastable and lightweight design system for any web technologies. Powerd by Web Component.",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/htmlplus/element#readme",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@babel/generator": "^7.20.
|
|
34
|
+
"@babel/generator": "^7.20.4",
|
|
35
35
|
"@babel/parser": "^7.20.3",
|
|
36
36
|
"@babel/traverse": "^7.20.1",
|
|
37
37
|
"@babel/types": "^7.20.2",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"fs-extra": "^10.1.0",
|
|
42
42
|
"handlebars": "^4.7.7",
|
|
43
43
|
"ora": "^6.1.2",
|
|
44
|
-
"typescript": "^4.
|
|
44
|
+
"typescript": "^4.9.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@trivago/prettier-plugin-sort-imports": "^
|
|
47
|
+
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
|
|
48
48
|
"cpy": "^9.0.1",
|
|
49
49
|
"nodemon": "^2.0.20",
|
|
50
|
-
"prettier": "^2.
|
|
50
|
+
"prettier": "^2.8.0",
|
|
51
51
|
"rimraf": "^3.0.2",
|
|
52
52
|
"ts-node": "^10.9.1",
|
|
53
|
-
"vite": "^3.2.
|
|
53
|
+
"vite": "^3.2.4"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/types/plugin.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context } from './context';
|
|
2
2
|
import { Global } from './global';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type Return<T> = void | T | Promise<T>;
|
|
4
|
+
export type Plugin = {
|
|
5
5
|
name: string;
|
|
6
6
|
options?: any;
|
|
7
7
|
start?: (global: Global) => Return<void>;
|