Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.1.1/schema.json",
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"changedFilePatterns": ["src/**", "template/**"]
"ignore": []
}
16 changes: 11 additions & 5 deletions .github/workflows/prerelease-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
run_id: context.payload.workflow_run.id
});

for (const artifact of allArtifacts.data.artifacts) {
Expand All @@ -48,17 +48,23 @@ jobs:
A new proofkit prerelease is available for testing. You can install this latest build in your project with:

```sh
pnpm create t3-app@${{ env.BETA_PACKAGE_VERSION }}
pnpm update @proofgeist/kit@${{ env.BETA_PACKAGE_VERSION }}
```

or to create a new project:
```sh
pnpx @proofgeist/kit@${{ env.BETA_PACKAGE_VERSION }}
```

- name: "Remove the autorelease label once published"
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
github.rest.issues.removeLabel({
const issueNumber = process.env.WORKFLOW_RUN_PR;
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ env.WORKFLOW_RUN_PR }},
name: '🚀 autorelease',
issue_number: issueNumber,
name: '🚀 autorelease'
});
6 changes: 4 additions & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ name: Release - Beta

on:
pull_request:
types: [labeled]
types: [labeled, synchronize]
branches:
- main

jobs:
prerelease:
if: |
github.repository_owner == 'proofgeist' &&
contains(github.event.pull_request.labels.*.name, '🚀 autorelease')
(github.event.action == 'labeled' && contains(github.event.pull_request.labels.*.name, '🚀 autorelease') ||
github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, '🚀 autorelease'))
name: Build & Publish a beta release to NPM
runs-on: ubuntu-latest

Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,26 @@ on:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
if: ${{ github.repository_owner == 'proofgeist' }}
name: Create a PR for release workflow
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup

- name: Check for errors
run: pnpm check

- name: Build the package
run: pnpm build:cli
- name: Setup
uses: ./.github/actions/setup

- name: Create Version PR or Publish to NPM
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: "chore(release): version packages"
title: "chore(release): version packages"
version: node .github/changeset-version.js
publish: npx changeset publish
publish: pnpm pub:release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NODE_ENV: "production"
20 changes: 10 additions & 10 deletions cli/src/cli/add/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ export async function runAddAuthAction() {
message: "What auth provider do you want to use?",
options: [
{
label: "Clerk",
value: "clerk",
hint: "Easy to setup and use, may required a paid plan",
value: "fmaddon",
label: "FM Add-on Auth",
hint: "Self-hosted auth with email/password",
},
{
label: "ProofKit Auth",
value: "proofkit",
hint: "More advanced, but self-hosted and customizable",
value: "clerk",
label: "Clerk",
hint: "Hosted auth service with many providers",
},
],
})
);

const type = z.enum(["clerk", "proofkit"]).parse(authType);
const type = z.enum(["clerk", "fmaddon"]).parse(authType);
state.authType = type;

if (type === "proofkit") {
if (type === "fmaddon") {
const emailProviderAnswer =
(state.emailProvider
? state.emailProvider
Expand Down Expand Up @@ -89,11 +89,11 @@ export const makeAddAuthCommand = () => {
.option("--authType <authType>", "Type of auth provider to use")
.option(
"--emailProvider <emailProvider>",
"Email provider to use (only for ProofKit Auth)"
"Email provider to use (only for FM Add-on Auth)"
)
.option(
"--apiKey <apiKey>",
"API key to use for the email provider (only for ProofKit Auth)"
"API key to use for the email provider (only for FM Add-on Auth)"
)
.addOption(ciOption)
.addOption(debugOption)
Expand Down
10 changes: 5 additions & 5 deletions cli/src/generators/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function addAuth({
options:
| { type: "clerk" }
| {
type: "proofkit";
type: "fmaddon";
emailProvider?: "plunk" | "resend";
apiKey?: string;
};
Expand All @@ -25,8 +25,8 @@ export async function addAuth({

if (options.type === "clerk") {
await addClerkAuth({ projectDir });
} else if (options.type === "proofkit") {
await addProofkitAuth(options);
} else if (options.type === "fmaddon") {
await addFmaddonAuth(options);
}

if (!noInstall) {
Expand All @@ -43,11 +43,11 @@ async function addClerkAuth({
mergeSettings({ auth: { type: "clerk" } });
}

async function addProofkitAuth({
async function addFmaddonAuth({
emailProvider,
}: {
emailProvider?: "plunk" | "resend";
}) {
await proofkitAuthInstaller();
mergeSettings({ auth: { type: "proofkit" } });
mergeSettings({ auth: { type: "fmaddon" } });
}
16 changes: 9 additions & 7 deletions cli/src/installers/install-fm-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export async function installFmAddon({
}: {
addonName: "auth" | "wv";
}) {
const friendlyName =
addonName === "auth" ? "ProofKit Auth" : "ProofKit WebViewer";
const addonDisplayName =
addonName === "auth" ? "FM Add-on Auth" : "ProofKit WebViewer";

let targetDir: string | null = null;
if (process.platform === "win32") {
Expand All @@ -38,7 +38,7 @@ export async function installFmAddon({

if (!targetDir) {
logger.warn(
`Could not install the ${friendlyName} addon. You will need to do this manually.`
`Could not install the ${addonDisplayName} addon. You will need to do this manually.`
);
return;
}
Expand All @@ -62,8 +62,8 @@ export async function installFmAddon({
if (addonName === "auth") {
console.log(
`${chalk.yellowBright(
"You must install the ProofKit Auth addon in your FileMaker file."
)} ${chalk.dim("(Learn more: https://proofkit.dev/auth/proofkit)")}`
"You must install the FM Add-on Auth addon in your FileMaker file."
)} ${chalk.dim("(Learn more: https://proofkit.dev/auth/fm-addon)")}`
);
} else {
console.log(
Expand All @@ -74,7 +74,7 @@ export async function installFmAddon({
}
const steps = [
"Restart FileMaker Pro (if it's currently running)",
`Open your FileMaker file, go to layout mode, and install the ${friendlyName} addon to the file`,
`Open your FileMaker file, go to layout mode, and install the ${addonDisplayName} addon to the file`,
"Run the typegen command to add the types into your project:",
];
steps.forEach((step, index) => {
Expand All @@ -84,5 +84,7 @@ export async function installFmAddon({
console.log(chalk.cyan(` ${getUserPkgManager()} typegen`));
console.log("");

return;
throw new Error(
"You must install the FM Add-on Auth addon in your FileMaker file."
);
}
11 changes: 4 additions & 7 deletions cli/src/installers/proofkit-auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os from "os";
import path from "path";
import { type OttoAPIKey } from "@proofgeist/fmdapi";
import chalk from "chalk";
Expand All @@ -12,8 +11,6 @@ import { addConfig, runCodegenCommand } from "~/generators/fmdapi.js";
import { injectTanstackQuery } from "~/generators/tanstack-query.js";
import { state } from "~/state.js";
import { addPackageDependency } from "~/utils/addPackageDependency.js";
import { getUserPkgManager } from "~/utils/getUserPkgManager.js";
import { logger } from "~/utils/logger.js";
import { getSettings } from "~/utils/parseSettings.js";
import { formatAndSaveSourceFiles, getNewProject } from "~/utils/ts-morph.js";
import { addToHeaderSlot } from "./auth-shared.js";
Expand All @@ -40,16 +37,16 @@ export const proofkitAuthInstaller = async () => {
devMode: true,
});

// copy all files from template/extras/proofkit-auth to projectDir/src
// copy all files from template/extras/fmaddon-auth to projectDir/src
await fs.copy(
path.join(PKG_ROOT, "template/extras/proofkit-auth"),
path.join(PKG_ROOT, "template/extras/fmaddon-auth"),
path.join(projectDir, "src")
);

const project = getNewProject(projectDir);

// ensure tanstack query is installed
await injectTanstackQuery({ projectDir, project });
await injectTanstackQuery({ project });

// inject signin/signout components to header slots
addToHeaderSlot(
Expand Down Expand Up @@ -210,7 +207,7 @@ async function checkForProofKitLayouts(projectDir: string): Promise<boolean> {
if (allProofkitAuthLayoutsExist) {
console.log(
chalk.green(
"Successfully detected all required layouts for ProofKit Auth in your FileMaker file."
"Successfully detected all required layouts for FM Add-on Auth in your FileMaker file."
)
);
return true;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const schema = z
baseCommand: z.enum(["add", "init", "deploy"]).optional().catch(undefined),
appType: z.enum(["browser", "webviewer"]).optional().catch(undefined),
projectDir: z.string().default(process.cwd()),
authType: z.enum(["clerk", "proofkit"]).optional(),
authType: z.enum(["clerk", "fmaddon"]).optional(),
emailProvider: z.enum(["plunk", "resend", "none"]).optional(),
})
.passthrough();
Expand Down
5 changes: 4 additions & 1 deletion cli/src/utils/parseSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const authSchema = z
type: z.literal("next-auth"),
}),
z.object({
type: z.literal("proofkit"),
type: z.literal("proofkit").transform(() => "fmaddon"),
}),
z.object({
type: z.literal("fmaddon"),
}),
z.object({
type: z.literal("none"),
Expand Down
2 changes: 1 addition & 1 deletion cli/template/extras/emailProviders/none/email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function sendEmail({
const subject = type === "verification" ? "Verify Your Email" : "Reset Your Password"

// TODO: Customize this function to actually send the email to your users
// Learn more: https://proofkit.dev/auth/proofkit
// Learn more: https://proofkit.dev/auth/fm-addon
console.warn("TODO: Customize this function to actually send to your users");
console.log(`To ${to}: Your ${type} code is ${code}`);
}
Expand Down
6 changes: 3 additions & 3 deletions cli/template/fm-addon/ProofKitAuth/de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@

<DynamicTemplateString>
<StringID>com.fmi.calculation.text.1F27E3E6452F6E3D407EC45CDFF933C3</StringID>
<SourceText>https://proofkit.dev/auth/proofkit/</SourceText>
<TargetText>https://proofkit.dev/auth/proofkit/</TargetText>
<Comment>com.fmi.calculation.text.https://proofkit.dev/auth/proofkit/</Comment>
<SourceText>https://proofkit.dev/auth/fm-addon/</SourceText>
<TargetText>https://proofkit.dev/auth/fm-addon/</TargetText>
<Comment>com.fmi.calculation.text.https://proofkit.dev/auth/fm-addon/</Comment>
</DynamicTemplateString>

<DynamicTemplateString>
Expand Down
6 changes: 3 additions & 3 deletions cli/template/fm-addon/ProofKitAuth/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@

<DynamicTemplateString>
<StringID>com.fmi.calculation.text.1F27E3E6452F6E3D407EC45CDFF933C3</StringID>
<SourceText>https://proofkit.dev/auth/proofkit/</SourceText>
<TargetText>https://proofkit.dev/auth/proofkit/</TargetText>
<Comment>com.fmi.calculation.text.https://proofkit.dev/auth/proofkit/</Comment>
<SourceText>https://proofkit.dev/auth/fm-addon/</SourceText>
<TargetText>https://proofkit.dev/auth/fm-addon/</TargetText>
<Comment>com.fmi.calculation.text.https://proofkit.dev/auth/fm-addon/</Comment>
</DynamicTemplateString>

<DynamicTemplateString>
Expand Down
6 changes: 3 additions & 3 deletions cli/template/fm-addon/ProofKitAuth/es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@

<DynamicTemplateString>
<StringID>com.fmi.calculation.text.1F27E3E6452F6E3D407EC45CDFF933C3</StringID>
<SourceText>https://proofkit.dev/auth/proofkit/</SourceText>
<TargetText>https://proofkit.dev/auth/proofkit/</TargetText>
<Comment>com.fmi.calculation.text.https://proofkit.dev/auth/proofkit/</Comment>
<SourceText>https://proofkit.dev/auth/fm-addon/</SourceText>
<TargetText>https://proofkit.dev/auth/fm-addon/</TargetText>
<Comment>com.fmi.calculation.text.https://proofkit.dev/auth/fm-addon/</Comment>
</DynamicTemplateString>

<DynamicTemplateString>
Expand Down
6 changes: 3 additions & 3 deletions cli/template/fm-addon/ProofKitAuth/fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@

<DynamicTemplateString>
<StringID>com.fmi.calculation.text.1F27E3E6452F6E3D407EC45CDFF933C3</StringID>
<SourceText>https://proofkit.dev/auth/proofkit/</SourceText>
<TargetText>https://proofkit.dev/auth/proofkit/</TargetText>
<Comment>com.fmi.calculation.text.https://proofkit.dev/auth/proofkit/</Comment>
<SourceText>https://proofkit.dev/auth/fm-addon/</SourceText>
<TargetText>https://proofkit.dev/auth/fm-addon/</TargetText>
<Comment>com.fmi.calculation.text.https://proofkit.dev/auth/fm-addon/</Comment>
</DynamicTemplateString>

<DynamicTemplateString>
Expand Down
2 changes: 1 addition & 1 deletion cli/template/fm-addon/ProofKitAuth/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ProofKit"
],
"Attribution" : "Proof+Geist",
"URL" : "https://proofkit.dev",
"URL" : "https://proofkit.dev/auth/fm-addon",
"Icon_Color" : "#7F7F7F",
"Version" : "1.0"
}
2 changes: 1 addition & 1 deletion cli/template/fm-addon/ProofKitAuth/info_de.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Title" : "ProofKit Auth",
"Title" : "FileMaker Add-on Auth",

"Description" : "*** DESCRIPTION MISSING *** - DNL",

Expand Down
14 changes: 5 additions & 9 deletions cli/template/fm-addon/ProofKitAuth/info_en.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"Title": "ProofKit Auth",
"Description": "ProofKit Auth - User authentication with ProofKit Web apps",
"Category": "Web",
"Features": [],
"Optimized": [
"Desktop",
"Tablet",
"Mobile"
]
"Title": "FileMaker Add-on Auth",
"Description": "FileMaker Add-on Auth - User authentication with FileMaker web apps",
"Version": "1.0",
"Type": "fmaddon",
"RequiredFMPVersion": "20.0.0"
}
Loading