Skip to content

Commit

Permalink
chore: release 0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
LZHD committed Feb 4, 2021
1 parent 6b98b25 commit eb535de
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 87 deletions.
31 changes: 0 additions & 31 deletions lib/karma.conf.js

This file was deleted.

12 changes: 12 additions & 0 deletions lib/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../publish",
"deleteDestPath": true,
"lib": {
"entryFile": "index.ts",
"umdModuleIds": {
"iv-viewer": "iv-viewer",
"ng-zorro-antd": "ng-zorro-antd"
}
}
}
28 changes: 28 additions & 0 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "ng-picture-viewer",
"version": "0.0.4",
"description": "angular image-viewer based on ng-zorro-antd and iv-viewer",
"author": "lzhd",
"license": "MIT",
"bugs": {
"url": "https://github.com/lzhd/ng-picture-viewer/issues"
},
"homepage": "https://lzhd.github.io/ng-picture-viewer",
"keywords": [
"image-viewer",
"image",
"ng-zorro-antd",
"angular",
"ng-picture-viewer",
"nz-image-viewer",
"viewer"
],
"repository": {
"type": "git",
"url": "git+https://github.com/lzhd/ng-picture-viewer.git"
},
"peerDependencies": {
"iv-viewer": ">=2.0.1",
"ng-zorro-antd": ">=10.0.0"
}
}
4 changes: 2 additions & 2 deletions lib/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(),
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
Expand Down
7 changes: 2 additions & 5 deletions lib/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es2015",
"lib": ["es2018", "dom"],
"alwaysStrict": true,
"sourceMap": true,
"inlineSources": true,
Expand All @@ -11,9 +9,8 @@
"strictFunctionTypes": true,
"stripInternal": true
},
"files": [
"./index.ts"
],
"files": ["./index.ts"],
"include": ["**/*.ts"],
"angularCompilerOptions": {
"enableIvy": false
}
Expand Down
21 changes: 0 additions & 21 deletions lib/tsconfig.spec.json

This file was deleted.

40 changes: 14 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-picture-viewer",
"version": "0.0.3",
"version": "0.0.4",
"description": "angular image-viewer based on ng-zorro-antd and iv-viewer",
"repository": {
"type": "git",
Expand Down Expand Up @@ -34,28 +34,30 @@
"release": "npm run build && cd publish && npm publish --access public"
},
"private": false,
"peerDependencies": {
"iv-viewer": ">=2.0.1",
"ng-zorro-antd": ">=9.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1002.1",
"dependencies": {
"@angular/animations": "~10.2.4",
"@angular/common": "~10.2.4",
"@angular/cli": "~10.2.1",
"@angular/compiler": "~10.2.4",
"@angular/compiler-cli": "~10.2.4",
"@angular/core": "~10.2.4",
"@angular/forms": "~10.2.4",
"@angular/platform-browser": "~10.2.4",
"@angular/platform-browser-dynamic": "~10.2.4",
"@angular/router": "~10.2.4",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2",
"ng-zorro-antd": "^10.2.2",
"iv-viewer": "^2.0.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1002.1",
"@angular/cli": "~10.2.1",
"@angular/compiler-cli": "~10.2.4",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"angular-cli-ghpages": "^0.6.2",
"codelyzer": "^6.0.0",
"iv-viewer": "^2.0.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
Expand All @@ -64,23 +66,9 @@
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^10.1.2",
"ng-zorro-antd": "^10.2.2",
"protractor": "~7.0.0",
"rxjs": "~6.6.0",
"ts-node": "~8.3.0",
"tslib": "^2.0.0",
"tslint": "~6.1.0",
"typescript": "~4.0.2",
"zone.js": "~0.10.2"
},
"ngPackage": {
"lib": {
"entryFile": "lib/index",
"umdModuleIds": {
"iv-viewer": "iv-viewer",
"ng-zorro-antd": "ng-zorro-antd"
}
},
"dest": "./publish"
"typescript": "~4.0.2"
}
}
28 changes: 26 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
const path = require('path');
const fs = require('fs-extra');
const ngPackage = require('ng-packagr');

const root = path.resolve(__dirname, `..`);
const libPackagePath = path.resolve(root, `./lib/package.json`);

// Update version
const rootPackageJson = require(path.resolve(root, `./package.json`));
const libPackageJson = require(libPackagePath);
[
'name',
'version',
'description',
'keywords',
'author',
'license',
'repository',
'bugs',
'homepage',
].forEach((key) => (libPackageJson[key] = rootPackageJson[key]));
fs.writeJsonSync(libPackagePath, libPackageJson, { spaces: 2 });

ngPackage
.ngPackagr()
.forProject(path.resolve(root, `./package.json`))
.forProject(path.resolve(root, `./lib/ng-package.json`))
.withTsConfig(path.resolve(root, './lib/tsconfig.lib.json'))
.build()
.catch(error => {
.then(() =>
fs.copyFileSync(
path.resolve(root, `./README.md`),
path.resolve(root, `./publish/README.md`),
),
)
.catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit eb535de

Please sign in to comment.