Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
fix(autoprefixer): update autoprefixer and resolve warnings due to ch…
Browse files Browse the repository at this point in the history
…anged options

- update dependencies and fix npm audit warnings
- add types for glob
- update license copyright
- updates for the latest versions of AngularJS Material
- fix test-versions to workaround incompatibility with AngularJS Material 1.1.19
- update travis to NodeJS 12
- fix typos
- add CircleCI config

Fixes #39
  • Loading branch information
Splaktar committed Feb 7, 2020
1 parent 512fab7 commit 89a5b97
Show file tree
Hide file tree
Showing 13 changed files with 794 additions and 660 deletions.
136 changes: 136 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Configuration file for https://circleci.com/gh/angular/material

# Note: YAML anchors allow an object to be re-used, reducing duplication.
# The ampersand declares an alias for an object, then later the `<<: *name`
# syntax dereferences it.
# See http://blog.daemonl.com/2016/02/yaml.html
# To validate changes, use an online parser, eg. http://yaml-online-parser.appspot.com/

var_1: &docker_image circleci/node:10.18.0-browsers
var_2: &cache_key material-tools-{{ checksum "package-lock.json" }}

# Settings common to each job
var_3: &job_defaults
working_directory: ~/ng
docker:
- image: *docker_image

# Job step for checking out the source code from GitHub. This also ensures that the source code
# is rebased on top of master.
var_4: &checkout_code
checkout:
# After checkout, rebase on top of master. By default, PRs are not rebased on top of master,
# which we want. See https://discuss.circleci.com/t/1662
post: git pull --ff-only origin "refs/pull/${CIRCLE_PULL_REQUEST//*pull\//}/merge"

# Restores the cache that could be available for the current lock file. The cache
# includes the node modules.
var_5: &restore_cache
restore_cache:
key: *cache_key

# Saves the cache for the current lock file. We store the node modules cache in order to make
# subsequent builds faster.
var_6: &save_cache
save_cache:
key: *cache_key
paths:
- "node_modules"
- "$HOME/.npm"
- "tmp/angular.js"

# Job step that ensures that the node module dependencies are installed and up-to-date. We use
# NPM with the frozen lockfile option in order to make sure that lock file and package.json are
# in sync. Unlike in Travis, we don't need to manually purge the node modules if stale because
# CircleCI automatically discards the cache if the checksum of the lock file has changed.
var_7: &npm_install
run: npm ci

var_8: &rebuild_node_sass
run: npm rebuild node-sass

var_9: &store_junit_test_results
store_test_results:
path: ./artifacts/junit

# -----------------------------
# Container version of CircleCI
# -----------------------------
version: 2

# -----------------------------------------------------------------------------------------
# Job definitions. Jobs which are defined just here, will not run automatically. Each job
# must be part of a workflow definition in order to run for PRs and push builds.
# -----------------------------------------------------------------------------------------
jobs:

# ----------------------------------
# Lint job. Runs the lint task.
# ----------------------------------
lint:
<<: *job_defaults
steps:
- *checkout_code
- *restore_cache
- *npm_install
- *rebuild_node_sass
- run: npm run tslint

# -----------------------------------
# Build and test job.
# -----------------------------------
build:
<<: *job_defaults
steps:
- *checkout_code
- *restore_cache
- *npm_install
- *rebuild_node_sass
- run: npm run build
- *save_cache

# ------------------------------------------------------------------------------------------
# Jobs that run the unit tests on locally installed browsers (Chrome and Firefox headless).
# The available browsers are included in the Docker image.
# ------------------------------------------------------------------------------------------
test:
<<: *job_defaults
steps:
- *checkout_code
- *restore_cache
- *npm_install
- run: npm run test
- *store_junit_test_results

test_versions:
<<: *job_defaults
steps:
- *checkout_code
- *restore_cache
- *npm_install
- run: npm run test:versions
- *store_junit_test_results

# ----------------------------------------------------------------------------------------
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
# one job depends on another.
# ----------------------------------------------------------------------------------------
workflows:
version: 2

# Lint workflow. As we want to lint in one job, this is a workflow with just one job.
lint:
jobs:
- lint

# Build and test workflow. A workflow includes multiple jobs that run in parallel. All jobs
# that build and test source code should be part of this workflow.
build_and_test:
jobs:
- build
- test:
requires:
- build
- test_versions:
requires:
- build
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
sudo: false
node_js:
- '10'
- '12'

branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2014-2018 Google LLC. https://angularjs.org
Copyright (c) 2014-2020 Google LLC. https://angularjs.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Logger} from './lib/common/Logger';

let tools = new MaterialTools({
destination: './tmp',
version: '1.1.1',
version: '1.1.21',
modules: ['button', 'list', 'datepicker'],
theme: {
primaryPalette: 'darkerRed',
Expand Down
2 changes: 1 addition & 1 deletion lib/builders/CSSBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class CSSBuilder {


let prefixer = autoprefixer({
browsers: ['last 2 versions', 'last 4 Android versions']
overrideBrowserslist: ['last 2 versions', 'last 4 Android versions']
});

return postcss(prefixer).process(compiled).css;
Expand Down
2 changes: 0 additions & 2 deletions lib/builders/MaterialBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export class MaterialBuilder {

constructor(protected _options: MaterialToolsOptions) {
this._outputBase = path.join(this._options.destination, this._options.destinationFilename);


}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/builders/ThemeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class ThemeBuilder {
const basePalette = palette.extends;

// Sanitize the palette to fulfill the $mdTheming service requirements
this._sanitizePalette(palette);
ThemeBuilder._sanitizePalette(palette);

palette = this._$mdThemingProvider.extendPalette(basePalette, palette);
}
Expand All @@ -119,7 +119,7 @@ export class ThemeBuilder {
* Sanitizes the palette definition from unnecessary overflow, which can lead to errors in the
* $mdTheming service.
*/
private _sanitizePalette(palette: MdPalette) {
private static _sanitizePalette(palette: MdPalette) {
delete palette.extends;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/common/VersionDownloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class VersionDownloader {
.on('finish', () => {
resolve(destination);
stream.destroy();
Logger.info(`Downloaded ${url} successfuly.`);
Logger.info(`Downloaded ${url} successfully.`);
});
} else {
reject(`Failed to download ${url}. Status code: ${response.statusCode}.`);
Expand Down

0 comments on commit 89a5b97

Please sign in to comment.