From f70dba9ee8e0b753e0f9ce0e3293ee0d7bb7d271 Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Thu, 15 Feb 2024 23:32:52 +0530 Subject: [PATCH 1/5] fix: global nested path conflict when assets begin with same name --- fastn-core/tests/05-hello-font/cmd.p1 | 2 - .../tests/05-hello-font/output/hello.py | 0 .../05-hello-font/output/hello/world/test.py | 0 .../tests/05-hello-font/output/manifest.json | 10 - .../tests/19-offline-build/output/index.html | 34 +-- .../output/.fastn/config.json | 216 ------------------ fastn-js/src/to_js.rs | 8 +- fastn-js/src/utils.rs | 19 +- 8 files changed, 42 insertions(+), 247 deletions(-) delete mode 100644 fastn-core/tests/05-hello-font/output/hello.py delete mode 100644 fastn-core/tests/05-hello-font/output/hello/world/test.py delete mode 100644 fastn-core/tests/21-http-endpoint/output/.fastn/config.json diff --git a/fastn-core/tests/05-hello-font/cmd.p1 b/fastn-core/tests/05-hello-font/cmd.p1 index e5bd727eda..2ad4e86991 100644 --- a/fastn-core/tests/05-hello-font/cmd.p1 +++ b/fastn-core/tests/05-hello-font/cmd.p1 @@ -7,8 +7,6 @@ output: amitu/.build Updated package dependency. Processing www.amitu.com/manifest.json ... done in Processing www.amitu.com/FASTN/ ... done in -Processing www.amitu.com/hello.py ... done in -Processing www.amitu.com/hello/world/test.py ... done in Processing www.amitu.com/index ... done in Processing www.amitu.com/ ... Processing www.amitu.com/index.jpg ... done in Processing www.amitu.com/index.ftd ... done in diff --git a/fastn-core/tests/05-hello-font/output/hello.py b/fastn-core/tests/05-hello-font/output/hello.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fastn-core/tests/05-hello-font/output/hello/world/test.py b/fastn-core/tests/05-hello-font/output/hello/world/test.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/fastn-core/tests/05-hello-font/output/manifest.json b/fastn-core/tests/05-hello-font/output/manifest.json index e37383f0b0..b9fb16339c 100644 --- a/fastn-core/tests/05-hello-font/output/manifest.json +++ b/fastn-core/tests/05-hello-font/output/manifest.json @@ -5,16 +5,6 @@ "checksum": "C08736376A2C9A13DFB62EDFFF1ED7D14294B96208DB383D11DE8703586FF17C", "size": 727 }, - "hello.py": { - "name": "hello.py", - "checksum": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", - "size": 0 - }, - "hello/world/test.py": { - "name": "hello/world/test.py", - "checksum": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", - "size": 0 - }, "index": { "name": "index", "checksum": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", diff --git a/fastn-core/tests/19-offline-build/output/index.html b/fastn-core/tests/19-offline-build/output/index.html index 4618e705ad..157bde556c 100644 --- a/fastn-core/tests/19-offline-build/output/index.html +++ b/fastn-core/tests/19-offline-build/output/index.html @@ -2077,7 +2077,7 @@ name: "John Doe", title: "Software Developer", company_name: "John Doe Pvt. Ltd.", - logo: global.fastn_community_github_io_business_card_demo_assets__files.get("assets").get("ipsum_logo").get("svg"), + logo: global.fastn_community_github_io_business_card_demo_assets__files.get("assets_ipsum_logo_svg"), contact_1: "+91 12345 99999", contact_2: "+91 12345 88888", email: "john@johndoe.com", @@ -2090,42 +2090,42 @@ } } global["main"] = main; -fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets.fastn_badge_white.svg", function () { +fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets_fastn_badge_white_svg", function () { let record = fastn.recordInstance({ }); record.set("light", "-/fastn-community.github.io/business-card/assets/fastn-badge-white.svg"); record.set("dark", "-/fastn-community.github.io/business-card/assets/fastn-badge-white-dark.svg"); return record; }()); -fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets.download_hover.svg", function () { +fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets_download_hover_svg", function () { let record = fastn.recordInstance({ }); record.set("light", "-/fastn-community.github.io/business-card/assets/download-hover.svg"); record.set("dark", "-/fastn-community.github.io/business-card/assets/download-hover-dark.svg"); return record; }()); -fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets.download.svg", function () { +fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets_download_svg", function () { let record = fastn.recordInstance({ }); record.set("light", "-/fastn-community.github.io/business-card/assets/download.svg"); record.set("dark", "-/fastn-community.github.io/business-card/assets/download-dark.svg"); return record; }()); -fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets.flip_icon.svg", function () { +fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets_flip_icon_svg", function () { let record = fastn.recordInstance({ }); record.set("light", "-/fastn-community.github.io/business-card/assets/flip-icon.svg"); record.set("dark", "-/fastn-community.github.io/business-card/assets/flip-icon-dark.svg"); return record; }()); -fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets.flip_icon_hover.svg", function () { +fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_assets__files.assets_flip_icon_hover_svg", function () { let record = fastn.recordInstance({ }); record.set("light", "-/fastn-community.github.io/business-card/assets/flip-icon-hover.svg"); record.set("dark", "-/fastn-community.github.io/business-card/assets/flip-icon-hover-dark.svg"); return record; }()); -fastn_utils.createNestedObject(global, "fastn_stack_github_io_fastn_js_assets__files.download.js", "-/fastn-stack.github.io/fastn-js/download.js"); +fastn_utils.createNestedObject(global, "fastn_stack_github_io_fastn_js_assets__files.download_js", "-/fastn-stack.github.io/fastn-js/download.js"); let fastn_stack_github_io_fastn_js_utils__download_as_image = function (args) { let __fastn_super_package_name__ = __fastn_package_name__; @@ -2244,7 +2244,7 @@ }, function (root, inherited) { let rooti0 = fastn_dom.createKernel(root, fastn_dom.ElementKind.Image); - rooti0.setProperty(fastn_dom.PropertyKind.ImageSrc, global.fastn_community_github_io_business_card_assets__files.get("assets").get("fastn_badge_white").get("svg"), inherited); + rooti0.setProperty(fastn_dom.PropertyKind.ImageSrc, global.fastn_community_github_io_business_card_assets__files.get("assets_fastn_badge_white_svg"), inherited); rooti0.setProperty(fastn_dom.PropertyKind.AlignSelf, fastn_dom.AlignSelf.Center, inherited); rooti0.setProperty(fastn_dom.PropertyKind.Width, fastn_dom.Resizing.Fixed(fastn_dom.Length.Px(140)), inherited); rooti0.setProperty(fastn_dom.PropertyKind.MarginTop, fastn_dom.Length.Px(8), inherited); @@ -2259,15 +2259,15 @@ rooti0.setProperty(fastn_dom.PropertyKind.Spacing, fastn_dom.Spacing.Fixed(fastn_dom.Length.Px(12)), inherited); rooti0.setProperty(fastn_dom.PropertyKind.Children, fastn.mutableList([function (root, inherited) { let rooti0 = fastn_dom.createKernel(root, fastn_dom.ElementKind.Image); - rooti0.setProperty(fastn_dom.PropertyKind.ImageSrc, fastn.formula([global.fastn_community_github_io_business_card_assets__files.get("assets").get("flip_icon_hover").get("svg"), - global.fastn_community_github_io_business_card_assets__files.get("assets").get("flip_icon").get("svg"), + rooti0.setProperty(fastn_dom.PropertyKind.ImageSrc, fastn.formula([global.fastn_community_github_io_business_card_assets__files.get("assets_flip_icon_hover_svg"), + global.fastn_community_github_io_business_card_assets__files.get("assets_flip_icon_svg"), __args__.mouse_in], function () { if (function () { return (!fastn_utils.getStaticValue(__args__.mouse_in)); }()) { - return global.fastn_community_github_io_business_card_assets__files.get("assets").get("flip_icon").get("svg"); + return global.fastn_community_github_io_business_card_assets__files.get("assets_flip_icon_svg"); } else { - return global.fastn_community_github_io_business_card_assets__files.get("assets").get("flip_icon_hover").get("svg"); + return global.fastn_community_github_io_business_card_assets__files.get("assets_flip_icon_hover_svg"); } } ), inherited); @@ -2293,15 +2293,15 @@ }, function (root, inherited) { let rooti0 = fastn_dom.createKernel(root, fastn_dom.ElementKind.Image); - rooti0.setProperty(fastn_dom.PropertyKind.ImageSrc, fastn.formula([global.fastn_community_github_io_business_card_assets__files.get("assets").get("download").get("svg"), - global.fastn_community_github_io_business_card_assets__files.get("assets").get("download_hover").get("svg"), + rooti0.setProperty(fastn_dom.PropertyKind.ImageSrc, fastn.formula([global.fastn_community_github_io_business_card_assets__files.get("assets_download_svg"), + global.fastn_community_github_io_business_card_assets__files.get("assets_download_hover_svg"), __args__.mouse_over], function () { if (function () { return fastn_utils.getStaticValue(__args__.mouse_over); }()) { - return global.fastn_community_github_io_business_card_assets__files.get("assets").get("download_hover").get("svg"); + return global.fastn_community_github_io_business_card_assets__files.get("assets_download_hover_svg"); } else { - return global.fastn_community_github_io_business_card_assets__files.get("assets").get("download").get("svg"); + return global.fastn_community_github_io_business_card_assets__files.get("assets_download_svg"); } } ), inherited); @@ -2606,7 +2606,7 @@ } } global["fastn_community_github_io_business_card__card"] = fastn_community_github_io_business_card__card; -fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_demo_assets__files.assets.ipsum_logo.svg", function () { +fastn_utils.createNestedObject(global, "fastn_community_github_io_business_card_demo_assets__files.assets_ipsum_logo_svg", function () { let record = fastn.recordInstance({ }); record.set("light", "-/fastn-community.github.io/business-card-demo/assets/ipsum-logo.svg"); diff --git a/fastn-core/tests/21-http-endpoint/output/.fastn/config.json b/fastn-core/tests/21-http-endpoint/output/.fastn/config.json deleted file mode 100644 index b49aa356ef..0000000000 --- a/fastn-core/tests/21-http-endpoint/output/.fastn/config.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "package": "fastn-stack.github.io/http-endpoint-test", - "all_packages": { - "fastn-stack.github.io/fastn-ui": { - "files": { - "FASTN.ftd": { - "name": "FASTN.ftd", - "checksum": "22E9BA037F761093E2BEA5C9D4E33E03787661992D94BA0612BD996FFA1AAE0F", - "size": 208 - }, - "arrow-right.png": { - "name": "arrow-right.png", - "checksum": "9F08169F542CB20A17F9432290A23B35DA8E815718E13749C125E5C915398036", - "size": 264 - }, - "code.ftd": { - "name": "code.ftd", - "checksum": "55817640588F621BDE4A4850AED568085E2C1E9CBBCD7C399C0FADA7DB6E512C", - "size": 125 - }, - "create-cr.ftd": { - "name": "create-cr.ftd", - "checksum": "17C19856B09572E56A82BB37704A69F8505022A65D792CB6E4E89750E84FA263", - "size": 659 - }, - "cross.svg": { - "name": "cross.svg", - "checksum": "030E3E7DBA0BD039E86E78A1DA968F24EA0811FB1C4CAD3481E18947A3F7A1D4", - "size": 1483 - }, - "delete-icon.svg": { - "name": "delete-icon.svg", - "checksum": "52593C3DC6B757A0F683709E254559723400EC0633915866E60E5B3F6DA0922C", - "size": 2944 - }, - "delete.png": { - "name": "delete.png", - "checksum": "044778C91335EC245858A656123EF2B561558C4554B59AAAB36D2208A35C9CD7", - "size": 647 - }, - "desktop-active.svg": { - "name": "desktop-active.svg", - "checksum": "8775C6BF6DCF54FBB347C2484900F65BE08FC2E9F7A1A22F377589E53ACB57CE", - "size": 740 - }, - "desktop.svg": { - "name": "desktop.svg", - "checksum": "2F345251CAAD01E884CD37EEE0AC4E939ABD092428A9B83BDB4886892456C1C8", - "size": 740 - }, - "downarrow.svg": { - "name": "downarrow.svg", - "checksum": "3EDC5E9D3185DABE1ED80673A59B38FA26B86905585C66DAC3DB10038800DEEA", - "size": 493 - }, - "e-active.svg": { - "name": "e-active.svg", - "checksum": "21373E1D1CB66CFDBD4DC69207F6EE1737EC5375CD2061B5EB704790AE19022C", - "size": 285 - }, - "e-default.svg": { - "name": "e-default.svg", - "checksum": "C0F739A6B7182CD32FB54732DBB375D9DD880613118758B65051F19F93F8EED4", - "size": 226 - }, - "edit-icon-default.svg": { - "name": "edit-icon-default.svg", - "checksum": "3E413DAEDE33A18766C486523F19F7B3EC3C1F13E93BEAC85E503B718D0E7B93", - "size": 680 - }, - "edit-icon.svg": { - "name": "edit-icon.svg", - "checksum": "A13E52D1FCC7FD76FD39CB697432D4AC3C47290991558B63A3FDEB43C483B1E8", - "size": 590 - }, - "edit.svg": { - "name": "edit.svg", - "checksum": "7E234382BB2096A022CF12D258515210D30BE7F5D2866902D711E90592F8CB46", - "size": 676 - }, - "editor-icon.svg": { - "name": "editor-icon.svg", - "checksum": "AE8CCE7B1D9EEBE7590EF2A519453CB2059C94E230393D6E1074E0D17F605C51", - "size": 2934 - }, - "editor.ftd": { - "name": "editor.ftd", - "checksum": "E4EC691229D5AE382614B0E3E066E14C4E8FABECCE861DDDD6BC24CFF4BAFFFA", - "size": 59032 - }, - "file.svg": { - "name": "file.svg", - "checksum": "56417622D53BA855271F5A0455F841BA4E084D326C733C461900F860ECEEC162", - "size": 1512 - }, - "folder-icon.svg": { - "name": "folder-icon.svg", - "checksum": "09558AC0F284D4FF37E0B94A2275C3A988B77E465FBA15C9A61650EA57D6D903", - "size": 995 - }, - "git-pull-request.svg": { - "name": "git-pull-request.svg", - "checksum": "F86F00421FA0F656E252440C2675E78E5B952C6343D7BB161F0092C5A1728416", - "size": 1302 - }, - "image.ftd": { - "name": "image.ftd", - "checksum": "58F326B131268701961B0E1763109CAD8CB1A9D8D864720135E63A11EA26B3EC", - "size": 73 - }, - "index.ftd": { - "name": "index.ftd", - "checksum": "3088825DA1446D71924305D7B073D03294A1E7E466AF8EF9449FE0A0CDAC3683", - "size": 4040 - }, - "local-active.svg": { - "name": "local-active.svg", - "checksum": "2DDC6BB01721570A9955188F46051140A457B4776FA0B080A08030F558B8D094", - "size": 292 - }, - "local.svg": { - "name": "local.svg", - "checksum": "1D9CCBE45D0D80A9367852BEEFB7930B63FC78413076784F32E32832C3741319", - "size": 292 - }, - "m-active.svg": { - "name": "m-active.svg", - "checksum": "B43127FA9B7B528A2A0858F6CF8E35C0D74E4F810B6A0098AE832FB052CBB51A", - "size": 340 - }, - "m-default.svg": { - "name": "m-default.svg", - "checksum": "8D94D17FE48001159854B031AF5D96E9220171ACAABEA7A5514E7D19EB24CA1F", - "size": 279 - }, - "markdown.ftd": { - "name": "markdown.ftd", - "checksum": "E49C79D420F5A91ACBFD6F891D03062EE9CE9F17743180872D85BE6994E738A6", - "size": 104 - }, - "mobile-active.svg": { - "name": "mobile-active.svg", - "checksum": "EAE169027F9884E0559E95793F626EB41FE0340511E0D8BED1EC55390B8E7E04", - "size": 1493 - }, - "mobile-frame.png": { - "name": "mobile-frame.png", - "checksum": "6B5910F7EB38FFD7B0518661A2A4AF52FCBC825E3F0ADCA166A17FA92D77D98B", - "size": 42009 - }, - "mobile.svg": { - "name": "mobile.svg", - "checksum": "38B6E21D51CBD7864FA2365BB127BB86A30337574CA1DF47C9C1369DCDA8D65C", - "size": 1485 - }, - "new-file-icon.svg": { - "name": "new-file-icon.svg", - "checksum": "652F3B1C3FCD4F85821925FC5DBF7ADB0F964A3F2F530B821D5D8C5C47B2F11F", - "size": 2982 - }, - "original-status.ftd-0.2": { - "name": "original-status.ftd-0.2", - "checksum": "146E13845A43A62192CFC5CEBB46C706C97998C811F4ECFEBF10E259AFBA379E", - "size": 3306 - }, - "package-info.ftd": { - "name": "package-info.ftd", - "checksum": "DDAC4D477EAB215452C3B904C906460816AFEBE8CF1027CC1E5EA8363F99457F", - "size": 881 - }, - "refresh.svg": { - "name": "refresh.svg", - "checksum": "0BE9E00669EF7798975D06DBD704D80C1DD348D712B2FB0728836F5959CAF538", - "size": 1354 - }, - "rename.png": { - "name": "rename.png", - "checksum": "6E653D8E53E6B826ACD190A365263CD0D4E560506D436DBD3C7C688BC392BB67", - "size": 464 - }, - "right-arrow.svg": { - "name": "right-arrow.svg", - "checksum": "4F72E539073791B9C9F1A4738381A60021372A8F512FC8F4621D5A641FD7943D", - "size": 426 - }, - "server-active.svg": { - "name": "server-active.svg", - "checksum": "35B41E77D4AAA14FF83CB1761197374B4C5206DACEBBB2ECE44CE07BD5683131", - "size": 318 - }, - "server.svg": { - "name": "server.svg", - "checksum": "55E91C6C89BC3818EB771AA08F37D97FDAE9E17E8CEE9B429AD456C2A49AB935", - "size": 318 - }, - "showbar.svg": { - "name": "showbar.svg", - "checksum": "F6109ECDC65DFEFC3B371EB878638BE9D96F7325C3F67CE23D7E8A7E9A172E9E", - "size": 795 - }, - "sync.svg": { - "name": "sync.svg", - "checksum": "86D7130343B46622211A67074289D55536122FE441E27B32E612ED795B259E00", - "size": 1427 - }, - "translation-status.ftd": { - "name": "translation-status.ftd", - "checksum": "F46AF144A7CB8201D123EEE299613F2964DF64A36A5451BF67941DF990D463D2", - "size": 3168 - } - }, - "zip_url": "https://github.com/fastn-stack/fastn-ui/archive/9b154f7807d317c4f617b06726a11ca2ab0a42a1.zip", - "checksum": "01F7EA2F19DBBC720D062757D833BA3C63D282FC7111C13E9E904391EC8CDBFD" - } - } -} \ No newline at end of file diff --git a/fastn-js/src/to_js.rs b/fastn-js/src/to_js.rs index 83e0ba8602..ddae097c71 100644 --- a/fastn-js/src/to_js.rs +++ b/fastn-js/src/to_js.rs @@ -71,7 +71,8 @@ impl fastn_js::SetProperty { .append(text( format!( "{},", - self.value + &self + .value .to_js_with_element_name(&Some(self.element_name.clone())) ) .as_str(), @@ -677,6 +678,11 @@ fn variable_to_js( let (doc_name, remaining) = fastn_js::utils::get_doc_name_and_remaining(variable_name); let mut name = fastn_js::utils::name_to_js(doc_name.as_str()); if let Some(remaining) = remaining { + let remaining = if fastn_js::utils::is_asset_path(doc_name.as_str()) { + remaining.replace('.', "_") + } else { + remaining + }; name = format!( "{}.{}", name, diff --git a/fastn-js/src/utils.rs b/fastn-js/src/utils.rs index f15975f02a..ae0bee0cfe 100644 --- a/fastn-js/src/utils.rs +++ b/fastn-js/src/utils.rs @@ -11,7 +11,12 @@ pub fn is_kernel(s: &str) -> bool { pub fn reference_to_js(s: &str) -> String { let (prefix, s) = get_prefix(s); - let (mut p1, mut p2) = get_doc_name_and_remaining(s.as_str()); + let (mut p1, p2) = get_doc_name_and_remaining(s.as_str()); + let mut p2 = if is_asset_path(p1.as_str()) { + p2.map(|s| s.replace('.', "_")) + } else { + p2 + }; p1 = fastn_js::utils::name_to_js_(p1.as_str()); let mut wrapper_function = None; while let Some(ref remaining) = p2 { @@ -125,3 +130,15 @@ pub fn trim_brackets(s: &str) -> String { pub(crate) fn kebab_to_snake_case(s: &str) -> String { s.replace('-', "_") } + +pub(crate) fn ends_with_exact_suffix(name: &str, separator: &str, suffix: &str) -> bool { + if let Some((_, end)) = name.rsplit_once(separator) { + end.eq(suffix) + } else { + false + } +} + +pub(crate) fn is_asset_path(name: &str) -> bool { + ends_with_exact_suffix(name, "/", "assets#files") +} From 1ded1e79d43059b0387e9d5bcace6413b2fffc8a Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Fri, 16 Feb 2024 11:58:38 +0530 Subject: [PATCH 2/5] fix: skip non sublime-syntax file in syntax dir --- fastn-core/tests/05-hello-font/cmd.p1 | 2 ++ fastn-core/tests/05-hello-font/output/hello.py | 0 .../tests/05-hello-font/output/hello/world/test.py | 0 fastn-core/tests/05-hello-font/output/manifest.json | 10 ++++++++++ ftd/src/ftd2021/code.rs | 9 +++++++++ 5 files changed, 21 insertions(+) create mode 100644 fastn-core/tests/05-hello-font/output/hello.py create mode 100644 fastn-core/tests/05-hello-font/output/hello/world/test.py diff --git a/fastn-core/tests/05-hello-font/cmd.p1 b/fastn-core/tests/05-hello-font/cmd.p1 index 2ad4e86991..e5bd727eda 100644 --- a/fastn-core/tests/05-hello-font/cmd.p1 +++ b/fastn-core/tests/05-hello-font/cmd.p1 @@ -7,6 +7,8 @@ output: amitu/.build Updated package dependency. Processing www.amitu.com/manifest.json ... done in Processing www.amitu.com/FASTN/ ... done in +Processing www.amitu.com/hello.py ... done in +Processing www.amitu.com/hello/world/test.py ... done in Processing www.amitu.com/index ... done in Processing www.amitu.com/ ... Processing www.amitu.com/index.jpg ... done in Processing www.amitu.com/index.ftd ... done in diff --git a/fastn-core/tests/05-hello-font/output/hello.py b/fastn-core/tests/05-hello-font/output/hello.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fastn-core/tests/05-hello-font/output/hello/world/test.py b/fastn-core/tests/05-hello-font/output/hello/world/test.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/fastn-core/tests/05-hello-font/output/manifest.json b/fastn-core/tests/05-hello-font/output/manifest.json index b9fb16339c..e37383f0b0 100644 --- a/fastn-core/tests/05-hello-font/output/manifest.json +++ b/fastn-core/tests/05-hello-font/output/manifest.json @@ -5,6 +5,16 @@ "checksum": "C08736376A2C9A13DFB62EDFFF1ED7D14294B96208DB383D11DE8703586FF17C", "size": 727 }, + "hello.py": { + "name": "hello.py", + "checksum": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "size": 0 + }, + "hello/world/test.py": { + "name": "hello/world/test.py", + "checksum": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", + "size": 0 + }, "index": { "name": "index", "checksum": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", diff --git a/ftd/src/ftd2021/code.rs b/ftd/src/ftd2021/code.rs index 4da1a1205e..301a557aec 100644 --- a/ftd/src/ftd2021/code.rs +++ b/ftd/src/ftd2021/code.rs @@ -5,6 +5,15 @@ pub static SS: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { let mut builder = syntect::parsing::SyntaxSet::load_defaults_newlines().into_builder(); for f in SYNTAX_DIR.files() { + match f.path().extension().and_then(|v| v.to_str()) { + Some(ext) => { + if ext.ne("sublime-syntax") { + continue; + } + } + None => continue, + } + builder.add( syntect::parsing::syntax_definition::SyntaxDefinition::load_from_str( f.contents_utf8().unwrap(), From 08d9e13b8d6bc39b6ba9729d1ca3743f1514b4cc Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Fri, 16 Feb 2024 12:17:04 +0530 Subject: [PATCH 3/5] moved unrelated file from ftd/syntax folder --- ftd/src/ftd2021/code.rs | 9 --------- ftd/syntax/neovim-ftd.lua => neovim-ftd.lua | 0 2 files changed, 9 deletions(-) rename ftd/syntax/neovim-ftd.lua => neovim-ftd.lua (100%) diff --git a/ftd/src/ftd2021/code.rs b/ftd/src/ftd2021/code.rs index 301a557aec..4da1a1205e 100644 --- a/ftd/src/ftd2021/code.rs +++ b/ftd/src/ftd2021/code.rs @@ -5,15 +5,6 @@ pub static SS: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { let mut builder = syntect::parsing::SyntaxSet::load_defaults_newlines().into_builder(); for f in SYNTAX_DIR.files() { - match f.path().extension().and_then(|v| v.to_str()) { - Some(ext) => { - if ext.ne("sublime-syntax") { - continue; - } - } - None => continue, - } - builder.add( syntect::parsing::syntax_definition::SyntaxDefinition::load_from_str( f.contents_utf8().unwrap(), diff --git a/ftd/syntax/neovim-ftd.lua b/neovim-ftd.lua similarity index 100% rename from ftd/syntax/neovim-ftd.lua rename to neovim-ftd.lua From e64802967f3151a39b2121c138f353534c1caf54 Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Fri, 16 Feb 2024 15:01:47 +0530 Subject: [PATCH 4/5] js fmt --- fastn-js/js/ftd.js | 1 - 1 file changed, 1 deletion(-) diff --git a/fastn-js/js/ftd.js b/fastn-js/js/ftd.js index 45ef9d8cda..8b5b0e6d18 100644 --- a/fastn-js/js/ftd.js +++ b/fastn-js/js/ftd.js @@ -217,7 +217,6 @@ const ftd = (function () { return; } - if (body && method !== "GET") { if (body[0] instanceof fastn.recordInstanceClass) { if (body.length !== 1) { From a1d7c876b06a48113c9e54fe802c9dfba45044a9 Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Fri, 16 Feb 2024 15:22:11 +0530 Subject: [PATCH 5/5] fix: fbt tests --- ...CA0E2E11544F787F9F644BD7079A31FB42B3FCE1DD4683696571A.js} | 5 +++++ fastn-core/tests/08-static-assets/output/index.html | 2 +- ...D1675D31D884F2DA8FC8E9CA2DA19F288E98A7B0C4357F1EAA780.js} | 5 +++++ fastn-core/tests/09-markdown-pages/output/index.html | 2 +- ...56B0FB5A975C4E898A0F1A37462F37F6DC231B85AB35688F315A4.js} | 5 +++++ fastn-core/tests/17-sitemap/output/guide/install/index.html | 2 +- fastn-core/tests/17-sitemap/output/index.html | 2 +- fastn-core/tests/17-sitemap/output/install/index.html | 2 +- ...31B24C510DFAA21A71343396A1503C8D7883C55CAA350B2B033AD.js} | 5 +++++ fastn-core/tests/19-offline-build/output/index.html | 4 ++-- ...6C81B1DB99DA46155FD0047BB6E6948676913F2A2C31D2E2457C9.js} | 5 +++++ fastn-core/tests/21-http-endpoint/output/index.html | 2 +- 12 files changed, 33 insertions(+), 8 deletions(-) rename fastn-core/tests/08-static-assets/output/{default-D664697CA52D6C29B1306A9A9D12A7ACF13B0529B76437F61F5AEDDA74233BC7.js => default-40B13B1A51BCA0E2E11544F787F9F644BD7079A31FB42B3FCE1DD4683696571A.js} (99%) rename fastn-core/tests/09-markdown-pages/output/{default-0122ED5D3AFF7F8489CA441E516970D33CAB03A8E8A7009F99B1F09460A36AD4.js => default-95E0EBF19DED1675D31D884F2DA8FC8E9CA2DA19F288E98A7B0C4357F1EAA780.js} (99%) rename fastn-core/tests/17-sitemap/output/{default-0FF06CE88CB4E828DE3A913F3D083D788EDE5599561936AD95C3A63370C8B19D.js => default-00321F81BF756B0FB5A975C4E898A0F1A37462F37F6DC231B85AB35688F315A4.js} (99%) rename fastn-core/tests/19-offline-build/output/{default-E53437B404B7748568BBA51316B50190DFF738680ACCD891F6684BBB0CFBF31D.js => default-7CB544FFDC631B24C510DFAA21A71343396A1503C8D7883C55CAA350B2B033AD.js} (99%) rename fastn-core/tests/21-http-endpoint/output/{default-1CB230847A396730B0DB3BA55C390AFF868BA98D37975743373DACDF37606759.js => default-86C05F0EF1F6C81B1DB99DA46155FD0047BB6E6948676913F2A2C31D2E2457C9.js} (99%) diff --git a/fastn-core/tests/08-static-assets/output/default-D664697CA52D6C29B1306A9A9D12A7ACF13B0529B76437F61F5AEDDA74233BC7.js b/fastn-core/tests/08-static-assets/output/default-40B13B1A51BCA0E2E11544F787F9F644BD7079A31FB42B3FCE1DD4683696571A.js similarity index 99% rename from fastn-core/tests/08-static-assets/output/default-D664697CA52D6C29B1306A9A9D12A7ACF13B0529B76437F61F5AEDDA74233BC7.js rename to fastn-core/tests/08-static-assets/output/default-40B13B1A51BCA0E2E11544F787F9F644BD7079A31FB42B3FCE1DD4683696571A.js index 644d9a2018..1fdaf5b16d 100644 --- a/fastn-core/tests/08-static-assets/output/default-D664697CA52D6C29B1306A9A9D12A7ACF13B0529B76437F61F5AEDDA74233BC7.js +++ b/fastn-core/tests/08-static-assets/output/default-40B13B1A51BCA0E2E11544F787F9F644BD7079A31FB42B3FCE1DD4683696571A.js @@ -4798,6 +4798,11 @@ const ftd = (function () { redirect, }; + if (method === "GET") { + console.warn("Method `GET` is not yet supported."); + return; + } + if (body && method !== "GET") { if (body[0] instanceof fastn.recordInstanceClass) { if (body.length !== 1) { diff --git a/fastn-core/tests/08-static-assets/output/index.html b/fastn-core/tests/08-static-assets/output/index.html index c71e1a87e0..c0690b219c 100644 --- a/fastn-core/tests/08-static-assets/output/index.html +++ b/fastn-core/tests/08-static-assets/output/index.html @@ -14,7 +14,7 @@ - + diff --git a/fastn-core/tests/09-markdown-pages/output/default-0122ED5D3AFF7F8489CA441E516970D33CAB03A8E8A7009F99B1F09460A36AD4.js b/fastn-core/tests/09-markdown-pages/output/default-95E0EBF19DED1675D31D884F2DA8FC8E9CA2DA19F288E98A7B0C4357F1EAA780.js similarity index 99% rename from fastn-core/tests/09-markdown-pages/output/default-0122ED5D3AFF7F8489CA441E516970D33CAB03A8E8A7009F99B1F09460A36AD4.js rename to fastn-core/tests/09-markdown-pages/output/default-95E0EBF19DED1675D31D884F2DA8FC8E9CA2DA19F288E98A7B0C4357F1EAA780.js index e0fbc0a7ea..eaf1f034fd 100644 --- a/fastn-core/tests/09-markdown-pages/output/default-0122ED5D3AFF7F8489CA441E516970D33CAB03A8E8A7009F99B1F09460A36AD4.js +++ b/fastn-core/tests/09-markdown-pages/output/default-95E0EBF19DED1675D31D884F2DA8FC8E9CA2DA19F288E98A7B0C4357F1EAA780.js @@ -4798,6 +4798,11 @@ const ftd = (function () { redirect, }; + if (method === "GET") { + console.warn("Method `GET` is not yet supported."); + return; + } + if (body && method !== "GET") { if (body[0] instanceof fastn.recordInstanceClass) { if (body.length !== 1) { diff --git a/fastn-core/tests/09-markdown-pages/output/index.html b/fastn-core/tests/09-markdown-pages/output/index.html index 316ab3dc4a..1db8ccd2a8 100644 --- a/fastn-core/tests/09-markdown-pages/output/index.html +++ b/fastn-core/tests/09-markdown-pages/output/index.html @@ -14,7 +14,7 @@ - + diff --git a/fastn-core/tests/17-sitemap/output/default-0FF06CE88CB4E828DE3A913F3D083D788EDE5599561936AD95C3A63370C8B19D.js b/fastn-core/tests/17-sitemap/output/default-00321F81BF756B0FB5A975C4E898A0F1A37462F37F6DC231B85AB35688F315A4.js similarity index 99% rename from fastn-core/tests/17-sitemap/output/default-0FF06CE88CB4E828DE3A913F3D083D788EDE5599561936AD95C3A63370C8B19D.js rename to fastn-core/tests/17-sitemap/output/default-00321F81BF756B0FB5A975C4E898A0F1A37462F37F6DC231B85AB35688F315A4.js index 5f1a7d1412..1ec8048e07 100644 --- a/fastn-core/tests/17-sitemap/output/default-0FF06CE88CB4E828DE3A913F3D083D788EDE5599561936AD95C3A63370C8B19D.js +++ b/fastn-core/tests/17-sitemap/output/default-00321F81BF756B0FB5A975C4E898A0F1A37462F37F6DC231B85AB35688F315A4.js @@ -4798,6 +4798,11 @@ const ftd = (function () { redirect, }; + if (method === "GET") { + console.warn("Method `GET` is not yet supported."); + return; + } + if (body && method !== "GET") { if (body[0] instanceof fastn.recordInstanceClass) { if (body.length !== 1) { diff --git a/fastn-core/tests/17-sitemap/output/guide/install/index.html b/fastn-core/tests/17-sitemap/output/guide/install/index.html index d9d0d13b47..84bed8f524 100644 --- a/fastn-core/tests/17-sitemap/output/guide/install/index.html +++ b/fastn-core/tests/17-sitemap/output/guide/install/index.html @@ -14,7 +14,7 @@ - + diff --git a/fastn-core/tests/17-sitemap/output/index.html b/fastn-core/tests/17-sitemap/output/index.html index e8f9ebd400..7e6849325a 100644 --- a/fastn-core/tests/17-sitemap/output/index.html +++ b/fastn-core/tests/17-sitemap/output/index.html @@ -14,7 +14,7 @@ - + diff --git a/fastn-core/tests/17-sitemap/output/install/index.html b/fastn-core/tests/17-sitemap/output/install/index.html index d9d0d13b47..84bed8f524 100644 --- a/fastn-core/tests/17-sitemap/output/install/index.html +++ b/fastn-core/tests/17-sitemap/output/install/index.html @@ -14,7 +14,7 @@ - + diff --git a/fastn-core/tests/19-offline-build/output/default-E53437B404B7748568BBA51316B50190DFF738680ACCD891F6684BBB0CFBF31D.js b/fastn-core/tests/19-offline-build/output/default-7CB544FFDC631B24C510DFAA21A71343396A1503C8D7883C55CAA350B2B033AD.js similarity index 99% rename from fastn-core/tests/19-offline-build/output/default-E53437B404B7748568BBA51316B50190DFF738680ACCD891F6684BBB0CFBF31D.js rename to fastn-core/tests/19-offline-build/output/default-7CB544FFDC631B24C510DFAA21A71343396A1503C8D7883C55CAA350B2B033AD.js index dc4298cedc..c195981f17 100644 --- a/fastn-core/tests/19-offline-build/output/default-E53437B404B7748568BBA51316B50190DFF738680ACCD891F6684BBB0CFBF31D.js +++ b/fastn-core/tests/19-offline-build/output/default-7CB544FFDC631B24C510DFAA21A71343396A1503C8D7883C55CAA350B2B033AD.js @@ -4798,6 +4798,11 @@ const ftd = (function () { redirect, }; + if (method === "GET") { + console.warn("Method `GET` is not yet supported."); + return; + } + if (body && method !== "GET") { if (body[0] instanceof fastn.recordInstanceClass) { if (body.length !== 1) { diff --git a/fastn-core/tests/19-offline-build/output/index.html b/fastn-core/tests/19-offline-build/output/index.html index 157bde556c..457470ce2f 100644 --- a/fastn-core/tests/19-offline-build/output/index.html +++ b/fastn-core/tests/19-offline-build/output/index.html @@ -14,9 +14,9 @@ - + - + diff --git a/fastn-core/tests/21-http-endpoint/output/default-1CB230847A396730B0DB3BA55C390AFF868BA98D37975743373DACDF37606759.js b/fastn-core/tests/21-http-endpoint/output/default-86C05F0EF1F6C81B1DB99DA46155FD0047BB6E6948676913F2A2C31D2E2457C9.js similarity index 99% rename from fastn-core/tests/21-http-endpoint/output/default-1CB230847A396730B0DB3BA55C390AFF868BA98D37975743373DACDF37606759.js rename to fastn-core/tests/21-http-endpoint/output/default-86C05F0EF1F6C81B1DB99DA46155FD0047BB6E6948676913F2A2C31D2E2457C9.js index b81b7edca0..8a11e9c7cf 100644 --- a/fastn-core/tests/21-http-endpoint/output/default-1CB230847A396730B0DB3BA55C390AFF868BA98D37975743373DACDF37606759.js +++ b/fastn-core/tests/21-http-endpoint/output/default-86C05F0EF1F6C81B1DB99DA46155FD0047BB6E6948676913F2A2C31D2E2457C9.js @@ -4798,6 +4798,11 @@ const ftd = (function () { redirect, }; + if (method === "GET") { + console.warn("Method `GET` is not yet supported."); + return; + } + if (body && method !== "GET") { if (body[0] instanceof fastn.recordInstanceClass) { if (body.length !== 1) { diff --git a/fastn-core/tests/21-http-endpoint/output/index.html b/fastn-core/tests/21-http-endpoint/output/index.html index c947ca4b1f..86741165a4 100644 --- a/fastn-core/tests/21-http-endpoint/output/index.html +++ b/fastn-core/tests/21-http-endpoint/output/index.html @@ -14,7 +14,7 @@ - +