<commit_before>// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import '../templates.dart';
import 'common.dart' as common;

/// A generator for a uber-simple web application.
class WebSimpleGenerator extends DefaultGenerator {
  WebSimpleGenerator()
      : super('web-simple', 'Bare-bones Web App',
            'A web app that uses only core Dart libraries.',
            categories: const ['dart', 'web']) {
    addFile('.gitignore', common.gitignore);
    addFile('analysis_options.yaml', common.analysisOptions);
    addFile('CHANGELOG.md', common.changelog);
    addFile('pubspec.yaml', _pubspec);
    addFile('README.md', _readme);
    addFile('web/index.html', _index);
    setEntrypoint(
      addFile('web/main.dart', _main),
    );
    addFile('web/styles.css', _styles);
  }
}

final String _pubspec = '''
name: __projectName__
description: An absolute bare-bones web app.
version: 1.0.0
# homepage: https://www.example.com

environment:
  sdk: '>=2.10.0 <3.0.0'

# dependencies:
#   path: ^1.7.0

dev_dependencies:
  build_runner: ^1.10.0
  build_web_compilers: ^2.11.0
  pedantic: ^1.9.0
''';

final String _readme = '''
An absolute bare-bones web app.
''';

final String _index = '''
<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="scaffolded-by" content="https://github.com/dart-lang/sdk">
    <title>__projectName__</title>
    <link rel="stylesheet" href="styles.css">
    <script defer src="main.dart.js"></script>
</head>

<body>

  <div id="output"></div>

</body>
</html>
''';

final String _main = '''
import 'dart:html';

void main() {
  querySelector('#output').text = 'Your Dart app is running.';
}
''';

final String _styles = '''
@import url(https://fonts.googleapis.com/css?family=Roboto);

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
}

#output {
  padding: 20px;
  text-align: center;
}
''';
<commit_msg>Upgrade the 'web-simple' project template to null safety.<commit_after>// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import '../templates.dart';
import 'common.dart' as common;

/// A generator for a uber-simple web application.
class WebSimpleGenerator extends DefaultGenerator {
  WebSimpleGenerator()
      : super('web-simple', 'Bare-bones Web App',
            'A web app that uses only core Dart libraries.',
            categories: const ['dart', 'web']) {
    addFile('.gitignore', common.gitignore);
    addFile('analysis_options.yaml', common.analysisOptions);
    addFile('CHANGELOG.md', common.changelog);
    addFile('pubspec.yaml', _pubspec);
    addFile('README.md', _readme);
    addFile('web/index.html', _index);
    setEntrypoint(
      addFile('web/main.dart', _main),
    );
    addFile('web/styles.css', _styles);
  }
}

final String _pubspec = '''
name: __projectName__
description: An absolute bare-bones web app.
version: 1.0.0
# homepage: https://www.example.com

environment:
  sdk: '>=2.12.0 <3.0.0'

# dependencies:
#   path: ^1.7.0

dev_dependencies:
  build_runner: ^1.10.0
  build_web_compilers: ^2.11.0
  pedantic: ^1.9.0
''';

final String _readme = '''
An absolute bare-bones web app.
''';

final String _index = '''
<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="scaffolded-by" content="https://github.com/dart-lang/sdk">
    <title>__projectName__</title>
    <link rel="stylesheet" href="styles.css">
    <script defer src="main.dart.js"></script>
</head>

<body>

  <div id="output"></div>

</body>
</html>
''';

final String _main = '''
import 'dart:html';

void main() {
  querySelector('#output')?.text = 'Your Dart app is running.';
}
''';

final String _styles = '''
@import url(https://fonts.googleapis.com/css?family=Roboto);

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
}

#output {
  padding: 20px;
  text-align: center;
}
''';

{'fraction_non_alphanumeric': 0.16618464961067853, 'fraction_numerical': 0.01824249165739711, 'mean_word_length': 3.7326315789473683, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '665821', 'n_tokens_mistral': 1602, 'n_tokens_neox': 1527, 'n_words': 395}