@blueprintui/cli 0.9.0 → 0.11.0
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/.nvmrc +1 -1
- package/CHANGELOG.md +7 -0
- package/package.json +23 -19
- package/src/custom-elements-manifest.config.mjs +2 -1
- package/src/index.mjs +18 -3
- package/src/project/blueprint.config.js +1 -1
- package/src/project/index.html +48 -0
- package/src/project/package.json +31 -15
- package/src/project/src/alert/element.css +7 -4
- package/src/project/src/alert/element.ts +1 -1
- package/src/project/src/include/alert.ts +3 -3
- package/src/project/tsconfig.json +1 -5
- package/src/rollup.config.mjs +0 -11
- package/src/utils.mjs +6 -1
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
22.11.0
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueprintui/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./index.mjs",
|
|
6
6
|
"bin": {
|
|
7
7
|
"bp": "./src/index.mjs"
|
|
8
8
|
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"start": "cd docs && lite-server",
|
|
12
|
-
"deploy": "firebase deploy --only hosting:blueprintui-cli"
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": "22.11.0"
|
|
13
11
|
},
|
|
14
12
|
"author": "Crylan Software",
|
|
15
13
|
"license": "MIT",
|
|
16
14
|
"dependencies": {
|
|
17
15
|
"@custom-elements-manifest/analyzer": "0.10.3",
|
|
18
16
|
"@lit/ts-transformers": "2.0.1",
|
|
19
|
-
"@rollup/plugin-node-resolve": "15.
|
|
20
|
-
"@rollup/plugin-replace": "
|
|
21
|
-
"@rollup/plugin-typescript": "
|
|
17
|
+
"@rollup/plugin-node-resolve": "15.3.0",
|
|
18
|
+
"@rollup/plugin-replace": "6.0.1",
|
|
19
|
+
"@rollup/plugin-typescript": "12.1.1",
|
|
22
20
|
"@rollup/plugin-virtual": "3.0.2",
|
|
23
|
-
"@
|
|
24
|
-
"browserslist": "4.
|
|
21
|
+
"@rollup/pluginutils": "5.1.3",
|
|
22
|
+
"browserslist": "4.24.2",
|
|
25
23
|
"commander": "12.1.0",
|
|
26
24
|
"custom-element-vs-code-integration": "1.4.1",
|
|
27
|
-
"glob": "
|
|
28
|
-
"lightningcss": "1.
|
|
25
|
+
"glob": "11.0.0",
|
|
26
|
+
"lightningcss": "1.28.1",
|
|
29
27
|
"minify-html-literals": "1.3.5",
|
|
30
28
|
"path": "0.12.7",
|
|
31
|
-
"
|
|
29
|
+
"publint": "0.2.12",
|
|
30
|
+
"rollup": "4.25.0",
|
|
32
31
|
"rollup-plugin-copy": "3.5.0",
|
|
33
32
|
"rollup-plugin-css-modules": "0.1.2",
|
|
34
|
-
"rollup-plugin-delete": "2.
|
|
33
|
+
"rollup-plugin-delete": "2.1.0",
|
|
35
34
|
"rollup-plugin-shell": "1.0.9",
|
|
36
|
-
"terser": "5.
|
|
37
|
-
"tslib": "2.
|
|
38
|
-
"typescript": "~5.
|
|
39
|
-
"zx": "8.1
|
|
35
|
+
"terser": "5.36.0",
|
|
36
|
+
"tslib": "2.8.1",
|
|
37
|
+
"typescript": "~5.6.3",
|
|
38
|
+
"zx": "8.2.1"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"lite-server": "2.6.1"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"bp": "./src/index.mjs",
|
|
45
|
+
"start": "cd docs && lite-server",
|
|
46
|
+
"deploy": "firebase deploy --only hosting:blueprintui-cli"
|
|
43
47
|
}
|
|
44
|
-
}
|
|
48
|
+
}
|
package/src/index.mjs
CHANGED
|
@@ -10,6 +10,8 @@ import { cp, lstat, readdir } from 'fs/promises';
|
|
|
10
10
|
import { readFileSync, writeFileSync } from 'fs';
|
|
11
11
|
import { join, resolve } from 'path';
|
|
12
12
|
import { getUserConfig } from './utils.mjs';
|
|
13
|
+
import { publint } from 'publint';
|
|
14
|
+
import { formatMessage } from 'publint/utils';
|
|
13
15
|
|
|
14
16
|
const deepReadDir = async (dirPath) => await Promise.all(
|
|
15
17
|
(await readdir(dirPath)).map(async (entity) => {
|
|
@@ -35,7 +37,7 @@ program
|
|
|
35
37
|
.action(async (options, command) => {
|
|
36
38
|
process.env.BLUEPRINTUI_BUILD = !options.watch ? 'production' : 'development';
|
|
37
39
|
process.env.BLUEPRINTUI_CONFIG = command.args[0] ? path.resolve(command.args[0]) : path.resolve('./blueprint.config.js');
|
|
38
|
-
buildRollup(options);
|
|
40
|
+
await buildRollup(options);
|
|
39
41
|
});
|
|
40
42
|
|
|
41
43
|
program
|
|
@@ -85,7 +87,7 @@ program
|
|
|
85
87
|
program.parse();
|
|
86
88
|
|
|
87
89
|
function buildRollup(args) {
|
|
88
|
-
loadConfigFile(path.resolve(__dirname, './rollup.config.mjs'), {}).then(
|
|
90
|
+
return loadConfigFile(path.resolve(__dirname, './rollup.config.mjs'), {}).then(
|
|
89
91
|
async ({ options, warnings }) => {
|
|
90
92
|
if (warnings.count) {
|
|
91
93
|
console.log(`${warnings.count} warnings`);
|
|
@@ -106,8 +108,21 @@ function buildRollup(args) {
|
|
|
106
108
|
}
|
|
107
109
|
if (bundle) {
|
|
108
110
|
const end = Date.now();
|
|
109
|
-
console.log(status.success, `Completed in ${(end - start) / 1000} seconds 🎉`);
|
|
110
111
|
await bundle.close();
|
|
112
|
+
|
|
113
|
+
const { messages } = await spinner('Verifying Package...', async () => await publint({
|
|
114
|
+
strict: true,
|
|
115
|
+
pkgDir: resolve(cwd())
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
if (messages.length) {
|
|
119
|
+
const pkg = JSON.parse(readFileSync(resolve(cwd(),'./package.json'), 'utf8'));
|
|
120
|
+
for (const message of messages) {
|
|
121
|
+
console.log(formatMessage(message, pkg))
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
console.log(status.success, `Success in ${(end - start) / 1000} seconds 🎉`);
|
|
125
|
+
}
|
|
111
126
|
}
|
|
112
127
|
process.exit(buildFailed ? 1 : 0);
|
|
113
128
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Basic HTML Page</title>
|
|
7
|
+
<script type="importmap">
|
|
8
|
+
{
|
|
9
|
+
"imports": {
|
|
10
|
+
"lit": "./node_modules/lit/index.js",
|
|
11
|
+
"lit/": "./node_modules/lit/",
|
|
12
|
+
"@lit/reactive-element": "./node_modules/@lit/reactive-element/reactive-element.js",
|
|
13
|
+
"@lit/reactive-element/": "./node_modules/@lit/reactive-element/",
|
|
14
|
+
"lit-html": "./node_modules/lit-html/lit-html.js",
|
|
15
|
+
"lit-html/": "./node_modules/lit-html/",
|
|
16
|
+
"lit-element/": "./node_modules/lit-element/",
|
|
17
|
+
"tslib": "./node_modules/tslib/tslib.es6.js"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
<style>
|
|
22
|
+
html { box-sizing: border-box; }
|
|
23
|
+
*, *:before, *:after { box-sizing: inherit; }
|
|
24
|
+
|
|
25
|
+
body {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding: 24px;
|
|
31
|
+
gap: 12px;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
<ui-alert status="neutral" closable>neutral</ui-alert>
|
|
37
|
+
|
|
38
|
+
<ui-alert status="success" closable>success</ui-alert>
|
|
39
|
+
|
|
40
|
+
<ui-alert status="warning" closable>warning</ui-alert>
|
|
41
|
+
|
|
42
|
+
<ui-alert status="danger" closable>danger</ui-alert>
|
|
43
|
+
|
|
44
|
+
<script type="module">
|
|
45
|
+
import './dist/include/alert.js';
|
|
46
|
+
</script>
|
|
47
|
+
</body>
|
|
48
|
+
</html>
|
package/src/project/package.json
CHANGED
|
@@ -1,43 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{LIBRARY}}",
|
|
3
3
|
"version": "0.0.0",
|
|
4
|
-
"main": "./index.js",
|
|
5
|
-
"module": "./index.js",
|
|
6
|
-
"typings": "./index.d.ts",
|
|
7
4
|
"type": "module",
|
|
8
5
|
"customElements": "./custom-elements.json",
|
|
9
6
|
"homepage": "https://cli.blueprintui.dev",
|
|
10
7
|
"keywords": ["web components", "blueprintui"],
|
|
11
8
|
"license": "MIT",
|
|
12
|
-
"description": "
|
|
9
|
+
"description": "test-project web component library",
|
|
13
10
|
"scripts": {
|
|
14
|
-
"start": "
|
|
15
|
-
"build": "bp build"
|
|
11
|
+
"start": "NODE_NO_WARNINGS=1 serve & npm run build:watch",
|
|
12
|
+
"build": "bp build",
|
|
13
|
+
"build:watch": "bp build --watch"
|
|
16
14
|
},
|
|
17
15
|
"files": [
|
|
18
|
-
"
|
|
16
|
+
"package.json",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE.md",
|
|
19
|
+
"dist/**/*"
|
|
19
20
|
],
|
|
20
21
|
"sideEffects": [
|
|
21
22
|
"./include/*.js"
|
|
22
23
|
],
|
|
23
24
|
"exports": {
|
|
24
|
-
"./
|
|
25
|
-
".": "./
|
|
26
|
-
"./include
|
|
27
|
-
|
|
25
|
+
"./package.json": "./package.json",
|
|
26
|
+
"./custom-elements.json": "./dist/custom-elements.json",
|
|
27
|
+
"./include/*.js": {
|
|
28
|
+
"types": "./dist/include/*.d.ts",
|
|
29
|
+
"default": "./dist/include/*.js"
|
|
30
|
+
},
|
|
31
|
+
"./*": {
|
|
32
|
+
"types": "./dist/*/index.d.ts",
|
|
33
|
+
"default": "./dist/*/index.js"
|
|
34
|
+
},
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
}
|
|
28
39
|
},
|
|
29
40
|
"author": {
|
|
30
41
|
"name": ""
|
|
31
42
|
},
|
|
32
43
|
"repository": {
|
|
33
44
|
"type": "git",
|
|
34
|
-
"url": "https://
|
|
45
|
+
"url": "git+https://github.com/blueprintui/cli.git"
|
|
35
46
|
},
|
|
36
47
|
"dependencies": {
|
|
37
|
-
"lit": "^3.
|
|
48
|
+
"lit": "^3.2.0"
|
|
38
49
|
},
|
|
39
50
|
"devDependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
51
|
+
"@lit/reactive-element": "^2.0.4",
|
|
52
|
+
"@blueprintui/cli": "^0.10.0",
|
|
53
|
+
"lit-html": "^3.2.0",
|
|
54
|
+
"lit-element": "^4.1.0",
|
|
55
|
+
"serve": "14.2.3",
|
|
56
|
+
"tslib": "~2.7.0",
|
|
57
|
+
"typescript": "~5.6.2"
|
|
42
58
|
}
|
|
43
59
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
--background: #bed5f2;
|
|
3
3
|
--color: #2d2d2d;
|
|
4
|
-
--font-family: Helvetica, Arial, "Lucida Grande", sans-serif;
|
|
5
4
|
--gap: 12px;
|
|
6
5
|
--padding: 12px;
|
|
6
|
+
font-family: inherit;
|
|
7
7
|
display: block;
|
|
8
8
|
width: 100%;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.private-host {
|
|
12
12
|
background: var(--background);
|
|
13
|
-
font-family: var(--font-family);
|
|
14
13
|
color: var(--color);
|
|
15
14
|
gap: var(--gap);
|
|
16
15
|
padding: var(--padding);
|
|
17
16
|
display: flex;
|
|
18
17
|
align-items: center;
|
|
18
|
+
position: relative;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
[part='icon'] {
|
|
@@ -49,9 +49,12 @@ button {
|
|
|
49
49
|
padding: 0;
|
|
50
50
|
cursor: pointer;
|
|
51
51
|
color: hsla(0, 0%, 0%, 0.4);
|
|
52
|
-
background: hsla(0, 0%, 0%, 0.05);
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
button:hover {
|
|
55
|
+
background: hsla(0, 0%, 0%, 0.05);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
button:active {
|
|
56
59
|
background: hsla(0, 0%, 0%, 0.1);
|
|
57
|
-
}
|
|
60
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Alert } from '
|
|
1
|
+
import { Alert } from '../alert/index.js';
|
|
2
2
|
|
|
3
|
-
customElements.get('
|
|
3
|
+
customElements.get('ui-alert') || customElements.define('ui-alert', Alert);
|
|
4
4
|
|
|
5
5
|
declare global {
|
|
6
6
|
interface HTMLElementTagNameMap {
|
|
7
7
|
'ui-alert': Alert;
|
|
8
8
|
}
|
|
9
|
-
}
|
|
9
|
+
}
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"resolveJsonModule": true,
|
|
11
11
|
"outDir": "./dist",
|
|
12
12
|
"declaration": true,
|
|
13
|
-
"types": ["jasmine"],
|
|
14
13
|
"alwaysStrict": true,
|
|
15
14
|
"noImplicitAny": true,
|
|
16
15
|
"noImplicitReturns": true,
|
|
@@ -24,10 +23,7 @@
|
|
|
24
23
|
"inlineSourceMap": false,
|
|
25
24
|
"importHelpers": true,
|
|
26
25
|
"baseUrl": "./",
|
|
27
|
-
"rootDir": "./src"
|
|
28
|
-
"paths": {
|
|
29
|
-
"library/*": ["./src/*"]
|
|
30
|
-
}
|
|
26
|
+
"rootDir": "./src"
|
|
31
27
|
},
|
|
32
28
|
"exclude": ["dist", "node_modules"]
|
|
33
29
|
}
|
package/src/rollup.config.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import replace from '@rollup/plugin-replace';
|
|
|
4
4
|
import virtual from '@rollup/plugin-virtual';
|
|
5
5
|
import copy from 'rollup-plugin-copy';
|
|
6
6
|
import del from 'rollup-plugin-delete';
|
|
7
|
-
import execute from 'rollup-plugin-shell';
|
|
8
7
|
import { fs, glob, path } from 'zx';
|
|
9
8
|
import { idiomaticDecoratorsTransformer, constructorCleanupTransformer } from '@lit/ts-transformers';
|
|
10
9
|
import { fileURLToPath } from 'url';
|
|
@@ -53,13 +52,11 @@ export default [
|
|
|
53
52
|
createEntrypoints(),
|
|
54
53
|
nodeResolve({ exportConditions: [project.prod ? 'production' : 'development'] }),
|
|
55
54
|
compileTypescript(),
|
|
56
|
-
typeCheck(),
|
|
57
55
|
project.prod ? [] : writeCache(project),
|
|
58
56
|
project.prod ? minifyHTML() : [],
|
|
59
57
|
project.prod ? minifyJavaScript() : [],
|
|
60
58
|
project.prod ? inlinePackageVersion() : [],
|
|
61
59
|
project.prod ? postClean(): [],
|
|
62
|
-
project.prod ? packageCheck() : [],
|
|
63
60
|
project.prod ? customElementsAnalyzer(project) : []
|
|
64
61
|
],
|
|
65
62
|
},
|
|
@@ -90,10 +87,6 @@ function compileTypescript() {
|
|
|
90
87
|
});
|
|
91
88
|
}
|
|
92
89
|
|
|
93
|
-
function typeCheck() {
|
|
94
|
-
return execute({ commands: [`tsc --noEmit --project ${project.tsconfig}`], hook: 'buildEnd' });
|
|
95
|
-
}
|
|
96
|
-
|
|
97
90
|
function inlinePackageVersion() {
|
|
98
91
|
return replace({ preventAssignment: false, values: { PACKAGE_VERSION: project.packageJSON.version } });
|
|
99
92
|
}
|
|
@@ -101,7 +94,3 @@ function inlinePackageVersion() {
|
|
|
101
94
|
function postClean() {
|
|
102
95
|
return del({ targets: [`${project.outDir}/**/.tsbuildinfo`, `${project.outDir}/**/_virtual`], hook: 'writeBundle' });
|
|
103
96
|
}
|
|
104
|
-
|
|
105
|
-
function packageCheck() {
|
|
106
|
-
return execute({ commands: [`package-check --cwd ${project.outDir}`], sync: true, hook: 'writeBundle' });
|
|
107
|
-
}
|
package/src/utils.mjs
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { cli } from '@custom-elements-manifest/analyzer/cli.js';
|
|
2
2
|
|
|
3
3
|
export async function runCustomElementsAnalyzer(customElementsManifestConfig) {
|
|
4
|
-
|
|
4
|
+
// disable noisy log output from custom-elements-manifest
|
|
5
|
+
const log = console.log;
|
|
6
|
+
console.log = () => {};
|
|
7
|
+
const result = await cli({ argv: ['analyze', '--quiet', '--config', customElementsManifestConfig] });
|
|
8
|
+
console.log = log;
|
|
9
|
+
return result;
|
|
5
10
|
}
|
|
6
11
|
|
|
7
12
|
export async function getUserConfig() {
|