@blueprintui/cli 0.9.0 → 0.10.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 +3 -0
- package/package.json +17 -13
- package/src/custom-elements-manifest.config.mjs +2 -1
- package/src/index.mjs +17 -3
- package/src/rollup.config.mjs +0 -11
- package/src/utils.mjs +6 -1
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
22.8.0
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueprintui/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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.8.0"
|
|
13
11
|
},
|
|
14
12
|
"author": "Crylan Software",
|
|
15
13
|
"license": "MIT",
|
|
@@ -20,7 +18,7 @@
|
|
|
20
18
|
"@rollup/plugin-replace": "5.0.7",
|
|
21
19
|
"@rollup/plugin-typescript": "11.1.6",
|
|
22
20
|
"@rollup/plugin-virtual": "3.0.2",
|
|
23
|
-
"@
|
|
21
|
+
"@rollup/pluginutils": "5.1.0",
|
|
24
22
|
"browserslist": "4.23.2",
|
|
25
23
|
"commander": "12.1.0",
|
|
26
24
|
"custom-element-vs-code-integration": "1.4.1",
|
|
@@ -28,17 +26,23 @@
|
|
|
28
26
|
"lightningcss": "1.25.1",
|
|
29
27
|
"minify-html-literals": "1.3.5",
|
|
30
28
|
"path": "0.12.7",
|
|
31
|
-
"
|
|
29
|
+
"publint": "0.2.10",
|
|
30
|
+
"rollup": "4.21.3",
|
|
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.32.0",
|
|
36
|
+
"tslib": "2.7.0",
|
|
37
|
+
"typescript": "~5.6.2",
|
|
38
|
+
"zx": "8.1.6"
|
|
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,20 @@ 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
|
+
}));
|
|
116
|
+
|
|
117
|
+
if (messages.length) {
|
|
118
|
+
const pkg = JSON.parse(readFileSync('./package.json', 'utf8'));
|
|
119
|
+
for (const message of messages) {
|
|
120
|
+
console.log(formatMessage(message, pkg))
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
console.log(status.success, `Success in ${(end - start) / 1000} seconds 🎉`);
|
|
124
|
+
}
|
|
111
125
|
}
|
|
112
126
|
process.exit(buildFailed ? 1 : 0);
|
|
113
127
|
}
|
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() {
|