Skip to content

Commit

Permalink
Merge branch 'release/0.4.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
yankeeinlondon committed Sep 29, 2020
2 parents c52b9ed + 8d10efa commit 3f9d070
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "do-devops",
"version": "0.4.11",
"version": "0.4.12",
"description": "Devops commands for your nodejs projects",
"main": "./bin/index.js",
"typings": "./bin/index.d.ts",
Expand Down
11 changes: 7 additions & 4 deletions src/commands/autoindex/private/exportable.ts
@@ -1,4 +1,4 @@
import { basename, dirname, join } from "path";
import { basename, dirname, posix } from "path";
import { existsSync, readdirSync } from "fs";

import { IExportableSymbols } from "./index";
Expand All @@ -10,7 +10,10 @@ import globby = require("globby");
* Determines the _files_, _directories_, and _sfc_'s in a _given directory_ that should be included
* in the index file. Files which match the
*/
export async function exportable(filePath: string, excluded: string[]): Promise<IExportableSymbols> {
export async function exportable(
filePath: string,
excluded: string[]
): Promise<IExportableSymbols> {
const dir = dirname(filePath);
const thisFile = basename(filePath);
const exclusions = excluded.concat(thisFile);
Expand All @@ -28,9 +31,9 @@ export async function exportable(filePath: string, excluded: string[]): Promise<
.map((i) => {
// directories must have a `index` file within them to considered
// as a directory export
if (existsSync(join(dir, i.name, "index.ts"))) {
if (existsSync(posix.join(dir, i.name, "index.ts"))) {
dirs.push(i.name);
} else if (existsSync(join(dir, i.name, "index.js"))) {
} else if (existsSync(posix.join(dir, i.name, "index.js"))) {
dirs.push(i.name);
}
});
Expand Down
12 changes: 6 additions & 6 deletions src/commands/autoindex/public/autoindex.ts
Expand Up @@ -8,7 +8,7 @@ import {
watchHandlers,
} from "../private/index";
import { getMonoRepoPackages, relativePath } from "../../../shared";
import { join } from "path";
import { posix } from "path";
import { FSWatcher, watch } from "chokidar";

/**
Expand All @@ -20,10 +20,10 @@ export async function handler(argv: string[], opts: IDictionary): Promise<void>
const monoRepoPackages: false | string[] = getMonoRepoPackages(process.cwd());
const globInclude = opts.glob ? (opts.glob as string[]).concat("!node_modules") : false;
const srcDir = opts.dir
? join(process.cwd(), opts.dir)
? posix.join(process.cwd(), opts.dir)
: monoRepoPackages
? join(process.cwd(), "packages/**/src")
: join(process.cwd(), "src");
? posix.join(process.cwd(), "packages/**/src")
: posix.join(process.cwd(), "src");
const testDir = monoRepoPackages ? "packages/**/test[s]{0,1}" : `test[s]{0,1}`;
/** default glob pattern which includes index files in _source_ and _test_ directories */
let defaultIndexGlob = globInclude || [`${srcDir}/**/index.[tj]s`, `${testDir}/**index.[tj]s`];
Expand Down Expand Up @@ -60,13 +60,13 @@ export async function handler(argv: string[], opts: IDictionary): Promise<void>
if (opts.watch) {
const watchGlob = pathsToIndexFiles.map((p) => {
const parts = p.replace(/\\/g, "/").replace(process.cwd(), "").split("/");
return relativePath(join(...parts.slice(0, parts.length - 1), "*.ts"), process.cwd());
return relativePath(posix.join(...parts.slice(0, parts.length - 1), "*.ts"), process.cwd());
});

const ignored = pathsToIndexFiles.map((p) => {
const parts = p.split(/[\/\\]/);
return relativePath(
join(...parts.slice(0, parts.length - 1), "node_modules/**"),
posix.join(...parts.slice(0, parts.length - 1), "node_modules/**"),
process.cwd()
);
});
Expand Down

0 comments on commit 3f9d070

Please sign in to comment.