Ensure Flo lib is ivy compiled. Use ng-packagr to build flo
This commit is contained in:
161
angular.json
Normal file
161
angular.json
Normal file
@@ -0,0 +1,161 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"dev": {
|
||||
"root": "",
|
||||
"projectType": "application",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "dist/app",
|
||||
"index": "src/demo/index.html",
|
||||
"main": "src/demo/main.ts",
|
||||
"tsConfig": "src/demo/tsconfig.dev.json",
|
||||
"polyfills": "src/demo/polyfills.ts",
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/demo/icons",
|
||||
"output": "/icons"
|
||||
},
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src/demo",
|
||||
"output": "/"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/demo/styles.css"
|
||||
],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "dev:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "dev:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "dev:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"tsconfig.json"
|
||||
],
|
||||
"exclude": []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"packaged": {
|
||||
"root": "",
|
||||
"projectType": "application",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "dist/app",
|
||||
"index": "src/demo/index.html",
|
||||
"main": "src/demo/main.ts",
|
||||
"tsConfig": "src/demo/tsconfig.packaged.json",
|
||||
"polyfills": "src/demo/polyfills.ts",
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/demo/icons",
|
||||
"output": "/icons"
|
||||
},
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src/demo",
|
||||
"output": "/"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/demo/styles.css"
|
||||
],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "packaged:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "packaged:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "packaged:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"tsconfig.json"
|
||||
],
|
||||
"exclude": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"prefix": "app",
|
||||
"styleext": "css"
|
||||
},
|
||||
"@schematics/angular:directive": {
|
||||
"prefix": "app"
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"analytics": false
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"server": {
|
||||
"baseDir": "src/demo",
|
||||
"routes": {
|
||||
"/node_modules": "node_modules",
|
||||
"/spring-flo": "src/lib"
|
||||
}
|
||||
}
|
||||
}
|
||||
191
build.js
191
build.js
@@ -1,191 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
const shell = require('shelljs');
|
||||
const chalk = require('chalk');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const sass = require('node-sass');
|
||||
const ScssBundler = require('scss-bundle');
|
||||
|
||||
const PACKAGE = `spring-flo`;
|
||||
const NPM_DIR = `dist`;
|
||||
const TS_COMPILED_DIR = `${NPM_DIR}/out-tsc`;
|
||||
const ESM2015_DIR = `${NPM_DIR}/esm2015`;
|
||||
const ESM5_DIR = `${NPM_DIR}/esm5`;
|
||||
const FESM2015_DIR = `${NPM_DIR}/fesm2015`;
|
||||
const FESM5_DIR = `${NPM_DIR}/fesm5`;
|
||||
const BUNDLES_DIR = `${NPM_DIR}/bundles`;
|
||||
const OUT_DIR = `${NPM_DIR}/package`;
|
||||
const OUT_DIR_ESM5 = `${NPM_DIR}/package/esm5`;
|
||||
|
||||
const gulp = require('gulp');
|
||||
const inlineTemplates = require('gulp-inline-ng2-template');
|
||||
|
||||
/**
|
||||
* Inline templates configuration.
|
||||
* @see https://github.com/ludohenin/gulp-inline-ng2-template
|
||||
*/
|
||||
const INLINE_TEMPLATES = {
|
||||
SRC: './src/lib/**/*.ts',
|
||||
DIST: './dist/package/lib',
|
||||
CONFIG: {
|
||||
base: './src/lib',
|
||||
target: 'es6',
|
||||
useRelativePaths: true
|
||||
}
|
||||
};
|
||||
|
||||
shell.echo(`Start building...`);
|
||||
|
||||
shell.rm(`-Rf`, `${NPM_DIR}/*`);
|
||||
shell.mkdir(`-p`, `./${ESM2015_DIR}`);
|
||||
shell.mkdir(`-p`, `./${ESM5_DIR}`);
|
||||
shell.mkdir(`-p`, `./${FESM2015_DIR}`);
|
||||
shell.mkdir(`-p`, `./${FESM5_DIR}`);
|
||||
shell.mkdir(`-p`, `./${BUNDLES_DIR}`);
|
||||
shell.mkdir(`-p`, `./${OUT_DIR}`);
|
||||
|
||||
/* TSLint with Codelyzer */
|
||||
// https://github.com/palantir/tslint/blob/master/src/configs/recommended.ts
|
||||
// https://github.com/mgechev/codelyzer
|
||||
shell.echo(`Start TSLint`);
|
||||
shell.exec(`tslint -p tsconfig.json -t stylish src/lib/**/*.ts`);
|
||||
shell.echo(chalk.green(`TSLint completed`));
|
||||
|
||||
|
||||
/**
|
||||
* Inline external HTML and SCSS templates into Angular component files.
|
||||
* @see: https://github.com/ludohenin/gulp-inline-ng2-template
|
||||
*/
|
||||
gulp.src(INLINE_TEMPLATES.SRC)
|
||||
.pipe(inlineTemplates(INLINE_TEMPLATES.CONFIG))
|
||||
.pipe(gulp.dest(INLINE_TEMPLATES.DIST)).on('end', compile);
|
||||
|
||||
|
||||
async function compile() {
|
||||
|
||||
shell.cp(`-Rf`, [`*.json`], `${OUT_DIR}`);
|
||||
|
||||
shell.cp('-Rf', './src/lib/styles.scss', `${OUT_DIR}`);
|
||||
|
||||
const mainScssFile = path.join(OUT_DIR, 'styles.scss');
|
||||
|
||||
const scssFiles = shell.ls(`${OUT_DIR}/**/*.scss`).filter(f => f.toString() !== mainScssFile).map(f => f.toString());
|
||||
|
||||
const singleScssFile = path.join(OUT_DIR, 'flo.scss');
|
||||
|
||||
await bundleScss(mainScssFile, scssFiles, singleScssFile);
|
||||
|
||||
const cssResult = sass.renderSync({
|
||||
file: singleScssFile,
|
||||
});
|
||||
|
||||
fs.writeFileSync(path.join(NPM_DIR, 'flo.css'), cssResult.css, (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
/* AoT compilation */
|
||||
shell.echo(`Start AoT compilation`);
|
||||
if (shell.exec(`ngc -p ${OUT_DIR}/tsconfig-build.json`).code !== 0) {
|
||||
shell.echo(chalk.red(`Error: AoT compilation failed`));
|
||||
shell.exit(1);
|
||||
}
|
||||
shell.echo(chalk.green(`AoT compilation completed`));
|
||||
|
||||
shell.echo(`Copy ES2015 for package`);
|
||||
shell.cp(`-Rf`, [ `${TS_COMPILED_DIR}/*` ], `${ESM2015_DIR}`);
|
||||
|
||||
/* BUNDLING PACKAGE */
|
||||
shell.echo(`Start bundling`);
|
||||
shell.echo(`Rollup package`);
|
||||
if (shell.exec(`rollup -c rollup.es.config.js -i ${TS_COMPILED_DIR}/${PACKAGE}.js -o ${FESM2015_DIR}/${PACKAGE}.js`).code !== 0) {
|
||||
shell.echo(chalk.red(`Error: Rollup package failed`));
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
shell.echo(`Produce ESM5/FESM5 versions`);
|
||||
shell.exec(`ngc -p ${OUT_DIR}/tsconfig-build.json --target es5 -d false --outDir ${OUT_DIR_ESM5} --sourceMap`);
|
||||
shell.cp(`-Rf`, [ `${OUT_DIR_ESM5}/*` ], `${ESM5_DIR}`);
|
||||
if (shell.exec(`rollup -c rollup.es.config.js -i ${OUT_DIR_ESM5}/${PACKAGE}.js -o ${FESM5_DIR}/${PACKAGE}.js`).code !== 0) {
|
||||
shell.echo(chalk.red(`Error: FESM5 version failed`));
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
shell.echo(`Run Rollup conversion on package`);
|
||||
if (shell.exec(`rollup -c rollup.config.js -i ${FESM5_DIR}/${PACKAGE}.js -o ${BUNDLES_DIR}/${PACKAGE}.umd.js`).code !== 0) {
|
||||
shell.echo(chalk.red(`Error: Rollup conversion failed`));
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
shell.echo(`Minifying`);
|
||||
shell.cd(`${BUNDLES_DIR}`);
|
||||
if (shell.exec(`uglifyjs ${PACKAGE}.umd.js -c --comments -o ${PACKAGE}.umd.min.js --source-map "includeSources=true,filename='${PACKAGE}.umd.min.js.map'"`).code !== 0) {
|
||||
shell.echo(chalk.red(`Error: Minifying failed`));
|
||||
shell.exit(1);
|
||||
}
|
||||
shell.cd(`..`);
|
||||
shell.cd(`..`);
|
||||
|
||||
shell.echo(chalk.green(`Bundling completed`));
|
||||
|
||||
shell.rm(`-Rf`, `${NPM_DIR}/package`);
|
||||
shell.rm(`-Rf`, `${TS_COMPILED_DIR}/**/*.js`);
|
||||
shell.rm(`-Rf`, `${TS_COMPILED_DIR}/**/*.js.map`);
|
||||
shell.rm(`-Rf`, `${ESM2015_DIR}/**/*.d.ts`);
|
||||
|
||||
shell.cp(`-Rf`, [`package.json`, `LICENSE`, `README.md`], `${NPM_DIR}`);
|
||||
|
||||
shell.sed('-i', `"private": true,`, `"private": false,`, `./${NPM_DIR}/package.json`);
|
||||
|
||||
shell.echo(chalk.green(`End building`));
|
||||
|
||||
const packagejson = path.join(NPM_DIR, 'package.json');
|
||||
const json = JSON.parse(fs.readFileSync(packagejson));
|
||||
if (json['scripts']) {
|
||||
delete json['scripts']['prepare'];
|
||||
}
|
||||
const searchValue = './' + NPM_DIR + '/';
|
||||
const replaceValue = './';
|
||||
replacePropertyValue(json, 'main', searchValue, replaceValue);
|
||||
replacePropertyValue(json, 'module', searchValue, replaceValue);
|
||||
replacePropertyValue(json, 'es2015', searchValue, replaceValue);
|
||||
replacePropertyValue(json, 'typings', searchValue, replaceValue);
|
||||
replacePropertyValue(json, 'esm5', searchValue, replaceValue);
|
||||
replacePropertyValue(json, 'esm2015', searchValue, replaceValue);
|
||||
replacePropertyValue(json, 'fesm5', searchValue, replaceValue);
|
||||
replacePropertyValue(json, 'fesm2015', searchValue, replaceValue);
|
||||
fs.writeFileSync(packagejson, JSON.stringify(json, null, 2));
|
||||
}
|
||||
|
||||
/** Bundles all SCSS files into a single file */
|
||||
async function bundleScss(mainInputFile, inputFiles, outputFile) {
|
||||
const { found, bundledContent, imports } = await new ScssBundler.Bundler()
|
||||
.Bundle(mainInputFile, inputFiles);
|
||||
|
||||
if (imports) {
|
||||
const cwd = process.cwd();
|
||||
|
||||
const filesNotFound = imports
|
||||
.filter(x => !x.found)
|
||||
.map(x => relative(cwd, x.filePath));
|
||||
|
||||
if (filesNotFound.length) {
|
||||
console.error(`SCSS imports failed \n\n${filesNotFound.join('\n - ')}\n`);
|
||||
throw new Error('One or more SCSS imports failed');
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
fs.writeFileSync(outputFile, bundledContent, (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
} else {
|
||||
throw new Error('SCSS files not found');
|
||||
}
|
||||
}
|
||||
|
||||
function replacePropertyValue(json, property, searchValue, newValue) {
|
||||
if (typeof json[property] === 'string') {
|
||||
json[property] = json[property].replace(searchValue, newValue);
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
// /*global jasmine, __karma__, window*/
|
||||
Error.stackTraceLimit = 0; // "No stacktrace"" is usually best for testing.
|
||||
|
||||
// Uncomment to get full stacktrace output. Sometimes helpful, usually not.
|
||||
// Error.stackTraceLimit = Infinity; //
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
|
||||
|
||||
// builtPaths: root paths for output ("built") files
|
||||
// get from karma.config.js, then prefix with '/base/' (default is 'src/')
|
||||
var builtPaths = (__karma__.config.builtPaths || ['src/'])
|
||||
.map(function(p) { return '/base/'+p;});
|
||||
|
||||
__karma__.loaded = function () { };
|
||||
|
||||
function isJsFile(path) {
|
||||
return path.slice(-3) == '.js';
|
||||
}
|
||||
|
||||
function isSpecFile(path) {
|
||||
return /\.spec\.(.*\.)?js$/.test(path);
|
||||
}
|
||||
|
||||
// Is a "built" file if is JavaScript file in one of the "built" folders
|
||||
function isBuiltFile(path) {
|
||||
return isJsFile(path) &&
|
||||
builtPaths.reduce(function(keep, bp) {
|
||||
return keep || (path.substr(0, bp.length) === bp);
|
||||
}, false);
|
||||
}
|
||||
|
||||
var allSpecFiles = Object.keys(window.__karma__.files)
|
||||
.filter(isSpecFile)
|
||||
.filter(isBuiltFile);
|
||||
|
||||
System.config({
|
||||
paths: {
|
||||
// paths serve as alias
|
||||
'npm:': 'node_modules/'
|
||||
},
|
||||
// Base URL for System.js calls. 'base/' is where Karma serves files from.
|
||||
baseURL: 'base/src/lib',
|
||||
// Extend usual application package list with test folder
|
||||
packages: {
|
||||
rxjs: { defaultExtension: 'js' },
|
||||
'': { defaultExtension: 'js' },
|
||||
src: {
|
||||
defaultExtension: 'js',
|
||||
meta: {
|
||||
'./*.js': {
|
||||
loader: 'system-loader'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// Map the angular umd bundles
|
||||
map: {
|
||||
'system-loader': 'demo/systemjs-angular-loader.js',
|
||||
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
|
||||
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
|
||||
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
|
||||
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
|
||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
||||
// Testing bundles
|
||||
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
|
||||
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
|
||||
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
|
||||
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
|
||||
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
|
||||
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
|
||||
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
|
||||
'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
|
||||
'rxjs': 'npm:rxjs',
|
||||
'src': 'src'
|
||||
}
|
||||
});
|
||||
|
||||
initTestBed().then(initTesting);
|
||||
|
||||
function initTestBed(){
|
||||
return Promise.all([
|
||||
System.import('@angular/core/testing'),
|
||||
System.import('@angular/platform-browser-dynamic/testing')
|
||||
])
|
||||
|
||||
.then(function (providers) {
|
||||
var coreTesting = providers[0];
|
||||
var browserTesting = providers[1];
|
||||
|
||||
coreTesting.TestBed.initTestEnvironment(
|
||||
browserTesting.BrowserDynamicTestingModule,
|
||||
browserTesting.platformBrowserDynamicTesting());
|
||||
})
|
||||
}
|
||||
|
||||
// Import all spec files and start karma
|
||||
function initTesting () {
|
||||
return Promise.all(
|
||||
allSpecFiles.map(function (moduleName) {
|
||||
return System.import(moduleName);
|
||||
})
|
||||
)
|
||||
.then(__karma__.start, __karma__.error);
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
module.exports = function (config) {
|
||||
|
||||
var libBase = 'src/lib/'; // transpiled app JS and map files
|
||||
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter')
|
||||
],
|
||||
|
||||
client: {
|
||||
builtPaths: [libBase], // add more spec base paths as needed
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
|
||||
customLaunchers: {
|
||||
// From the CLI. Not used here but interesting
|
||||
// chrome setup for travis CI using chromium
|
||||
Chrome_travis_ci: {
|
||||
base: 'Chrome',
|
||||
flags: ['--no-sandbox']
|
||||
}
|
||||
},
|
||||
|
||||
files: [
|
||||
// System.js for module loading
|
||||
'node_modules/systemjs/dist/system.src.js',
|
||||
|
||||
// Polyfills
|
||||
'node_modules/core-js/client/shim.js',
|
||||
|
||||
// zone.js
|
||||
'node_modules/zone.js/dist/zone.js',
|
||||
'node_modules/zone.js/dist/long-stack-trace-zone.js',
|
||||
'node_modules/zone.js/dist/proxy.js',
|
||||
'node_modules/zone.js/dist/sync-test.js',
|
||||
'node_modules/zone.js/dist/jasmine-patch.js',
|
||||
'node_modules/zone.js/dist/async-test.js',
|
||||
'node_modules/zone.js/dist/fake-async-test.js',
|
||||
|
||||
// RxJs
|
||||
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
||||
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
|
||||
|
||||
// Paths loaded via module imports:
|
||||
// Angular itself
|
||||
{ pattern: 'node_modules/@angular/**/*.js', included: false, watched: false },
|
||||
{ pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false },
|
||||
|
||||
{ pattern: 'src/demo/systemjs-angular-loader.js', included: false, watched: false },
|
||||
|
||||
'karma-test-shim.js', // optionally extend SystemJS mapping e.g., with barrels
|
||||
|
||||
// transpiled application & spec code paths loaded via module imports
|
||||
{ pattern: libBase + '**/*.js', included: false, watched: true },
|
||||
|
||||
// Asset (HTML & CSS) paths loaded via Angular's component compiler
|
||||
// (these paths need to be rewritten, see proxies section)
|
||||
{ pattern: libBase + '**/*.html', included: false, watched: true },
|
||||
{ pattern: libBase + '**/*.css', included: false, watched: true },
|
||||
|
||||
// Paths for debugging with source maps in dev tools
|
||||
{ pattern: libBase + '**/*.ts', included: false, watched: false },
|
||||
{ pattern: libBase + '**/*.js.map', included: false, watched: false }
|
||||
],
|
||||
|
||||
// Proxied base paths for loading assets
|
||||
proxies: {
|
||||
// required for modules fetched by SystemJS
|
||||
'/base/src/lib/node_modules/': '/base/node_modules/',
|
||||
'/base/src/lib/demo/': '/base/src/demo/'
|
||||
},
|
||||
|
||||
exclude: [],
|
||||
preprocessors: {},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false
|
||||
})
|
||||
}
|
||||
15472
package-lock.json
generated
15472
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
90
package.json
90
package.json
@@ -2,14 +2,16 @@
|
||||
"name": "spring-flo",
|
||||
"version": "0.9.0",
|
||||
"description": "Library for quickly building text DSL visualization diagram editor",
|
||||
"main": "./dist/bundles/spring-flo.umd.js",
|
||||
"module": "./dist/fesm5/spring-flo.js",
|
||||
"es2015": "./dist/fesm2015/spring-flo.js",
|
||||
"esm5": "./dist/esm5/spring-flo.js",
|
||||
"esm2015": "./dist/esm2015/spring-flo.js",
|
||||
"fesm5": "./dist/fesm5/spring-flo.js",
|
||||
"fesm2015": "./dist/fesm2015/spring-flo.js",
|
||||
"typings": "./dist/out-tsc/spring-flo.d.ts",
|
||||
"main": "dist/lib/bundles/spring-flo.umd.js",
|
||||
"module": "dist/lib/fesm5/spring-flo.js",
|
||||
"es2015": "dist/lib/fesm2015/spring-flo.js",
|
||||
"esm5": "dist/lib/esm5/spring-flo.js",
|
||||
"esm2015": "dist/lib/esm2015/spring-flo.js",
|
||||
"fesm5": "dist/lib/fesm5/spring-flo.js",
|
||||
"fesm2015": "dist/lib/fesm2015/spring-flo.js",
|
||||
"typings": "dist/lib/spring-flo.d.ts",
|
||||
"metadata": "dist/lib/spring-flo.metadata.json",
|
||||
"sideEffects": false,
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
@@ -21,46 +23,25 @@
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf out-tsc dist/*",
|
||||
"prebuild": "npm run clean",
|
||||
"build": "node build.js",
|
||||
"build-demo": "tsc -p src/demo/",
|
||||
"build-demo:watch": "tsc -p src/demo/ -w",
|
||||
"serve": "lite-server -c=bs-config.json",
|
||||
"prestart": "npm run build-demo",
|
||||
"start": "concurrently \"npm run build-demo:watch\" \"npm run serve\"",
|
||||
"build-test": "tsc -p src/lib/tsconfig.spec.json",
|
||||
"build-test:watch": "tsc -p src/lib/tsconfig.spec.json -w",
|
||||
"pretest": "npm run build-test",
|
||||
"test": "concurrently \"npm run build-test:watch\" \"karma start karma.conf.js\"",
|
||||
"pretest:once": "npm run build-test",
|
||||
"test:once": "karma start karma.conf.js --single-run",
|
||||
"preintegration": "npm run build && cd integration && npm run clean && npm install",
|
||||
"integration": "npm run integration:aot && npm run integration:jit",
|
||||
"integration:jit": "cd integration && npm run e2e",
|
||||
"integration:aot": "cd integration && npm run e2e:aot",
|
||||
"lint": "tslint ./src/**/*.ts -t verbose",
|
||||
"serve": "ng serve dev",
|
||||
"build:lib": "rimraf dist && ng-packagr -p src/lib/package.json",
|
||||
"build:app": "cpr dist/lib src/demo/spring-flo -d && ng build packaged && rimraf src/demo/spring-flo",
|
||||
"build": "npm run build:lib",
|
||||
"prestart": "npm run build:lib",
|
||||
"start": "npm run serve",
|
||||
"release": "standard-version",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror-minified": "5.49.2",
|
||||
"jointjs": "3.1.0",
|
||||
"ts-disposables": "2.2.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": ">=9.0.0 <10.0.0",
|
||||
"@angular/forms": ">=9.0.0 < 10.0.0",
|
||||
"@angular/common": ">=9.0.0 <10.0.0",
|
||||
"rxjs": ">=6.0.0 <7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "latest",
|
||||
"@angular-devkit/schematics": "9.0.1",
|
||||
"@angular/animations": "9.0.0",
|
||||
"@angular/common": "9.0.0",
|
||||
"@angular/compiler": "9.0.0",
|
||||
"@angular/compiler-cli": "9.0.0",
|
||||
"@angular/core": "9.0.0",
|
||||
"@angular/forms": "9.0.0",
|
||||
"@angular/cli": "9.0.0",
|
||||
"@angular/platform-browser": "9.0.0",
|
||||
"@angular/platform-browser-dynamic": "9.0.0",
|
||||
"@angular/platform-server": "9.0.0",
|
||||
@@ -70,39 +51,20 @@
|
||||
"@types/jquery": "3.3.4",
|
||||
"@types/lodash": "4.14.123",
|
||||
"@types/node": "6.0.46",
|
||||
"camelcase": "4.0.0",
|
||||
"chalk": "2.4.1",
|
||||
"concurrently": "4.0.1",
|
||||
"core-js": "3.6.4",
|
||||
"glob": "7.1.1",
|
||||
"gulp": "3.9.1",
|
||||
"gulp-inline-ng2-template": "5.0.1",
|
||||
"jasmine-core": "2.5.2",
|
||||
"jquery": "3.4.1",
|
||||
"core-js": "^3.6.4",
|
||||
"cpr": "^3.0.1",
|
||||
"jshint": "2.10.2",
|
||||
"karma": "1.5.0",
|
||||
"karma-chrome-launcher": "2.0.0",
|
||||
"karma-cli": "1.0.1",
|
||||
"karma-html-reporter": "0.2.7",
|
||||
"karma-jasmine": "1.1.0",
|
||||
"karma-jasmine-html-reporter": "0.2.2",
|
||||
"lite-server": "2.5.4",
|
||||
"ng-packagr": "9.0.0",
|
||||
"scss-bundle": "^2.5.1",
|
||||
"node-sass": "^4.12.0",
|
||||
"ngx-bootstrap": "5.2.0",
|
||||
"rimraf": "2.6.1",
|
||||
"rollup": "^1.31.0",
|
||||
"rollup-plugin-commonjs": "^10.1.0",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"rollup-plugin-sourcemaps": "^0.5.0",
|
||||
"rxjs": "6.5.4",
|
||||
"shelljs": "0.8.1",
|
||||
"standard-version": "7.0.1",
|
||||
"systemjs": "0.21.4",
|
||||
"tslint": "5.17.0",
|
||||
"typescript": "3.7.5",
|
||||
"uglify-js": "3.6.0",
|
||||
"zone.js": "0.10.2"
|
||||
"zone.js": "0.10.2",
|
||||
|
||||
"codemirror-minified": "5.49.2",
|
||||
"jointjs": "3.1.0",
|
||||
"ts-disposables": "2.2.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
import resolve from 'rollup-plugin-node-resolve';
|
||||
import sourcemaps from 'rollup-plugin-sourcemaps';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
|
||||
/**
|
||||
* Add here external dependencies that actually you use.
|
||||
*
|
||||
* Angular dependencies
|
||||
* - '@angular/animations' => 'ng.animations'
|
||||
* - '@angular/animations/browser': 'ng.animations.browser'
|
||||
* - '@angular/common' => 'ng.common'
|
||||
* - '@angular/compiler' => 'ng.compiler'
|
||||
* - '@angular/core' => 'ng.core'
|
||||
* - '@angular/forms' => 'ng.forms'
|
||||
* - '@angular/common/http' => 'ng.common.http'
|
||||
* - '@angular/platform-browser-dynamic' => 'ng.platformBrowserDynamic'
|
||||
* - '@angular/platform-browser' => 'ng.platformBrowser'
|
||||
* - '@angular/platform-browser/animations' => 'ng.platformBrowser.animations'
|
||||
* - '@angular/platform-server' => 'ng.platformServer'
|
||||
* - '@angular/router' => 'ng.router'
|
||||
*
|
||||
* RxJS dependencies
|
||||
* From RxJS v6 you need only 'rxjs' and 'rxjs.operators'.
|
||||
*
|
||||
* Other dependencies
|
||||
* - Angular libraries: refer to their global namespace
|
||||
* - TypeScript/JavaScript libraries:
|
||||
* e.g. lodash: 'lodash' => 'lodash'
|
||||
*
|
||||
* Also, if the dependency uses CommonJS modules, such as lodash,
|
||||
* you should also use a plugin like rollup-plugin-commonjs,
|
||||
* to explicitly specify unresolvable "named exports".
|
||||
*
|
||||
*/
|
||||
const globals = {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/forms': 'ng.forms',
|
||||
'@angular/platform-browser': 'ng.browser',
|
||||
'rxjs': 'rxjs',
|
||||
'rxjs/operators': 'rxjs.operators',
|
||||
'lodash': 'lodash',
|
||||
'ts-disposables': 'ts-disposables',
|
||||
'codemirror-minified': 'codemirror-minified',
|
||||
'codemirror': 'codemirror-minified',
|
||||
'jointjs': 'jointjs',
|
||||
'jquery': 'jquery',
|
||||
|
||||
// CodeMirror extensions
|
||||
'codemirror-minified/mode/meta': 'codemirror-minified/mode/meta',
|
||||
'codemirror-minified/addon/lint/lint': 'codemirror-minified/addon/lint/lint',
|
||||
'codemirror-minified/addon/hint/show-hint': 'codemirror-minified/addon/hint/show-hint',
|
||||
'codemirror-minified/addon/mode/loadmode': 'codemirror-minified/addon/mode/loadmode',
|
||||
'codemirror-minified/addon/edit/matchbrackets': 'codemirror-minified/addon/edit/matchbrackets',
|
||||
'codemirror-minified/addon/edit/closebrackets': 'codemirror-minified/addon/edit/closebrackets',
|
||||
'codemirror-minified/addon/display/placeholder': 'codemirror-minified/addon/edit/closebrackets',
|
||||
'codemirror-minified/addon/scroll/annotatescrollbar': 'codemirror-minified/addon/scroll/annotatescrollbar',
|
||||
'codemirror-minified/addon/scroll/simplescrollbars': 'codemirror-minified/addon/scroll/simplescrollbars',
|
||||
|
||||
// Lint support
|
||||
// Unclear how to import this dynamically...
|
||||
'codemirror-minified/addon/lint/javascript-lint': 'codemirror-minified/addon/lint/javascript-lint',
|
||||
'codemirror-minified/addon/lint/coffeescript-lint': 'codemirror-minified/addon/lint/coffeescript-lint',
|
||||
'codemirror-minified/addon/lint/json-lint': 'codemirror-minified/addon/lint/json-lint',
|
||||
'codemirror-minified/addon/lint/yaml-lint': 'codemirror-minified/addon/lint/yaml-lint',
|
||||
|
||||
// TODO: use dynamic import with JS7 in the future. CM autoLoad cannot load it properly - thinks its AMD
|
||||
// Supported languages until dynamic loading
|
||||
'codemirror-minified/mode/groovy/groovy': 'codemirror-minified/mode/groovy/groovy',
|
||||
'codemirror-minified/mode/javascript/javascript': 'codemirror-minified/mode/javascript/javascript',
|
||||
'codemirror-minified/mode/python/python': 'codemirror-minified/mode/python/python',
|
||||
'codemirror-minified/mode/ruby/ruby': 'codemirror-minified/mode/ruby/ruby',
|
||||
'codemirror-minified/mode/clike/clike': 'codemirror-minified/mode/clike/clike',
|
||||
'codemirror-minified/mode/yaml/yaml': 'codemirror-minified/mode/yaml/yaml',
|
||||
'codemirror-minified/mode/coffeescript/coffeescript': 'codemirror-minified/mode/coffeescript/coffeescript'
|
||||
|
||||
};
|
||||
|
||||
export default {
|
||||
external: Object.keys(globals),
|
||||
plugins: [resolve(), sourcemaps(), commonjs()],
|
||||
onwarn: () => { return },
|
||||
output: {
|
||||
format: 'umd',
|
||||
name: 'ng.spring-flo',
|
||||
globals: globals,
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
amd: { id: 'spring-flo' }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import sourcemaps from 'rollup-plugin-sourcemaps';
|
||||
|
||||
export default {
|
||||
output: {
|
||||
format: 'es',
|
||||
sourcemap: true
|
||||
},
|
||||
plugins: [
|
||||
sourcemaps()
|
||||
],
|
||||
onwarn: () => { return }
|
||||
}
|
||||
@@ -9,15 +9,15 @@
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
|
||||
<!-- Polyfill(s) for older browsers -->
|
||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||
<!--<script src="node_modules/core-js/client/shim.min.js"></script>-->
|
||||
|
||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||
<!--<script src="node_modules/zone.js/dist/zone.js"></script>-->
|
||||
<!--<script src="node_modules/systemjs/dist/system.src.js"></script>-->
|
||||
|
||||
<script src="systemjs.config.js"></script>
|
||||
<script>
|
||||
System.import('main.js').catch(function(err){ console.error(err); });
|
||||
</script>
|
||||
<!--<script src="systemjs.config.js"></script>-->
|
||||
<!--<script>-->
|
||||
<!--System.import('main.js').catch(function(err){ console.error(err); });-->
|
||||
<!--</script>-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
57
src/demo/polyfills.ts
Normal file
57
src/demo/polyfills.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
/***************************************************************************************************
|
||||
* BROWSER POLYFILLS
|
||||
*/
|
||||
|
||||
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
|
||||
// import 'core-js/es6/symbol';
|
||||
// import 'core-js/es6/object';
|
||||
// import 'core-js/es6/function';
|
||||
// import 'core-js/es6/parse-int';
|
||||
// import 'core-js/es6/parse-float';
|
||||
// import 'core-js/es6/number';
|
||||
// import 'core-js/es6/math';
|
||||
// import 'core-js/es6/string';
|
||||
// import 'core-js/es6/date';
|
||||
// import 'core-js/es6/array';
|
||||
// import 'core-js/es6/regexp';
|
||||
// import 'core-js/es6/map';
|
||||
// import 'core-js/es6/set';
|
||||
|
||||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
||||
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||
|
||||
/** IE10 and IE11 requires the following to support `@angular/animation`. */
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
|
||||
/** Evergreen browsers require these. **/
|
||||
// import 'core-js/es6/reflect';
|
||||
// import 'core-js/es7/reflect';
|
||||
|
||||
|
||||
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
|
||||
|
||||
/***************************************************************************************************
|
||||
* Zone JS is required by Angular itself.
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
|
||||
|
||||
|
||||
/***************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
*/
|
||||
|
||||
/**
|
||||
* Date, currency, decimal and percent pipes.
|
||||
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
|
||||
*/
|
||||
// import 'intl'; // Run `npm install --save intl`.
|
||||
/**
|
||||
* Need to import at least one locale-data with intl.
|
||||
*/
|
||||
// import 'intl/locale-data/jsonp/en';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@import "./../../node_modules/jointjs/dist/joint.core.css";
|
||||
@import "./../../node_modules/codemirror/lib/codemirror.css";
|
||||
@import "./../../node_modules/codemirror/addon/hint/show-hint.css";
|
||||
@import "./../../node_modules/codemirror/addon/lint/lint.css";
|
||||
@import "./../../node_modules/codemirror/addon/scroll/simplescrollbars.css";
|
||||
@import "./../../node_modules/codemirror-minified/lib/codemirror.css";
|
||||
@import "./../../node_modules/codemirror-minified/addon/hint/show-hint.css";
|
||||
@import "./../../node_modules/codemirror-minified/addon/lint/lint.css";
|
||||
@import "./../../node_modules/codemirror-minified/addon/scroll/simplescrollbars.css";
|
||||
|
||||
h1 {
|
||||
color: #369;
|
||||
|
||||
22
src/demo/tsconfig.dev.json
Normal file
22
src/demo/tsconfig.dev.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"angularCompilerOptions": {
|
||||
"paths": {
|
||||
"spring-flo": [ "../lib/index.ts" ]
|
||||
}
|
||||
},
|
||||
"compilerOptions": {
|
||||
"baseUrl": "",
|
||||
"module": "commonjs",
|
||||
"declaration": false,
|
||||
"emitDecoratorMetadata": true,
|
||||
"paths": {
|
||||
"spring-flo": [
|
||||
"../lib/index.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"main-aot.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"angularCompilerOptions": {
|
||||
"paths": {
|
||||
"spring-flo": [ "../../dist/lib" ]
|
||||
}
|
||||
},
|
||||
"compilerOptions": {
|
||||
"baseUrl": "",
|
||||
"module": "commonjs",
|
||||
@@ -7,7 +12,7 @@
|
||||
"emitDecoratorMetadata": true,
|
||||
"paths": {
|
||||
"spring-flo": [
|
||||
"../lib"
|
||||
"../../dist/lib"
|
||||
]
|
||||
}
|
||||
},
|
||||
41
src/lib/package.json
Normal file
41
src/lib/package.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "spring-flo",
|
||||
"version": "0.9.0",
|
||||
"description": "Library for quickly building text DSL visualization diagram editor",
|
||||
"author": "Andy Clement, Alex Boyko",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/spring-projects/spring-flo.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.9.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror-minified": "5.49.2",
|
||||
"jointjs": "3.1.0",
|
||||
"ts-disposables": "2.2.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": ">=9.0.0 <10.0.0",
|
||||
"@angular/forms": ">=9.0.0 < 10.0.0",
|
||||
"@angular/common": ">=9.0.0 <10.0.0",
|
||||
"rxjs": ">=6.0.0 <7.0.0"
|
||||
},
|
||||
"ngPackage": {
|
||||
"assets": [
|
||||
"styles.scss"
|
||||
],
|
||||
"lib": {
|
||||
"entryFile": "./index.ts"
|
||||
},
|
||||
"whitelistedNonPeerDependencies": [
|
||||
"codemirror-minified",
|
||||
"jointjs",
|
||||
"ts-disposables"
|
||||
],
|
||||
"dest": "../../dist/lib",
|
||||
"deleteDestPath": true
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"rootDir": "./lib",
|
||||
"baseUrl": "./lib",
|
||||
"paths": {
|
||||
"@angular/*": [
|
||||
"../../node_modules/@angular/*"
|
||||
],
|
||||
"@rxjs/*": [
|
||||
"../../node_modules/rxjs/*"
|
||||
]
|
||||
},
|
||||
"outDir": "../out-tsc",
|
||||
"declaration": true,
|
||||
"strict": true,
|
||||
"strictPropertyInitialization": false,
|
||||
"moduleResolution": "node",
|
||||
"module": "es2015",
|
||||
"target": "es2015",
|
||||
"lib": [
|
||||
"es2015",
|
||||
"dom"
|
||||
],
|
||||
"skipLibCheck": true,
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
"src/lib/@types"
|
||||
],
|
||||
"types": [],
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"importHelpers": true,
|
||||
"strictNullChecks": false
|
||||
},
|
||||
"include": [
|
||||
"./lib/**/*",
|
||||
"../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"enableResourceInlining": false,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"flatModuleOutFile": "./spring-flo.js",
|
||||
"flatModuleId": "spring-flo",
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
"node_modules/@types",
|
||||
"src/lib/@types"
|
||||
],
|
||||
"strictNullChecks":false
|
||||
"strictNullChecks":false,
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user