mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-25 16:57:51 +08:00
ci: add golden-api file for core/node
This is necessary as we introduce namespaces in jobs.
This commit is contained in:
parent
2b3f9de403
commit
6bf80edf54
@ -1,9 +1,8 @@
|
|||||||
export declare function createConsoleLogger(verbose?: boolean, stdout?: ProcessOutput, stderr?: ProcessOutput): logging.Logger;
|
export declare function createConsoleLogger(verbose?: boolean, stdout?: ProcessOutput, stderr?: ProcessOutput): logging.Logger;
|
||||||
|
|
||||||
export declare namespace fs {
|
export declare function isDirectory(filePath: string): boolean;
|
||||||
function isFile(filePath: string): boolean;
|
|
||||||
function isDirectory(filePath: string): boolean;
|
export declare function isFile(filePath: string): boolean;
|
||||||
}
|
|
||||||
|
|
||||||
export declare class ModuleNotFoundException extends BaseException {
|
export declare class ModuleNotFoundException extends BaseException {
|
||||||
readonly basePath: string;
|
readonly basePath: string;
|
11
packages/angular_devkit/core/node/_golden-api.ts
Normal file
11
packages/angular_devkit/core/node/_golden-api.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* @license
|
||||||
|
* Copyright Google Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by an MIT-style license that can be
|
||||||
|
* found in the LICENSE file at https://angular.io/license
|
||||||
|
*/
|
||||||
|
export * from './fs';
|
||||||
|
export * from './cli-logger';
|
||||||
|
export * from './host';
|
||||||
|
export { ModuleNotFoundException, ResolveOptions, resolve } from './resolve';
|
@ -7,8 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
import { statSync } from 'fs';
|
import { statSync } from 'fs';
|
||||||
|
|
||||||
export namespace fs {
|
export function isFile(filePath: string): boolean {
|
||||||
export function isFile(filePath: string): boolean {
|
|
||||||
let stat;
|
let stat;
|
||||||
try {
|
try {
|
||||||
stat = statSync(filePath);
|
stat = statSync(filePath);
|
||||||
@ -20,10 +19,10 @@ export namespace fs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return stat.isFile() || stat.isFIFO();
|
return stat.isFile() || stat.isFIFO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function isDirectory(filePath: string): boolean {
|
export function isDirectory(filePath: string): boolean {
|
||||||
let stat;
|
let stat;
|
||||||
try {
|
try {
|
||||||
stat = statSync(filePath);
|
stat = statSync(filePath);
|
||||||
@ -35,6 +34,4 @@ export namespace fs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return stat.isDirectory();
|
return stat.isDirectory();
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,11 @@
|
|||||||
* Use of this source code is governed by an MIT-style license that can be
|
* Use of this source code is governed by an MIT-style license that can be
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
export * from './fs';
|
import * as fs from './fs';
|
||||||
export * from './cli-logger';
|
export * from './cli-logger';
|
||||||
export * from './host';
|
export * from './host';
|
||||||
export { ModuleNotFoundException, ResolveOptions, resolve } from './resolve';
|
export { ModuleNotFoundException, ResolveOptions, resolve } from './resolve';
|
||||||
|
|
||||||
|
export {
|
||||||
|
fs,
|
||||||
|
};
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { BaseException } from '../src';
|
import { BaseException } from '../src';
|
||||||
import { fs as devkitFs } from './fs';
|
import { isFile } from './fs';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown when a module could not be resolved.
|
* Exception thrown when a module could not be resolved.
|
||||||
@ -204,16 +204,16 @@ export function resolve(x: string, options: ResolveOptions): string {
|
|||||||
throw new ModuleNotFoundException(x, basePath);
|
throw new ModuleNotFoundException(x, basePath);
|
||||||
|
|
||||||
function loadAsFileSync(x: string): string | null {
|
function loadAsFileSync(x: string): string | null {
|
||||||
if (devkitFs.isFile(x)) {
|
if (isFile(x)) {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
return extensions.map(ex => x + ex).find(f => devkitFs.isFile(f)) || null;
|
return extensions.map(ex => x + ex).find(f => isFile(f)) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadAsDirectorySync(x: string): string | null {
|
function loadAsDirectorySync(x: string): string | null {
|
||||||
const pkgfile = path.join(x, 'package.json');
|
const pkgfile = path.join(x, 'package.json');
|
||||||
if (devkitFs.isFile(pkgfile)) {
|
if (isFile(pkgfile)) {
|
||||||
if (options.resolvePackageJson) {
|
if (options.resolvePackageJson) {
|
||||||
return pkgfile;
|
return pkgfile;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user