create-meith 0.31.0 → 0.33.0

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.
package/dist/bin.mjs CHANGED
@@ -1863,13 +1863,17 @@ export const __MEITH_EXTENSION_CAMEL__Plugin = definePlugin({
1863
1863
  contributions: [
1864
1864
  {
1865
1865
  region: 'index.footer',
1866
- render: (context) => (
1867
- <p className="text-xs text-muted-foreground" data-plugin="__MEITH_EXTENSION_KEY__">
1868
- {context.viewer.isGuest
1869
- ? 'Greetings, guest \u2014 this line comes from the __MEITH_EXTENSION_TITLE__ plugin.'
1870
- : 'Greetings, member \u2014 this line comes from the __MEITH_EXTENSION_TITLE__ plugin.'}
1871
- </p>
1872
- ),
1866
+ render: (context) => {
1867
+ const key = context.viewer.isGuest ? '__MEITH_EXTENSION_KEY__.footer.guest' : '__MEITH_EXTENSION_KEY__.footer.member'
1868
+ const fallback = context.viewer.isGuest
1869
+ ? 'Greetings, guest \u2014 this line comes from the __MEITH_EXTENSION_TITLE__ plugin.'
1870
+ : 'Greetings, member \u2014 this line comes from the __MEITH_EXTENSION_TITLE__ plugin.'
1871
+ return (
1872
+ <p className="text-xs text-muted-foreground" data-plugin="__MEITH_EXTENSION_KEY__">
1873
+ {context.t.has(key) ? context.t.t(key) : fallback}
1874
+ </p>
1875
+ )
1876
+ },
1873
1877
  },
1874
1878
  ],
1875
1879
 
@@ -2756,7 +2760,7 @@ async function run(argv, version, updateOptions = {}) {
2756
2760
  }
2757
2761
 
2758
2762
  // src/bin.ts
2759
- var result = await run(process.argv.slice(2), "0.31.0");
2763
+ var result = await run(process.argv.slice(2), "0.33.0");
2760
2764
  for (const line of result.lines) {
2761
2765
  if (result.code === 0) console.log(line);
2762
2766
  else console.error(line);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-meith",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "description": "Scaffold a Meith board, plugin or theme — npx create-meith <name> writes a deployable board workspace; --plugin and --theme write extension workspaces built on the published kits.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/bin.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { run } from './cli'
3
3
 
4
- const result = await run(process.argv.slice(2), '0.31.0')
4
+ const result = await run(process.argv.slice(2), '0.33.0')
5
5
  for (const line of result.lines) {
6
6
  if (result.code === 0) console.log(line)
7
7
  else console.error(line)
@@ -5,7 +5,7 @@ export const PLUGIN_TEMPLATES: readonly ExtensionTemplate[] = [
5
5
  {
6
6
  path: 'src/plugin.tsx',
7
7
  contents:
8
- "import { definePlugin } from '@meith/plugin-kit'\n\nexport const __MEITH_EXTENSION_CAMEL__Plugin = definePlugin({\n key: '__MEITH_EXTENSION_KEY__',\n name: '__MEITH_EXTENSION_TITLE__',\n version: '0.1.0',\n description:\n 'A plugin scaffolded by create-meith: a footer link, a greeting ' +\n 'on the board index, one setting, one migration, one task and an admin page.',\n apiVersion: '0',\n\n settings: [\n {\n key: 'greeting',\n label: 'Greeting',\n default: 'A greeting from the __MEITH_EXTENSION_TITLE__ plugin!',\n description: 'Shown on the status page under Admin → Plugins → __MEITH_EXTENSION_TITLE__.',\n },\n ],\n\n migrations: [\n {\n id: '0001_create_wave_table',\n statements: [\n `create table if not exists plugin___MEITH_EXTENSION_SNAKE___wave (\n id integer generated by default as identity primary key,\n waved_at timestamptz not null default now()\n )`,\n ],\n },\n ],\n\n tasks: [\n {\n id: 'wave',\n intervalSeconds: 3600,\n run: (context) => {\n context.logger.info('__MEITH_EXTENSION_KEY__ plugin: waving', {\n greeting: context.settings.greeting,\n })\n },\n },\n ],\n\n adminPages: [\n {\n path: 'status',\n title: '__MEITH_EXTENSION_TITLE__ plugin',\n render: (context) => (\n <div className=\"flex flex-col gap-2 text-sm\">\n <p>{String(context.settings.greeting)}</p>\n <p className=\"text-muted-foreground\">\n This page is rendered by the plugin itself. Edit the greeting on the plugin&rsquo;s\n settings screen and reload to see the resolved value arrive in{' '}\n <code className=\"text-xs\">context.settings</code>.\n </p>\n </div>\n ),\n },\n ],\n\n contributions: [\n {\n region: 'index.footer',\n render: (context) => (\n <p className=\"text-xs text-muted-foreground\" data-plugin=\"__MEITH_EXTENSION_KEY__\">\n {context.viewer.isGuest\n ? 'Greetings, guest — this line comes from the __MEITH_EXTENSION_TITLE__ plugin.'\n : 'Greetings, member — this line comes from the __MEITH_EXTENSION_TITLE__ plugin.'}\n </p>\n ),\n },\n ],\n\n hooks: {\n 'view.footer': (footer) => ({\n ...footer,\n links: [\n ...footer.links,\n {\n label: '__MEITH_EXTENSION_TITLE__ plugin',\n href: '__MEITH_EXTENSION_REPOSITORY__',\n },\n ],\n }),\n\n 'post.created': () => {},\n },\n})\n",
8
+ "import { definePlugin } from '@meith/plugin-kit'\n\nexport const __MEITH_EXTENSION_CAMEL__Plugin = definePlugin({\n key: '__MEITH_EXTENSION_KEY__',\n name: '__MEITH_EXTENSION_TITLE__',\n version: '0.1.0',\n description:\n 'A plugin scaffolded by create-meith: a footer link, a greeting ' +\n 'on the board index, one setting, one migration, one task and an admin page.',\n apiVersion: '0',\n\n settings: [\n {\n key: 'greeting',\n label: 'Greeting',\n default: 'A greeting from the __MEITH_EXTENSION_TITLE__ plugin!',\n description: 'Shown on the status page under Admin → Plugins → __MEITH_EXTENSION_TITLE__.',\n },\n ],\n\n migrations: [\n {\n id: '0001_create_wave_table',\n statements: [\n `create table if not exists plugin___MEITH_EXTENSION_SNAKE___wave (\n id integer generated by default as identity primary key,\n waved_at timestamptz not null default now()\n )`,\n ],\n },\n ],\n\n tasks: [\n {\n id: 'wave',\n intervalSeconds: 3600,\n run: (context) => {\n context.logger.info('__MEITH_EXTENSION_KEY__ plugin: waving', {\n greeting: context.settings.greeting,\n })\n },\n },\n ],\n\n adminPages: [\n {\n path: 'status',\n title: '__MEITH_EXTENSION_TITLE__ plugin',\n render: (context) => (\n <div className=\"flex flex-col gap-2 text-sm\">\n <p>{String(context.settings.greeting)}</p>\n <p className=\"text-muted-foreground\">\n This page is rendered by the plugin itself. Edit the greeting on the plugin&rsquo;s\n settings screen and reload to see the resolved value arrive in{' '}\n <code className=\"text-xs\">context.settings</code>.\n </p>\n </div>\n ),\n },\n ],\n\n contributions: [\n {\n region: 'index.footer',\n render: (context) => {\n const key = context.viewer.isGuest ? '__MEITH_EXTENSION_KEY__.footer.guest' : '__MEITH_EXTENSION_KEY__.footer.member'\n const fallback = context.viewer.isGuest\n ? 'Greetings, guest — this line comes from the __MEITH_EXTENSION_TITLE__ plugin.'\n : 'Greetings, member — this line comes from the __MEITH_EXTENSION_TITLE__ plugin.'\n return (\n <p className=\"text-xs text-muted-foreground\" data-plugin=\"__MEITH_EXTENSION_KEY__\">\n {context.t.has(key) ? context.t.t(key) : fallback}\n </p>\n )\n },\n },\n ],\n\n hooks: {\n 'view.footer': (footer) => ({\n ...footer,\n links: [\n ...footer.links,\n {\n label: '__MEITH_EXTENSION_TITLE__ plugin',\n href: '__MEITH_EXTENSION_REPOSITORY__',\n },\n ],\n }),\n\n 'post.created': () => {},\n },\n})\n",
9
9
  },
10
10
  {
11
11
  path: 'src/plugin.test.ts',