deprecate non-styled modules

This commit is contained in:
Brian Hicks 2019-12-05 20:58:17 -06:00
parent 42d3c57a8a
commit 6f466c349a
2 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,5 @@
SHELL:=env PATH=${PATH} /bin/sh
export DEPRECATED_MODULES=Html,Accessibility,Accessibility.Aria,Accessibility.Key,Accessibility.Landmark,Accessibility.Live,Accessibility.Role,Accessibility.Style,Accessibility.Widget
.PHONY: test
test: node_modules
@ -22,10 +23,13 @@ percy-tests:
tests/deprecated-imports-report.txt: $(shell find src -type f) script/deprecated-imports.py
script/deprecated-imports.py report > $@
script/deprecated-imports.csv: $(shell find src -type f) script/deprecated-imports.py
script/deprecated-imports.py --imports-file $@ update
.PHONY: deprecated-imports-report
deprecated-imports-report: tests/deprecated-imports-report.txt script/deprecated-imports.py
@cat tests/deprecated-imports-report.txt
@script/deprecated-imports.py check
@script/deprecated-imports.py --check-message-fix-command='make script/deprecated-imports.csv' check
.PHONY: checks
checks:

View File

@ -60,10 +60,15 @@ class NriUiModules:
class Import:
"""a single import."""
DEPRECATED = "DEPRECATED"
def __init__(self, filename, name, version):
self.filename = filename
self.name = name
self.version = int(version)
try:
self.version = int(version)
except ValueError: # DEPRECATED
self.version = self.DEPRECATED
def to_dict(self):
return {"filename": self.filename, "name": self.name, "version": self.version}
@ -359,7 +364,7 @@ def parser():
'--deprecate',
help="explicitly deprecate a module by name",
action="append",
default=[],
default=[m for m in os.environ.get("DEPRECATED_MODULES", "").split(",") if m],
)
sub = out.add_subparsers()