Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@inlang/paraglide-js

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inlang/paraglide-js - npm Package Compare versions

Comparing version 1.0.0-prerelease.2 to 1.0.0-prerelease.3

dist/cli/commands/init.d.ts

2

dist/cli/commands/compile.js

@@ -7,3 +7,3 @@ import { loadProject } from "@inlang/sdk";

import { Command } from "commander";
import { paraglideDirectory } from "../main.js";
import { paraglideDirectory } from "../state.js";
import dedent from "dedent";

@@ -10,0 +10,0 @@ export const compileCommand = new Command()

import { Command } from "commander";
/**
* The absolute path to the paraglide directory.
*
* slices a path
* from '/Users/samuel/example/repository/node_modules/paraglide-js/dist/cli/main.js'
* to '/Users/samuel/example/repository/node_modules/paraglide-js'
*/
export declare const paraglideDirectory: string;
export declare const cli: Command;
//# sourceMappingURL=main.d.ts.map
import consola from "consola";
import dedent from "dedent";
import { fileURLToPath } from "node:url";
import { Command } from "commander";
import { compileCommand } from "./commands/compile.js";
/**
* The path this file is executed from.
*
* Usually something like '/Users/samuel/example/repository/node_modules/paraglide-js/dist/cli/main.js'
*/
const metaUrlPath = fileURLToPath(import.meta.url);
/**
* The absolute path to the paraglide directory.
*
* slices a path
* from '/Users/samuel/example/repository/node_modules/paraglide-js/dist/cli/main.js'
* to '/Users/samuel/example/repository/node_modules/paraglide-js'
*/
export const paraglideDirectory = metaUrlPath.slice(0, metaUrlPath.indexOf("/dist/"));
import { paraglideDirectory } from "./state.js";
export const cli = new Command()
.name("paraglide-js")
.addCommand(compileCommand)
.hook("preAction", () => {
.action(() => {
// ------------------- VALIDATE IF RUNNING FROM CORRECT FOLDER -------------------
// the CLI expects to be running from the dist folder of the specific paraglide package
// to compile the output in the correct directory
if (metaUrlPath.includes(`paraglide-js/dist/`) === false) {
if (paraglideDirectory.endsWith(`paraglide-js`) === false) {
consola.error(dedent `
The CLI is not running from the dist folder.
The CLI is not running from a paraglide-js directory.

@@ -35,7 +21,9 @@ This is likely an internal bug. Please file an issue at https://github.com/inlang/monorepo/issues.

- metaUrlPath: ${metaUrlPath}
- paraglideDirectory: ${paraglideDirectory}
`);
process.exit(1);
return process.exit(1);
}
// show the help because no command is specified
return cli.help();
});
cli.showHelpAfterError(true);
{
"name": "@inlang/paraglide-js",
"type": "module",
"version": "1.0.0-prerelease.2",
"version": "1.0.0-prerelease.3",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc