Skip to content

Commit

Permalink
Fix private-npm-package bundling (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c authored Jun 17, 2020
1 parent 72c2e2c commit 676030a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-ladybugs-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'skuba': patch
---

**template/private-npm-package:** Fix ReferenceError on init
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ Related reading:
To create a new project:

```shell
npx skuba init
npx skuba@3.7.0-beta.4 init
```

To bootstrap an existing project:

```shell
npx skuba configure
npx skuba@3.7.0-beta.4 configure
```

## CLI reference
Expand Down
10 changes: 9 additions & 1 deletion src/cli/init/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import chalk from 'chalk';
import { Form, FormChoice } from 'enquirer';
import fs from 'fs-extra';

import { copyFiles } from '../../utils/copy';
import { isErrorWithCode } from '../../utils/error';
import { log } from '../../utils/logging';
import {
Expand Down Expand Up @@ -92,7 +93,14 @@ const cloneTemplate = async (templateName: string, destinationDir: string) => {
}

const templateDir = path.join(TEMPLATE_DIR, templateName);
await fs.copy(templateDir, destinationDir);

await copyFiles({
// assume built-in templates have no extraneous files
include: () => true,
sourceRoot: templateDir,
destinationRoot: destinationDir,
processors: [],
});
};

const getTemplateName = async () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"devDependencies": {
"skuba": "*"
},
"files": [
"lib*/**/*.d.ts",
"lib*/**/*.js",
"lib*/**/*.js.map"
],
"files": ["lib*/**/*.d.ts", "lib*/**/*.js", "lib*/**/*.js.map"],
"license": "UNLICENSED",
"main": "./lib-commonjs",
"module": "./lib-es2015",
Expand Down
3 changes: 1 addition & 2 deletions template/private-npm-package/skuba.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ module.exports = {
message: 'Module name',
initial: '@seek/my-first-module',
validate: (value) =>
/^@seek\/.+$/.test(value) ||
`module must start with an ${chalk.bold('@seek/')} scope`,
/^@seek\/.+$/.test(value) || 'must start with an @seek/ scope',
},
{
name: 'description',
Expand Down

0 comments on commit 676030a

Please sign in to comment.