playcademy 0.14.8 → 0.14.10
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/index.d.ts +2 -0
- package/dist/index.js +72 -18
- package/dist/utils.js +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,8 @@ type BucketDeleteOptions = BaseBucketOptions;
|
|
|
217
217
|
interface BucketBulkOptions extends BaseBucketOptions {
|
|
218
218
|
/** Add prefix to all uploaded keys */
|
|
219
219
|
prefix?: string;
|
|
220
|
+
/** Automatically use source directory path as prefix */
|
|
221
|
+
preservePrefix?: boolean;
|
|
220
222
|
/** Show what would be uploaded without uploading */
|
|
221
223
|
dryRun?: boolean;
|
|
222
224
|
}
|
package/dist/index.js
CHANGED
|
@@ -7142,7 +7142,7 @@ import { join as join15 } from "path";
|
|
|
7142
7142
|
// package.json
|
|
7143
7143
|
var package_default2 = {
|
|
7144
7144
|
name: "playcademy",
|
|
7145
|
-
version: "0.14.
|
|
7145
|
+
version: "0.14.9",
|
|
7146
7146
|
type: "module",
|
|
7147
7147
|
exports: {
|
|
7148
7148
|
".": {
|
|
@@ -7825,7 +7825,7 @@ function generateBindingsTypeString(features) {
|
|
|
7825
7825
|
return bindings.length > 0 ? "\n" + bindings.join("\n") : "";
|
|
7826
7826
|
}
|
|
7827
7827
|
function generateAuthVariablesString(hasAuth, hasAuthFile) {
|
|
7828
|
-
const authImport = hasAuthFile ? "\nimport type { UserInfo } from './node_modules/@playcademy/sdk/dist/
|
|
7828
|
+
const authImport = hasAuthFile ? "\nimport type { UserInfo } from './node_modules/@playcademy/sdk/dist/types.d.ts'\nimport type { User } from './server/lib/auth'" : "\nimport type { UserInfo } from './node_modules/@playcademy/sdk/dist/types.d.ts'";
|
|
7829
7829
|
const variableFields = [" playcademyUser?: UserInfo"];
|
|
7830
7830
|
if (hasAuth && hasAuthFile) {
|
|
7831
7831
|
variableFields.push(" user?: User");
|
|
@@ -12999,6 +12999,16 @@ async function runBucketBulk(directory, options = {}) {
|
|
|
12999
12999
|
if (!options.raw && !options.json) {
|
|
13000
13000
|
logger.newLine();
|
|
13001
13001
|
}
|
|
13002
|
+
if (options.prefix && options.preservePrefix) {
|
|
13003
|
+
if (!options.raw && !options.json) {
|
|
13004
|
+
logger.error("Cannot use both --prefix and --preserve-prefix flags");
|
|
13005
|
+
logger.newLine();
|
|
13006
|
+
}
|
|
13007
|
+
process.exit(1);
|
|
13008
|
+
}
|
|
13009
|
+
if (options.preservePrefix) {
|
|
13010
|
+
options.prefix = directory;
|
|
13011
|
+
}
|
|
13002
13012
|
if (!existsSync25(directory)) {
|
|
13003
13013
|
if (!options.raw && !options.json) {
|
|
13004
13014
|
logger.error(`Directory not found: ${directory}`);
|
|
@@ -13726,6 +13736,9 @@ bucketCommand.command("bulk <directory>").description(
|
|
|
13726
13736
|
).option(
|
|
13727
13737
|
"--prefix <prefix>",
|
|
13728
13738
|
"Prefix for all uploaded keys (use to include source dir: --prefix assets)"
|
|
13739
|
+
).option(
|
|
13740
|
+
"--preserve-prefix",
|
|
13741
|
+
"Use source directory path as prefix (cannot be used with --prefix)"
|
|
13729
13742
|
).option("--dry-run", "Show what would be uploaded without uploading").option("--raw", "Output minimal confirmation").option("--json", "Output result as JSON").option("--remote", "Use remote bucket instead of local").option(
|
|
13730
13743
|
"--env <environment>",
|
|
13731
13744
|
"Environment to use with --remote: staging (default) or production"
|
|
@@ -13940,8 +13953,8 @@ import { Command as Command24 } from "commander";
|
|
|
13940
13953
|
init_src();
|
|
13941
13954
|
import { confirm as confirm13 } from "@inquirer/prompts";
|
|
13942
13955
|
import { Command as Command21 } from "commander";
|
|
13943
|
-
var deleteCommand2 = new Command21("delete").description("Delete a game secret").argument("<key>", "Secret key to delete").option("--env <environment>", "Environment (staging or production)").option("-f, --force", "Skip confirmation").action(async (key, options) => {
|
|
13944
|
-
const { env } = options;
|
|
13956
|
+
var deleteCommand2 = new Command21("delete").description("Delete a game secret").argument("<key>", "Secret key to delete").option("--env <environment>", "Environment (staging or production)").option("-f, --force", "Skip confirmation").option("--no-deploy", "Skip deployment prompt").action(async (key, options) => {
|
|
13957
|
+
const { env, deploy: shouldPromptDeploy = true } = options;
|
|
13945
13958
|
try {
|
|
13946
13959
|
const environment = ensureEnvironment(env);
|
|
13947
13960
|
const client = await requireAuthenticatedClient();
|
|
@@ -13975,6 +13988,28 @@ var deleteCommand2 = new Command21("delete").description("Delete a game secret")
|
|
|
13975
13988
|
`Secret deleted successfully from ${environment}`
|
|
13976
13989
|
);
|
|
13977
13990
|
logger.newLine();
|
|
13991
|
+
if (shouldPromptDeploy) {
|
|
13992
|
+
const shouldRedeploy = await confirm13({
|
|
13993
|
+
message: `Redeploy now to apply this change?`,
|
|
13994
|
+
default: true
|
|
13995
|
+
});
|
|
13996
|
+
if (shouldRedeploy) {
|
|
13997
|
+
await deployCommand.parseAsync(["--env", environment], {
|
|
13998
|
+
from: "user"
|
|
13999
|
+
});
|
|
14000
|
+
} else {
|
|
14001
|
+
logger.newLine();
|
|
14002
|
+
logger.admonition("tip", "Next Steps", [
|
|
14003
|
+
`Remember to deploy your game to apply the secret: \`playcademy deploy\``
|
|
14004
|
+
]);
|
|
14005
|
+
logger.newLine();
|
|
14006
|
+
}
|
|
14007
|
+
} else {
|
|
14008
|
+
logger.admonition("tip", "Next Steps", [
|
|
14009
|
+
`Remember to deploy your game to apply the secret: \`playcademy deploy\``
|
|
14010
|
+
]);
|
|
14011
|
+
logger.newLine();
|
|
14012
|
+
}
|
|
13978
14013
|
} catch (error) {
|
|
13979
14014
|
logAndExit(error, logger, { prefix: "Failed to delete secret" });
|
|
13980
14015
|
}
|
|
@@ -14023,9 +14058,10 @@ var listCommand2 = new Command22("list").description("List game secret keys").op
|
|
|
14023
14058
|
|
|
14024
14059
|
// src/commands/secret/set.ts
|
|
14025
14060
|
init_src();
|
|
14061
|
+
import { confirm as confirm14 } from "@inquirer/prompts";
|
|
14026
14062
|
import { Command as Command23 } from "commander";
|
|
14027
|
-
var setCommand = new Command23("set").description("Set or update a game secret").argument("<key>", "Secret key (e.g., STRIPE_KEY)").argument("<value>", "Secret value").option("--env <environment>", "Environment (staging or production)").action(async (key, value, options) => {
|
|
14028
|
-
const { env } = options;
|
|
14063
|
+
var setCommand = new Command23("set").description("Set or update a game secret").argument("<key>", "Secret key (e.g., STRIPE_KEY)").argument("<value>", "Secret value").option("--env <environment>", "Environment (staging or production)").option("--no-deploy", "Skip deployment prompt").action(async (key, value, options) => {
|
|
14064
|
+
const { env, deploy: shouldPromptDeploy = true } = options;
|
|
14029
14065
|
try {
|
|
14030
14066
|
const environment = ensureEnvironment(env);
|
|
14031
14067
|
const client = await requireAuthenticatedClient();
|
|
@@ -14047,10 +14083,28 @@ var setCommand = new Command23("set").description("Set or update a game secret")
|
|
|
14047
14083
|
`Secret "${key}" set successfully in ${environment}`
|
|
14048
14084
|
);
|
|
14049
14085
|
logger.newLine();
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
|
|
14086
|
+
if (shouldPromptDeploy) {
|
|
14087
|
+
const shouldRedeploy = await confirm14({
|
|
14088
|
+
message: `Redeploy now to apply this change?`,
|
|
14089
|
+
default: true
|
|
14090
|
+
});
|
|
14091
|
+
if (shouldRedeploy) {
|
|
14092
|
+
await deployCommand.parseAsync(["--env", environment], {
|
|
14093
|
+
from: "user"
|
|
14094
|
+
});
|
|
14095
|
+
} else {
|
|
14096
|
+
logger.newLine();
|
|
14097
|
+
logger.admonition("tip", "Next Steps", [
|
|
14098
|
+
`Remember to deploy your game to apply the secret: \`playcademy deploy\``
|
|
14099
|
+
]);
|
|
14100
|
+
logger.newLine();
|
|
14101
|
+
}
|
|
14102
|
+
} else {
|
|
14103
|
+
logger.admonition("tip", "Next Steps", [
|
|
14104
|
+
`Remember to deploy your game to apply the secret: \`playcademy deploy\``
|
|
14105
|
+
]);
|
|
14106
|
+
logger.newLine();
|
|
14107
|
+
}
|
|
14054
14108
|
} catch (error) {
|
|
14055
14109
|
logAndExit(error, logger, { prefix: "Failed to set secret" });
|
|
14056
14110
|
}
|
|
@@ -14153,7 +14207,7 @@ var removeCommand = new Command27("remove").alias("rm").description('Remove an a
|
|
|
14153
14207
|
|
|
14154
14208
|
// src/commands/profiles/reset.ts
|
|
14155
14209
|
init_string();
|
|
14156
|
-
import { confirm as
|
|
14210
|
+
import { confirm as confirm15 } from "@inquirer/prompts";
|
|
14157
14211
|
import { Command as Command28 } from "commander";
|
|
14158
14212
|
var resetCommand = new Command28("reset").description(
|
|
14159
14213
|
"Remove all authentication profiles across all environments (requires confirmation)"
|
|
@@ -14191,7 +14245,7 @@ var resetCommand = new Command28("reset").description(
|
|
|
14191
14245
|
logger.newLine();
|
|
14192
14246
|
}
|
|
14193
14247
|
}
|
|
14194
|
-
const confirmed = await
|
|
14248
|
+
const confirmed = await confirm15({
|
|
14195
14249
|
message: "Are you sure you want to remove all profiles?",
|
|
14196
14250
|
default: false
|
|
14197
14251
|
});
|
|
@@ -14241,7 +14295,7 @@ import { Command as Command35 } from "commander";
|
|
|
14241
14295
|
|
|
14242
14296
|
// src/commands/timeback/cleanup.ts
|
|
14243
14297
|
init_src();
|
|
14244
|
-
import { confirm as
|
|
14298
|
+
import { confirm as confirm16 } from "@inquirer/prompts";
|
|
14245
14299
|
import { Command as Command30 } from "commander";
|
|
14246
14300
|
var cleanupCommand = new Command30("cleanup").description("Remove TimeBack integration for your game").option(
|
|
14247
14301
|
"--env <environment>",
|
|
@@ -14265,7 +14319,7 @@ var cleanupCommand = new Command30("cleanup").description("Remove TimeBack integ
|
|
|
14265
14319
|
return;
|
|
14266
14320
|
}
|
|
14267
14321
|
displayCleanupWarning(integration, game.displayName, logger);
|
|
14268
|
-
const confirmed = await
|
|
14322
|
+
const confirmed = await confirm16({
|
|
14269
14323
|
message: "Are you sure you want to remove TimeBack integration?",
|
|
14270
14324
|
default: false
|
|
14271
14325
|
});
|
|
@@ -14436,7 +14490,7 @@ var setupCommand = new Command32("setup").description("Set up TimeBack integrati
|
|
|
14436
14490
|
// src/commands/timeback/update.ts
|
|
14437
14491
|
init_src();
|
|
14438
14492
|
init_string();
|
|
14439
|
-
import { confirm as
|
|
14493
|
+
import { confirm as confirm17 } from "@inquirer/prompts";
|
|
14440
14494
|
import { green as green4, red as red4 } from "colorette";
|
|
14441
14495
|
import { Command as Command33 } from "commander";
|
|
14442
14496
|
var updateCommand = new Command33("update").description("Update TimeBack integration configuration for your game").option("--verbose, -v", "Output detailed information").option(
|
|
@@ -14517,7 +14571,7 @@ var updateCommand = new Command33("update").description("Update TimeBack integra
|
|
|
14517
14571
|
logger.data(change.label, `${red4(change.current)} \u2192 ${green4(change.next)}`, 1);
|
|
14518
14572
|
}
|
|
14519
14573
|
logger.newLine();
|
|
14520
|
-
const confirmed = await
|
|
14574
|
+
const confirmed = await confirm17({
|
|
14521
14575
|
message: `Update ${changeDetails.length} ${pluralize(changeDetails.length, "field")} in TimeBack?`,
|
|
14522
14576
|
default: false
|
|
14523
14577
|
});
|
|
@@ -14703,7 +14757,7 @@ import { Command as Command38 } from "commander";
|
|
|
14703
14757
|
// src/commands/vite/init.ts
|
|
14704
14758
|
init_package_manager();
|
|
14705
14759
|
import path3 from "node:path";
|
|
14706
|
-
import { confirm as
|
|
14760
|
+
import { confirm as confirm18 } from "@inquirer/prompts";
|
|
14707
14761
|
import { dim as dim9, underline as underline7 } from "colorette";
|
|
14708
14762
|
async function runViteInit() {
|
|
14709
14763
|
try {
|
|
@@ -14713,7 +14767,7 @@ async function runViteInit() {
|
|
|
14713
14767
|
if (!existingViteConfig) {
|
|
14714
14768
|
logger.warn("No vite config file found in your project");
|
|
14715
14769
|
logger.newLine();
|
|
14716
|
-
const shouldCreate = await
|
|
14770
|
+
const shouldCreate = await confirm18({
|
|
14717
14771
|
message: "Would you like to create a new vite.config.ts?",
|
|
14718
14772
|
default: true
|
|
14719
14773
|
});
|
package/dist/utils.js
CHANGED
|
@@ -3829,7 +3829,7 @@ import { join as join8 } from "path";
|
|
|
3829
3829
|
// package.json
|
|
3830
3830
|
var package_default2 = {
|
|
3831
3831
|
name: "playcademy",
|
|
3832
|
-
version: "0.14.
|
|
3832
|
+
version: "0.14.9",
|
|
3833
3833
|
type: "module",
|
|
3834
3834
|
exports: {
|
|
3835
3835
|
".": {
|
|
@@ -4096,7 +4096,7 @@ function generateBindingsTypeString(features) {
|
|
|
4096
4096
|
return bindings.length > 0 ? "\n" + bindings.join("\n") : "";
|
|
4097
4097
|
}
|
|
4098
4098
|
function generateAuthVariablesString(hasAuth, hasAuthFile) {
|
|
4099
|
-
const authImport = hasAuthFile ? "\nimport type { UserInfo } from './node_modules/@playcademy/sdk/dist/
|
|
4099
|
+
const authImport = hasAuthFile ? "\nimport type { UserInfo } from './node_modules/@playcademy/sdk/dist/types.d.ts'\nimport type { User } from './server/lib/auth'" : "\nimport type { UserInfo } from './node_modules/@playcademy/sdk/dist/types.d.ts'";
|
|
4100
4100
|
const variableFields = [" playcademyUser?: UserInfo"];
|
|
4101
4101
|
if (hasAuth && hasAuthFile) {
|
|
4102
4102
|
variableFields.push(" user?: User");
|
package/dist/version.js
CHANGED