Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/now preview #3618

Closed
wants to merge 16 commits into from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ integration/**/*.ngsummary.json
schematics/demo
schematics/utils/create-custom-theme.ts
schematics/utils/version-names.ts
ng-zorro.github.io/

# dependencies
node_modules
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.9.0
12.1.0
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ sudo: required
dist: trusty
language: node_js
node_js:
- '10.9.0'
- '12.1.0'

env:
- TASK=pre-release
- TASK=build
- TASK=test
- TASK=lint
- TASK=integration-cli
Expand Down
13 changes: 13 additions & 0 deletions build-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const {join} = require('path');

const packageJson = require('./package.json');
const buildVersion = packageJson.version;

module.exports = {
projectVersion: buildVersion,
projectDir: __dirname,
componentsDir: join(__dirname, 'components'),
scriptsDir: join(__dirname, 'scripts'),
outputDir: join(__dirname, 'dist'),
publishDir: join(__dirname, 'publish'),
};
8 changes: 8 additions & 0 deletions components/core/responsive/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/**
* @license
* Copyright Alibaba.com 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://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

export * from './public-api';
8 changes: 8 additions & 0 deletions components/core/responsive/public-api.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/**
* @license
* Copyright Alibaba.com 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://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

export * from './break-point';
2 changes: 2 additions & 0 deletions components/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

const tags = process.env && process.env['NG_TEST_TAGS'];
module.exports = function(config) {
config.set({
basePath: '',
Expand All @@ -15,6 +16,7 @@ module.exports = function(config) {
require('karma-viewport')
],
client: {
args: [tags],
clearContext: true // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
Expand Down
26 changes: 23 additions & 3 deletions components/test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

// tslint:disable-next-line:no-import-side-effect
import 'zone.js/dist/zone-testing';

import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
platformBrowserDynamicTesting,
BrowserDynamicTestingModule
} from '@angular/platform-browser-dynamic/testing';

// tslint:disable-next-line:no-any
declare const __karma__: any;
// tslint:disable-next-line:no-any
declare const require: any;

const tags = __karma__.config.args[0];
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);

let filterRegExp: RegExp;

if (tags) {
filterRegExp = new RegExp(`(${tags})\\.spec\\.ts$`);
} else {
filterRegExp = /\.spec\.ts$/;
}

// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// Filter specify file
const specFiles = context.keys().filter((path: string) => {
console.log(filterRegExp);
return filterRegExp.test(path);
});
// And load the modules.
context.keys().map(context);
specFiles.map(context);
17 changes: 17 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const path = require('path');

const projectDir = __dirname;
const tsconfigPath = path.join(projectDir, 'scripts/gulp/tsconfig.json');

if (projectDir.includes(' ')) {
console.error('Error: Cannot run the build tasks if the project is ' +
'located in a directory with spaces in between. Please rename your project directory.');
process.exit(1);
}

// Register TS compilation.
require('ts-node').register({
project: tsconfigPath
});

require('./scripts/gulp/gulpfile');
Empty file added now.json
Empty file.
53 changes: 22 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,22 @@
"node": ">=12.1.0"
},
"scripts": {
"build-iframe": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --project=ng-zorro-antd-iframe --prod --base-href ./",
"build-site": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod",
"build-site-server": "node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng run ng-zorro-antd-doc:server:production",
"build:client-and-server-bundles": "npm run build-site && npm run build-site-server",
"build:docs": "npm run build:client-and-server-bundles && npm run build:prerender && npm run build-iframe && npm run helper",
"build:prerender": "npm run compile:prerender && npm run generate:prerender",
"compile:prerender": "tsc -p scripts/prerender/tsconfig.json",
"generate:prerender": "cd dist && node prerender && node sitemap",
"start": "gulp start:dev",
"test": "ng test --watch=false --code-coverage",
"test:watch": "gulp test:watch --tags $tags",
"build": "gulp build:release",
"build:lib": "gulp build:library",
"doc": "gulp build:preview",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --pkg components/package.json && node ./scripts/site/replace-scope-prefix.js",
"doc": "npm run site:init && npm run build-site",
"format:check": "prettier --config ./.prettierrc --list-different \"component/**/*{.ts}\"",
"generate": "ng build ng-zorro-antd-lib",
"helper": "bash ./scripts/release-helper.sh",
"integration-cli": "npm run generate && cd integration/angular-cli && npm run integration",
"integration-rollup": "npm run generate && cd integration/rollup && npm run integration",
"integration-webpack": "npm run generate && cd integration/webpack && npm run integration",
"integration": "npm run generate && bash ./integration-test.sh",
"lint": "tslint -c tslint.json 'components/**/!(demo|testing)/!(polyfills).ts' --fix",
"migration-styles": "node ./scripts/build/migration-styles.js",
"format": "prettier --config ./.prettierrc --list-different \"component/**/*{.ts}\"",
"stage-release": "ts-node --project scripts/release/tsconfig.json scripts/release/release.ts",
"ng": "ng",
"postgenerate": "node scripts/build/compile-styles.js && cp README.md publish/README.md && npm run migration-styles && npm run schematic:generate",
"pre-release": "npm run site:init && bash ./scripts/build/replace-publish.sh && npm run generate && npm run build:docs",
"release": "node ./scripts/publish/publish.js",
"schematic:build": "node ./scripts/schematics/set-theme.js && node ./scripts/schematics/set-version.js && npm run schematic:tsc && node ./scripts/schematics/copy-resources",
"schematic:demo": "node ./scripts/schematics/demo2schematics",
"schematic:generate": "npm run schematic:demo && npm run schematic:build && rm -rf schematics/demo",
"schematic:tsc": "tsc -p schematics/tsconfig.json",
"site:init": "node ./scripts/site/generate-site init && node ./scripts/site/generateColorLess",
"site:start": "npm run site:init && ng serve --port 0 --open",
"site": "node ./scripts/site/generate-site",
"start": "ng serve --port 0",
"test": "ng test --watch=false --code-coverage"
"gulp": "gulp",
"lint": "tslint -c tslint.json 'components/**/!(demo|testing)/!(polyfills).ts' --fix",
"integration-cli": "npm run build:lib && cd integration/angular-cli && npm run integration",
"integration-rollup": "npm run build:lib&& cd integration/rollup && npm run integration",
"integration-webpack": "npm run build:lib && cd integration/webpack && npm run integration",
"integration": "npm run build:lib && bash ./integration-test.sh"
},
"dependencies": {
"@angular/cdk": "~8.0.0",
Expand Down Expand Up @@ -70,8 +54,10 @@
"@schematics/angular": "~8.0.1",
"@stackblitz/sdk": "^1.1.1",
"@types/fs-extra": "^5.0.4",
"@types/gulp": "^4.0.6",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/less": "^3.0.0",
"antd-theme-generator": "^1.0.7",
"chalk": "^2.4.1",
"classlist.js": "^1.1.20150312",
Expand All @@ -81,6 +67,8 @@
"conventional-changelog-cli": "^2.0.1",
"core-js": "^2.5.4",
"fs-extra": "^6.0.1",
"gulp": "^4.0.2",
"gulp-clean": "^0.4.0",
"husky": "^1.0.1",
"jasmine-core": "~2.99.1",
"karma": "~3.0.0",
Expand All @@ -94,6 +82,7 @@
"less-plugin-clean-css": "^1.5.1",
"lint-staged": "^8.1.5",
"marked": "^0.6.2",
"minimist": "^1.2.0",
"ng-packagr": "^5.2.0",
"ngx-color": "^2.0.5",
"node-prismjs": "^0.1.1",
Expand All @@ -102,9 +91,11 @@
"protractor": "~5.4.0",
"readline-sync": "^1.4.9",
"remark": "^8.0.0",
"resolve-bin": "^0.4.0",
"run-sequence": "^2.2.1",
"rxjs": "~6.5.2",
"sitemap": "^2.1.0",
"ts-node": "~7.0.0",
"ts-node": "^7.0.1",
"tsickle": ">=0.34.0",
"tslib": "^1.9.0",
"tslint": "~5.11.0",
Expand Down
27 changes: 27 additions & 0 deletions scripts/build-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { existsSync } from 'fs';
import { dirname, join, resolve } from 'path';

export interface BuildConfig {
projectVersion: string;
projectDir: string;
componentsDir: string;
scriptsDir: string;
outputDir: string;
publishDir: string;
}

const BUILD_CONFIG_FILENAME = 'build-config.js';

export function findBuildConfig(): string {
let currentDir = process.cwd();

while (!existsSync(resolve(currentDir, BUILD_CONFIG_FILENAME))) {
currentDir = dirname(currentDir);
}

return join(currentDir, BUILD_CONFIG_FILENAME);
}

const buildConfigPath = findBuildConfig();

export const buildConfig = require(buildConfigPath) as BuildConfig;
84 changes: 0 additions & 84 deletions scripts/build/compile-styles.js

This file was deleted.

Loading