@carbon/cli 11.32.0-rc.0 → 11.32.0-rc.1
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/bin/carbon-cli.js +6 -9
- package/package.json +14 -13
- package/src/changelog.js +4 -10
- package/src/cli.js +43 -7
- package/src/commands/bundle/bundlers.js +4 -6
- package/src/commands/bundle/javascript.js +10 -14
- package/src/commands/bundle/typescript.js +12 -16
- package/src/commands/bundle/utils.js +7 -15
- package/src/commands/bundle.js +24 -28
- package/src/commands/changelog.js +23 -27
- package/src/commands/check.js +25 -29
- package/src/commands/ci-check.js +8 -12
- package/src/commands/component.js +11 -15
- package/src/commands/contribute/setup.js +15 -19
- package/src/commands/contribute/tools/getGitHubClient.js +6 -10
- package/src/commands/contribute.js +5 -8
- package/src/commands/inline.js +22 -24
- package/src/commands/publish.js +63 -63
- package/src/commands/release.js +20 -23
- package/src/commands/sync/npm.js +5 -10
- package/src/commands/sync/package.js +4 -9
- package/src/commands/sync/readme.js +13 -18
- package/src/commands/sync/remark/remark-monorepo.js +4 -8
- package/src/commands/sync.js +20 -20
- package/src/compile.js +3 -7
- package/src/component/index.js +7 -11
- package/src/git.js +4 -10
- package/src/logger.js +11 -13
- package/src/workspace.js +9 -14
package/bin/carbon-cli.js
CHANGED
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
10
|
// Inspired by Create React App
|
|
13
11
|
// https://github.com/facebook/create-react-app/blob/next/packages/create-react-app/index.js
|
|
14
12
|
|
|
13
|
+
import chalk from 'chalk';
|
|
14
|
+
import { main } from '../src/cli.js';
|
|
15
|
+
|
|
15
16
|
// Makes the script crash on unhandled rejections instead of silently
|
|
16
17
|
// ignoring them. In the future, promise rejections that are not handled will
|
|
17
18
|
// terminate the Node.js process with a non-zero exit code.
|
|
@@ -19,11 +20,9 @@ process.on('unhandledRejection', (error) => {
|
|
|
19
20
|
console.error(error);
|
|
20
21
|
});
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var semver = currentNodeVersion.split('.');
|
|
26
|
-
var major = semver[0];
|
|
23
|
+
const currentNodeVersion = process.versions.node;
|
|
24
|
+
const semver = currentNodeVersion.split('.');
|
|
25
|
+
const major = semver[0];
|
|
27
26
|
|
|
28
27
|
if (major < 8) {
|
|
29
28
|
console.error(
|
|
@@ -36,8 +35,6 @@ if (major < 8) {
|
|
|
36
35
|
process.exit(1);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
var main = require('../src/cli');
|
|
40
|
-
|
|
41
38
|
main(process).catch((error) => {
|
|
42
39
|
console.error(error);
|
|
43
40
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/cli",
|
|
3
3
|
"description": "Task automation for working with the Carbon Design System",
|
|
4
|
-
"version": "11.32.0-rc.
|
|
4
|
+
"version": "11.32.0-rc.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"bin": {
|
|
7
8
|
"carbon-cli": "./bin/carbon-cli.js"
|
|
8
9
|
},
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
31
|
"@babel/core": "^7.27.3",
|
|
31
|
-
"@carbon/cli-reporter": "^10.7.0",
|
|
32
|
+
"@carbon/cli-reporter": "^10.7.1-rc.0",
|
|
32
33
|
"@ibm/telemetry-js": "^1.5.0",
|
|
33
34
|
"@octokit/plugin-retry": "^3.0.7",
|
|
34
35
|
"@octokit/plugin-throttling": "^4.0.0",
|
|
@@ -36,25 +37,25 @@
|
|
|
36
37
|
"@rollup/plugin-babel": "^6.0.0",
|
|
37
38
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
38
39
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
39
|
-
"chalk": "^4.1
|
|
40
|
-
"change-case": "^
|
|
40
|
+
"chalk": "^5.4.1",
|
|
41
|
+
"change-case-all": "^2.1.0",
|
|
41
42
|
"child-process-promise": "^2.2.1",
|
|
42
|
-
"clipboardy": "^
|
|
43
|
-
"enquirer": "^2.
|
|
44
|
-
"fast-glob": "^3.
|
|
45
|
-
"fs-extra": "^11.
|
|
46
|
-
"inquirer": "^
|
|
43
|
+
"clipboardy": "^4.0.0",
|
|
44
|
+
"enquirer": "^2.4.1",
|
|
45
|
+
"fast-glob": "^3.3.3",
|
|
46
|
+
"fs-extra": "^11.2.0",
|
|
47
|
+
"inquirer": "^12.5.0",
|
|
47
48
|
"klaw-sync": "^6.0.0",
|
|
48
49
|
"lodash.template": "^4.5.0",
|
|
49
50
|
"prettier": "^3.3.3",
|
|
50
51
|
"prettier-config-carbon": "^0.12.0",
|
|
51
52
|
"progress-estimator": "^0.3.0",
|
|
52
|
-
"remark": "^
|
|
53
|
-
"replace-in-file": "^
|
|
53
|
+
"remark": "^15.0.1",
|
|
54
|
+
"replace-in-file": "^8.3.0",
|
|
54
55
|
"rollup": "^4.41.1",
|
|
55
56
|
"sass": "^1.77.7",
|
|
56
57
|
"typescript-config-carbon": "^0.5.0",
|
|
57
|
-
"yargs": "^17.
|
|
58
|
+
"yargs": "^17.7.2"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "573fc72ac30bc2d71ebb90644b803ba8408fe82e"
|
|
60
61
|
}
|
package/src/changelog.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2019,
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const { default: parse } = require('@commitlint/parse');
|
|
11
|
-
const execa = require('execa');
|
|
8
|
+
import { default as parse } from '@commitlint/parse';
|
|
9
|
+
import { execa } from 'execa';
|
|
12
10
|
|
|
13
11
|
// We keep a list of commits that are process-oriented that we never want to
|
|
14
12
|
// show up in generated changelogs
|
|
@@ -36,7 +34,7 @@ const headerDenyList = new Set([
|
|
|
36
34
|
* @param {string} latestTag
|
|
37
35
|
* @returns {string}
|
|
38
36
|
*/
|
|
39
|
-
async function generate(packages, lastTag, latestTag) {
|
|
37
|
+
export async function generate(packages, lastTag, latestTag) {
|
|
40
38
|
const packageCommitsInRange = await Promise.all(
|
|
41
39
|
packages.map((pkg) => getCommitsInRange(pkg, `${lastTag}...${latestTag}`))
|
|
42
40
|
);
|
|
@@ -211,7 +209,3 @@ async function getCommitsInRange(pkg, range) {
|
|
|
211
209
|
commits,
|
|
212
210
|
};
|
|
213
211
|
}
|
|
214
|
-
|
|
215
|
-
module.exports = {
|
|
216
|
-
generate,
|
|
217
|
-
};
|
package/src/cli.js
CHANGED
|
@@ -5,17 +5,55 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import yargs from 'yargs';
|
|
9
|
+
import { hideBin } from 'yargs/helpers';
|
|
10
|
+
import { createRequire } from 'module';
|
|
11
|
+
|
|
12
|
+
// Import commands explicitly since yargs commandDir() doesn't support ESM yet
|
|
13
|
+
import * as bundle from './commands/bundle.js';
|
|
14
|
+
import * as check from './commands/check.js';
|
|
15
|
+
import * as ciCheck from './commands/ci-check.js';
|
|
16
|
+
import * as changelog from './commands/changelog.js';
|
|
17
|
+
import * as component from './commands/component.js';
|
|
18
|
+
import * as contribute from './commands/contribute.js';
|
|
19
|
+
import * as inline from './commands/inline.js';
|
|
20
|
+
import * as publish from './commands/publish.js';
|
|
21
|
+
import * as release from './commands/release.js';
|
|
22
|
+
import * as sync from './commands/sync.js';
|
|
23
|
+
|
|
24
|
+
const require = createRequire(import.meta.url);
|
|
9
25
|
|
|
10
|
-
const cli = require('yargs');
|
|
11
26
|
const packageJson = require('../package.json');
|
|
12
27
|
|
|
13
|
-
|
|
14
|
-
|
|
28
|
+
// Create yargs command config with optional properties
|
|
29
|
+
function createCommand(cmd) {
|
|
30
|
+
const config = {
|
|
31
|
+
command: cmd.command,
|
|
32
|
+
desc: cmd.desc,
|
|
33
|
+
handler: cmd.handler,
|
|
34
|
+
};
|
|
35
|
+
if (cmd.builder) {
|
|
36
|
+
config.builder = cmd.builder;
|
|
37
|
+
}
|
|
38
|
+
return config;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function main({ argv }) {
|
|
42
|
+
yargs(hideBin(argv))
|
|
15
43
|
.scriptName(packageJson.name)
|
|
16
44
|
.version(packageJson.version)
|
|
17
45
|
.usage('Usage: $0 [options]')
|
|
18
|
-
|
|
46
|
+
// Add commands explicitly
|
|
47
|
+
.command(createCommand(bundle))
|
|
48
|
+
.command(createCommand(check))
|
|
49
|
+
.command(createCommand(ciCheck))
|
|
50
|
+
.command(createCommand(changelog))
|
|
51
|
+
.command(createCommand(component))
|
|
52
|
+
.command(createCommand(contribute))
|
|
53
|
+
.command(createCommand(inline))
|
|
54
|
+
.command(createCommand(publish))
|
|
55
|
+
.command(createCommand(release))
|
|
56
|
+
.command(createCommand(sync))
|
|
19
57
|
.strict()
|
|
20
58
|
.fail((message, error, yargs) => {
|
|
21
59
|
if (error) {
|
|
@@ -32,5 +70,3 @@ async function main({ argv }) {
|
|
|
32
70
|
})
|
|
33
71
|
.parse(argv.slice(2));
|
|
34
72
|
}
|
|
35
|
-
|
|
36
|
-
module.exports = main;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp.
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const javascript = require('./javascript');
|
|
11
|
-
const typescript = require('./typescript');
|
|
8
|
+
import javascript from './javascript.js';
|
|
9
|
+
import typescript from './typescript.js';
|
|
12
10
|
|
|
13
11
|
const bundlers = new Map([
|
|
14
12
|
['.js', javascript],
|
|
15
13
|
['.ts', typescript],
|
|
16
14
|
]);
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
export default bundlers;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp.
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const { rollup } = require('rollup');
|
|
16
|
-
const {
|
|
8
|
+
import { babel } from '@rollup/plugin-babel';
|
|
9
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
10
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
11
|
+
import fs from 'fs-extra';
|
|
12
|
+
import path from 'path';
|
|
13
|
+
import { rollup } from 'rollup';
|
|
14
|
+
import {
|
|
17
15
|
formatGlobals,
|
|
18
16
|
findPackageFolder,
|
|
19
17
|
formatDependenciesIntoGlobals,
|
|
20
|
-
}
|
|
18
|
+
} from './utils.js';
|
|
21
19
|
|
|
22
|
-
async function bundle(entrypoint, options) {
|
|
20
|
+
export default async function bundle(entrypoint, options) {
|
|
23
21
|
const globals = options.globals ? formatGlobals(options.globals) : {};
|
|
24
22
|
const { name } = options;
|
|
25
23
|
const packageFolder = await findPackageFolder(entrypoint);
|
|
@@ -98,5 +96,3 @@ async function bundle(entrypoint, options) {
|
|
|
98
96
|
})
|
|
99
97
|
);
|
|
100
98
|
}
|
|
101
|
-
|
|
102
|
-
module.exports = bundle;
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp.
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const { loadBaseTsCompilerOpts } = require('typescript-config-carbon');
|
|
18
|
-
const {
|
|
8
|
+
import { babel } from '@rollup/plugin-babel';
|
|
9
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
10
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
11
|
+
import typescript from '@rollup/plugin-typescript';
|
|
12
|
+
import fs from 'fs-extra';
|
|
13
|
+
import path from 'path';
|
|
14
|
+
import { rollup } from 'rollup';
|
|
15
|
+
import { loadBaseTsCompilerOpts } from 'typescript-config-carbon';
|
|
16
|
+
import {
|
|
19
17
|
formatGlobals,
|
|
20
18
|
findPackageFolder,
|
|
21
19
|
formatDependenciesIntoGlobals,
|
|
22
|
-
}
|
|
20
|
+
} from './utils.js';
|
|
23
21
|
|
|
24
|
-
async function bundle(entrypoint, options) {
|
|
22
|
+
export default async function bundle(entrypoint, options) {
|
|
25
23
|
const globals = options.globals ? formatGlobals(options.globals) : {};
|
|
26
24
|
const { name } = options;
|
|
27
25
|
const packageFolder = await findPackageFolder(entrypoint);
|
|
@@ -114,5 +112,3 @@ async function bundle(entrypoint, options) {
|
|
|
114
112
|
})
|
|
115
113
|
);
|
|
116
114
|
}
|
|
117
|
-
|
|
118
|
-
module.exports = bundle;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp.
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import fs from 'fs-extra';
|
|
10
|
+
import { pascalCase } from 'change-case';
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
const fs = require('fs-extra');
|
|
12
|
-
const { pascalCase } = require('change-case');
|
|
13
|
-
|
|
14
|
-
function formatGlobals(string) {
|
|
12
|
+
export function formatGlobals(string) {
|
|
15
13
|
const mappings = string.split(',').map((mapping) => {
|
|
16
14
|
return mapping.split('=');
|
|
17
15
|
});
|
|
@@ -24,7 +22,7 @@ function formatGlobals(string) {
|
|
|
24
22
|
);
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
function formatDependenciesIntoGlobals(dependencies) {
|
|
25
|
+
export function formatDependenciesIntoGlobals(dependencies) {
|
|
28
26
|
return Object.keys(dependencies).reduce((acc, key) => {
|
|
29
27
|
const parts = key.split('/').map((identifier, i) => {
|
|
30
28
|
if (i === 0) {
|
|
@@ -40,7 +38,7 @@ function formatDependenciesIntoGlobals(dependencies) {
|
|
|
40
38
|
}, {});
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
async function findPackageFolder(entrypoint) {
|
|
41
|
+
export async function findPackageFolder(entrypoint) {
|
|
44
42
|
let packageFolder = entrypoint;
|
|
45
43
|
|
|
46
44
|
while (packageFolder !== '/' && path.dirname(packageFolder) !== '/') {
|
|
@@ -54,9 +52,3 @@ async function findPackageFolder(entrypoint) {
|
|
|
54
52
|
|
|
55
53
|
return packageFolder;
|
|
56
54
|
}
|
|
57
|
-
|
|
58
|
-
module.exports = {
|
|
59
|
-
formatGlobals,
|
|
60
|
-
formatDependenciesIntoGlobals,
|
|
61
|
-
findPackageFolder,
|
|
62
|
-
};
|
package/src/commands/bundle.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2019,
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const { createLogger } = require('../logger');
|
|
12
|
-
const bundlers = require('./bundle/bundlers');
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import { createLogger } from '../logger.js';
|
|
10
|
+
import bundlers from './bundle/bundlers.js';
|
|
13
11
|
|
|
14
12
|
const logger = createLogger('bundle');
|
|
15
13
|
|
|
@@ -41,27 +39,25 @@ async function bundle({ entrypoint, name, globals }) {
|
|
|
41
39
|
logger.stop();
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
type: 'string',
|
|
50
|
-
describe: 'the entrypoint Javascript file',
|
|
51
|
-
});
|
|
42
|
+
export const builder = (yargs) => {
|
|
43
|
+
yargs.positional('entrypoint', {
|
|
44
|
+
type: 'string',
|
|
45
|
+
describe: 'the entrypoint Javascript file',
|
|
46
|
+
});
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
handler: bundle,
|
|
48
|
+
yargs.options({
|
|
49
|
+
n: {
|
|
50
|
+
alias: 'name',
|
|
51
|
+
describe: 'the name of the module for the UMD build',
|
|
52
|
+
type: 'string',
|
|
53
|
+
},
|
|
54
|
+
g: {
|
|
55
|
+
alias: 'globals',
|
|
56
|
+
describe: 'global module names',
|
|
57
|
+
type: 'string',
|
|
58
|
+
},
|
|
59
|
+
});
|
|
67
60
|
};
|
|
61
|
+
export const command = 'bundle <entrypoint>';
|
|
62
|
+
export const desc = 'bundle the given .js entrypoint';
|
|
63
|
+
export const handler = bundle;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2019,
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const { createLogger, displayBanner } = require('../logger');
|
|
15
|
-
const { getPackages } = require('../workspace');
|
|
8
|
+
import clipboard from 'clipboardy';
|
|
9
|
+
import inquirer from 'inquirer';
|
|
10
|
+
import { generate } from '../changelog.js';
|
|
11
|
+
import { fetchLatestFromUpstream } from '../git.js';
|
|
12
|
+
import { createLogger, displayBanner } from '../logger.js';
|
|
13
|
+
import { getPackages } from '../workspace.js';
|
|
16
14
|
|
|
17
15
|
const logger = createLogger('changelog');
|
|
18
16
|
|
|
@@ -52,7 +50,7 @@ async function changelog({ range, noPrompt = false }) {
|
|
|
52
50
|
|
|
53
51
|
let response;
|
|
54
52
|
if (!noPrompt) {
|
|
55
|
-
response = await prompt([
|
|
53
|
+
response = await inquirer.prompt([
|
|
56
54
|
{
|
|
57
55
|
type: 'confirm',
|
|
58
56
|
name: 'copy',
|
|
@@ -69,21 +67,19 @@ async function changelog({ range, noPrompt = false }) {
|
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
69
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
type: 'boolean',
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
handler: changelog,
|
|
70
|
+
export const builder = (yargs) => {
|
|
71
|
+
yargs.positional('range', {
|
|
72
|
+
describe: 'the git tag range to generate a changelog for',
|
|
73
|
+
type: 'string',
|
|
74
|
+
});
|
|
75
|
+
yargs.options({
|
|
76
|
+
n: {
|
|
77
|
+
alias: 'noPrompt',
|
|
78
|
+
describe: 'disables copy to clipboard prompt',
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
},
|
|
81
|
+
});
|
|
89
82
|
};
|
|
83
|
+
export const command = 'changelog <range>';
|
|
84
|
+
export const desc = 'generate the changelog for the given git tag range';
|
|
85
|
+
export const handler = changelog;
|
package/src/commands/check.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2019,
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const { createLogger } = require('../logger');
|
|
13
|
-
const compile = require('../compile');
|
|
8
|
+
import glob from 'fast-glob';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import { createLogger } from '../logger.js';
|
|
11
|
+
import compile from '../compile.js';
|
|
14
12
|
|
|
15
13
|
const logger = createLogger('check');
|
|
16
14
|
|
|
@@ -51,27 +49,25 @@ async function check({ glob: pattern, ignore = [], list = false }) {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
type: 'string',
|
|
60
|
-
describe: 'glob pattern for files to check',
|
|
61
|
-
});
|
|
52
|
+
export const builder = (yargs) => {
|
|
53
|
+
yargs.positional('glob', {
|
|
54
|
+
type: 'string',
|
|
55
|
+
describe: 'glob pattern for files to check',
|
|
56
|
+
});
|
|
62
57
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
handler: check,
|
|
58
|
+
yargs.options({
|
|
59
|
+
i: {
|
|
60
|
+
alias: 'ignore',
|
|
61
|
+
describe: 'provide a glob pattern of files to ignore',
|
|
62
|
+
type: 'string',
|
|
63
|
+
},
|
|
64
|
+
l: {
|
|
65
|
+
alias: 'list',
|
|
66
|
+
describe: 'list all the files that were compiled',
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
77
70
|
};
|
|
71
|
+
export const command = 'check <glob>';
|
|
72
|
+
export const desc = 'check that each file can be compiled';
|
|
73
|
+
export const handler = check;
|
package/src/commands/ci-check.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2019,
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const { exec } = require('child-process-promise');
|
|
12
|
-
const { workspace } = require('../workspace');
|
|
8
|
+
import { reporter } from '@carbon/cli-reporter';
|
|
9
|
+
import { exec } from 'child-process-promise';
|
|
10
|
+
import { workspace } from '../workspace.js';
|
|
13
11
|
|
|
14
12
|
async function check(args, env) {
|
|
15
13
|
reporter.info('Running checks in CI...');
|
|
@@ -41,9 +39,7 @@ async function check(args, env) {
|
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
handler: workspace(check),
|
|
49
|
-
};
|
|
42
|
+
export const builder = {};
|
|
43
|
+
export const command = 'ci-check';
|
|
44
|
+
export const desc = 'run CI checks';
|
|
45
|
+
export const handler = workspace(check);
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2019,
|
|
2
|
+
* Copyright IBM Corp. 2019, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const { loadTemplates } = require('../component');
|
|
15
|
-
const { createLogger } = require('../logger');
|
|
8
|
+
import { paramCase } from 'change-case';
|
|
9
|
+
import fs from 'fs-extra';
|
|
10
|
+
import inquirer from 'inquirer';
|
|
11
|
+
import path from 'path';
|
|
12
|
+
import { loadTemplates } from '../component/index.js';
|
|
13
|
+
import { createLogger } from '../logger.js';
|
|
16
14
|
|
|
17
15
|
const logger = createLogger('component');
|
|
18
16
|
|
|
@@ -64,7 +62,7 @@ async function component() {
|
|
|
64
62
|
];
|
|
65
63
|
|
|
66
64
|
clearConsole();
|
|
67
|
-
const answers = await prompt(questions);
|
|
65
|
+
const answers = await inquirer.prompt(questions);
|
|
68
66
|
|
|
69
67
|
logger.start('Generating component...');
|
|
70
68
|
|
|
@@ -123,8 +121,6 @@ async function component() {
|
|
|
123
121
|
logger.stop();
|
|
124
122
|
}
|
|
125
123
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
handler: component,
|
|
130
|
-
};
|
|
124
|
+
export const command = 'component';
|
|
125
|
+
export const desc = '[EXPERIMENTAL] Scaffold a component in React';
|
|
126
|
+
export const handler = component;
|