@ember/app-blueprint 0.0.0 → 0.1.1

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.
Files changed (89) hide show
  1. package/.editorconfig +19 -0
  2. package/.github/workflows/ci.yml +35 -0
  3. package/.github/workflows/plan-release.yml +94 -0
  4. package/.github/workflows/publish.yml +43 -0
  5. package/.prettierrc.cjs +13 -0
  6. package/.release-plan.json +18 -0
  7. package/CHANGELOG.md +29 -0
  8. package/RELEASE.md +27 -0
  9. package/eslint.config.mjs +30 -0
  10. package/files/.editorconfig +19 -0
  11. package/files/.ember-cli +7 -0
  12. package/files/.github/workflows/ci.yml +53 -0
  13. package/files/.prettierignore +13 -0
  14. package/files/.prettierrc.js +39 -0
  15. package/files/.stylelintignore +5 -0
  16. package/files/.stylelintrc.js +5 -0
  17. package/files/.template-lintrc.js +5 -0
  18. package/files/.watchmanconfig +3 -0
  19. package/files/README.md +58 -0
  20. package/files/_js_babel.config.cjs +42 -0
  21. package/files/_js_eslint.config.mjs +115 -0
  22. package/files/_ts_babel.config.cjs +50 -0
  23. package/files/_ts_eslint.config.mjs +135 -0
  24. package/files/app/app.ts +18 -0
  25. package/files/app/components/.gitkeep +0 -0
  26. package/files/app/config/environment.ts +17 -0
  27. package/files/app/controllers/.gitkeep +0 -0
  28. package/files/app/deprecation-workflow.ts +24 -0
  29. package/files/app/helpers/.gitkeep +0 -0
  30. package/files/app/models/.gitkeep +0 -0
  31. package/files/app/router.ts +11 -0
  32. package/files/app/routes/.gitkeep +0 -0
  33. package/files/app/styles/app.css +1 -0
  34. package/files/app/templates/_js_application.hbs +10 -0
  35. package/files/app/templates/_ts_application.gts +15 -0
  36. package/files/config/ember-cli-update.json +16 -0
  37. package/files/config/environment.js +48 -0
  38. package/files/config/optional-features.json +7 -0
  39. package/files/config/targets.js +11 -0
  40. package/files/ember-cli-build.js +22 -0
  41. package/files/gitignore +26 -0
  42. package/files/index.html +29 -0
  43. package/files/package.json +112 -0
  44. package/files/public/robots.txt +3 -0
  45. package/files/testem.js +25 -0
  46. package/files/tests/helpers/index.ts +43 -0
  47. package/files/tests/index.html +43 -0
  48. package/files/tests/integration/.gitkeep +0 -0
  49. package/files/tests/test-helper.ts +15 -0
  50. package/files/tests/unit/.gitkeep +0 -0
  51. package/files/tsconfig.json +31 -0
  52. package/files/vite.config.mjs +15 -0
  53. package/index.js +158 -0
  54. package/lib/directory-for-package-name.js +31 -0
  55. package/lib/prepend-emoji.js +12 -0
  56. package/package.json +33 -6
  57. package/tests/default.test.mjs +145 -0
  58. package/tests/fixture/app/components/custom-component.hbs +3 -0
  59. package/tests/fixture/app/initializers/test-init.js +6 -0
  60. package/tests/fixture/app/instance-initializers/test-instance-init.js +6 -0
  61. package/tests/fixture/app/router.js +12 -0
  62. package/tests/fixture/app/routes/styles.js +6 -0
  63. package/tests/fixture/app/styles/app.css +5 -0
  64. package/tests/fixture/app/templates/application.hbs +3 -0
  65. package/tests/fixture/app/templates/custom-component.hbs +1 -0
  66. package/tests/fixture/app/templates/index.hbs +1 -0
  67. package/tests/fixture/app/templates/styles.hbs +5 -0
  68. package/tests/fixture/testem-proxy.js +35 -0
  69. package/tests/fixture/tests/acceptance/app-init-test.js +13 -0
  70. package/tests/fixture/tests/acceptance/custom-component-test.js +14 -0
  71. package/tests/fixture/tests/acceptance/styles-test.js +18 -0
  72. package/tests/fixture/tests/acceptance/welcome-page-test.js +14 -0
  73. package/tests/fixture-ts/app/initializers/test-init.ts +10 -0
  74. package/tests/fixture-ts/app/instance-initializers/test-instance-init.ts +10 -0
  75. package/tests/fixture-ts/app/router.ts +12 -0
  76. package/tests/fixture-ts/app/routes/styles.ts +8 -0
  77. package/tests/fixture-ts/app/styles/app.css +5 -0
  78. package/tests/fixture-ts/app/templates/components/custom.gts +5 -0
  79. package/tests/fixture-ts/app/templates/custom-component.gts +5 -0
  80. package/tests/fixture-ts/app/templates/index.gts +5 -0
  81. package/tests/fixture-ts/app/templates/styles.gts +7 -0
  82. package/tests/fixture-ts/testem-proxy.js +36 -0
  83. package/tests/fixture-ts/tests/acceptance/app-init-test.ts +22 -0
  84. package/tests/fixture-ts/tests/acceptance/custom-component-test.ts +14 -0
  85. package/tests/fixture-ts/tests/acceptance/styles-test.ts +18 -0
  86. package/tests/fixture-ts/tests/acceptance/welcome-page-test.ts +14 -0
  87. package/tests/helpers.mjs +57 -0
  88. package/tests/typescript.test.mjs +24 -0
  89. package/vitest.config.ts +10 -0
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Debugging:
3
+ * https://eslint.org/docs/latest/use/configure/debug
4
+ * ----------------------------------------------------
5
+ *
6
+ * Print a file's calculated configuration
7
+ *
8
+ * npx eslint --print-config path/to/file.js
9
+ *
10
+ * Inspecting the config
11
+ *
12
+ * npx eslint --inspect-config
13
+ *
14
+ */
15
+ import globals from 'globals';
16
+ import js from '@eslint/js';
17
+
18
+ import ember from 'eslint-plugin-ember/recommended';
19
+ import eslintConfigPrettier from 'eslint-config-prettier';
20
+ import qunit from 'eslint-plugin-qunit';
21
+ import n from 'eslint-plugin-n';
22
+
23
+ import babelParser from '@babel/eslint-parser';
24
+
25
+ const esmParserOptions = {
26
+ ecmaFeatures: { modules: true },
27
+ ecmaVersion: 'latest',
28
+ };
29
+
30
+ export default [
31
+ js.configs.recommended,
32
+ eslintConfigPrettier,
33
+ ember.configs.base,
34
+ ember.configs.gjs,
35
+ /**
36
+ * Ignores must be in their own object
37
+ * https://eslint.org/docs/latest/use/configure/ignore
38
+ */
39
+ {
40
+ ignores: ['dist/', 'node_modules/', 'coverage/', '!**/.*'],
41
+ },
42
+ /**
43
+ * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
44
+ */
45
+ {
46
+ linterOptions: {
47
+ reportUnusedDisableDirectives: 'error',
48
+ },
49
+ },
50
+ {
51
+ files: ['**/*.js'],
52
+ languageOptions: {
53
+ parser: babelParser,
54
+ },
55
+ },
56
+ {
57
+ files: ['**/*.{js,gjs}'],
58
+ languageOptions: {
59
+ parserOptions: esmParserOptions,
60
+ globals: {
61
+ ...globals.browser,
62
+ },
63
+ },
64
+ },
65
+ {
66
+ files: ['tests/**/*-test.{js,gjs}'],
67
+ plugins: {
68
+ qunit,
69
+ },
70
+ },
71
+ /**
72
+ * CJS node files
73
+ */
74
+ {
75
+ files: [
76
+ '**/*.cjs',
77
+ 'config/**/*.js',
78
+ 'testem.js',
79
+ 'testem*.js',
80
+ '.prettierrc.js',
81
+ '.stylelintrc.js',
82
+ '.template-lintrc.js',
83
+ 'ember-cli-build.js',
84
+ ],
85
+ plugins: {
86
+ n,
87
+ },
88
+
89
+ languageOptions: {
90
+ sourceType: 'script',
91
+ ecmaVersion: 'latest',
92
+ globals: {
93
+ ...globals.node,
94
+ },
95
+ },
96
+ },
97
+ /**
98
+ * ESM node files
99
+ */
100
+ {
101
+ files: ['**/*.mjs'],
102
+ plugins: {
103
+ n,
104
+ },
105
+
106
+ languageOptions: {
107
+ sourceType: 'module',
108
+ ecmaVersion: 'latest',
109
+ parserOptions: esmParserOptions,
110
+ globals: {
111
+ ...globals.node,
112
+ },
113
+ },
114
+ },
115
+ ];
@@ -0,0 +1,50 @@
1
+ const {
2
+ babelCompatSupport,
3
+ templateCompatSupport,
4
+ } = require('@embroider/compat/babel');
5
+
6
+ module.exports = {
7
+ plugins: [
8
+ [
9
+ '@babel/plugin-transform-typescript',
10
+ {
11
+ allExtensions: true,
12
+ onlyRemoveTypeImports: true,
13
+ allowDeclareFields: true,
14
+ },
15
+ ],
16
+ [
17
+ 'babel-plugin-ember-template-compilation',
18
+ {
19
+ compilerPath: 'ember-source/dist/ember-template-compiler.js',
20
+ enableLegacyModules: [
21
+ 'ember-cli-htmlbars',
22
+ 'ember-cli-htmlbars-inline-precompile',
23
+ 'htmlbars-inline-precompile',
24
+ ],
25
+ transforms: [...templateCompatSupport()],
26
+ },
27
+ ],
28
+ [
29
+ 'module:decorator-transforms',
30
+ {
31
+ runtime: {
32
+ import: require.resolve('decorator-transforms/runtime-esm'),
33
+ },
34
+ },
35
+ ],
36
+ [
37
+ '@babel/plugin-transform-runtime',
38
+ {
39
+ absoluteRuntime: __dirname,
40
+ useESModules: true,
41
+ regenerator: false,
42
+ },
43
+ ],
44
+ ...babelCompatSupport(),
45
+ ],
46
+
47
+ generatorOpts: {
48
+ compact: false,
49
+ },
50
+ };
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Debugging:
3
+ * https://eslint.org/docs/latest/use/configure/debug
4
+ * ----------------------------------------------------
5
+ *
6
+ * Print a file's calculated configuration
7
+ *
8
+ * npx eslint --print-config path/to/file.js
9
+ *
10
+ * Inspecting the config
11
+ *
12
+ * npx eslint --inspect-config
13
+ *
14
+ */
15
+ import globals from 'globals';
16
+ import js from '@eslint/js';
17
+
18
+ import ts from 'typescript-eslint';
19
+
20
+ import ember from 'eslint-plugin-ember/recommended';
21
+
22
+ import eslintConfigPrettier from 'eslint-config-prettier';
23
+ import qunit from 'eslint-plugin-qunit';
24
+ import n from 'eslint-plugin-n';
25
+
26
+ import babelParser from '@babel/eslint-parser';
27
+
28
+ const parserOptions = {
29
+ esm: {
30
+ js: {
31
+ ecmaFeatures: { modules: true },
32
+ ecmaVersion: 'latest',
33
+ },
34
+ ts: {
35
+ projectService: true,
36
+ tsconfigRootDir: import.meta.dirname,
37
+ },
38
+ },
39
+ };
40
+
41
+ export default ts.config(
42
+ js.configs.recommended,
43
+ ember.configs.base,
44
+ ember.configs.gjs,
45
+ ember.configs.gts,
46
+ eslintConfigPrettier,
47
+ /**
48
+ * Ignores must be in their own object
49
+ * https://eslint.org/docs/latest/use/configure/ignore
50
+ */
51
+ {
52
+ ignores: ['dist/', 'node_modules/', 'coverage/', '!**/.*'],
53
+ },
54
+ /**
55
+ * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
56
+ */
57
+ {
58
+ linterOptions: {
59
+ reportUnusedDisableDirectives: 'error',
60
+ },
61
+ },
62
+ {
63
+ files: ['**/*.js'],
64
+ languageOptions: {
65
+ parser: babelParser,
66
+ },
67
+ },
68
+ {
69
+ files: ['**/*.{js,gjs}'],
70
+ languageOptions: {
71
+ parserOptions: parserOptions.esm.js,
72
+ globals: {
73
+ ...globals.browser,
74
+ },
75
+ },
76
+ },
77
+ {
78
+ files: ['**/*.{ts,gts}'],
79
+ languageOptions: {
80
+ parser: ember.parser,
81
+ parserOptions: parserOptions.esm.ts,
82
+ },
83
+ extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
84
+ },
85
+ {
86
+ files: ['tests/**/*-test.{js,gjs,ts,gts}'],
87
+ plugins: {
88
+ qunit,
89
+ },
90
+ },
91
+ /**
92
+ * CJS node files
93
+ */
94
+ {
95
+ files: [
96
+ '**/*.cjs',
97
+ 'config/**/*.js',
98
+ 'testem.js',
99
+ 'testem*.js',
100
+ '.prettierrc.js',
101
+ '.stylelintrc.js',
102
+ '.template-lintrc.js',
103
+ 'ember-cli-build.js',
104
+ ],
105
+ plugins: {
106
+ n,
107
+ },
108
+
109
+ languageOptions: {
110
+ sourceType: 'script',
111
+ ecmaVersion: 'latest',
112
+ globals: {
113
+ ...globals.node,
114
+ },
115
+ },
116
+ },
117
+ /**
118
+ * ESM node files
119
+ */
120
+ {
121
+ files: ['**/*.mjs'],
122
+ plugins: {
123
+ n,
124
+ },
125
+
126
+ languageOptions: {
127
+ sourceType: 'module',
128
+ ecmaVersion: 'latest',
129
+ parserOptions: parserOptions.esm.js,
130
+ globals: {
131
+ ...globals.node,
132
+ },
133
+ },
134
+ },
135
+ );
@@ -0,0 +1,18 @@
1
+ import Application from '@ember/application';
2
+ import compatModules from '@embroider/virtual/compat-modules';
3
+ import Resolver from 'ember-resolver';
4
+ import loadInitializers from 'ember-load-initializers';
5
+ import config from '<%= modulePrefix %>/config/environment';
6
+ import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
7
+
8
+ if (macroCondition(isDevelopingApp())) {
9
+ importSync('./deprecation-workflow');
10
+ }
11
+
12
+ export default class App extends Application {
13
+ modulePrefix = config.modulePrefix;
14
+ podModulePrefix = config.podModulePrefix;
15
+ Resolver = Resolver.withModules(compatModules);
16
+ }
17
+
18
+ loadInitializers(App, config.modulePrefix, compatModules);
File without changes
@@ -0,0 +1,17 @@
1
+ import loadConfigFromMeta from '@embroider/config-meta-loader';
2
+ import { assert } from '@ember/debug';
3
+
4
+ const config = loadConfigFromMeta('<%= name %>') as unknown;
5
+
6
+ assert("config is not an object", typeof config === "object" && config !== null);
7
+ assert("modulePrefix was not detected on your config", "modulePrefix" in config && typeof config.modulePrefix === 'string')
8
+ assert("locationType was not detected on your config", "locationType" in config && typeof config.locationType === 'string')
9
+ assert("rootURL was not detected on your config", "rootURL" in config && typeof config.rootURL === 'string')
10
+ assert("APP was not detected on your config", "APP" in config && typeof config.APP === 'object')
11
+
12
+ export default config as {
13
+ modulePrefix: string,
14
+ locationType: string,
15
+ rootURL: string,
16
+ APP: Record<string, unknown>
17
+ } & Record<string, unknown>;
File without changes
@@ -0,0 +1,24 @@
1
+ import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow';
2
+
3
+ /**
4
+ * Docs: https://github.com/ember-cli/ember-cli-deprecation-workflow
5
+ */
6
+ setupDeprecationWorkflow({
7
+ /**
8
+ false by default, but if a developer / team wants to be more aggressive about being proactive with
9
+ handling their deprecations, this should be set to "true"
10
+ */
11
+ throwOnUnhandled: false,
12
+ workflow: [
13
+ /* ... handlers ... */
14
+ /* to generate this list, run your app for a while (or run the test suite),
15
+ * and then run in the browser console:
16
+ *
17
+ * deprecationWorkflow.flushDeprecations()
18
+ *
19
+ * And copy the handlers here
20
+ */
21
+ /* example: */
22
+ /* { handler: 'silence', matchId: 'template-action' }, */
23
+ ],
24
+ });
File without changes
File without changes
@@ -0,0 +1,11 @@
1
+ import EmberRouter from '@ember/routing/router';
2
+ import config from '<%= modulePrefix %>/config/environment';
3
+
4
+ export default class Router extends EmberRouter {
5
+ location = config.locationType;
6
+ rootURL = config.rootURL;
7
+ }
8
+
9
+ Router.map(function () {<% if (typescript) { %>
10
+ // Add route declarations here
11
+ <% } %>});
File without changes
@@ -0,0 +1 @@
1
+ /* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */
@@ -0,0 +1,10 @@
1
+ {{page-title "<%= namespace %>"}}
2
+ <% if (welcome) { %>
3
+ {{outlet}}
4
+
5
+ {{! The following component displays Ember's default welcome message. }}
6
+ <WelcomePage />
7
+ {{! Feel free to remove this! }}<% } else { %>
8
+ <h2 id="title">Welcome to Ember</h2>
9
+
10
+ {{outlet}}<% } %>
@@ -0,0 +1,15 @@
1
+ import { pageTitle } from 'ember-page-title';
2
+ <% if (welcome) {%>import { WelcomePage } from 'ember-welcome-page';<% } %>
3
+
4
+ <template>
5
+ {{pageTitle "<%= namespace %>"}}
6
+ <% if (welcome) { %>
7
+ {{outlet}}
8
+
9
+ {{! The following component displays Ember's default welcome message. }}
10
+ <WelcomePage />
11
+ {{! Feel free to remove this! }}<% } else { %>
12
+ <h2 id="title">Welcome to Ember</h2>
13
+
14
+ {{outlet}}<% } %>
15
+ </template>
@@ -0,0 +1,16 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "packages": [
4
+ {
5
+ "name": "@ember/app-blueprint",
6
+ "version": "<%= blueprintVersion %>",
7
+ "blueprints": [
8
+ {
9
+ "name": "@ember/app-blueprint",
10
+ "isBaseBlueprint": true,
11
+ "options": [<%= blueprintOptions %>]
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ module.exports = function (environment) {
4
+ const ENV = {
5
+ modulePrefix: '<%= modulePrefix %>',
6
+ environment,
7
+ rootURL: '/',
8
+ locationType: 'history',
9
+ EmberENV: {
10
+ EXTEND_PROTOTYPES: false,
11
+ FEATURES: {
12
+ // Here you can enable experimental features on an ember canary build
13
+ // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
14
+ },
15
+ },
16
+
17
+ APP: {
18
+ // Here you can pass flags/options to your application instance
19
+ // when it is created
20
+ },
21
+ };
22
+
23
+ if (environment === 'development') {
24
+ // ENV.APP.LOG_RESOLVER = true;
25
+ // ENV.APP.LOG_ACTIVE_GENERATION = true;
26
+ // ENV.APP.LOG_TRANSITIONS = true;
27
+ // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
28
+ // ENV.APP.LOG_VIEW_LOOKUPS = true;
29
+ }
30
+
31
+ if (environment === 'test') {
32
+ // Testem prefers this...
33
+ ENV.locationType = 'none';
34
+
35
+ // keep test console output quieter
36
+ ENV.APP.LOG_ACTIVE_GENERATION = false;
37
+ ENV.APP.LOG_VIEW_LOOKUPS = false;
38
+
39
+ ENV.APP.rootElement = '#ember-testing';
40
+ ENV.APP.autoboot = false;
41
+ }
42
+
43
+ if (environment === 'production') {
44
+ // here you can enable a production-specific feature
45
+ }
46
+
47
+ return ENV;
48
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "application-template-wrapper": false,
3
+ "default-async-observers": true,
4
+ "jquery-integration": false,
5
+ "template-only-glimmer-components": true,
6
+ "no-implicit-route-model": true
7
+ }
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ const browsers = [
4
+ 'last 1 Chrome versions',
5
+ 'last 1 Firefox versions',
6
+ 'last 1 Safari versions',
7
+ ];
8
+
9
+ module.exports = {
10
+ browsers,
11
+ };
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ const EmberApp = require('ember-cli/lib/broccoli/ember-app');
4
+ const { compatBuild } = require('@embroider/compat');
5
+
6
+ module.exports = async function (defaults) {
7
+ const { buildOnce } = await import('@embroider/vite');
8
+ let app = new EmberApp(defaults, {
9
+ <% if (emberData) {%>emberData: {
10
+ deprecations: {
11
+ // New projects can safely leave this deprecation disabled.
12
+ // If upgrading, to opt-into the deprecated behavior, set this to true and then follow:
13
+ // https://deprecations.emberjs.com/id/ember-data-deprecate-store-extends-ember-object
14
+ // before upgrading to Ember Data 6.0
15
+ DEPRECATE_STORE_EXTENDS_EMBER_OBJECT: false,
16
+ },
17
+ },
18
+ <% } %>// Add options here
19
+ });
20
+
21
+ return compatBuild(app, buildOnce);
22
+ };
@@ -0,0 +1,26 @@
1
+ # compiled output
2
+ /dist/
3
+ /declarations/
4
+ /tmp/
5
+
6
+ # dependencies
7
+ /node_modules/
8
+
9
+ # misc
10
+ /.env*
11
+ /.pnp*
12
+ /.eslintcache
13
+ /coverage/
14
+ /npm-debug.log*
15
+ /testem.log
16
+ /yarn-error.log
17
+
18
+ # ember-try
19
+ /.node_modules.ember-try/
20
+ /npm-shrinkwrap.json.ember-try
21
+ /package.json.ember-try
22
+ /package-lock.json.ember-try
23
+ /yarn.lock.ember-try
24
+
25
+ # broccoli-debug
26
+ /DEBUG/
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html<% if(lang) { %> lang="<%= lang %>"<% } %>>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title><%= namespace %></title>
6
+ <meta name="description" content="">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+
9
+ {{content-for "head"}}
10
+
11
+ <link integrity="" rel="stylesheet" href="/@embroider/virtual/vendor.css">
12
+ <link integrity="" rel="stylesheet" href="/@embroider/virtual/app.css">
13
+
14
+ {{content-for "head-footer"}}
15
+ </head>
16
+ <body>
17
+ {{content-for "body"}}
18
+
19
+ <script src="/@embroider/virtual/vendor.js"></script>
20
+ <script type="module">
21
+ import Application from './app/app';
22
+ import environment from './app/config/environment';
23
+
24
+ Application.create(environment.APP);
25
+ </script>
26
+
27
+ {{content-for "body-footer"}}
28
+ </body>
29
+ </html>