Socket
Socket
Sign inDemoInstall

polymer-project-config

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polymer-project-config - npm Package Compare versions

Comparing version 3.13.0 to 3.14.0

lib/builds.js.map

12

CHANGELOG.md

@@ -11,2 +11,14 @@ # Change Log

## [3.14.0] - 2018-05-03
* Dropped support for node v6. This is a soft break, as we aren't
making any changes that are known to break node v6, but we're no longer testing against it. See our [node version support policy](https://www.polymer-project.org/2.0/docs/tools/node-support)
for details.
* Removed the `transformImportMeta` option, because it is now always coupled
with the `transformModulesToAmd` option.
* The `import.meta` transform now depends on the special `"meta"` dependency
provided by
[@polymer/esm-amd-loader](https://github.com/Polymer/tools/tree/master/packages/esm-amd-loader),
instead of injecting a static path. As a result, it is now always coupled with
the AMD transform, and cannot be enabled independently.
## [3.13.0] - 2018-04-03

@@ -13,0 +25,0 @@ * [breaking] Rename `build` option from `js.transformEsModulesToAmd` to `js.transformModulesToAmd`.

9

lib/builds.d.ts

@@ -14,2 +14,4 @@ /**

*/
import { BrowserCapability } from 'browser-capabilities';
export declare type JsCompileTarget = 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018';
export interface ProjectBuildOptions {

@@ -118,3 +120,4 @@ /**

/** Use babel to compile all ES6 JS down to ES5 for older browsers. */
compile?: boolean | {
compile?: boolean | JsCompileTarget | {
target?: JsCompileTarget;
/** JavaScript files listed here will not be compiled. */

@@ -125,4 +128,2 @@ exclude?: string[];

transformModulesToAmd?: boolean;
/** Rewrite `import.meta` expressions to objects with inline URLs. */
transformImportMeta?: boolean;
};

@@ -139,3 +140,3 @@ /**

*/
browserCapabilities?: string[];
browserCapabilities?: BrowserCapability[];
/**

@@ -142,0 +143,0 @@ * Update the entrypoint's `<base>` tag, to support serving this build from a

@@ -21,3 +21,7 @@ "use strict";

name: 'es5-bundled',
js: { minify: true, compile: true },
js: {
minify: true,
compile: 'es5',
transformModulesToAmd: true,
},
css: { minify: true },

@@ -35,3 +39,7 @@ html: { minify: true },

browserCapabilities: ['es2015'],
js: { minify: true, compile: false },
js: {
minify: true,
compile: 'es2015',
transformModulesToAmd: true,
},
css: { minify: true },

@@ -49,3 +57,7 @@ html: { minify: true },

browserCapabilities: ['es2015', 'push'],
js: { minify: true, compile: false },
js: {
minify: true,
compile: 'es2015',
transformModulesToAmd: true,
},
css: { minify: true },

@@ -58,2 +70,28 @@ html: { minify: true },

],
[
'uncompiled-bundled',
{
name: 'es6-bundled',
browserCapabilities: ['es2018'],
js: { minify: true },
css: { minify: true },
html: { minify: true },
bundle: true,
addServiceWorker: true,
addPushManifest: false,
}
],
[
'uncompiled-unbundled',
{
name: 'es6-unbundled',
browserCapabilities: ['es2018', 'push'],
js: { minify: true },
css: { minify: true },
html: { minify: true },
bundle: false,
addServiceWorker: true,
addPushManifest: true,
}
],
]);

@@ -86,1 +124,2 @@ function isValidPreset(presetName) {

exports.applyBuildPreset = applyBuildPreset;
//# sourceMappingURL=builds.js.map
import { ProjectBuildOptions } from './builds';
import { FsUrlLoader, PackageUrlResolver, WarningFilter, Analyzer } from 'polymer-analyzer';
export { ProjectBuildOptions, applyBuildPreset } from './builds';
export { ProjectBuildOptions, JsCompileTarget, applyBuildPreset } from './builds';
/**

@@ -5,0 +5,0 @@ * The default globs for matching all user application source files.

@@ -24,2 +24,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const fs = require("fs");

@@ -78,2 +79,3 @@ const jsonschema = require("jsonschema");

*/
// tslint:disable-next-line: no-any User input represented as any.
function fixDeprecatedOptions(options) {

@@ -332,22 +334,22 @@ if (typeof options.sourceGlobs !== 'undefined') {

if (this.entrypoint) {
console.assert(this.entrypoint.startsWith(this.root), `${validateErrorPrefix}: entrypoint (${this.entrypoint}) ` +
assert(this.entrypoint.startsWith(this.root), `${validateErrorPrefix}: entrypoint (${this.entrypoint}) ` +
`does not resolve within root (${this.root})`);
}
if (this.shell) {
console.assert(this.shell.startsWith(this.root), `${validateErrorPrefix}: shell (${this.shell}) ` +
assert(this.shell.startsWith(this.root), `${validateErrorPrefix}: shell (${this.shell}) ` +
`does not resolve within root (${this.root})`);
}
this.fragments.forEach((f) => {
console.assert(f.startsWith(this.root), `${validateErrorPrefix}: a "fragments" path (${f}) ` +
assert(f.startsWith(this.root), `${validateErrorPrefix}: a "fragments" path (${f}) ` +
`does not resolve within root (${this.root})`);
});
this.sources.forEach((s) => {
console.assert(getPositiveGlob(s).startsWith(this.root), `${validateErrorPrefix}: a "sources" path (${s}) ` +
assert(getPositiveGlob(s).startsWith(this.root), `${validateErrorPrefix}: a "sources" path (${s}) ` +
`does not resolve within root (${this.root})`);
});
this.extraDependencies.forEach((d) => {
console.assert(getPositiveGlob(d).startsWith(this.root), `${validateErrorPrefix}: an "extraDependencies" path (${d}) ` +
assert(getPositiveGlob(d).startsWith(this.root), `${validateErrorPrefix}: an "extraDependencies" path (${d}) ` +
`does not resolve within root (${this.root})`);
});
console.assert(moduleResolutionStrategies.has(this.moduleResolution), `${validateErrorPrefix}: "moduleResolution" must be one of: ` +
assert(moduleResolutionStrategies.has(this.moduleResolution), `${validateErrorPrefix}: "moduleResolution" must be one of: ` +
`${[...moduleResolutionStrategies].join(', ')}.`);

@@ -357,3 +359,3 @@ // TODO(fks) 11-14-2016: Validate that files actually exist in the

if (this.builds) {
console.assert(Array.isArray(this.builds), `${validateErrorPrefix}: "builds" (${this.builds}) ` +
assert(Array.isArray(this.builds), `${validateErrorPrefix}: "builds" (${this.builds}) ` +
`expected an array of build configurations.`);

@@ -365,7 +367,7 @@ if (this.builds.length > 1) {

const buildPreset = build.preset;
console.assert(!buildPreset || builds_1.isValidPreset(buildPreset), `${validateErrorPrefix}: "${buildPreset}" is not a valid ` +
assert(!buildPreset || builds_1.isValidPreset(buildPreset), `${validateErrorPrefix}: "${buildPreset}" is not a valid ` +
` "builds" preset.`);
console.assert(buildName, `${validateErrorPrefix}: all "builds" require ` +
assert(buildName, `${validateErrorPrefix}: all "builds" require ` +
`a "name" property when there are multiple builds defined.`);
console.assert(!buildNames.has(buildName), `${validateErrorPrefix}: "builds" duplicate build name ` +
assert(!buildNames.has(buildName), `${validateErrorPrefix}: "builds" duplicate build name ` +
`"${buildName}" found. Build names must be unique.`);

@@ -388,2 +390,6 @@ buildNames.add(buildName);

}
const isWindows = process.platform === 'win32';
const normalizePath = isWindows ?
(path) => path.replace(/\\/g, '/') :
(path) => path;
const obj = {

@@ -393,9 +399,9 @@ entrypoint: globRelative(this.root, this.entrypoint),

fragments: this.fragments.map((absolutePath) => {
return globRelative(this.root, absolutePath);
return normalizePath(globRelative(this.root, absolutePath));
}),
sources: this.sources.map((absolutePath) => {
return globRelative(this.root, absolutePath);
return normalizePath(globRelative(this.root, absolutePath));
}),
extraDependencies: this.extraDependencies.map((absolutePath) => {
return globRelative(this.root, absolutePath);
return normalizePath(globRelative(this.root, absolutePath));
}),

@@ -440,1 +446,2 @@ builds: this.builds,

}
//# sourceMappingURL=index.js.map
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"JsCompileTarget": {
"enum": [
"es2015",
"es2016",
"es2017",
"es2018",
"es5"
],
"type": "string"
},
"LintOptions": {

@@ -64,2 +74,11 @@ "properties": {

"items": {
"enum": [
"es2015",
"es2016",
"es2017",
"es2018",
"modules",
"push",
"serviceworker"
],
"type": "string"

@@ -178,2 +197,5 @@ },

"type": "array"
},
"target": {
"$ref": "#/definitions/JsCompileTarget"
}

@@ -184,3 +206,11 @@ },

{
"type": "boolean"
"enum": [
"es2015",
"es2016",
"es2017",
"es2018",
"es5",
false,
true
]
}

@@ -210,6 +240,2 @@ ],

},
"transformImportMeta": {
"description": "Rewrite `import.meta` expressions to objects with inline URLs.",
"type": "boolean"
},
"transformModulesToAmd": {

@@ -216,0 +242,0 @@ "description": "Transform ES modules to AMD modules.",

{
"name": "polymer-project-config",
"version": "3.13.0",
"version": "3.14.0",
"description": "reads, validates, and shapes your polymer.json project configuration",
"homepage": "https://github.com/Polymer/polymer-project-config#readme",
"repository": "github:Polymer/tools",
"bugs": "https://github.com/Polymer/tools/issues",
"license": "BSD-3-Clause",
"author": "The Polymer Project Authors",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"author": "The Polymer Project Authors",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "git+https://github.com/Polymer/polymer-project-config.git"
},
"bugs": {
"url": "https://github.com/Polymer/polymer-project-config/issues"
},
"homepage": "https://github.com/Polymer/polymer-project-config#readme",
"scripts": {
"build": "tsc && typescript-json-schema src/index.ts ProjectOptions --ignoreErrors -o lib/schema.json",
"test": "npm run build && mocha --ui tdd",
"format": "find src test \\( -iname '*.ts' -o -iname '*.js' \\) | xargs clang-format --style=file -i"
"test": "npm run build && mocha \"test/**/*_test.js\"",
"test:unit": "mocha \"test/**/*_test.js\"",
"format": "find src test \\( -iname \"*.ts\" -o -iname \"*.js\" \\) | xargs clang-format --style=file -i"
},
"dependencies": {
"@types/node": "^6.0.41",
"@types/node": "^9.6.4",
"browser-capabilities": "^1.0.0",
"jsonschema": "^1.1.1",

@@ -29,12 +26,16 @@ "minimatch-all": "^1.1.0",

"devDependencies": {
"@types/chai": "^4.0.2",
"@types/mocha": "^2.2.41",
"chai": "^3.5.0",
"clang-format": "1.0.49",
"mocha": "^3.0.2",
"polymer-analyzer": "^3.0.0-pre.22",
"source-map-support": "^0.5.5",
"tslint": "^5.9.1",
"typescript": "^2.0.2",
"typescript-json-schema": "^0.9.0",
"clang-format": "1.0.49",
"polymer-analyzer": "^3.0.0-pre.17 || ^3.0.0"
"typescript-json-schema": "^0.9.0"
},
"peerDependencies": {
"polymer-analyzer": "^3.0.0-pre.17 || ^3.0.0"
"polymer-analyzer": "^3.0.0-pre.22"
}
}

@@ -15,2 +15,6 @@ /**

import {BrowserCapability} from 'browser-capabilities';
export type JsCompileTarget = 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018';
export interface ProjectBuildOptions {

@@ -135,3 +139,4 @@ /**

/** Use babel to compile all ES6 JS down to ES5 for older browsers. */
compile?: boolean|{
compile?: boolean|JsCompileTarget|{
target?: JsCompileTarget;
/** JavaScript files listed here will not be compiled. */

@@ -143,5 +148,2 @@ exclude?: string[],

transformModulesToAmd?: boolean,
/** Rewrite `import.meta` expressions to objects with inline URLs. */
transformImportMeta?: boolean;
};

@@ -159,3 +161,3 @@

*/
browserCapabilities?: string[];
browserCapabilities?: BrowserCapability[];

@@ -180,3 +182,7 @@ /**

name: 'es5-bundled',
js: {minify: true, compile: true},
js: {
minify: true,
compile: 'es5',
transformModulesToAmd: true,
},
css: {minify: true},

@@ -194,3 +200,7 @@ html: {minify: true},

browserCapabilities: ['es2015'],
js: {minify: true, compile: false},
js: {
minify: true,
compile: 'es2015',
transformModulesToAmd: true,
},
css: {minify: true},

@@ -208,3 +218,7 @@ html: {minify: true},

browserCapabilities: ['es2015', 'push'],
js: {minify: true, compile: false},
js: {
minify: true,
compile: 'es2015',
transformModulesToAmd: true,
},
css: {minify: true},

@@ -217,2 +231,28 @@ html: {minify: true},

],
[
'uncompiled-bundled',
{
name: 'es6-bundled',
browserCapabilities: ['es2018'],
js: {minify: true},
css: {minify: true},
html: {minify: true},
bundle: true,
addServiceWorker: true,
addPushManifest: false,
}
],
[
'uncompiled-unbundled',
{
name: 'es6-unbundled',
browserCapabilities: ['es2018', 'push'],
js: {minify: true},
css: {minify: true},
html: {minify: true},
bundle: false,
addServiceWorker: true,
addPushManifest: true,
}
],
]);

@@ -219,0 +259,0 @@

@@ -15,2 +15,3 @@ /**

import * as assert from 'assert';
import * as fs from 'fs';

@@ -24,3 +25,3 @@ import * as jsonschema from 'jsonschema';

export {ProjectBuildOptions, applyBuildPreset} from './builds';
export {ProjectBuildOptions, JsCompileTarget, applyBuildPreset} from './builds';

@@ -77,2 +78,3 @@ const logger = logging.getLogger('polymer-project-config');

*/
// tslint:disable-next-line: no-any User input represented as any.
function fixDeprecatedOptions(options: any): ProjectOptions {

@@ -474,3 +476,3 @@ if (typeof options.sourceGlobs !== 'undefined') {

if (this.entrypoint) {
console.assert(
assert(
this.entrypoint.startsWith(this.root),

@@ -481,3 +483,3 @@ `${validateErrorPrefix}: entrypoint (${this.entrypoint}) ` +

if (this.shell) {
console.assert(
assert(
this.shell.startsWith(this.root),

@@ -488,3 +490,3 @@ `${validateErrorPrefix}: shell (${this.shell}) ` +

this.fragments.forEach((f) => {
console.assert(
assert(
f.startsWith(this.root),

@@ -495,3 +497,3 @@ `${validateErrorPrefix}: a "fragments" path (${f}) ` +

this.sources.forEach((s) => {
console.assert(
assert(
getPositiveGlob(s).startsWith(this.root),

@@ -502,3 +504,3 @@ `${validateErrorPrefix}: a "sources" path (${s}) ` +

this.extraDependencies.forEach((d) => {
console.assert(
assert(
getPositiveGlob(d).startsWith(this.root),

@@ -508,3 +510,3 @@ `${validateErrorPrefix}: an "extraDependencies" path (${d}) ` +

});
console.assert(
assert(
moduleResolutionStrategies.has(this.moduleResolution),

@@ -518,3 +520,3 @@ `${validateErrorPrefix}: "moduleResolution" must be one of: ` +

if (this.builds) {
console.assert(
assert(
Array.isArray(this.builds),

@@ -529,11 +531,11 @@ `${validateErrorPrefix}: "builds" (${this.builds}) ` +

const buildPreset = build.preset;
console.assert(
assert(
!buildPreset || isValidPreset(buildPreset),
`${validateErrorPrefix}: "${buildPreset}" is not a valid ` +
` "builds" preset.`);
console.assert(
assert(
buildName,
`${validateErrorPrefix}: all "builds" require ` +
`a "name" property when there are multiple builds defined.`);
console.assert(
assert(
!buildNames.has(buildName!),

@@ -560,2 +562,6 @@ `${validateErrorPrefix}: "builds" duplicate build name ` +

}
const isWindows = process.platform === 'win32';
const normalizePath = isWindows ?
(path: string) => path.replace(/\\/g, '/') :
(path: string) => path;
const obj = {

@@ -565,9 +571,9 @@ entrypoint: globRelative(this.root, this.entrypoint),

fragments: this.fragments.map((absolutePath) => {
return globRelative(this.root, absolutePath);
return normalizePath(globRelative(this.root, absolutePath));
}),
sources: this.sources.map((absolutePath) => {
return globRelative(this.root, absolutePath);
return normalizePath(globRelative(this.root, absolutePath));
}),
extraDependencies: this.extraDependencies.map((absolutePath) => {
return globRelative(this.root, absolutePath);
return normalizePath(globRelative(this.root, absolutePath));
}),

@@ -597,3 +603,3 @@ builds: this.builds,

return schema;
}
};
})();

@@ -600,0 +606,0 @@

{
"extends": "../../tsconfig-base.json",
"compilerOptions": {
"target": "es6",
"lib": ["es2016"],
"module": "commonjs",
"moduleResolution": "node",
"isolatedModules": false,
"declaration": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitAny": true,
"removeComments": false,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": false,
"strictNullChecks": true,
"outDir": "lib",
"rootDir": "src"
"strictPropertyInitialization": false,
"outDir": "./lib"
},
"include": [
"custom_typings/**/*.ts",
"custom_typings/**/*.d.ts",
"src/**/*.ts"
]
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc