Update pubspec and changelog for 4.0.0 (#2823)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc05b44..34554d2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,15 @@
+## 4.0.0
+* BREAKING CHANGE: Refactors to support NNBD and adapt to new analyzer 
+  changes are technically semver breaking.   If you make extensive use of
+  the `documentationComment` getter on `ModelElement` or other deep
+  structural elements in dartdoc or custom templates, they could break
+  dependent code.  (#2819, #2818, #2817, #2806, #2798)
+* BREAKING CHANGE: Remove a large number of long-standing deprecated
+  symbols in dartdoc. (#2821)
+* Fix a problem where certain comment reference strings could
+  crash the parser. (#2813, #2808)
+* Fix an assert in canonicalization for enums. (#2812)
+
 ## 3.1.0
 * This version supports the Dart language feature constructor tearoffs,
   pending completion by other tools.
diff --git a/dartdoc_options.yaml b/dartdoc_options.yaml
index e9b9acf..71e9748 100644
--- a/dartdoc_options.yaml
+++ b/dartdoc_options.yaml
@@ -1,4 +1,4 @@
 dartdoc:
   linkToSource:
     root: '.'
-    uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v3.1.0/%f%#L%l%'
+    uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v4.0.0/%f%#L%l%'
diff --git a/lib/src/version.dart b/lib/src/version.dart
index d006dce..66803ec 100644
--- a/lib/src/version.dart
+++ b/lib/src/version.dart
@@ -1,2 +1,2 @@
 // Generated code. Do not modify.
-const packageVersion = '3.1.0';
+const packageVersion = '4.0.0';
diff --git a/pubspec.yaml b/pubspec.yaml
index e563174..7603d6f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,17 +1,17 @@
 name: dartdoc
 # Run `grind build` after updating.
-version: 3.1.0
+version: 4.0.0
 description: A non-interactive HTML documentation generator for Dart source code.
 homepage: https://github.com/dart-lang/dartdoc
 environment:
   sdk: '>=2.11.99 <3.0.0'
 
 dependencies:
-  analyzer: ^2.3.0
+  analyzer: ^2.4.0
   args: ^2.3.0
   charcode: ^1.3.1
   collection: ^1.15.0
-  cli_util: ^0.3.3
+  cli_util: ^0.3.4
   crypto: ^3.0.1
   glob: ^2.0.1
   html: ^0.15.0
@@ -32,10 +32,10 @@
   build_version: ^2.1.0
   code_builder: ^4.1.0
   coverage: ^1.0.3
-  dart_style: ^2.1.0
+  dart_style: ^2.2.0
   grinder: ^0.9.0
   http: ^0.13.3
-  pedantic: ^1.11.1
+  lints: ^1.0.1
   test: ^1.17.12
 
 executables: