froggy-docs 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/froggy-docs CHANGED
Binary file
@@ -0,0 +1,81 @@
1
+ (function() {
2
+ var _currentDirectory = (function () {
3
+ var _url;
4
+ var lines = new Error().stack.split('\n');
5
+ function lookupUrl() {
6
+ if (lines.length > 2) {
7
+ var match = lines[1].match(/^\s+at (.+):\d+:\d+$/);
8
+ // Chrome.
9
+ if (match) return match[1];
10
+ // Chrome nested eval case.
11
+ match = lines[1].match(/^\s+at eval [(](.+):\d+:\d+[)]$/);
12
+ if (match) return match[1];
13
+ // Edge.
14
+ match = lines[1].match(/^\s+at.+\((.+):\d+:\d+\)$/);
15
+ if (match) return match[1];
16
+ // Firefox.
17
+ match = lines[0].match(/[<][@](.+):\d+:\d+$/)
18
+ if (match) return match[1];
19
+ }
20
+ // Safari.
21
+ return lines[0].match(/[@](.+):\d+:\d+$/)[1];
22
+ }
23
+ _url = lookupUrl();
24
+ var lastSlash = _url.lastIndexOf('/');
25
+ if (lastSlash == -1) return _url;
26
+ var currentDirectory = _url.substring(0, lastSlash + 1);
27
+ return currentDirectory;
28
+ })();
29
+
30
+ var baseUrl = (function () {
31
+ // Attempt to detect --precompiled mode for tests, and set the base url
32
+ // appropriately, otherwise set it to '/'.
33
+ var pathParts = location.pathname.split("/");
34
+ if (pathParts[0] == "") {
35
+ pathParts.shift();
36
+ }
37
+ if (pathParts.length > 1 && pathParts[1] == "test") {
38
+ return "/" + pathParts.slice(0, 2).join("/") + "/";
39
+ }
40
+ // Attempt to detect base url using <base href> html tag
41
+ // base href should start and end with "/"
42
+ if (typeof document !== 'undefined') {
43
+ var el = document.getElementsByTagName('base');
44
+ if (el && el[0] && el[0].getAttribute("href") && el[0].getAttribute
45
+ ("href").startsWith("/") && el[0].getAttribute("href").endsWith("/")){
46
+ return el[0].getAttribute("href");
47
+ }
48
+ }
49
+ // return default value
50
+ return "/";
51
+ }());
52
+
53
+
54
+ var mapperUri = baseUrl + "packages/build_web_compilers/src/dev_compiler_stack_trace/stack_trace_mapper.dart.js";
55
+ var requireUri = baseUrl +
56
+ "packages/build_web_compilers/src/dev_compiler/require.js";
57
+ var mainUri = _currentDirectory + "main.client.dart.bootstrap";
58
+
59
+ if (typeof document != 'undefined') {
60
+ var el = document.createElement("script");
61
+ el.defer = true;
62
+ el.async = false;
63
+ el.src = mapperUri;
64
+ document.head.appendChild(el);
65
+
66
+ el = document.createElement("script");
67
+ el.defer = true;
68
+ el.async = false;
69
+ el.src = requireUri;
70
+ el.setAttribute("data-main", mainUri);
71
+ document.head.appendChild(el);
72
+ } else {
73
+ importScripts(mapperUri, requireUri);
74
+ require.config({
75
+ baseUrl: baseUrl,
76
+ });
77
+ // TODO: update bootstrap code to take argument - dart-lang/build#1115
78
+ window = self;
79
+ require([mainUri + '.js']);
80
+ }
81
+ })();
@@ -9,8 +9,6 @@ import 'package:path/path.dart' as p;
9
9
  const defaultPort = 8080;
10
10
 
11
11
  Future<void> startServer({int port = defaultPort}) async {
12
- _debugPaths();
13
-
14
12
  final handler = const Pipeline()
15
13
  .addMiddleware(logRequests())
16
14
  .addHandler(_router.call);
@@ -39,13 +37,6 @@ String get deployDir => p.join(_packageDir, 'frontend', 'deploy', 'web');
39
37
 
40
38
  String get userWebDir => p.join(Directory.current.path, 'frontend', 'web');
41
39
 
42
- void _debugPaths() {
43
- print('DEBUG: packageDir = $_packageDir');
44
- print('DEBUG: webDir = $webDir');
45
- print('DEBUG: userWebDir = $userWebDir');
46
- print('DEBUG: currentDir = ${Directory.current.path}');
47
- }
48
-
49
40
  Router get _router {
50
41
  final router = Router();
51
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "froggy-docs",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Auto-generate API documentation from code annotations. Works with any programming language.",
5
5
  "author": "Kaung Mrat Thu <kaungmyatthuu.dev@gmail.com>",
6
6
  "homepage": "https://github.com/Kaung-Myat/froggydocs",