@curl.md/amp 0.0.2 → 0.0.3
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/README.md +7 -0
- package/dist/install.js +2 -2
- package/package.json +1 -1
- package/plugin.ts +4 -1
package/README.md
CHANGED
|
@@ -11,6 +11,13 @@ npx @curl.md/amp install
|
|
|
11
11
|
Successful installs print the Amp config path and create
|
|
12
12
|
`~/.config/amp/plugins/curlmd.ts`.
|
|
13
13
|
|
|
14
|
+
Amp currently starts with plugins disabled unless `PLUGINS` is set.
|
|
15
|
+
Launch it with:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
PLUGINS=all amp
|
|
19
|
+
```
|
|
20
|
+
|
|
14
21
|
## License
|
|
15
22
|
|
|
16
23
|
[MIT](https://github.com/wevm/curl.md/blob/main/LICENSE)
|
package/dist/install.js
CHANGED
|
@@ -38,7 +38,7 @@ if (isMain) {
|
|
|
38
38
|
const result = await installAmpPlugin();
|
|
39
39
|
console.log(`Installed ${result.packageSpec} to ${result.ampConfigDir}`);
|
|
40
40
|
console.log(`Plugin shim: ${result.shimPath}`);
|
|
41
|
-
console.log("Run 'amp' to
|
|
41
|
+
console.log("Run 'PLUGINS=all amp' to load plugins");
|
|
42
42
|
console.log('If auth is needed, set `CURLMD_API_KEY` or run `curl.md auth login`.');
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
@@ -67,7 +67,7 @@ export async function installAmpPlugin(options = {}) {
|
|
|
67
67
|
}
|
|
68
68
|
console.log(`Installing ${packageSpec}`);
|
|
69
69
|
// Install the plugin package into that config-local node_modules.
|
|
70
|
-
const result = (options.spawnSync || spawnSync)(platform === 'win32' ? 'npm.cmd' : 'npm', ['install', '--save-exact', packageSpec], {
|
|
70
|
+
const result = (options.spawnSync || spawnSync)(platform === 'win32' ? 'npm.cmd' : 'npm', ['install', '--silent', '--save-exact', packageSpec], {
|
|
71
71
|
cwd: ampConfigDir,
|
|
72
72
|
env,
|
|
73
73
|
stdio: 'inherit',
|
package/package.json
CHANGED
package/plugin.ts
CHANGED
|
@@ -185,7 +185,10 @@ export default function (amp: PluginAPI) {
|
|
|
185
185
|
credits_remaining: parseNumberHeader(res.headers.get('x-credits-remaining')),
|
|
186
186
|
fresh: input.fresh || undefined,
|
|
187
187
|
keywords: input.keywords,
|
|
188
|
-
markdown: json.content
|
|
188
|
+
markdown: json.content.replace(
|
|
189
|
+
/\n\n---\n\nPowered by \[curl\.md\]\(https:\/\/curl\.md\)$/,
|
|
190
|
+
'',
|
|
191
|
+
),
|
|
189
192
|
mode: input.mode,
|
|
190
193
|
objective: input.objective,
|
|
191
194
|
request_id: res.headers.get('x-request-id') || undefined,
|