@angular-devkit/schematics
Advanced tools
Comparing version 18.1.0-next.3 to 18.1.0-rc.0
{ | ||
"name": "@angular-devkit/schematics", | ||
"version": "18.1.0-next.3", | ||
"version": "18.1.0-rc.0", | ||
"description": "Angular Schematics - Library", | ||
@@ -21,4 +21,4 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"@angular-devkit/core": "18.1.0-next.3", | ||
"jsonc-parser": "3.2.1", | ||
"@angular-devkit/core": "18.1.0-rc.0", | ||
"jsonc-parser": "3.3.1", | ||
"magic-string": "0.30.10", | ||
@@ -25,0 +25,0 @@ "ora": "5.4.1", |
@@ -27,3 +27,3 @@ /** | ||
export * from './tree/host-tree'; | ||
export { UpdateRecorder } from './tree/interface'; | ||
export type { UpdateRecorder } from './tree/interface'; | ||
export * from './engine/schematic'; | ||
@@ -30,0 +30,0 @@ export * from './sink/dryrun'; |
@@ -110,3 +110,3 @@ "use strict"; | ||
// Default handling code is for old tasks that incorrectly export `default` with non-ESM module | ||
return (0, rxjs_1.from)(Promise.resolve(`${path}`).then(s => __importStar(require(s))).then((mod) => (mod.default?.default || mod.default)())).pipe((0, rxjs_1.catchError)(() => (0, rxjs_1.throwError)(new src_1.UnregisteredTaskException(name)))); | ||
return (0, rxjs_1.from)(Promise.resolve(`${path}`).then(s => __importStar(require(s))).then((mod) => (mod.default?.default || mod.default)())).pipe((0, rxjs_1.catchError)(() => (0, rxjs_1.throwError)(() => new src_1.UnregisteredTaskException(name)))); | ||
} | ||
@@ -113,0 +113,0 @@ catch { } |
@@ -15,7 +15,14 @@ "use strict"; | ||
function readJsonFile(path) { | ||
if (!(0, fs_1.existsSync)(path)) { | ||
throw new schematics_1.FileDoesNotExistException(path); | ||
let data; | ||
try { | ||
data = (0, fs_1.readFileSync)(path, 'utf-8'); | ||
} | ||
catch (e) { | ||
if (e && typeof e === 'object' && 'code' in e && e.code === 'ENOENT') { | ||
throw new schematics_1.FileDoesNotExistException(path); | ||
} | ||
throw e; | ||
} | ||
const errors = []; | ||
const content = (0, jsonc_parser_1.parse)((0, fs_1.readFileSync)(path, 'utf-8'), errors, { allowTrailingComma: true }); | ||
const content = (0, jsonc_parser_1.parse)(data, errors, { allowTrailingComma: true }); | ||
if (errors.length) { | ||
@@ -22,0 +29,0 @@ const { error, offset } = errors[0]; |
@@ -16,4 +16,3 @@ /** | ||
export declare class NodeModulesTestEngineHost extends NodeModulesEngineHost { | ||
private _collections; | ||
private _tasks; | ||
#private; | ||
get tasks(): TaskConfiguration<{}>[]; | ||
@@ -20,0 +19,0 @@ clearTasks(): void; |
@@ -17,18 +17,18 @@ "use strict"; | ||
class NodeModulesTestEngineHost extends node_module_engine_host_1.NodeModulesEngineHost { | ||
_collections = new Map(); | ||
_tasks = []; | ||
#collections = new Map(); | ||
#tasks = []; | ||
get tasks() { | ||
return this._tasks; | ||
return this.#tasks; | ||
} | ||
clearTasks() { | ||
this._tasks = []; | ||
this.#tasks = []; | ||
} | ||
registerCollection(name, path) { | ||
this._collections.set(name, path); | ||
this.#collections.set(name, path); | ||
} | ||
transformContext(context) { | ||
const oldAddTask = context.addTask; | ||
const oldAddTask = context.addTask.bind(context); | ||
context.addTask = (task, dependencies) => { | ||
this._tasks.push(task.toConfiguration()); | ||
return oldAddTask.call(context, task, dependencies); | ||
this.#tasks.push(task.toConfiguration()); | ||
return oldAddTask(task, dependencies); | ||
}; | ||
@@ -38,9 +38,5 @@ return context; | ||
_resolveCollectionPath(name, requester) { | ||
const maybePath = this._collections.get(name); | ||
if (maybePath) { | ||
return maybePath; | ||
} | ||
return super._resolveCollectionPath(name, requester); | ||
return this.#collections.get(name) ?? super._resolveCollectionPath(name, requester); | ||
} | ||
} | ||
exports.NodeModulesTestEngineHost = NodeModulesTestEngineHost; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
254441
6075
+ Added@angular-devkit/core@18.1.0-rc.0(transitive)
+ Addedjsonc-parser@3.3.1(transitive)
- Removed@angular-devkit/core@18.1.0-next.3(transitive)
- Removedjsonc-parser@3.2.1(transitive)
Updatedjsonc-parser@3.3.1