Skip to content

Commit

Permalink
Add example code copile to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Roaders committed May 8, 2022
1 parent 5087421 commit f7687f8
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 15 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"clean": "rimraf dist",
"clean": "rimraf dist coverage",
"build": "tsc -p tsconfig.build.json",
"build:example": "tsc -p src/example",
"watch-build:example": "tsc -p src/example --watch",
"watch-build": "tsc --watch -p tsconfig.build.json",
"lint": "eslint . --ext .ts",
"test": "jest --ci --coverage && tsc --noemit",
"watch-test": "jest --watch",
"prebuild-release": "npm run clean",
"build-release": "concurrently --kill-others-on-fail npm:test npm:lint npm:build npm:verify-markdown && codecov",
"build-release": "concurrently --kill-others-on-fail npm:test npm:lint npm:build npm:build:example npm:verify-markdown && codecov",
"prewrite-markdown": "npm run build",
"preverify-markdown": "npm run build",
"write-markdown": "node dist/write-markdown -f package.json -p markdownConfig",
Expand Down
2 changes: 1 addition & 1 deletion src/example/additionalModifiers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from '../parse';
import { parse } from '../';
import { additionalModifiers } from './configs';

const args = parse(additionalModifiers.arguments, additionalModifiers.parseOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/example/configs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-useless-escape */
import { ArgumentConfig, UsageGuideConfig } from '../contracts';
import { ArgumentConfig, UsageGuideConfig } from '../';

/**
* we do not have any side effects in this file as this file is required by write-markdown
Expand Down
2 changes: 1 addition & 1 deletion src/example/exampleConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from '../parse';
import { parse } from '../';
import { argumentConfig } from './configs';

const args = parse(argumentConfig);
Expand Down
3 changes: 1 addition & 2 deletions src/example/exampleConfigHelpWithMissingArgs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CommandLineOption } from '../contracts';
import { parse } from '../parse';
import { parse, CommandLineOption } from '../';
import { argumentConfig } from './configs';

const args = parse(argumentConfig, {
Expand Down
2 changes: 1 addition & 1 deletion src/example/exampleConfigUsingPrintHelp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from '../parse';
import { parse } from '../';
import { argumentConfig } from './configs';

const args = parse(argumentConfig, { hideMissingArgMessages: true }, false, true);
Expand Down
2 changes: 1 addition & 1 deletion src/example/exampleConfigWithHelp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from '../parse';
import { parse } from '../';

interface ICopyFilesArguments {
sourcePath?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/example/exitProcessExample.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from '../parse';
import { parse } from '../';
import { argumentConfig } from './configs';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/example/noExitProcessExample.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { argumentConfig } from './configs';
import { parse } from '../parse';
import { parse } from '../';

/**
* will ignore missing errors and not exit
Expand Down
6 changes: 6 additions & 0 deletions src/example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": false,
}
}
2 changes: 1 addition & 1 deletion src/example/typicalAppWithGroups.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from '../parse';
import { parse } from '../';
import { typicalAppWithGroupsInfo } from './configs';

const args = parse(typicalAppWithGroupsInfo.arguments, typicalAppWithGroupsInfo.parseOptions);
Expand Down
2 changes: 1 addition & 1 deletion src/example/unknownArgumentsExample.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from '../parse';
import { parse } from '../';
import { argumentConfig } from './configs';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/example/usageGuideWithExamples.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from '../parse';
import { parse } from '../';
import { exampleSections } from './configs';

const args = parse(exampleSections.arguments, exampleSections.parseOptions);
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "./tsconfig.json",
"exclude": [
"src/**/*.spec.ts",
"dist"
"dist",
"src/example/**/*"
]
}

0 comments on commit f7687f8

Please sign in to comment.