ng-packagr 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +15 -0
- package/lib/model/ng-package-data.d.ts +1 -0
- package/lib/model/ng-package-data.js +4 -0
- package/lib/model/ng-package-data.js.map +1 -1
- package/lib/steps/ngc.js +3 -0
- package/lib/steps/ngc.js.map +1 -1
- package/ng-package.schema.d.ts +4 -0
- package/ng-package.schema.js.map +1 -1
- package/ng-package.schema.json +11 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
<a name="1.7.0"></a>
|
|
6
|
+
# [1.7.0](https://github.com/dherges/ng-packagr/compare/v1.6.0...v1.7.0) (2018-02-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* back-port language level support for library authors in v1 ([#581](https://github.com/dherges/ng-packagr/issues/581)) ([800f615](https://github.com/dherges/ng-packagr/commit/800f615))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
5
15
|
<a name="1.6.0"></a>
|
|
6
16
|
# [1.6.0](https://github.com/dherges/ng-packagr/compare/v1.5.2...v1.6.0) (2017-11-14)
|
|
7
17
|
|
package/README.md
CHANGED
|
@@ -154,6 +154,21 @@ For example, the following would use `index.ts` as the secondary entry point:
|
|
|
154
154
|
}
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
+
##### How do I use es2016 or es2017 features in my TypeScript library?
|
|
158
|
+
|
|
159
|
+
You can change the TypeScript language level support in tsconfig by also using the `ngPackage` configuration field in your secondary package.json` and setting the `languageLevel` property in `lib`:
|
|
160
|
+
For example,:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"ngPackage": {
|
|
165
|
+
"lib": {
|
|
166
|
+
"languageLevel": [ "dom", "es2017" ]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
157
172
|
##### What if I want to use React Components?
|
|
158
173
|
|
|
159
174
|
If you have React Components that you're using in your library, and want to use proper JSX/TSX syntax in order to
|
|
@@ -25,6 +25,7 @@ export declare class NgPackageData {
|
|
|
25
25
|
readonly buildDirectory: string;
|
|
26
26
|
readonly libExternals: any;
|
|
27
27
|
readonly jsxConfig?: string;
|
|
28
|
+
readonly languageLevel: string[];
|
|
28
29
|
constructor(
|
|
29
30
|
/**
|
|
30
31
|
* Source path of the root package (equivalent to the `src` field configured in the root ng-package.json).
|
|
@@ -40,6 +40,7 @@ class NgPackageData {
|
|
|
40
40
|
this.flatModuleFileName = ngPackageConfig.lib.flatModuleFile;
|
|
41
41
|
this.entryFile = ngPackageConfig.lib.entryFile;
|
|
42
42
|
this.jsxConfig = ngPackageConfig.lib.jsx;
|
|
43
|
+
this.languageLevel = ngPackageConfig.lib.languageLevel;
|
|
43
44
|
}
|
|
44
45
|
if (!this.libExternals) {
|
|
45
46
|
this.libExternals = {};
|
|
@@ -50,6 +51,9 @@ class NgPackageData {
|
|
|
50
51
|
if (!this.entryFile) {
|
|
51
52
|
this.entryFile = 'public_api.ts';
|
|
52
53
|
}
|
|
54
|
+
if (!this.languageLevel) {
|
|
55
|
+
this.languageLevel = ['dom', 'es2015'];
|
|
56
|
+
}
|
|
53
57
|
// Each entry point gets it's own unique build directory based upon the package name.
|
|
54
58
|
const packageBuildFolderName = this.fullPackageName.replace(exports.SCOPE_NAME_SEPARATOR, '-');
|
|
55
59
|
this.buildDirectory = path_1.path.resolve(this.rootSourcePath, exports.DEFAULT_BUILD_FOLDER, packageBuildFolderName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-package-data.js","sourceRoot":"","sources":["../../../src/lib/model/ng-package-data.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F,MAAM,sBAAsB,GAAW,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,4BAAoB,EAAE,GAAG,CAAC,CAAC;QAC/F,IAAI,CAAC,cAAc,GAAG,WAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,4BAAoB,EAAE,sBAAsB,CAAC,CAAC;IACxG,CAAC;CACF;AAvED,sCAuEC","sourcesContent":["import { NgPackageConfig } from '../../ng-package.schema';\nimport { path } from '../util/path';\n\nexport const SCOPE_PREFIX = '@';\nexport const SCOPE_NAME_SEPARATOR = '/';\nexport const DEFAULT_BUILD_FOLDER = '.ng_pkg_build';\n\nexport class NgPackageData {\n public readonly pathOffsetFromSourceRoot: string;\n public readonly fullPackageName: string;\n public readonly packageNameWithoutScope: string;\n public readonly scope?: string;\n public readonly flatModuleFileName: string;\n public readonly entryFile: string;\n public readonly destinationPath: string;\n public readonly buildDirectory: string;\n public readonly libExternals: any;\n public readonly jsxConfig?: string;\n public readonly languageLevel: string[];\n\n constructor(\n /**\n * Source path of the root package (equivalent to the `src` field configured in the root ng-package.json).\n */\n public readonly rootSourcePath: string,\n rootPackageName: string,\n /**\n * Destination path of the root package (equivalent to the `dest` field configured in the root ng-package.json).\n */\n public readonly rootDestinationPath: string,\n /**\n * Source path of the current package (equivalent to a sub folder of the `src` field configured in the root ng-package.json).\n */\n public readonly sourcePath: string,\n ngPackageConfig: NgPackageConfig\n ) {\n this.pathOffsetFromSourceRoot = this.sourcePath.substring(rootSourcePath.length);\n // destination path of secondary modules is not configurable - this is to meet the Angular package format.\n this.destinationPath = rootDestinationPath + this.pathOffsetFromSourceRoot;\n this.fullPackageName = path.ensureUnixPath(rootPackageName + this.pathOffsetFromSourceRoot);\n\n if (this.fullPackageName.startsWith(SCOPE_PREFIX)) {\n const firstSeparatorIndex: number = this.fullPackageName.indexOf(SCOPE_NAME_SEPARATOR);\n if (firstSeparatorIndex > -1) { // if there is no scope name separator\n this.scope = this.fullPackageName.substring(0, firstSeparatorIndex);\n this.packageNameWithoutScope = this.fullPackageName.substring(firstSeparatorIndex + 1);\n }\n }\n\n if (!this.packageNameWithoutScope) { // no scope was detected\n this.packageNameWithoutScope = this.fullPackageName;\n }\n\n if (ngPackageConfig.lib) {\n this.libExternals = ngPackageConfig.lib.externals;\n this.flatModuleFileName = ngPackageConfig.lib.flatModuleFile;\n this.entryFile = ngPackageConfig.lib.entryFile;\n this.jsxConfig = ngPackageConfig.lib.jsx;\n this.languageLevel = ngPackageConfig.lib.languageLevel;\n }\n\n if (!this.libExternals) {\n this.libExternals = {};\n }\n if (!this.flatModuleFileName) {\n this.flatModuleFileName = path.basename(this.fullPackageName);\n }\n if (!this.entryFile) {\n this.entryFile = 'public_api.ts';\n }\n if (!this.languageLevel) {\n this.languageLevel = ['dom', 'es2015'];\n }\n\n // Each entry point gets it's own unique build directory based upon the package name.\n const packageBuildFolderName: string = this.fullPackageName.replace(SCOPE_NAME_SEPARATOR, '-');\n this.buildDirectory = path.resolve(this.rootSourcePath, DEFAULT_BUILD_FOLDER, packageBuildFolderName);\n }\n}\n\n"]}
|
package/lib/steps/ngc.js
CHANGED
|
@@ -25,6 +25,9 @@ function prepareTsConfig(ngPkg, outFile) {
|
|
|
25
25
|
log_1.debug('prepareTsConfig: Applying jsx flag to tsconfig ' + ngPkg.jsxConfig);
|
|
26
26
|
tsConfig['compilerOptions']['jsx'] = ngPkg.jsxConfig;
|
|
27
27
|
}
|
|
28
|
+
if (ngPkg.languageLevel) {
|
|
29
|
+
tsConfig.compilerOptions.lib = ngPkg.languageLevel;
|
|
30
|
+
}
|
|
28
31
|
yield fs_extra_1.writeJson(outFile, tsConfig);
|
|
29
32
|
});
|
|
30
33
|
}
|
package/lib/steps/ngc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngc.js","sourceRoot":"","sources":["../../../src/lib/steps/ngc.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,6BAA6B;AAC7B,sDAA2E;AAE3E,uCAA+C;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C,MAAM,CAAC,GAAG,QAAQ,IAAI,QAAQ,CAAC,eAAe,CAAC,MAAM,IAAI,QAAQ,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,CAAC;IAC/G,CAAC;CAAA;AAXD,kBAWC","sourcesContent":["import * as path from 'path';\nimport { main as tsc, AngularCompilerOptions } from '@angular/tsc-wrapped';\nimport { NgPackageData } from '../model/ng-package-data';\nimport { readJson, writeJson } from 'fs-extra';\nimport { debug } from '../util/log';\n\n\nasync function prepareTsConfig(ngPkg: NgPackageData, outFile: string): Promise<void> {\n const tsConfigPath: string = path.resolve(__dirname, '..', 'conf', 'tsconfig.ngc.json');\n debug('prepareTsConfig: Resolved tsconfig path to ' + tsConfigPath);\n\n const tsConfig: any = await readJson(tsConfigPath);\n\n const compilerOptions: AngularCompilerOptions = tsConfig.angularCompilerOptions;\n compilerOptions.flatModuleId = ngPkg.fullPackageName;\n compilerOptions.flatModuleOutFile = `${ngPkg.flatModuleFileName}.js`;\n\n tsConfig['files'] = [ ngPkg.entryFile ];\n\n if (ngPkg.jsxConfig) {\n debug('prepareTsConfig: Applying jsx flag to tsconfig ' + ngPkg.jsxConfig);\n tsConfig['compilerOptions']['jsx'] = ngPkg.jsxConfig;\n }\n\n await writeJson(outFile, tsConfig);\n}\n\n\n/**\n * Compiles typescript sources with 'ngc'.\n *\n * @param ngPkg Angular package data\n * @param basePath\n */\nexport async function ngc(ngPkg: NgPackageData, basePath: string): Promise<string> {\n const tsConfigPath: string = `${basePath}/tsconfig.lib.json`;\n debug(`ngc ${tsConfigPath}, { basePath: ${basePath} })`);\n\n await prepareTsConfig(ngPkg, tsConfigPath);\n await tsc(tsConfigPath, { basePath });\n\n debug('Reading tsconfig from ' + tsConfigPath);\n const tsConfig = await readJson(tsConfigPath);\n\n return `${basePath}/${tsConfig.compilerOptions.outDir}/${tsConfig.angularCompilerOptions.flatModuleOutFile}`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ngc.js","sourceRoot":"","sources":["../../../src/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AC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC3C,MAAM,kBAAG,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAEtC,WAAK,CAAC,wBAAwB,GAAG,YAAY,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,MAAM,mBAAQ,CAAC,YAAY,CAAC,CAAC;QAE9C,MAAM,CAAC,GAAG,QAAQ,IAAI,QAAQ,CAAC,eAAe,CAAC,MAAM,IAAI,QAAQ,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,CAAC;IAC/G,CAAC;CAAA;AAXD,kBAWC","sourcesContent":["import * as path from 'path';\nimport { main as tsc, AngularCompilerOptions } from '@angular/tsc-wrapped';\nimport { NgPackageData } from '../model/ng-package-data';\nimport { readJson, writeJson } from 'fs-extra';\nimport { debug } from '../util/log';\n\n\nasync function prepareTsConfig(ngPkg: NgPackageData, outFile: string): Promise<void> {\n const tsConfigPath: string = path.resolve(__dirname, '..', 'conf', 'tsconfig.ngc.json');\n debug('prepareTsConfig: Resolved tsconfig path to ' + tsConfigPath);\n\n const tsConfig: any = await readJson(tsConfigPath);\n\n const compilerOptions: AngularCompilerOptions = tsConfig.angularCompilerOptions;\n compilerOptions.flatModuleId = ngPkg.fullPackageName;\n compilerOptions.flatModuleOutFile = `${ngPkg.flatModuleFileName}.js`;\n\n tsConfig['files'] = [ ngPkg.entryFile ];\n\n if (ngPkg.jsxConfig) {\n debug('prepareTsConfig: Applying jsx flag to tsconfig ' + ngPkg.jsxConfig);\n tsConfig['compilerOptions']['jsx'] = ngPkg.jsxConfig;\n }\n\n if (ngPkg.languageLevel) {\n tsConfig.compilerOptions.lib = ngPkg.languageLevel;\n }\n\n await writeJson(outFile, tsConfig);\n}\n\n\n/**\n * Compiles typescript sources with 'ngc'.\n *\n * @param ngPkg Angular package data\n * @param basePath\n */\nexport async function ngc(ngPkg: NgPackageData, basePath: string): Promise<string> {\n const tsConfigPath: string = `${basePath}/tsconfig.lib.json`;\n debug(`ngc ${tsConfigPath}, { basePath: ${basePath} })`);\n\n await prepareTsConfig(ngPkg, tsConfigPath);\n await tsc(tsConfigPath, { basePath });\n\n debug('Reading tsconfig from ' + tsConfigPath);\n const tsConfig = await readJson(tsConfigPath);\n\n return `${basePath}/${tsConfig.compilerOptions.outDir}/${tsConfig.angularCompilerOptions.flatModuleOutFile}`;\n}\n"]}
|
package/ng-package.schema.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ export interface NgPackageConfig {
|
|
|
42
42
|
* A property to indicate whether your library is going to be bundling jsx/tsx files. This passes through to tsconfig - see https://www.typescriptlang.org/docs/handbook/jsx.html
|
|
43
43
|
*/
|
|
44
44
|
jsx?: ("preserve" | "react" | "react-native");
|
|
45
|
+
/**
|
|
46
|
+
* Set typescript language level, i.e. tsconfig.lib. This will enable accessing typescript features available in es2016, es2017, etc.
|
|
47
|
+
*/
|
|
48
|
+
languageLevel?: string[];
|
|
45
49
|
[k: string]: any;
|
|
46
50
|
};
|
|
47
51
|
}
|
package/ng-package.schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-package.schema.js","sourceRoot":"","sources":["../src/ng-package.schema.ts"],"names":[],"mappings":";AAAA;;;;EAIE","sourcesContent":["/**\n* This file was automatically generated by json-schema-to-typescript.\n* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n* and run json-schema-to-typescript to regenerate this file.\n*/\n\n/**\n * JSON Schema for `ng-package.json` description file\n */\nexport interface NgPackageConfig {\n $schema?: string;\n /**\n * The source folder of an Angular library. This is the folder where a `package.json` is located and defaults to cwd.\n */\n src?: string;\n /**\n * The destination folder to output build artifacts and distributables of an Angular library (default: `dist`).\n */\n dest?: string;\n /**\n * Internal working directory of ng-packagr where intermediate build files are stored (default: `.ng_pkg_build`).\n */\n workingDirectory?: string;\n /**\n * Description of the library that is being built.\n */\n lib?: {\n /**\n * Entry file to the public API of the library (default: `src/public_api.ts`).\n */\n entryFile?: string;\n /**\n * Filename of the auto-generated flat module file (if empty, defaults to the package name as given in `package.json`).\n */\n flatModuleFile?: string;\n /**\n * A symbol map of external dependencies. The purpose of this map is to correctly bundle a flat module file (with `rollup`). By default, `rxjs` and `@angular/*` dependency symbols are supported.\n */\n externals?: {\n [k: string]: any;\n };\n /**\n * A property to indicate whether your library is going to be bundling jsx/tsx files. This passes through to tsconfig - see https://www.typescriptlang.org/docs/handbook/jsx.html\n */\n jsx?: (\"preserve\" | \"react\" | \"react-native\");\n [k: string]: any;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ng-package.schema.js","sourceRoot":"","sources":["../src/ng-package.schema.ts"],"names":[],"mappings":";AAAA;;;;EAIE","sourcesContent":["/**\n* This file was automatically generated by json-schema-to-typescript.\n* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n* and run json-schema-to-typescript to regenerate this file.\n*/\n\n/**\n * JSON Schema for `ng-package.json` description file\n */\nexport interface NgPackageConfig {\n $schema?: string;\n /**\n * The source folder of an Angular library. This is the folder where a `package.json` is located and defaults to cwd.\n */\n src?: string;\n /**\n * The destination folder to output build artifacts and distributables of an Angular library (default: `dist`).\n */\n dest?: string;\n /**\n * Internal working directory of ng-packagr where intermediate build files are stored (default: `.ng_pkg_build`).\n */\n workingDirectory?: string;\n /**\n * Description of the library that is being built.\n */\n lib?: {\n /**\n * Entry file to the public API of the library (default: `src/public_api.ts`).\n */\n entryFile?: string;\n /**\n * Filename of the auto-generated flat module file (if empty, defaults to the package name as given in `package.json`).\n */\n flatModuleFile?: string;\n /**\n * A symbol map of external dependencies. The purpose of this map is to correctly bundle a flat module file (with `rollup`). By default, `rxjs` and `@angular/*` dependency symbols are supported.\n */\n externals?: {\n [k: string]: any;\n };\n /**\n * A property to indicate whether your library is going to be bundling jsx/tsx files. This passes through to tsconfig - see https://www.typescriptlang.org/docs/handbook/jsx.html\n */\n jsx?: (\"preserve\" | \"react\" | \"react-native\");\n /**\n * Set typescript language level, i.e. tsconfig.lib. This will enable accessing typescript features available in es2016, es2017, etc.\n */\n languageLevel?: string[];\n [k: string]: any;\n };\n}\n"]}
|
package/ng-package.schema.json
CHANGED
|
@@ -47,6 +47,17 @@
|
|
|
47
47
|
"type": "string",
|
|
48
48
|
"enum": ["preserve", "react", "react-native"],
|
|
49
49
|
"default": ""
|
|
50
|
+
},
|
|
51
|
+
"languageLevel": {
|
|
52
|
+
"description": "Set typescript language level, i.e. tsconfig.lib. This will enable accessing typescript features available in es2016, es2017, etc.",
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"default": [
|
|
58
|
+
"dom",
|
|
59
|
+
"es2015"
|
|
60
|
+
]
|
|
50
61
|
}
|
|
51
62
|
}
|
|
52
63
|
}
|