mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-04 07:02:12 +03:00
deprecate non-styled modules
This commit is contained in:
parent
42d3c57a8a
commit
6f466c349a
6
Makefile
6
Makefile
@ -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:
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user