sst 2.0.0-rc.21 → 2.0.0-rc.22
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/cli/commands/env.js +1 -4
- package/package.json +1 -1
- package/site-env.js +1 -0
- package/sst.mjs +13 -15
package/cli/commands/env.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useProject } from "../../project.js";
|
|
2
2
|
import { createSpinner } from "../spinner.js";
|
|
3
3
|
import fs from "fs/promises";
|
|
4
|
-
import path from "path";
|
|
5
4
|
import { SiteEnv } from "../../site-env.js";
|
|
6
5
|
import { spawnSync } from "child_process";
|
|
7
6
|
export const env = (program) => program.command("env <command>", "description", (yargs) => yargs.positional("command", {
|
|
@@ -23,9 +22,7 @@ export const env = (program) => program.command("env <command>", "description",
|
|
|
23
22
|
}
|
|
24
23
|
spinner?.succeed();
|
|
25
24
|
const sites = await SiteEnv.values();
|
|
26
|
-
const
|
|
27
|
-
const env = sites[current] || {};
|
|
28
|
-
console.log(args.command);
|
|
25
|
+
const env = sites[process.cwd()] || {};
|
|
29
26
|
const result = spawnSync(args.command, {
|
|
30
27
|
env: {
|
|
31
28
|
...process.env,
|
package/package.json
CHANGED
package/site-env.js
CHANGED
|
@@ -37,6 +37,7 @@ export async function writeValues(input) {
|
|
|
37
37
|
await fs.promises.writeFile(file, JSON.stringify(input));
|
|
38
38
|
}
|
|
39
39
|
export function append(input) {
|
|
40
|
+
input.path = path.join(useProject().paths.root, input.path);
|
|
40
41
|
fs.appendFileSync(keysFile(), JSON.stringify(input) + "\n");
|
|
41
42
|
}
|
|
42
43
|
export function reset() {
|
package/sst.mjs
CHANGED
|
@@ -5212,6 +5212,7 @@ async function writeValues(input) {
|
|
|
5212
5212
|
await fs13.promises.writeFile(file, JSON.stringify(input));
|
|
5213
5213
|
}
|
|
5214
5214
|
function append(input) {
|
|
5215
|
+
input.path = path14.join(useProject().paths.root, input.path);
|
|
5215
5216
|
fs13.appendFileSync(keysFile(), JSON.stringify(input) + "\n");
|
|
5216
5217
|
}
|
|
5217
5218
|
function reset2() {
|
|
@@ -5283,15 +5284,15 @@ async function extractSchema(opts) {
|
|
|
5283
5284
|
{
|
|
5284
5285
|
name: "pothos-extractor",
|
|
5285
5286
|
visitor: {
|
|
5286
|
-
Program(
|
|
5287
|
-
const dummyResolverId =
|
|
5287
|
+
Program(path18) {
|
|
5288
|
+
const dummyResolverId = path18.scope.generateUidIdentifier("DUMMY_RESOLVER");
|
|
5288
5289
|
const resolverNode = dummyResolver({
|
|
5289
5290
|
dummy_resolver: dummyResolverId
|
|
5290
5291
|
});
|
|
5291
|
-
|
|
5292
|
-
|
|
5292
|
+
path18.unshiftContainer("body", resolverNode);
|
|
5293
|
+
path18.scope.crawl();
|
|
5293
5294
|
let schemaBuilder = null;
|
|
5294
|
-
|
|
5295
|
+
path18.traverse({
|
|
5295
5296
|
ImportDeclaration(declarator) {
|
|
5296
5297
|
if (!declarator)
|
|
5297
5298
|
return;
|
|
@@ -5349,17 +5350,17 @@ async function extractSchema(opts) {
|
|
|
5349
5350
|
);
|
|
5350
5351
|
return contents.code;
|
|
5351
5352
|
}
|
|
5352
|
-
function getBindings(
|
|
5353
|
+
function getBindings(path18, globalPaths) {
|
|
5353
5354
|
const bindings = [];
|
|
5354
|
-
|
|
5355
|
+
path18.traverse({
|
|
5355
5356
|
Expression(expressionPath) {
|
|
5356
5357
|
if (!expressionPath.isIdentifier())
|
|
5357
5358
|
return;
|
|
5358
|
-
const binding =
|
|
5359
|
+
const binding = path18.scope.getBinding(expressionPath);
|
|
5359
5360
|
if (!binding || globalPaths.has(binding.path) || bindings.includes(binding.path))
|
|
5360
5361
|
return;
|
|
5361
5362
|
const rootBinding = findRootBinding(binding.path);
|
|
5362
|
-
if (
|
|
5363
|
+
if (path18 === rootBinding) {
|
|
5363
5364
|
bindings.push(binding.path);
|
|
5364
5365
|
return;
|
|
5365
5366
|
}
|
|
@@ -5372,8 +5373,8 @@ function getBindings(path19, globalPaths) {
|
|
|
5372
5373
|
}
|
|
5373
5374
|
return bindings;
|
|
5374
5375
|
}
|
|
5375
|
-
function findRootBinding(
|
|
5376
|
-
let rootPath =
|
|
5376
|
+
function findRootBinding(path18) {
|
|
5377
|
+
let rootPath = path18;
|
|
5377
5378
|
while (rootPath.parentPath?.node !== void 0 && !rootPath.parentPath?.isProgram()) {
|
|
5378
5379
|
rootPath = rootPath.parentPath;
|
|
5379
5380
|
}
|
|
@@ -5940,7 +5941,6 @@ import dotenv2 from "dotenv";
|
|
|
5940
5941
|
init_project();
|
|
5941
5942
|
init_spinner();
|
|
5942
5943
|
import fs19 from "fs/promises";
|
|
5943
|
-
import path18 from "path";
|
|
5944
5944
|
import { spawnSync } from "child_process";
|
|
5945
5945
|
var env = (program2) => program2.command(
|
|
5946
5946
|
"env <command>",
|
|
@@ -5962,9 +5962,7 @@ var env = (program2) => program2.command(
|
|
|
5962
5962
|
}
|
|
5963
5963
|
spinner?.succeed();
|
|
5964
5964
|
const sites = await site_env_exports.values();
|
|
5965
|
-
const
|
|
5966
|
-
const env2 = sites[current] || {};
|
|
5967
|
-
console.log(args.command);
|
|
5965
|
+
const env2 = sites[process.cwd()] || {};
|
|
5968
5966
|
const result = spawnSync(args.command, {
|
|
5969
5967
|
env: {
|
|
5970
5968
|
...process.env,
|