Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Get things building
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner committed Oct 9, 2024
1 parent df0f71b commit f2fd9bd
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 47 deletions.
14 changes: 10 additions & 4 deletions ember-prism/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dist"
],
"scripts": {
"build": "concurrently ':build:*'",
"build": "concurrently 'pnpm:build:*'",
"build:js": "rollup --config",
"build:types": "glint --declaration",
"lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'",
Expand All @@ -43,7 +43,7 @@
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"prepack": "pnpm run build",
"start": "concurrently ':start:*'",
"start": "concurrently 'pnpm:start:*'",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "glint --declaration --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
Expand All @@ -63,6 +63,8 @@
"@babel/plugin-transform-typescript": "^7.24.4",
"@babel/runtime": "^7.24.4",
"@embroider/addon-dev": "^4.3.1",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@glint/core": "^1.4.0",
"@glint/environment-ember-loose": "^1.4.0",
"@glint/environment-ember-template-imports": "^1.4.0",
Expand Down Expand Up @@ -116,9 +118,13 @@
"ember-addon": {
"version": 2,
"type": "addon",
"main": "addon-main.cjs"
"main": "addon-main.cjs",
"app-js": {
"./components/code-block.js": "./dist/_app_/components/code-block.js",
"./components/code-inline.js": "./dist/_app_/components/code-inline.js"
}
},
"peerDependencies": {
"ember-source": ">= 4.0.0"
}
}
}
6 changes: 3 additions & 3 deletions ember-prism/src/components/code-block.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import Component from '@glimmer/component';

interface CodeBlockSignature {
Element: HTMLElement;
Args: {
code: string;
language?: string;
showLineNumbers?: boolean;
start?: string;
};
Element: HTMLElement;
}

export default class CodeBlockComponent extends Component<CodeBlockSignature> {
export default class CodeBlock extends Component<CodeBlockSignature> {
get language() {
return this.args.language ?? 'markup';
}
Expand All @@ -22,6 +22,6 @@ export default class CodeBlockComponent extends Component<CodeBlockSignature> {

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
CodeBlock: typeof CodeBlockComponent;
CodeBlock: typeof CodeBlock;
}
}
6 changes: 3 additions & 3 deletions ember-prism/src/components/code-inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { assert } from '@ember/debug';
declare const Prism: any;

interface CodeInlineSignature {
Element: HTMLElement;
Args: {
code: string;
language?: string;
};
Element: HTMLElement;
}

export default class CodeInlineComponent extends Component<CodeInlineSignature> {
export default class CodeInline extends Component<CodeInlineSignature> {
@tracked prismCode: string | SafeString = '';

get code() {
Expand Down Expand Up @@ -63,6 +63,6 @@ export default class CodeInlineComponent extends Component<CodeInlineSignature>

declare module '@glint/environment-ember-loose/registry' {
export default interface Registry {
CodeInline: typeof CodeInlineComponent;
CodeInline: typeof CodeInline;
}
}
1 change: 1 addition & 0 deletions ember-prism/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-expect-error no types shipped from prismjs-glimmer
import { setup as glimmer } from 'prismjs-glimmer';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
5 changes: 4 additions & 1 deletion ember-prism/unpublished-development-types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// eslint-disable-next-line ember/no-at-ember-render-modifiers
import type RenderModifiersRegistry from '@ember/render-modifiers/template-registry';

// Add any types here that you need for local development only.
// These will *not* be published as part of your addon, so be careful that your published code does not rely on them!

Expand All @@ -7,7 +10,7 @@ import '@glint/environment-ember-template-imports';
declare module '@glint/environment-ember-loose/registry' {
// Remove this once entries have been added! 👇
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export default interface Registry {
export default interface Registry extends RenderModifiersRegistry {
// Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
// See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
}
Expand Down
50 changes: 14 additions & 36 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f2fd9bd

Please sign in to comment.