Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.0.2' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Sep 1, 2020
2 parents b3c3b55 + bb72ec6 commit cb8f741
Show file tree
Hide file tree
Showing 17 changed files with 739 additions and 166 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ typings/

# Redundant ignore files
packages/*/.npmignore
packages/*/.gitignore
packages/*/.drone.yml
packages/*/LICENSE
packages/generator-ts-project/templates/.gitignore.ejs

# Yarn Integrity file
.yarn-integrity
Expand Down
Binary file modified .gulp/gitignore.diff
Binary file not shown.
11 changes: 11 additions & 0 deletions .gulp/npmignore.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/.npmignore b/.npmignore
index 9d3909d..e8a353f 100644
--- a/.npmignore
+++ b/.npmignore
@@ -123,6 +123,3 @@ tsconfig.*.json

# Visual Studio Code-Environment
.vscode/
-
-# Drone configuration
-.drone.yml
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ dist
.tern-port

# Source-files
[Ss]rc/
[Ss]rc/**/*
![Ss]rc/tests/tsconfig.json

# Source-maps
[Ll]ib/**/*.map
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## TSProjectGenerator [Unreleased]

[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v1.0.1...dev)
[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v1.0.2...dev)

## TSProjectGenerator v1.0.2
### Fixed
- Fix the creation of `.gitignore` files
- Malformed and inexistent imports
- Fix the creation of `.drone.yml` files
- Errors due to missing dependencies
- Errors during the `cleanup`-task due to `.eslintrc.js` being placed incorrectly

[Show differences](https://github.com/manuth/TSProjectGenerator/compare/v1.0.1...v1.0.2)

## TSProjectGenerator v1.0.1
### Updated
Expand Down
46 changes: 34 additions & 12 deletions gulpfile.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import glob = require("glob");
import { src, dest, parallel, watch, series } from "gulp";
import rename = require("gulp-rename");
import merge = require("merge-stream");
import minimist = require("minimist");
import { join } from "upath";
import { join, basename } from "upath";
import ApplyPatch = require("./.gulp/ApplyPatch");

let projectGeneratorName = "generator-ts-project";
Expand All @@ -12,7 +13,8 @@ let npmIgnoreFile = ".npmignore";
let droneFile = ".drone.yml";
let licenseFile = "LICENSE";
let gitDiffFile = GulpPath("gitignore.diff");
let npmDiffFile = CommonTemplatePath("npmignore.diff");
let npmDiffFile = CommonTemplatePath(projectGeneratorName, "npmignore.diff");
let customNPMDiffFile = GulpPath("npmignore.diff");
let options = minimist(process.argv.slice(2), { boolean: "watch" });

/**
Expand Down Expand Up @@ -46,15 +48,18 @@ function PackagePath(...path: string[]): string
/**
* Creates a path relative to the common template folder.
*
* @param generatorName
* The name of the generator containing the common templates.
*
* @param path
* The path to join.
*
* @returns
* The `path` relative to the common template folder.
*/
function CommonTemplatePath(...path: string[]): string
function CommonTemplatePath(generatorName: string, ...path: string[]): string
{
return PackagePath(projectGeneratorName, "templates", ...path);
return PackagePath(generatorName, "templates", ...path);
}

/**
Expand Down Expand Up @@ -85,7 +90,8 @@ export let CopyFiles =
watch(
[
npmIgnoreFile,
npmDiffFile
npmDiffFile,
customNPMDiffFile
],
CopyNPMIgnore);

Expand Down Expand Up @@ -118,7 +124,12 @@ export function CopyGitIgnore(): NodeJS.ReadWriteStream
return src(gitIgnoreFile).pipe(
ApplyPatch(gitDiffFile)
).pipe(
dest(PackagePath(projectGeneratorName))
rename(
{
suffix: ".ejs"
})
).pipe(
dest(CommonTemplatePath(projectGeneratorName))
);
}

Expand All @@ -135,15 +146,26 @@ export function CopyNPMIgnore(): NodeJS.ReadWriteStream
let ignoreFile = (): NodeJS.ReadWriteStream => src(npmIgnoreFile);
let streams: NodeJS.ReadWriteStream[] = [];

for (let folder of glob.sync(PackagePath(`!(${projectGeneratorName})`)))
for (let folder of glob.sync(PackagePath("*")))
{
streams.push(
ignoreFile().pipe(
ApplyPatch(npmDiffFile)
).pipe(dest(folder)));
let stream = ignoreFile();
let packageName = basename(folder);

if (packageName !== projectGeneratorName)
{
stream = stream.pipe(
ApplyPatch(npmDiffFile));

if (packageName === customProjectGeneratorName)
{
stream = stream.pipe(
ApplyPatch(customNPMDiffFile));
}
}

streams.push(stream.pipe(dest(folder)));
}

streams.push(ignoreFile().pipe(dest(PackagePath(projectGeneratorName))));
return merge(streams);
}

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.1",
"version": "1.0.2",
"packages": [
"./packages/*"
],
Expand Down
Loading

0 comments on commit cb8f741

Please sign in to comment.