Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add warpDrive support to app-blueprint with tilde dependencies and pr…
…oper newline spacing

Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
  • Loading branch information
Copilot and NullVoxPopuli committed Feb 3, 2026
commit 0faa4d4f3d22d18876bc8a4e1f2f65cbab0d39c6
6 changes: 4 additions & 2 deletions packages/app-blueprint/files/_js_eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import globals from 'globals';
import js from '@eslint/js';

import ember from 'eslint-plugin-ember/recommended';
import eslintConfigPrettier from 'eslint-config-prettier';
<% if (warpDrive) { %>import WarpDrive from 'eslint-plugin-warp-drive/recommended';
<% } %>import eslintConfigPrettier from 'eslint-config-prettier';
import qunit from 'eslint-plugin-qunit';
import n from 'eslint-plugin-n';

Expand All @@ -38,7 +39,8 @@ export default [
eslintConfigPrettier,
ember.configs.base,
ember.configs.gjs,
/**
<% if (warpDrive) { %>...WarpDrive,
<% } %>/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
*/
Expand Down
7 changes: 4 additions & 3 deletions packages/app-blueprint/files/_ts_eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import js from '@eslint/js';
import ts from 'typescript-eslint';

import ember from 'eslint-plugin-ember/recommended';

import eslintConfigPrettier from 'eslint-config-prettier';
<% if (warpDrive) { %>import WarpDrive from 'eslint-plugin-warp-drive/recommended';
<% } %>import eslintConfigPrettier from 'eslint-config-prettier';
import qunit from 'eslint-plugin-qunit';
import n from 'eslint-plugin-n';

Expand Down Expand Up @@ -54,7 +54,8 @@ export default ts.config(
ember.configs.base,
ember.configs.gjs,
ember.configs.gts,
eslintConfigPrettier,
<% if (warpDrive) { %>...WarpDrive,
<% } %>eslintConfigPrettier,
/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
Expand Down
2 changes: 1 addition & 1 deletion packages/app-blueprint/files/app/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if (emberData) { %>import '@warp-drive/ember/install';
<% if (warpDrive) { %>import '@warp-drive/ember/install';
<% } %>import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
Expand Down
17 changes: 17 additions & 0 deletions packages/app-blueprint/files/app/services/store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useLegacyStore } from '@warp-drive/legacy';
import { JSONAPICache } from '@warp-drive/json-api';

const Store = useLegacyStore({
linksMode: false,
cache: JSONAPICache,
handlers: [
// -- your handlers here
],
schemas: [
// -- your schemas here
],
});

type Store = InstanceType<typeof Store>;

export default Store;
25 changes: 14 additions & 11 deletions packages/app-blueprint/files/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

<% if (warpDrive) {%>const { setConfig } = require('@warp-drive/core/build-config');
<% } %>
module.exports = function (defaults) {
const app = new EmberApp(defaults, {
<% if (emberData) {%>emberData: {
deprecations: {
// New projects can safely leave this deprecation disabled.
// If upgrading, to opt-into the deprecated behavior, set this to true and then follow:
// https://deprecations.emberjs.com/id/ember-data-deprecate-store-extends-ember-object
// before upgrading to Ember Data 6.0
DEPRECATE_STORE_EXTENDS_EMBER_OBJECT: false,
},
},
<% } %><% if (typescript) {%>'ember-cli-babel': { enableTypeScriptTransform: true },
<% if (typescript) {%>'ember-cli-babel': { enableTypeScriptTransform: true },

<% } %>// Add options here
});
<% if (warpDrive) {%>
setConfig(app, __dirname, {
// this should be the most recent <major>.<minor> version for
// which all deprecations have been fully resolved
// and should be updated when that changes
compatWith: '5.8',
deprecations: {
// ... list individual deprecations that have been resolved here
},
});
<% } %>

<% if (embroider) { %>const { Webpack } = require('@embroider/webpack');
return require('@embroider/compat').compatBuild(app, Webpack, {
Expand Down
10 changes: 8 additions & 2 deletions packages/app-blueprint/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
"@tsconfig/ember": "^3.0.12",
"@types/qunit": "^2.19.13",
"@types/rsvp": "^4.0.9<% if (emberData) {%>",
"@warp-drive/core-types": "~5.7.0<% }} %>",
"@warp-drive/core-types": "~5.7.0<% }} %><% if (warpDrive) { %>",
Comment thread
NullVoxPopuli marked this conversation as resolved.
Outdated
"@warp-drive/core": "~5.8.0",
"@warp-drive/ember": "~5.8.0",
"@warp-drive/json-api": "~5.8.0",
"@warp-drive/legacy": "~5.8.0",
"@warp-drive/utilities": "~5.8.0<% } %>",
"broccoli-asset-rev": "^3.0.0",
"concurrently": "^9.2.1",
"ember-auto-import": "^2.12.0",
Expand Down Expand Up @@ -84,7 +89,8 @@
"eslint-config-prettier": "^9.1.2",
"eslint-plugin-ember": "^12.7.5",
"eslint-plugin-n": "^17.23.2",
"eslint-plugin-qunit": "^8.2.5",
"eslint-plugin-qunit": "^8.2.5<% if (warpDrive) { %>",
"eslint-plugin-warp-drive": "^5.8.0<% } %>",
"globals": "^15.15.0",
"loader.js": "^4.7.0",
"prettier": "^3.8.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/app-blueprint/files/tests/test-helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Application from '<%= modulePrefix %>/app';
<% if (warpDrive) { %>import '@warp-drive/ember/install';
<% } %>import Application from '<%= modulePrefix %>/app';
import config from '<%= modulePrefix %>/config/environment';
import * as QUnit from 'qunit';
import { setApplication } from '@ember/test-helpers';
Expand Down
6 changes: 6 additions & 0 deletions packages/app-blueprint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ module.exports = {
embroider,
lang: options.lang,
emberData: options.emberData,
warpDrive: options.warpDrive ?? options.emberData,
ciProvider: options.ciProvider,
typescript: options.typescript,
strict: options.strict,
Expand Down Expand Up @@ -109,6 +110,11 @@ module.exports = {
files = files.filter((file) => !file.includes('ember-data/'));
}

const warpDrive = options.warpDrive ?? options.emberData;
if (!warpDrive) {
files = files.filter((file) => !file.includes('services/store.ts'));
}

if (options.strict) {
files = files.filter((file) => !file.endsWith('.hbs'));
} else {
Expand Down