Skip to content

Commit

Permalink
all the fixes needed to get it running
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Sep 12, 2024
1 parent 276ca16 commit 9e1e456
Show file tree
Hide file tree
Showing 12 changed files with 380 additions and 165 deletions.
1 change: 0 additions & 1 deletion app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { inject as service } from '@ember/service';
import JSONAPIAdapter from '@ember-data/adapter/json-api';
import fetch from 'fetch';
import { pluralize } from 'ember-inflector';
import { isBlank } from '@ember/utils';

Expand Down
1 change: 1 addition & 0 deletions app/instance-initializers/ember-meta-store.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { isPresent } from '@ember/utils';

export function initialize(appInstance) {
return;
const metaStore = appInstance.lookup('service:meta-store');

Check failure on line 5 in app/instance-initializers/ember-meta-store.js

View workflow job for this annotation

GitHub Actions / Lint files

Unreachable code
const fastBootService = appInstance.lookup('service:fastboot');

Expand Down
4 changes: 4 additions & 0 deletions app/services/fastboot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Service from '@ember/service';

export default class FakeFastbootService extends Service {

Check failure on line 3 in app/services/fastboot.js

View workflow job for this annotation

GitHub Actions / Lint files

Delete `⏎`
}
4 changes: 2 additions & 2 deletions app/utils/create-excerpt.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import sanitizeHtml from 'sanitize-html';
import HtmlSanitizer from '@jitbit/htmlsanitizer';

export default function createExcerpt(string, maxLength = 300) {
// Stop at first code example
string = string.split('<table')[0];

let excerpt = sanitizeHtml(string, { allowedTags: [] })
let excerpt = HtmlSanitizer.SanitizeHtml(string, { allowedTags: [] })
// Remove tabs and line breaks
.replace(/\t/g, '')
.replace(/\n/g, ' ')
Expand Down
3 changes: 0 additions & 3 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ const { maybeEmbroider } = require('@embroider/test-setup');

module.exports = function (defaults) {
let app = new EmberApp(defaults, {
prember: {
urls: premberUrls(),
},
fingerprint: {
extensions: [
'js',
Expand Down
55 changes: 34 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@
"test": "tests"
},
"scripts": {
"clone": "rm -rf ember-api-docs-data && git clone --depth=1 https://github.com/ember-learn/ember-api-docs-data.git",
"build": "vite build",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:css": "stylelint \"**/*.css\"",
"lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "vite",
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test:ember": "vite build --mode test && ember test --path dist"
"test:browserstack": "node run-tests.js",
"test:ember": "ember test"
},
"devDependencies": {
"@ember-data/adapter": "~3.28.0",
"@ember-data/model": "~3.28.0",
"@ember-data/serializer": "~3.28.0",
"@ember-decorators/component": "^6.1.1",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.6.0",
"@embroider/compat": "3.6.2-unstable.a691d39",
Expand All @@ -37,8 +40,10 @@
"@glimmer/tracking": "^1.1.2",
"@glint/core": "^0.9.7",
"@glint/environment-ember-loose": "^0.9.7",
"@jitbit/htmlsanitizer": "^2.0.2",
"@percy/cli": "^1.28.7",
"@percy/ember": "^4.2.0",
"@percy/sdk-utils": "1.28.7",
"@rollup/plugin-babel": "^6.0.4",
"@tsconfig/ember": "^1.0.1",
"@types/ember": "^4.0.2",
Expand Down Expand Up @@ -75,7 +80,6 @@
"ember-cli-deploy-build": "^1.1.0",
"ember-cli-deploy-gzip": "^1.0.0",
"ember-cli-deprecation-workflow": "^3.0.1",
"ember-cli-document-title-northm": "^1.0.3",
"ember-cli-htmlbars": "^6.1.1",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-meta-tags": "^7.0.0",
Expand All @@ -89,7 +93,7 @@
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-metrics": "^1.5.2",
"ember-page-title": "^6.2.2",
"ember-page-title": "^8.2.3",
"ember-power-select": "^7.2.0",
"ember-qunit": "^5.1.5",
"ember-resolver": "^8.0.3",
Expand Down Expand Up @@ -133,25 +137,35 @@
"sanitize-html": "^2.3.2",
"semver": "^7.5.4",
"semver-compare": "^1.0.0",
"showdown": "^2.1.0",
"sinon": "7.5.0",
"spawndamnit": "2.0.0",
"testem": "^3.10.0",
"typescript": "^4.9.3",
"vite": "^5.4.3",
"webpack": "^5.90.0"
},
"packageManager": "pnpm@9.5.0",
"engines": {
"node": "16.* || 18.* || 20.*",
"npm": "7 || 8 || >= 9"
},
"pnpm": {
"overrides": {
"ember-get-config": "github:mansona/ember-get-config#config-meta-loader",
"ember-truth-helpers": "^4.0.0",
"node-sass": "^9.0.0"
},
"patchedDependencies": {
"@ember-data/store@3.28.13": "patches/@ember-data__store@3.28.13.patch",
"ember-source@3.28.12": "patches/ember-source@3.28.12.patch",
"postcss@8.4.45": "patches/postcss@8.4.45.patch",
"@jitbit/htmlsanitizer@2.0.2": "patches/@jitbit__htmlsanitizer@2.0.2.patch"
}
},
"ember": {
"edition": "octane"
},
"fastbootDependencies": [
"algoliasearch",
"node-fetch",
"abortcontroller-polyfill",
"abortcontroller-polyfill/dist/cjs-ponyfill"
],
"ember-addon": {
"paths": [
"lib/api-docs-data"
Expand All @@ -163,11 +177,10 @@
"./tests/*": "./tests/*",
"./*": "./app/*"
},
"pnpm": {
"overrides": {
"node-sass": "^9.0.0",
"ember-truth-helpers": "^4.0.0"
}
},
"packageManager": "pnpm@9.5.0"
"fastbootDependencies": [
"algoliasearch",
"node-fetch",
"abortcontroller-polyfill",
"abortcontroller-polyfill/dist/cjs-ponyfill"
]
}
52 changes: 52 additions & 0 deletions patches/@ember-data__store@3.28.13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/addon/-private/system/backburner.js b/addon/-private/system/backburner.js
index 6aa30ddf1a6c5151f68ec7a1e2b30e34fae64716..28cc2bad6367c2a41a0b589c7e788bf6bcb19ec5 100644
--- a/addon/-private/system/backburner.js
+++ b/addon/-private/system/backburner.js
@@ -2,7 +2,6 @@
@module @ember-data/store
*/

-import { registerWaiter } from '@ember/test';
import { DEBUG } from '@glimmer/env';
import Ember from 'ember';

@@ -17,9 +16,7 @@ import Ember from 'ember';
const backburner = new Ember._Backburner(['coalesce', 'sync', 'notify']);

if (DEBUG) {
- registerWaiter(() => {
- return !backburner.currentInstance && !backburner.hasTimers();
- });
+
}

export default backburner;
diff --git a/addon/-private/system/core-store.ts b/addon/-private/system/core-store.ts
index f7eb8b96bd70abb8b8ebf5beb8a755853e38adc6..319c72e5beb6474a3111b1c5be9b4537797d5b27 100644
--- a/addon/-private/system/core-store.ts
+++ b/addon/-private/system/core-store.ts
@@ -8,7 +8,6 @@ import { computed, defineProperty, get, set } from '@ember/object';
import { assign } from '@ember/polyfills';
import { _backburner as emberBackburner } from '@ember/runloop';
import Service from '@ember/service';
-import { registerWaiter, unregisterWaiter } from '@ember/test';
import { isNone, isPresent, typeOf } from '@ember/utils';
import { DEBUG } from '@glimmer/env';
import Ember from 'ember';
@@ -414,8 +413,6 @@ abstract class CoreStore extends Service {

return shouldTrack !== true || isSettled;
};
-
- registerWaiter(this.__asyncWaiter);
}
}

@@ -3690,7 +3687,6 @@ abstract class CoreStore extends Service {
this.unloadAll();

if (DEBUG) {
- unregisterWaiter(this.__asyncWaiter);
let shouldTrack = this.shouldTrackAsyncRequests;
let tracked = this._trackedAsyncRequests;
let isSettled = tracked.length === 0;
10 changes: 10 additions & 0 deletions patches/@jitbit__htmlsanitizer@2.0.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/HtmlSanitizer.js b/HtmlSanitizer.js
index 1dde0ed2effaf438946fd07f550ba502dd0371f4..d40db1d18ee3a5880054afd8611adbbda7488d67 100644
--- a/HtmlSanitizer.js
+++ b/HtmlSanitizer.js
@@ -110,3 +110,5 @@ const HtmlSanitizer = new (function () {
this.AllowedCssStyles = _cssWhitelist;
this.AllowedSchemas = _schemaWhiteList;
});
+
+module.exports = HtmlSanitizer;
67 changes: 67 additions & 0 deletions patches/ember-source@3.28.12.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 7ab6fbae31241ccf49da5f1dcea7690738e659d9..0000000000000000000000000000000000000000
diff --git a/dist/packages/@ember/-internals/runtime/.gitignore b/dist/packages/@ember/-internals/runtime/.gitignore
deleted file mode 100644
index a1136368651e6eb6d0d93a09c478f4978f4196fa..0000000000000000000000000000000000000000
diff --git a/dist/packages/@ember/debug/index.js b/dist/packages/@ember/debug/index.js
index 6e9b00d5c858be042cd530bcb647fc87d2a00e83..393bdc04dbf1ecc6a091b4696303affa0d94c4a2 100644
--- a/dist/packages/@ember/debug/index.js
+++ b/dist/packages/@ember/debug/index.js
@@ -1,7 +1,7 @@
import { isChrome, isFirefox } from '@ember/-internals/browser-environment';
import EmberError from '@ember/error';
import { DEBUG } from '@glimmer/env';
-import _deprecate from './lib/deprecate';
+import defaultDeprecate from './lib/deprecate';
import { isTesting } from './lib/testing';
import _warn from './lib/warn';
export { inspect } from '@ember/-internals/utils';
@@ -16,7 +16,7 @@ let assert = noop;
let info = noop;
let warn = noop;
let debug = noop;
-let deprecate = noop;
+let currentDeprecate;
let debugSeal = noop;
let debugFreeze = noop;
let runInDebug = noop;
@@ -27,6 +27,14 @@ let deprecateFunc = function () {
return arguments[arguments.length - 1];
};

+export function deprecate() {
+ if (currentDeprecate) {
+ return currentDeprecate(...arguments);
+ }
+
+ return defaultDeprecate(...arguments);
+}
+
if (DEBUG) {
setDebugFunction = function (type, callback) {
switch (type) {
@@ -43,7 +51,7 @@ if (DEBUG) {
return debug = callback;

case 'deprecate':
- return deprecate = callback;
+ return currentDeprecate = callback;

case 'debugSeal':
return debugSeal = callback;
@@ -251,7 +259,6 @@ if (DEBUG) {
Object.freeze(obj);
}
});
- setDebugFunction('deprecate', _deprecate);
setDebugFunction('warn', _warn);
}

@@ -275,4 +282,4 @@ if (DEBUG && !isTesting()) {
}
}

-export { assert, info, warn, debug, deprecate, debugSeal, debugFreeze, runInDebug, deprecateFunc, setDebugFunction, getDebugFunction, _warnIfUsingStrippedFeatureFlags };
\ No newline at end of file
+export { assert, info, warn, debug, debugSeal, debugFreeze, runInDebug, deprecateFunc, setDebugFunction, getDebugFunction, _warnIfUsingStrippedFeatureFlags };
30 changes: 30 additions & 0 deletions patches/postcss@8.4.45.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/lib/css-syntax-error.js b/lib/css-syntax-error.js
index 275a4f64c2f8df215341a74d61e2aa2d05d61f78..6fa64a9ea9119fb194cfe28c9a02748d9d736672 100644
--- a/lib/css-syntax-error.js
+++ b/lib/css-syntax-error.js
@@ -2,7 +2,7 @@

let pico = require('picocolors')

-let terminalHighlight = require('./terminal-highlight')
+let terminalHighlight = require('./terminal-highlight.js')

class CssSyntaxError extends Error {
constructor(message, line, column, source, file, plugin) {
diff --git a/lib/input.js b/lib/input.js
index 685bce74b22af19d28e19aacea26f5f35e37cacc..205653ea088484495ad756ee8cd0a5c5b84d6e17 100644
--- a/lib/input.js
+++ b/lib/input.js
@@ -5,9 +5,9 @@ let { isAbsolute, resolve } = require('path')
let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
let { fileURLToPath, pathToFileURL } = require('url')

-let CssSyntaxError = require('./css-syntax-error')
-let PreviousMap = require('./previous-map')
-let terminalHighlight = require('./terminal-highlight')
+let CssSyntaxError = require('./css-syntax-error.js')
+let PreviousMap = require('./previous-map.js')
+let terminalHighlight = require('./terminal-highlight.js')

let fromOffsetCache = Symbol('fromOffsetCache')

Loading

0 comments on commit 9e1e456

Please sign in to comment.