Skip to content

Commit

Permalink
Base changes for switching to virtual that imports virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Mar 29, 2024
1 parent 86ca5a0 commit ed743db
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 52 deletions.
2 changes: 0 additions & 2 deletions docs-app/app/routes/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export default class ApplicationRoute extends Route {
});

await this.docs.setup({
apiDocs: import('kolay/api-docs:virtual'),
manifest: import('kolay/manifest:virtual'),
resolve: {
'ember-primitives': import('ember-primitives'),
kolay: import('kolay'),
Expand Down
5 changes: 1 addition & 4 deletions docs-app/tests/kolay/components/api-docs-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { setupKolay } from 'kolay/test-support';

module('<APIDocs>', function (hooks) {
setupRenderingTest(hooks);
setupKolay(hooks, async () => ({
apiDocs: await import('kolay/api-docs:virtual'),
manifest: await import('kolay/manifest:virtual'),
}));
setupKolay(hooks);

test('it works', async function (assert) {
await render(
Expand Down
5 changes: 1 addition & 4 deletions docs-app/tests/kolay/components/comment-query-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { setupKolay } from 'kolay/test-support';

module('<CommentQuery>', function (hooks) {
setupRenderingTest(hooks);
setupKolay(hooks, async () => ({
apiDocs: await import('kolay/api-docs:virtual'),
manifest: await import('kolay/manifest:virtual'),
}));
setupKolay(hooks);

test('it works', async function (assert) {
await render(
Expand Down
5 changes: 1 addition & 4 deletions docs-app/tests/kolay/components/component-signature-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { setupKolay } from 'kolay/test-support';

module('<ComponentSignature>', function (hooks) {
setupRenderingTest(hooks);
setupKolay(hooks, async () => ({
apiDocs: await import('kolay/api-docs:virtual'),
manifest: await import('kolay/manifest:virtual'),
}));
setupKolay(hooks);

test('self', async function (assert) {
await render(
Expand Down
5 changes: 1 addition & 4 deletions docs-app/tests/kolay/components/helper-signature-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { setupKolay } from 'kolay/test-support';

module('<HelperSignature>', function (hooks) {
setupRenderingTest(hooks);
setupKolay(hooks, async () => ({
apiDocs: await import('kolay/api-docs:virtual'),
manifest: await import('kolay/manifest:virtual'),
}));
setupKolay(hooks);

test('self', async function (assert) {
// This is not supported
Expand Down
5 changes: 1 addition & 4 deletions docs-app/tests/kolay/components/modifier-signature-test.gts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { setupKolay } from 'kolay/test-support';

module('<ModifierSignature>', function (hooks) {
setupRenderingTest(hooks);
setupKolay(hooks, async () => ({
apiDocs: await import('kolay/api-docs:virtual'),
manifest: await import('kolay/manifest:virtual'),
}));
setupKolay(hooks);

test('self', async function (assert) {
// This is not supported
Expand Down
5 changes: 1 addition & 4 deletions docs-app/tests/kolay/services/docs-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { setupKolay } from 'kolay/test-support';

module('@service(Docs)', function (hooks) {
setupTest(hooks);
setupKolay(hooks, async () => ({
apiDocs: await import('kolay/api-docs:virtual'),
manifest: await import('kolay/manifest:virtual'),
}));
setupKolay(hooks);

test('No duplicates in available Groups', async function (assert) {
let docs = this.owner.lookup('service:kolay/docs');
Expand Down
9 changes: 1 addition & 8 deletions src/browser/virtual/setup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ import type { Manifest } from '@universal-ember/kolay-ui';

export function setupKolay(
context: object,
options: {
// Temporary until I can figure out how to make
// virtual modules import virtual modules
apiDocs: any;
// Temporary until I can figure out how to make
// virtual modules import virtual modules
manifest: any;

options?: {
/**
* Additional invokables that you'd like to have access to
* in the markdown, without a codefence.
Expand Down
36 changes: 18 additions & 18 deletions src/plugins/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ export const setup = () => {
// :(
// So the whole strategy / benefit of setupKolay is
// .... much less useful than originally planned
// let [apiDocs, manifest] = await Promise.all([
// import('kolay/api-docs:virtual'),
// import('kolay/manifest:virtual'),
// ]);
let [apiDocs, manifest] = await Promise.all([
import('kolay/api-docs:virtual'),
import('kolay/manifest:virtual'),
]);
await docs.setup({
// apiDocs,
// manifest,
apiDocs,
manifest,
...options,
});
Expand All @@ -66,20 +66,20 @@ export const setup = () => {
// .... much less useful than originally planned
//
//
// {
// importPath: 'kolay/test-support',
// content: stripIndent`
// import { setupKolay as setup } from 'kolay/setup';
{
importPath: 'kolay/test-support',
content: stripIndent`
import { setupKolay as setup } from 'kolay/setup';
// export function setupKolay(hooks, config) {
// hooks.beforeEach(async function () {
// let docs = this.owner.lookup('service:kolay/docs');
export function setupKolay(hooks, config) {
hooks.beforeEach(async function () {
let docs = this.owner.lookup('service:kolay/docs');
// await setup(this, config);
// });
// }
// `,
// },
await setup(this, config);
});
}
`,
},
]),
};
};

0 comments on commit ed743db

Please sign in to comment.