diff --git a/enums/placeholders.html b/enums/placeholders.html index a2909dd..cc43153 100644 --- a/enums/placeholders.html +++ b/enums/placeholders.html @@ -89,7 +89,7 @@
email: = "YOUR_EMAIL"
@@ -99,7 +99,7 @@
name: = "YOUR_NAME"
@@ -109,7 +109,7 @@
username: = "YOUR_GITHUB_USER_NAME"
diff --git a/enums/runner.html b/enums/runner.html index 7d23c18..836eaa5 100644 --- a/enums/runner.html +++ b/enums/runner.html @@ -88,7 +88,7 @@
Npm: = "npm"
@@ -98,7 +98,7 @@
Yarn: = "yarn"
diff --git a/enums/testdirectories.html b/enums/testdirectories.html index 5a8e4de..f64bf8b 100644 --- a/enums/testdirectories.html +++ b/enums/testdirectories.html @@ -92,7 +92,7 @@
five: = "test-5"
@@ -102,7 +102,7 @@
four: = "test-4"
@@ -112,7 +112,7 @@
one: = "test-1"
@@ -122,7 +122,7 @@
six: = "test-6"
@@ -132,7 +132,7 @@
three: = "test-3"
@@ -142,7 +142,7 @@
two: = "test-2"
diff --git a/globals.html b/globals.html index 0cece2f..cae79b4 100644 --- a/globals.html +++ b/globals.html @@ -156,7 +156,7 @@
TypescriptStarterArgsOptions: TypescriptStarterUserOptions | TypescriptStarterRequiredConfig
@@ -166,7 +166,7 @@
TypescriptStarterUserOptions: TypescriptStarterCLIOptions & TypescriptStarterRequiredConfig
@@ -179,7 +179,7 @@
branch: string = execa.sync('git', ['rev-parse','--symbolic-full-name','--abbrev-ref','HEAD']).stdout
@@ -197,7 +197,7 @@
buildDir: string = join(process.cwd(), 'build')
@@ -207,7 +207,7 @@
down: "" = ""
@@ -219,7 +219,7 @@ "
@@ -229,7 +229,7 @@
inherit: undefined | null | number | "inherit" | "pipe" | "ipc" | "ignore" | Stream = 'inherit' as StdIOOption
@@ -239,7 +239,7 @@
up: "" = ""
@@ -256,7 +256,7 @@
  • Parameters

    @@ -279,7 +279,7 @@
  • @@ -287,15 +287,13 @@

    A sample async function (to demo Typescript's es7 async/await downleveling).

    Example (es imports)

    -
    import { asyncABC } from 'typescript-starter'
    +								
    import { asyncABC } from 'typescript-starter'
     console.log(await asyncABC())
    -// => ['a','b','c']
    -
    +// => ['a','b','c']

    Example (commonjs)

    -
    var double = require('typescript-starter').asyncABC;
    +								
    var double = require('typescript-starter').asyncABC;
     asyncABC().then(console.log);
    -// => ['a','b','c']
    -
    +// => ['a','b','c']

    Returns Promise<ReadonlyArray<string>>

    a Promise which should contain ['a','b','c']

    @@ -312,7 +310,7 @@ asyncABC().then(console.log);
  • Returns Promise<TypescriptStarterArgsOptions>

    @@ -329,7 +327,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -355,7 +353,7 @@ asyncABC().then(console.log);
  • @@ -363,15 +361,13 @@ asyncABC().then(console.log);

    Multiplies a value by 2. (Also a full example of Typedoc's functionality.)

    Example (es module)

    -
    import { double } from 'typescript-starter'
    +								
    import { double } from 'typescript-starter'
     console.log(double(4))
    -// => 8
    -
    +// => 8

    Example (commonjs)

    -
    var double = require('typescript-starter').double;
    +								
    var double = require('typescript-starter').double;
     console.log(double(4))
    -// => 8
    -
    +// => 8
    anothernote

    Some other value.

    @@ -402,7 +398,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -425,7 +421,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -448,7 +444,7 @@ asyncABC().then(console.log);
  • @@ -492,7 +488,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -515,7 +511,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -538,7 +534,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -567,7 +563,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -593,7 +589,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -616,7 +612,7 @@ asyncABC().then(console.log);
  • Returns Promise<TypescriptStarterCLIOptions>

    @@ -633,7 +629,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -656,7 +652,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -679,7 +675,7 @@ asyncABC().then(console.log);
  • Parameters

    @@ -702,7 +698,7 @@ asyncABC().then(console.log);
  • @@ -710,15 +706,13 @@ asyncABC().then(console.log);

    Raise the value of the first parameter to the power of the second using the es7 ** operator.

    Example (es module)

    -
    import { power } from 'typescript-starter'
    +								
    import { power } from 'typescript-starter'
     console.log(power(2,3))
    -// => 8
    -
    +// => 8

    Example (commonjs)

    -
    var power = require('typescript-starter').power;
    +								
    var power = require('typescript-starter').power;
     console.log(power(2,3))
    -// => 8
    -
    +// => 8

    Parameters

      @@ -743,7 +737,7 @@ asyncABC().then(console.log);
    • Parameters

      @@ -766,7 +760,7 @@ asyncABC().then(console.log);
    • Parameters

      @@ -789,7 +783,7 @@ asyncABC().then(console.log);
    • Parameters

      @@ -818,7 +812,7 @@ asyncABC().then(console.log);
    • @@ -826,10 +820,9 @@ asyncABC().then(console.log);

      Calculate the sha256 digest of a string.

      Example (es imports)

      -
      import { sha256 } from 'typescript-starter'
      +								
      import { sha256 } from 'typescript-starter'
       sha256('test')
      -// => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
      -
      +// => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'

      Parameters

        @@ -852,7 +845,7 @@ sha256('test')
      • @@ -860,10 +853,9 @@ sha256('test')

        A faster implementation of sha256 which requires the native Node.js module. Browser consumers should use sha256, instead.

        Example (es imports)

        -
        import { sha256Native as sha256 } from 'typescript-starter'
        +								
        import { sha256Native as sha256 } from 'typescript-starter'
         sha256('test')
        -// => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'
        -
        +// => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'

        Parameters

          @@ -886,7 +878,7 @@ sha256('test')
        • Parameters

          @@ -909,7 +901,7 @@ sha256('test')
        • Parameters

          @@ -938,7 +930,7 @@ sha256('test')
        • Parameters

          @@ -1025,7 +1017,7 @@ sha256('test')
        • Parameters

          @@ -1051,7 +1043,7 @@ sha256('test')
        • Parameters

          @@ -1076,7 +1068,7 @@ sha256('test')
          LiveTasks: object
          @@ -1085,7 +1077,7 @@ sha256('test')
          cloneRepo: (Anonymous function) = cloneRepo(execa)
          @@ -1095,7 +1087,7 @@ sha256('test')
          initialCommit: (Anonymous function) = initialCommit(execa)
          @@ -1105,7 +1097,7 @@ sha256('test')
          install: (Anonymous function) = install(execa)
          @@ -1116,7 +1108,7 @@ sha256('test')
          env: object
          @@ -1125,7 +1117,7 @@ sha256('test')
          TYPESCRIPT_STARTER_REPO_BRANCH: string = repoInfo.branch
          @@ -1135,7 +1127,7 @@ sha256('test')
          TYPESCRIPT_STARTER_REPO_URL: string = repoInfo.repo
          @@ -1146,7 +1138,7 @@ sha256('test')
          repoInfo: object
          @@ -1155,7 +1147,7 @@ sha256('test')
          branch: string = branch === 'HEAD' ? '.' : branch
          @@ -1165,7 +1157,7 @@ sha256('test')
          repo: string = process.cwd()
          @@ -1176,7 +1168,7 @@ sha256('test')
          sandboxOptions: object
          @@ -1185,7 +1177,7 @@ sha256('test')
          description: string = "this is an example description"
          @@ -1195,7 +1187,7 @@ sha256('test')
          githubUsername: string = "SOME_GITHUB_USERNAME"
          @@ -1205,7 +1197,7 @@ sha256('test')
          repoInfo: object
          @@ -1226,7 +1218,7 @@ sha256('test')
          workingDirectory: string = buildDir
          diff --git a/index.html b/index.html index 90e76cd..f5db152 100644 --- a/index.html +++ b/index.html @@ -70,14 +70,13 @@ CircleCI Travis AppVeyor - GitHub stars

          + GitHub stars

          demo of the typescript-starter command-line interface

          Start Now

          Run one simple command to install and use the interactive project generator. You'll need Node v8.9 (the current LTS release) or later.

          -
          npx typescript-starter
          -
          +
          npx typescript-starter

          The interactive CLI will help you create and configure your project automatically.

          Since this repo includes the CLI and it's tests, you'll only need to fork or clone this project if you want to contribute. If you find this project useful, please consider leaving a star so others can find it. Thanks!

          @@ -110,8 +109,7 @@

          Developing with typescript-starter

          Development zen

          To start working, run the watch task using npm or yarn.

          -
          npm run watch
          -
          +
          npm run watch

          This starter includes a watch task which makes development faster and more interactive. It's particularly helpful for TDD/BDD workflows.

          The watch task will build and watch the entire project for changes (to both the library source files and test source files). As you develop, you can add tests for new functionality – which will initially fail – before developing the new functionality. Each time you save, any changes will be rebuilt and retested.

          @@ -124,45 +122,38 @@

          To enable additional Typescript type checking features (a good idea for mission-critical or large projects), review the commented-out lines in your typescript compiler options.

          View test coverage

          To generate and view test coverage, run:

          -
          npm run cov
          -
          +
          npm run cov

          This will create an HTML report of test coverage – source-mapped back to Typescript – and open it in your default browser.

          source-mapped typescript test coverage example

          Generate your API docs

          The src folder is analyzed and documentation is automatically generated using TypeDoc.

          -
          npm run doc
          -
          +
          npm run doc

          This command generates API documentation for your library in HTML format and opens it in a browser.

          Since types are tracked by Typescript, there's no need to indicate types in JSDoc format. For more information, see the TypeDoc documentation.

          To generate and publish your documentation to GitHub Pages use the following command:

          -
          npm run doc:publish
          -
          +
          npm run doc:publish

          Once published, your documentation should be available at the proper GitHub Pages URL for your repo. See typescript-starter's GitHub Pages for an example.

          TypeDoc documentation example

          For more advanced documentation generation, you can provide your own TypeDoc theme, or build your own documentation using the JSON TypeDoc export:

          -
          npm run doc:json
          -
          +
          npm run doc:json

          Bump version, update changelog, commit, & tag release

          It's recommended that you install commitizen to make commits to your project.

          -
          npm install -g commitizen
          +				
          npm install -g commitizen
           
           # commit your changes:
          -git cz
          -
          +git cz

          This project is tooled for conventional changelog to make managing releases easier. See the standard-version documentation for more information on the workflow, or CHANGELOG.md for an example.

          -
          # bump package.json version, update CHANGELOG.md, git tag the release
          -npm run version
          -
          +
          # bump package.json version, update CHANGELOG.md, git tag the release
          +npm run version

          You may find a tool like wip helpful for managing work in progress before you're ready to create a meaningful commit.

          One-step publish preparation script

          Bringing together many of the steps above, this repo includes a one-step release preparation command.

          -
          # Prepare a standard release:
          -npm run prepare-release
          -
          +
          # Prepare a standard release:
          +npm run prepare-release

          This command runs the following tasks:

          • reset: cleans the repo by removing all untracked files and resetting --hard to the latest commit. (Note: this could be destructive.)
          • @@ -172,11 +163,10 @@ npm run prepare-release
          • version: bump package.json version, update CHANGELOG.md, and git tag the release

          When the script finishes, it will log the final command needed to push the release commit to the repo and publish the package on the npm registry:

          -
          git push --follow-tags origin master; npm publish
          -
          +
          git push --follow-tags origin master; npm publish

          Look over the release if you'd like, then execute the command to publish everything.

          You can also prepare a non-standard release:

          -
          # Or a non-standard release:
          +				
          # Or a non-standard release:
           
           # Build everything
           npm run all
          @@ -194,8 +184,7 @@ npm run version -- --first-release
           # $ npm run version -- --prerelease alpha
           
           # And don't forget to push the docs to GitHub pages:
          -npm run doc:publish
          -
          +npm run doc:publish

          Get scripts info

          You can run the info script for information on each script intended to be individually run.

          npm run info
          @@ -223,8 +212,7 @@ doc:json:
           reset:
             Delete all untracked files and reset the repo to the last commit
           prepare-release:
          -  One-step: clean, build, test, publish docs, and prep a release
          -

          FAQs

          + One-step: clean, build, test, publish docs, and prep a release

          FAQs

          Why are there two builds? (main and module)

          The src of typescript-starter is compiled into two separate builds: main and module. The main build is configured to use the CommonJS module system. The module build uses the new es6 module system.

          Because Node.js LTS releases do not yet support the es6 module system, some projects which depend on your project will follow the main field in package.json. Tools which support the new system (like Rollup, Webpack, or Parcel) will follow the module field, giving them the ability to statically analyze your project. These tools can tree-shake your module build to import only the code they need.

          @@ -260,18 +248,16 @@ reset:

          Providing a public API where consumer code is the same between browsers and Node.js is desirable, but it comes at the cost of significant configuration and complexity. In many cases, it requires that code be aware of its environment at runtime, requiring additional complexity and testing.

          A better way to provide this developer experience is to provide similar APIs for each environment, and then encourage the use of es6 import aliasing to standardize between them.

          For example, in the documentation for typescript-starter, we encourage Node.js users to import sha256Native as sha256. With this convention, we get a standard API without loaders or dependency substitution hacks.

          -
          // browser-application.js
          +				
          // browser-application.js
           import { sha256 } from 'typescript-starter';
           
           // fully-portable code
          -console.log(sha256('test'));
          -
          -
          // node-application.js
          +console.log(sha256('test'));
          +
          // node-application.js
           import { sha256Native as sha256 } from 'typescript-starter';
           
           // fully-portable code
          -console.log(sha256('test'));
          -
          +console.log(sha256('test'));

          What about Git hooks to validate commit messages?

          This project uses standard-version to automatically update the changelog based on commit messages since the last release. To do this, each relevant commit must be properly formatted.

          To ensure all commits follow the proper conventions, you can use a package like commitlint with Husky. However, keep in mind that commit hooks can be confusing, especially for new contributors. They also interfere with some development tools and workflows.

          @@ -283,14 +269,11 @@ reset: cd typescript-starter npm install npm test -npm link -

          To manually test the CLI, you can use the TYPESCRIPT_STARTER_REPO_URL environment variable to test a clone from your local repo. Run npm run watch as you're developing, then in a different testing directory:

          +npm link

          To manually test the CLI, you can use the TYPESCRIPT_STARTER_REPO_URL environment variable to test a clone from your local repo. Run npm run watch as you're developing, then in a different testing directory:

          mkdir typescript-starter-testing
           cd typescript-starter-testing
          -TYPESCRIPT_STARTER_REPO_URL='/local/path/to/typescript-starter' typescript-starter
          -

          You can also set TYPESCRIPT_STARTER_REPO_URL to any valid Git URL, such as your fork of this repo:

          -
          TYPESCRIPT_STARTER_REPO_URL='https://github.com/YOUR_USERNAME/typescript-starter.git' typescript-starter
          -

          If TYPESCRIPT_STARTER_REPO_BRANCH is not provided, it will default to master.

          +TYPESCRIPT_STARTER_REPO_URL='/local/path/to/typescript-starter' typescript-starter

          You can also set TYPESCRIPT_STARTER_REPO_URL to any valid Git URL, such as your fork of this repo:

          +
          TYPESCRIPT_STARTER_REPO_URL='https://github.com/YOUR_USERNAME/typescript-starter.git' typescript-starter

          If TYPESCRIPT_STARTER_REPO_BRANCH is not provided, it will default to master.

          If you're using VS Code, the Debug CLI launch configuration also allows you to immediately build and step through execution of the CLI.

          In the wild

          You can find more advanced configurations, usage examples, and inspiration from other projects using typescript-starter:

          diff --git a/interfaces/tasks.html b/interfaces/tasks.html index 6993dd3..41d3b94 100644 --- a/interfaces/tasks.html +++ b/interfaces/tasks.html @@ -97,7 +97,7 @@
          cloneRepo: function
          @@ -142,7 +142,7 @@
          initialCommit: function
          @@ -179,7 +179,7 @@
          install: function
          diff --git a/interfaces/typescriptstarterclioptions.html b/interfaces/typescriptstarterclioptions.html index 5e35d9a..9a3a662 100644 --- a/interfaces/typescriptstarterclioptions.html +++ b/interfaces/typescriptstarterclioptions.html @@ -111,7 +111,7 @@
          appveyor: boolean
          @@ -121,7 +121,7 @@
          circleci: boolean
          @@ -131,7 +131,7 @@
          description: string
          @@ -141,7 +141,7 @@
          domDefinitions: boolean
          @@ -151,7 +151,7 @@
          immutable: boolean
          @@ -161,7 +161,7 @@
          install: boolean
          @@ -171,7 +171,7 @@
          nodeDefinitions: boolean
          @@ -181,7 +181,7 @@
          projectName: string
          @@ -191,7 +191,7 @@
          runner: Runner
          @@ -201,7 +201,7 @@
          strict: boolean
          @@ -211,7 +211,7 @@
          travis: boolean
          @@ -221,7 +221,7 @@
          vscode: boolean
          diff --git a/interfaces/typescriptstarterinferredoptions.html b/interfaces/typescriptstarterinferredoptions.html index 6fe4fa1..dd688ec 100644 --- a/interfaces/typescriptstarterinferredoptions.html +++ b/interfaces/typescriptstarterinferredoptions.html @@ -104,7 +104,7 @@
          email: string
          @@ -114,7 +114,7 @@
          fullName: string
          @@ -124,7 +124,7 @@
          githubUsername: string
          @@ -134,7 +134,7 @@
          repoInfo: object
          @@ -155,7 +155,7 @@
          workingDirectory: string
          diff --git a/interfaces/typescriptstarteroptions.html b/interfaces/typescriptstarteroptions.html index 83f47b2..2a563d1 100644 --- a/interfaces/typescriptstarteroptions.html +++ b/interfaces/typescriptstarteroptions.html @@ -120,7 +120,7 @@ @@ -131,7 +131,7 @@ @@ -142,7 +142,7 @@ @@ -153,7 +153,7 @@ @@ -164,7 +164,7 @@ @@ -175,7 +175,7 @@ @@ -186,7 +186,7 @@ @@ -197,7 +197,7 @@ @@ -208,7 +208,7 @@ @@ -219,7 +219,7 @@ @@ -230,7 +230,7 @@ @@ -241,7 +241,7 @@
          @@ -263,7 +263,7 @@ @@ -274,7 +274,7 @@ @@ -285,7 +285,7 @@ @@ -296,7 +296,7 @@ @@ -307,7 +307,7 @@ diff --git a/interfaces/typescriptstarterrequiredconfig.html b/interfaces/typescriptstarterrequiredconfig.html index f3422fe..c74c879 100644 --- a/interfaces/typescriptstarterrequiredconfig.html +++ b/interfaces/typescriptstarterrequiredconfig.html @@ -96,7 +96,7 @@
          install: boolean
          @@ -106,7 +106,7 @@
          starterVersion: string