Skip to content

Commit 211de5a

Browse files
committed
scaffold create
1 parent 697abcc commit 211de5a

File tree

9 files changed

+542
-28
lines changed

9 files changed

+542
-28
lines changed

tools/cli/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"build": "rollup -c rollup.config.mjs"
1414
},
1515
"dependencies": {
16+
"@lg-tools/create": "^0.0.1",
1617
"@lg-tools/link": "^0.0.1",
1718
"@lg-tools/lint": "^0.0.1",
1819
"@lg-tools/test": "^0.0.1",

tools/cli/src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { createPackage } from '@lg-tools/create';
12
import {
23
build,
34
buildPackage,
@@ -28,7 +29,8 @@ cli
2829
.command('create')
2930
.description('Creates a new package with the provided name')
3031
.argument('<name>', 'The name of the package')
31-
.option('-s, --scope', 'The npm scope of the new package', '@leafygreen-ui');
32+
.option('-s, --scope', 'The npm scope of the new package', '@leafygreen-ui')
33+
.action(createPackage);
3234

3335
/** Install */
3436
// TODO:

tools/cli/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
{
1515
"path": "../build"
1616
},
17+
{
18+
"path": "../create"
19+
},
1720
{
1821
"path": "../link"
1922
},

tools/create/bin/legacy-create.js

-2
This file was deleted.

tools/create/package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
"name": "@lg-tools/create",
33
"version": "0.0.1",
44
"description": "Creates a new LeafyGreen packages",
5-
"main": "index.js",
5+
"main": "dist/index.js",
6+
"module": "dist/esm/index.js",
67
"license": "Apache-2.0",
78
"bin": {
8-
"lg-create": "./bin/legacy-create.js"
9+
"lg-create": "./dist/legacy-create.js"
910
},
1011
"scripts": {
11-
"build": "rollup -c rollup.config.mjs"
12+
"build": "rollup -c rollup.config.mjs",
13+
"tsc": "tsc --build tsconfig.json"
1214
},
1315
"publishConfig": {
1416
"access": "public",

tools/create/rollup.config.mjs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
1-
import { umdConfig } from '@lg-tools/build/config/rollup.config.mjs';
2-
3-
export default [
4-
{
5-
...umdConfig,
6-
input: 'src/legacy-create.ts',
7-
},
8-
];
1+
import { esmConfig, umdConfig } from '@lg-tools/build/config/rollup.config.mjs';
2+
export default [esmConfig, umdConfig];

tools/create/src/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
// Package scope (default @leafygreen-ui)
44
// Package directory (default `/packages`)
55
// Package name
6+
7+
export function createPackage() {
8+
9+
}

tools/create/tsconfig.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "@lg-tools/build/config/package.tsconfig.json",
3+
"compilerOptions": {
4+
"declarationDir": "dist",
5+
"outDir": "dist",
6+
"rootDir": "src",
7+
"baseUrl": "."
8+
},
9+
"include": [
10+
"src/**/*"
11+
]
12+
}

0 commit comments

Comments
 (0)