framer-cms-markdown 0.0.3 → 0.0.4

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.
Files changed (31) hide show
  1. package/dist/src/framer-to-markdown/cli.js +1 -1
  2. package/dist/src/framer-to-markdown/export.js +4 -4
  3. package/dist/src/framer-to-markdown/index.js +3 -3
  4. package/dist/src/markdown-to-framer/cli.js +1 -1
  5. package/dist/src/markdown-to-framer/import.js +5 -5
  6. package/dist/src/markdown-to-framer/index.js +1 -1
  7. package/package.json +4 -1
  8. package/src/framer-to-markdown/cli.ts +1 -1
  9. package/src/framer-to-markdown/export.ts +5 -5
  10. package/src/framer-to-markdown/index.ts +4 -3
  11. package/src/markdown-to-framer/cli.ts +1 -1
  12. package/src/markdown-to-framer/import.ts +5 -5
  13. package/src/markdown-to-framer/index.ts +1 -1
  14. package/dist/src/framer-to-markdown/config.js +0 -1
  15. package/dist/src/framer-to-markdown/filename.js +0 -1
  16. package/dist/src/framer-to-markdown/format.js +0 -1
  17. package/dist/src/framer-to-markdown/framer-client.js +0 -1
  18. package/dist/src/framer-to-markdown/frontmatter.js +0 -1
  19. package/dist/src/framer-to-markdown/markdown.js +0 -1
  20. package/src/framer-to-markdown/config.ts +0 -4
  21. package/src/framer-to-markdown/filename.ts +0 -5
  22. package/src/framer-to-markdown/format.ts +0 -1
  23. package/src/framer-to-markdown/framer-client.ts +0 -6
  24. package/src/framer-to-markdown/frontmatter.ts +0 -4
  25. package/src/framer-to-markdown/markdown.ts +0 -5
  26. /package/dist/src/{framer-to-markdown → libs/framer}/__tests__/filename.spec.js +0 -0
  27. /package/dist/src/{framer-to-markdown → libs/framer}/__tests__/frontmatter.spec.js +0 -0
  28. /package/dist/src/{framer-to-markdown → libs/framer}/__tests__/markdown.spec.js +0 -0
  29. /package/src/{framer-to-markdown → libs/framer}/__tests__/filename.spec.ts +0 -0
  30. /package/src/{framer-to-markdown → libs/framer}/__tests__/frontmatter.spec.ts +0 -0
  31. /package/src/{framer-to-markdown → libs/framer}/__tests__/markdown.spec.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from "./index";
2
+ import { runCli } from "./index.js";
3
3
  await runCli().catch((error) => {
4
4
  console.error(error instanceof Error ? error.message : error);
5
5
  process.exitCode = 1;
@@ -1,9 +1,9 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { resolveMarkdownFilename, slugify } from "./filename";
4
- import { formatMarkdownDocument } from "./format";
5
- import { toFrontmatter } from "./frontmatter";
6
- import { htmlToMarkdown } from "./markdown";
3
+ import { resolveMarkdownFilename, slugify } from "../libs/framer/filename.js";
4
+ import { formatMarkdownDocument } from "../libs/framer/format.js";
5
+ import { toFrontmatter } from "../libs/framer/frontmatter.js";
6
+ import { htmlToMarkdown } from "../libs/framer/markdown.js";
7
7
  const SECTION_HTML_FIELD_PATTERN = /^Section\s+(\d+)\s+HTML$/i;
8
8
  const BODY_FIELD_CANDIDATES = [
9
9
  "content",
@@ -2,9 +2,9 @@ import path from "node:path";
2
2
  import process from "node:process";
3
3
  import yargs from "yargs";
4
4
  import { hideBin } from "yargs/helpers";
5
- import { loadConfig } from "./config";
6
- import { exportItemsToMarkdown } from "./export";
7
- import { FramerClient } from "./framer-client";
5
+ import { loadConfig } from "../libs/framer/config.js";
6
+ import { FramerClient } from "../libs/framer/framer-client.js";
7
+ import { exportItemsToMarkdown } from "./export.js";
8
8
  export async function runCli(argv = hideBin(process.argv)) {
9
9
  const args = await yargs(argv)
10
10
  .scriptName("framer-to-markdown")
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from "./index";
2
+ import { runCli } from "./index.js";
3
3
  await runCli().catch((error) => {
4
4
  console.error(error instanceof Error ? error.message : error);
5
5
  process.exitCode = 1;
@@ -1,10 +1,10 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { slugify } from "../libs/framer/filename";
4
- import { createFieldDataEntryInput, } from "../libs/framer/framer-client";
5
- import { parseFrontmatterDocument } from "../libs/framer/frontmatter";
6
- import { markdownToHtml, splitMarkdownIntoSections, } from "../libs/framer/markdown";
7
- import { markdownFaqToJsonLd } from "./json-ld-faq";
3
+ import { slugify } from "../libs/framer/filename.js";
4
+ import { createFieldDataEntryInput, } from "../libs/framer/framer-client.js";
5
+ import { parseFrontmatterDocument } from "../libs/framer/frontmatter.js";
6
+ import { markdownToHtml, splitMarkdownIntoSections, } from "../libs/framer/markdown.js";
7
+ import { markdownFaqToJsonLd } from "./json-ld-faq.js";
8
8
  const SECTION_HTML_FIELD_PATTERN = /^Section\s+(\d+)\s+HTML$/i;
9
9
  const SECTION_TITLE_FIELD_PATTERN = /^Section\s+(\d+)\s+Title$/i;
10
10
  export async function listMarkdownFiles(rootDir) {
@@ -2,7 +2,7 @@ import path from "node:path";
2
2
  import process from "node:process";
3
3
  import yargs from "yargs";
4
4
  import { hideBin } from "yargs/helpers";
5
- import { loadConfig } from "../libs/framer/config";
5
+ import { loadConfig } from "../libs/framer/config.js";
6
6
  import { FramerClient, } from "../libs/framer/framer-client";
7
7
  import { buildCollectionItemInput, readMarkdownDocuments } from "./import";
8
8
  export async function runCli(argv = hideBin(process.argv)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framer-cms-markdown",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Sync's Framer CMS content from/to markdown",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -54,6 +54,9 @@
54
54
  ".ts",
55
55
  ".tsx"
56
56
  ],
57
+ "moduleNameMapper": {
58
+ "^(\\.{1,2}/.*)\\.js$": "$1"
59
+ },
57
60
  "testEnvironment": "node",
58
61
  "testTimeout": 20000,
59
62
  "testMatch": [
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runCli } from "./index";
3
+ import { runCli } from "./index.js";
4
4
 
5
5
  await runCli().catch((error) => {
6
6
  console.error(error instanceof Error ? error.message : error);
@@ -1,11 +1,11 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
3
 
4
- import { resolveMarkdownFilename, slugify } from "./filename";
5
- import { formatMarkdownDocument } from "./format";
6
- import type { FramerCollectionItemExport } from "./framer-client";
7
- import { toFrontmatter } from "./frontmatter";
8
- import { htmlToMarkdown } from "./markdown";
4
+ import { resolveMarkdownFilename, slugify } from "../libs/framer/filename.js";
5
+ import { formatMarkdownDocument } from "../libs/framer/format.js";
6
+ import { FramerCollectionItemExport } from "../libs/framer/framer-client.js";
7
+ import { toFrontmatter } from "../libs/framer/frontmatter.js";
8
+ import { htmlToMarkdown } from "../libs/framer/markdown.js";
9
9
 
10
10
  export type ExportOptions = {
11
11
  outputDir?: string;
@@ -4,9 +4,10 @@ import process from "node:process";
4
4
  import yargs from "yargs";
5
5
  import { hideBin } from "yargs/helpers";
6
6
 
7
- import { loadConfig } from "./config";
8
- import { exportItemsToMarkdown } from "./export";
9
- import { FramerClient } from "./framer-client";
7
+ import { loadConfig } from "../libs/framer/config.js";
8
+ import { FramerClient } from "../libs/framer/framer-client.js";
9
+
10
+ import { exportItemsToMarkdown } from "./export.js";
10
11
 
11
12
  export type CliArgs = {
12
13
  token?: string;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { runCli } from "./index";
3
+ import { runCli } from "./index.js";
4
4
 
5
5
  await runCli().catch((error) => {
6
6
  console.error(error instanceof Error ? error.message : error);
@@ -3,18 +3,18 @@ import path from "node:path";
3
3
 
4
4
  import type { CollectionItemInput, Field } from "framer-api";
5
5
 
6
- import { slugify } from "../libs/framer/filename";
6
+ import { slugify } from "../libs/framer/filename.js";
7
7
  import {
8
8
  createFieldDataEntryInput,
9
9
  type FramerCollectionItemExport,
10
- } from "../libs/framer/framer-client";
11
- import { parseFrontmatterDocument } from "../libs/framer/frontmatter";
10
+ } from "../libs/framer/framer-client.js";
11
+ import { parseFrontmatterDocument } from "../libs/framer/frontmatter.js";
12
12
  import {
13
13
  markdownToHtml,
14
14
  splitMarkdownIntoSections,
15
- } from "../libs/framer/markdown";
15
+ } from "../libs/framer/markdown.js";
16
16
 
17
- import { markdownFaqToJsonLd } from "./json-ld-faq";
17
+ import { markdownFaqToJsonLd } from "./json-ld-faq.js";
18
18
 
19
19
  const SECTION_HTML_FIELD_PATTERN = /^Section\s+(\d+)\s+HTML$/i;
20
20
  const SECTION_TITLE_FIELD_PATTERN = /^Section\s+(\d+)\s+Title$/i;
@@ -4,7 +4,7 @@ import process from "node:process";
4
4
  import yargs from "yargs";
5
5
  import { hideBin } from "yargs/helpers";
6
6
 
7
- import { loadConfig } from "../libs/framer/config";
7
+ import { loadConfig } from "../libs/framer/config.js";
8
8
  import {
9
9
  FramerClient,
10
10
  type FramerCollectionItemExport,
@@ -1 +0,0 @@
1
- export { loadConfig, } from "../libs/framer/config";
@@ -1 +0,0 @@
1
- export { resolveMarkdownFilename, slugify, uniqueName, } from "../libs/framer/filename";
@@ -1 +0,0 @@
1
- export { formatMarkdownDocument } from "../libs/framer/format";
@@ -1 +0,0 @@
1
- export { createFieldDataEntryInput, FramerClient, } from "../libs/framer/framer-client";
@@ -1 +0,0 @@
1
- export { parseFrontmatterDocument, toFrontmatter, } from "../libs/framer/frontmatter";
@@ -1 +0,0 @@
1
- export { htmlToMarkdown, markdownToHtml, splitMarkdownIntoSections, } from "../libs/framer/markdown";
@@ -1,4 +0,0 @@
1
- export {
2
- loadConfig,
3
- type SyncConfig as ExportConfig,
4
- } from "../libs/framer/config";
@@ -1,5 +0,0 @@
1
- export {
2
- resolveMarkdownFilename,
3
- slugify,
4
- uniqueName,
5
- } from "../libs/framer/filename";
@@ -1 +0,0 @@
1
- export { formatMarkdownDocument } from "../libs/framer/format";
@@ -1,6 +0,0 @@
1
- export {
2
- createFieldDataEntryInput,
3
- FramerClient,
4
- type FramerClientOptions,
5
- type FramerCollectionItemExport,
6
- } from "../libs/framer/framer-client";
@@ -1,4 +0,0 @@
1
- export {
2
- parseFrontmatterDocument,
3
- toFrontmatter,
4
- } from "../libs/framer/frontmatter";
@@ -1,5 +0,0 @@
1
- export {
2
- htmlToMarkdown,
3
- markdownToHtml,
4
- splitMarkdownIntoSections,
5
- } from "../libs/framer/markdown";