Skip to content

Commit 5dad33e

Browse files
author
Cam Tullos
committed
rc 0.0.21
1 parent 38c3b6e commit 5dad33e

22 files changed

+8791
-2736
lines changed

.cli/commands/publisher/index.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const { chalk, message, op, prefix, flagsToParams, fs, semver } = arcli;
2+
3+
export const NAME = 'publisher';
4+
export const ID = NAME;
5+
6+
const DESC = 'Publish the module to NPM';
7+
const pkg = fs.readJsonSync(process.cwd() + '/package.json');
8+
const ver = semver.inc(op.get(pkg, 'version'), 'patch');
9+
10+
// prettier-ignore
11+
const HELP = () => console.log(`
12+
Example:
13+
$ reactium publisher --version 0.0.1
14+
`);
15+
16+
const INPUT = ({ inquirer }, params) => {
17+
return inquirer.prompt(
18+
[
19+
{
20+
type: 'input',
21+
name: 'version',
22+
prefix,
23+
message: 'version',
24+
default: ver,
25+
suffix: chalk.magenta(': '),
26+
},
27+
],
28+
params,
29+
);
30+
};
31+
32+
const ACTION = async ({ opt, props }) => {
33+
const flags = ['version'];
34+
35+
let params = flagsToParams({ opt, flags });
36+
37+
const userInput = await INPUT(props, params);
38+
Object.entries(userInput).forEach(([key, val]) => (params[key] = val));
39+
40+
pkg.version = params.version;
41+
42+
fs.writeFileSync(
43+
process.cwd() + '/package.json',
44+
JSON.stringify(pkg, null, 2),
45+
);
46+
47+
message(`Updated ${chalk.magenta('package.json')}`);
48+
};
49+
50+
export const COMMAND = ({ program, props }) =>
51+
program
52+
.command(NAME)
53+
.description(DESC)
54+
.action((opt) => ACTION({ opt, props }))
55+
.option('-v, --version [version]', 'semantic version of the package.')
56+
.on('--help', HELP);

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
tests/__snapshots__

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.cli
2+
tests

babel.config.cjs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
browsers: ['last 2 versions'],
8+
},
9+
},
10+
],
11+
[
12+
'@babel/preset-react',
13+
{
14+
runtime: 'automatic',
15+
},
16+
],
17+
],
18+
plugins: [
19+
'@babel/plugin-proposal-object-rest-spread',
20+
'@babel/plugin-proposal-class-properties',
21+
],
22+
sourceMaps: true,
23+
};

lib/markdown-to-jsx.cjs

-2
This file was deleted.

lib/markdown-to-jsx.cjs.map

-1
This file was deleted.

lib/markdown-to-jsx.js

+44-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/markdown-to-jsx.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/markdown-to-jsx.modern.js

-2
This file was deleted.

lib/markdown-to-jsx.modern.js.map

-1
This file was deleted.

0 commit comments

Comments
 (0)