From 2064b808e79e009d1bb2935663f46ee98093918f Mon Sep 17 00:00:00 2001 From: Serhii Khoma Date: Thu, 27 Mar 2025 19:38:04 +0700 Subject: [PATCH 1/4] feat: update to spago@next --- bower.json | 21 -- package.json | 10 +- packages.dhall | 5 - spago.dhall | 11 - spago.lock | 605 +++++++++++++++++++++++++++++++++++++++++++++ spago.yaml | 20 ++ src/React/Basic.js | 7 +- 7 files changed, 631 insertions(+), 48 deletions(-) delete mode 100644 bower.json delete mode 100644 packages.dhall delete mode 100644 spago.dhall create mode 100644 spago.lock create mode 100644 spago.yaml diff --git a/bower.json b/bower.json deleted file mode 100644 index ecd760b..0000000 --- a/bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "purescript-react-basic", - "license": [ - "Apache-2.0" - ], - "repository": { - "type": "git", - "url": "https://github.com/lumihq/purescript-react-basic" - }, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "output" - ], - "dependencies": { - "purescript-effect": "^v4.0.0", - "purescript-prelude": "^v6.0.0", - "purescript-record": "^v4.0.0" - } -} diff --git a/package.json b/package.json index 7d57c3c..c8f5f08 100644 --- a/package.json +++ b/package.json @@ -14,17 +14,13 @@ }, "homepage": "https://github.com/lumihq/purescript-react-basic#readme", "devDependencies": { - "bower": "^1.8.14", - "npm-run-all": "^4.1.5", - "pulp": "^16.0.1", - "purescript": "^0.15.0", - "spago": "^0.20.9" + "npm-run-all": "^4.1.5" }, "dependencies": { - "react": "^18.1.0" + "react": "^19.0.0" }, "scripts": { "build": "spago build", "clean": "rm -rf .spago bower_components output output-pulp node_modules" } -} +} \ No newline at end of file diff --git a/packages.dhall b/packages.dhall deleted file mode 100644 index e51832b..0000000 --- a/packages.dhall +++ /dev/null @@ -1,5 +0,0 @@ -let upstream = - https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220513/packages.dhall - sha256:1ed784f37ae6131d99acd542d058d5ce39954ccaacc3adba5cc7cf1549d2bffa - -in upstream diff --git a/spago.dhall b/spago.dhall deleted file mode 100644 index d58c6dd..0000000 --- a/spago.dhall +++ /dev/null @@ -1,11 +0,0 @@ -{- -Welcome to a Spago project! -You can edit this file as you like. --} -{ name = "react-basic" -, dependencies = [ "effect", "prelude", "record" ] -, packages = ./packages.dhall -, sources = [ "src/**/*.purs" ] -, license = "Apache-2.0" -, repository = "https://github.com/lumihq/purescript-react-basic" -} diff --git a/spago.lock b/spago.lock new file mode 100644 index 0000000..4cc869a --- /dev/null +++ b/spago.lock @@ -0,0 +1,605 @@ +{ + "workspace": { + "packages": { + "react-basic": { + "path": "./", + "core": { + "dependencies": [ + { + "effect": ">=4.0.0 <5.0.0" + }, + { + "prelude": ">=6.0.2 <7.0.0" + }, + { + "record": ">=4.0.0 <5.0.0" + } + ], + "build_plan": [ + "effect", + "functions", + "prelude", + "record", + "unsafe-coerce" + ] + }, + "test": { + "dependencies": [ + "effect" + ], + "build_plan": [] + } + } + }, + "package_set": { + "address": { + "registry": "63.6.0" + }, + "compiler": ">=0.15.15 <0.16.0", + "content": { + "abc-parser": "2.0.1", + "ace": "9.1.0", + "address-rfc2821": "0.1.1", + "aff": "8.0.0", + "aff-bus": "6.0.0", + "aff-coroutines": "9.0.0", + "aff-promise": "4.0.0", + "aff-retry": "2.0.0", + "affjax": "13.0.0", + "affjax-node": "1.0.0", + "affjax-web": "1.0.0", + "ansi": "7.0.0", + "apexcharts": "0.5.0", + "applicative-phases": "1.0.0", + "argonaut": "9.0.0", + "argonaut-aeson-generic": "0.4.1", + "argonaut-codecs": "9.1.0", + "argonaut-core": "7.0.0", + "argonaut-generic": "8.0.0", + "argonaut-traversals": "10.0.0", + "argparse-basic": "2.0.0", + "array-builder": "0.1.2", + "array-search": "0.6.0", + "arraybuffer": "13.2.0", + "arraybuffer-builder": "3.1.0", + "arraybuffer-types": "3.0.2", + "arrays": "7.3.0", + "arrays-extra": "0.6.1", + "arrays-zipper": "2.0.1", + "ask": "1.0.0", + "assert": "6.0.0", + "assert-multiple": "0.4.0", + "avar": "5.0.1", + "b64": "0.0.8", + "barbies": "1.0.1", + "barlow-lens": "0.9.0", + "bifunctors": "6.0.0", + "bigints": "7.0.1", + "bolson": "0.3.9", + "bookhound": "0.1.7", + "bower-json": "3.0.0", + "call-by-name": "4.0.1", + "canvas": "6.0.0", + "canvas-action": "9.0.0", + "cartesian": "1.0.6", + "catenable-lists": "7.0.0", + "cbor-stream": "1.3.0", + "chameleon": "1.0.0", + "chameleon-halogen": "1.0.3", + "chameleon-react-basic": "1.1.0", + "chameleon-styled": "2.5.0", + "chameleon-transformers": "1.0.0", + "channel": "1.0.0", + "checked-exceptions": "3.1.1", + "choku": "1.0.2", + "classless": "0.1.1", + "classless-arbitrary": "0.1.1", + "classless-decode-json": "0.1.1", + "classless-encode-json": "0.1.3", + "classnames": "2.0.0", + "codec": "6.1.0", + "codec-argonaut": "10.0.0", + "codec-json": "2.0.0", + "colors": "7.0.1", + "concur-core": "0.5.0", + "concur-react": "0.5.0", + "concurrent-queues": "3.0.0", + "console": "6.1.0", + "const": "6.0.0", + "contravariant": "6.0.0", + "control": "6.0.0", + "convertable-options": "1.0.0", + "coroutines": "7.0.0", + "css": "6.0.0", + "css-class-name-extractor": "0.0.4", + "css-frameworks": "1.0.1", + "csv-stream": "2.3.0", + "data-mvc": "0.0.2", + "datetime": "6.1.0", + "datetime-parsing": "0.2.0", + "debounce": "0.1.0", + "debug": "6.0.2", + "decimals": "7.1.0", + "default-values": "1.0.1", + "deku": "0.9.23", + "deno": "0.0.5", + "dissect": "1.0.0", + "distributive": "6.0.0", + "dodo-printer": "2.2.3", + "dom-filereader": "7.0.0", + "dom-indexed": "12.0.0", + "dom-simple": "0.4.0", + "dotenv": "4.0.3", + "droplet": "0.6.0", + "dts": "1.0.0", + "dual-numbers": "1.0.3", + "dynamic-buffer": "3.0.1", + "echarts-simple": "0.0.1", + "effect": "4.0.0", + "either": "6.1.0", + "elmish": "0.13.0", + "elmish-enzyme": "0.1.1", + "elmish-hooks": "0.10.3", + "elmish-html": "0.9.0", + "elmish-testing-library": "0.3.2", + "email-validate": "7.0.0", + "encoding": "0.0.9", + "enums": "6.0.1", + "env-names": "0.4.0", + "error": "2.0.0", + "eta-conversion": "0.3.2", + "exceptions": "6.1.0", + "exists": "6.0.0", + "exitcodes": "4.0.0", + "expect-inferred": "3.0.0", + "ezfetch": "1.1.0", + "fahrtwind": "2.0.0", + "fallback": "0.1.0", + "fast-vect": "1.2.0", + "fetch": "4.1.0", + "fetch-argonaut": "1.0.1", + "fetch-core": "5.1.0", + "fetch-yoga-json": "1.1.0", + "ffi-simple": "0.5.1", + "fft-js": "0.1.0", + "filterable": "5.0.0", + "fix-functor": "0.1.0", + "fixed-points": "7.0.0", + "fixed-precision": "5.0.0", + "flame": "1.3.0", + "float32": "2.0.0", + "fmt": "0.2.1", + "foldable-traversable": "6.0.0", + "foldable-traversable-extra": "0.0.6", + "foreign": "7.0.0", + "foreign-object": "4.1.0", + "foreign-readwrite": "3.4.0", + "forgetmenot": "0.1.0", + "fork": "6.0.0", + "form-urlencoded": "7.0.0", + "formatters": "7.0.0", + "framer-motion": "1.0.1", + "free": "7.1.0", + "freeap": "7.0.0", + "freer-free": "0.0.1", + "freet": "7.0.0", + "functions": "6.0.0", + "functor1": "3.0.0", + "functors": "5.0.0", + "fuzzy": "0.4.0", + "gen": "4.0.0", + "generate-values": "1.0.1", + "generic-router": "0.0.1", + "geojson": "0.0.5", + "geometria": "2.2.0", + "gesso": "1.0.0", + "gojs": "0.1.1", + "grain": "3.0.0", + "grain-router": "3.0.0", + "grain-virtualized": "3.0.0", + "graphs": "8.1.0", + "group": "4.1.1", + "halogen": "7.0.0", + "halogen-bootstrap5": "5.3.2", + "halogen-canvas": "1.0.0", + "halogen-css": "10.0.0", + "halogen-echarts-simple": "0.0.4", + "halogen-formless": "4.0.3", + "halogen-helix": "1.0.1", + "halogen-hooks": "0.6.3", + "halogen-hooks-extra": "0.9.0", + "halogen-infinite-scroll": "1.1.0", + "halogen-store": "0.5.4", + "halogen-storybook": "2.0.0", + "halogen-subscriptions": "2.0.0", + "halogen-svg-elems": "8.0.0", + "halogen-typewriter": "1.0.4", + "halogen-vdom": "8.0.0", + "halogen-vdom-string-renderer": "0.5.0", + "halogen-xterm": "2.0.0", + "heckin": "2.0.1", + "heterogeneous": "0.6.0", + "homogeneous": "0.4.0", + "http-methods": "6.0.0", + "httpurple": "4.0.0", + "huffman": "0.4.0", + "humdrum": "0.0.1", + "hyrule": "2.3.8", + "identity": "6.0.0", + "identy": "4.0.1", + "indexed-db": "1.0.0", + "indexed-monad": "3.0.0", + "int64": "3.0.0", + "integers": "6.0.0", + "interpolate": "5.0.2", + "intersection-observer": "1.0.1", + "invariant": "6.0.0", + "jarilo": "1.0.1", + "jelly": "0.10.0", + "jelly-router": "0.3.0", + "jelly-signal": "0.4.0", + "jest": "1.0.0", + "js-abort-controller": "1.0.0", + "js-bigints": "2.2.1", + "js-date": "8.0.0", + "js-fetch": "0.2.1", + "js-fileio": "3.0.0", + "js-intl": "1.1.4", + "js-iterators": "0.1.1", + "js-maps": "0.1.2", + "js-promise": "1.0.0", + "js-promise-aff": "1.0.0", + "js-timers": "6.1.0", + "js-uri": "3.1.0", + "jsdom": "1.0.0", + "json": "1.1.0", + "json-codecs": "5.0.0", + "justifill": "0.5.0", + "jwt": "0.0.9", + "labeled-data": "0.2.0", + "language-cst-parser": "0.14.1", + "lazy": "6.0.0", + "lazy-joe": "1.0.0", + "lcg": "4.0.0", + "leibniz": "5.0.0", + "leveldb": "1.0.1", + "liminal": "1.0.1", + "linalg": "6.0.0", + "lists": "7.0.0", + "literals": "1.0.2", + "logging": "3.0.0", + "logging-journald": "0.4.0", + "lumi-components": "18.0.0", + "machines": "7.0.0", + "maps-eager": "0.5.0", + "marionette": "1.0.0", + "marionette-react-basic-hooks": "0.1.1", + "marked": "0.1.0", + "matrices": "5.0.1", + "matryoshka": "1.0.0", + "maybe": "6.0.0", + "media-types": "6.0.0", + "meowclient": "1.0.0", + "midi": "4.0.0", + "milkis": "9.0.0", + "minibench": "4.0.1", + "mmorph": "7.0.0", + "monad-control": "5.0.0", + "monad-logger": "1.3.1", + "monad-loops": "0.5.0", + "monad-unlift": "1.0.1", + "monoid-extras": "0.0.1", + "monoidal": "0.16.0", + "morello": "0.4.0", + "mote": "3.0.0", + "motsunabe": "2.0.0", + "mvc": "0.0.1", + "mysql": "6.0.1", + "n3": "0.1.0", + "nano-id": "1.1.0", + "nanoid": "0.1.0", + "naturals": "3.0.0", + "nested-functor": "0.2.1", + "newtype": "5.0.0", + "nextjs": "0.1.1", + "nextui": "0.2.0", + "node-buffer": "9.0.0", + "node-child-process": "11.1.0", + "node-event-emitter": "3.0.0", + "node-execa": "5.0.0", + "node-fs": "9.2.0", + "node-glob-basic": "2.0.0", + "node-http": "9.1.0", + "node-http2": "1.1.1", + "node-human-signals": "1.0.0", + "node-net": "5.1.0", + "node-os": "5.1.0", + "node-path": "5.0.1", + "node-process": "11.2.0", + "node-readline": "8.1.1", + "node-sqlite3": "8.0.0", + "node-stream-pipes": "2.1.6", + "node-streams": "9.0.1", + "node-tls": "0.3.1", + "node-url": "7.0.1", + "node-workerbees": "0.3.1", + "node-zlib": "0.4.0", + "nonempty": "7.0.0", + "now": "6.0.0", + "npm-package-json": "2.0.0", + "nullable": "6.0.0", + "numberfield": "0.2.2", + "numbers": "9.0.1", + "oak": "3.1.1", + "oak-debug": "1.2.2", + "object-maps": "0.3.0", + "ocarina": "1.5.4", + "oooooooooorrrrrrrmm-lib": "0.0.1", + "open-colors-scales-and-schemes": "1.0.0", + "open-folds": "6.4.0", + "open-foreign-generic": "11.0.3", + "open-memoize": "6.2.0", + "open-mkdirp-aff": "1.2.0", + "open-pairing": "6.2.0", + "open-smolder": "12.0.2", + "options": "7.0.0", + "optparse": "5.0.1", + "ordered-collections": "3.2.0", + "ordered-set": "0.4.0", + "orders": "6.0.0", + "owoify": "1.2.0", + "pairs": "9.0.1", + "parallel": "7.0.0", + "parsing": "10.3.0", + "parsing-dataview": "3.2.4", + "partial": "4.0.0", + "pathy": "9.0.0", + "pha": "0.13.0", + "phaser": "0.7.0", + "phylio": "1.1.2", + "pipes": "8.0.0", + "pirates-charm": "0.0.1", + "pmock": "0.9.0", + "point-free": "1.0.0", + "pointed-list": "0.5.1", + "polymorphic-vectors": "4.0.0", + "posix-types": "6.0.0", + "postgresql": "2.0.20", + "precise": "6.0.0", + "precise-datetime": "7.0.0", + "prelude": "6.0.2", + "prettier-printer": "3.0.0", + "printf": "0.1.0", + "priority-queue": "0.1.2", + "profunctor": "6.0.1", + "profunctor-lenses": "8.0.0", + "protobuf": "4.4.0", + "psa-utils": "8.0.0", + "psci-support": "6.0.0", + "punycode": "1.0.0", + "qualified-do": "2.2.0", + "quantities": "12.2.0", + "quickcheck": "8.0.1", + "quickcheck-combinators": "0.1.3", + "quickcheck-laws": "7.0.0", + "quickcheck-utf8": "0.0.0", + "random": "6.0.0", + "rationals": "6.0.0", + "rdf": "0.1.0", + "react": "11.0.0", + "react-aria": "0.2.0", + "react-basic": "17.0.0", + "react-basic-classic": "3.0.0", + "react-basic-dnd": "10.1.0", + "react-basic-dom": "7.0.0", + "react-basic-dom-beta": "0.1.1", + "react-basic-emotion": "7.1.0", + "react-basic-hooks": "8.2.0", + "react-basic-storybook": "2.0.0", + "react-dom": "8.0.0", + "react-halo": "3.0.0", + "react-icons": "1.1.5", + "react-markdown": "0.1.0", + "react-testing-library": "4.0.1", + "react-virtuoso": "1.0.0", + "reactix": "0.6.1", + "read": "1.0.1", + "recharts": "1.1.0", + "record": "4.0.0", + "record-extra": "5.0.1", + "record-ptional-fields": "0.1.2", + "record-studio": "1.0.4", + "refs": "6.0.0", + "remotedata": "5.0.1", + "repr": "0.5.0", + "resize-observer": "1.0.0", + "resource": "2.0.1", + "resourcet": "1.0.0", + "result": "1.0.3", + "return": "0.2.0", + "ring-modules": "5.0.1", + "rito": "0.3.4", + "roman": "0.4.0", + "rough-notation": "1.0.2", + "routing": "11.0.0", + "routing-duplex": "0.7.0", + "run": "5.0.0", + "safe-coerce": "2.0.0", + "safely": "4.0.1", + "school-of-music": "1.3.0", + "selection-foldable": "0.2.0", + "selective-functors": "1.0.1", + "semirings": "7.0.0", + "shuffle": "1.1.0", + "signal": "13.0.0", + "simple-emitter": "3.0.1", + "simple-i18n": "2.0.1", + "simple-json": "9.0.0", + "simple-json-generics": "0.2.1", + "simple-ulid": "3.0.0", + "sized-matrices": "1.0.0", + "sized-vectors": "5.0.2", + "slug": "3.1.0", + "small-ffi": "4.0.1", + "soundfonts": "4.1.0", + "sparse-matrices": "2.0.1", + "sparse-polynomials": "3.0.1", + "spec": "8.1.1", + "spec-discovery": "8.4.0", + "spec-mocha": "5.1.1", + "spec-node": "0.0.3", + "spec-quickcheck": "5.0.2", + "spec-reporter-xunit": "0.7.1", + "splitmix": "2.1.0", + "ssrs": "1.0.0", + "st": "6.2.0", + "statistics": "0.3.2", + "strictlypositiveint": "1.0.1", + "string-parsers": "8.0.0", + "strings": "6.0.1", + "strings-extra": "4.0.0", + "stringutils": "0.0.12", + "substitute": "0.2.3", + "supply": "0.2.0", + "svg-parser": "3.0.0", + "systemd-journald": "0.3.0", + "tagged": "4.0.2", + "tailrec": "6.1.0", + "tanstack-query": "2.0.0", + "tecton": "0.2.1", + "tecton-halogen": "0.2.0", + "test-unit": "17.0.0", + "thermite": "6.3.1", + "thermite-dom": "0.3.1", + "these": "6.0.0", + "threading": "0.0.3", + "tidy": "0.11.1", + "tidy-codegen": "4.0.1", + "tldr": "0.0.0", + "toestand": "0.9.0", + "transformation-matrix": "1.0.1", + "transformers": "6.1.0", + "tree-rose": "4.0.2", + "trivial-unfold": "0.4.1", + "ts-bridge": "4.0.0", + "tuples": "7.0.0", + "two-or-more": "1.0.0", + "type-equality": "4.0.1", + "typedenv": "2.0.1", + "typelevel": "6.0.0", + "typelevel-lists": "2.1.0", + "typelevel-peano": "1.0.1", + "typelevel-prelude": "7.0.0", + "typelevel-regex": "0.0.3", + "typelevel-rows": "0.1.0", + "typisch": "0.4.0", + "uint": "7.0.0", + "ulid": "3.0.1", + "uncurried-transformers": "1.1.0", + "undefined": "2.0.0", + "undefined-is-not-a-problem": "1.1.0", + "unfoldable": "6.0.0", + "unicode": "6.0.0", + "unique": "0.6.1", + "unlift": "1.0.1", + "unordered-collections": "3.1.0", + "unsafe-coerce": "6.0.0", + "unsafe-reference": "5.0.0", + "untagged-to-tagged": "0.1.4", + "untagged-union": "1.0.0", + "uri": "9.0.0", + "url-immutable": "1.0.0", + "uuid": "9.0.0", + "uuidv4": "1.0.0", + "validation": "6.0.0", + "variant": "8.0.0", + "variant-encodings": "2.0.0", + "vectorfield": "1.0.1", + "vectors": "2.1.0", + "versions": "7.0.0", + "visx": "0.0.2", + "vitest": "1.0.0", + "web-clipboard": "6.0.0", + "web-cssom": "2.0.0", + "web-cssom-view": "0.1.0", + "web-dom": "6.0.0", + "web-dom-parser": "8.0.0", + "web-dom-xpath": "3.0.0", + "web-encoding": "3.0.0", + "web-events": "4.0.0", + "web-fetch": "4.0.1", + "web-file": "4.0.0", + "web-geometry": "0.1.0", + "web-html": "4.1.0", + "web-pointerevents": "2.0.0", + "web-proletarian": "1.0.0", + "web-promise": "3.2.0", + "web-resize-observer": "2.1.0", + "web-router": "1.0.0", + "web-socket": "4.0.0", + "web-storage": "5.0.0", + "web-streams": "4.0.0", + "web-touchevents": "4.0.0", + "web-uievents": "5.0.0", + "web-url": "2.0.0", + "web-workers": "1.1.0", + "web-xhr": "5.0.1", + "webextension-polyfill": "0.1.0", + "webgpu": "0.0.1", + "which": "2.0.0", + "whine-core": "0.0.28", + "xterm": "1.0.0", + "yoga-fetch": "1.0.1", + "yoga-json": "5.1.0", + "yoga-om": "0.1.0", + "yoga-postgres": "6.0.0", + "yoga-react-dom": "1.0.1", + "yoga-subtlecrypto": "0.1.0", + "yoga-tree": "1.0.0", + "z3": "0.0.2", + "zipperarray": "2.0.0" + } + }, + "extra_packages": {} + }, + "packages": { + "effect": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-eBtZu+HZcMa5HilvI6kaDyVX3ji8p0W9MGKy2K4T6+M=", + "dependencies": [ + "prelude" + ] + }, + "functions": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-adMyJNEnhGde2unHHAP79gPtlNjNqzgLB8arEOn9hLI=", + "dependencies": [ + "prelude" + ] + }, + "prelude": { + "type": "registry", + "version": "6.0.2", + "integrity": "sha256-kiAPZxihtAel8uRiTNdccf4qylp/9J3jNkEHNAD0MsE=", + "dependencies": [] + }, + "record": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-Za5U85bTRJEfGK5Sk4hM41oXy84YQI0I8TL3WUn1Qzg=", + "dependencies": [ + "functions", + "prelude", + "unsafe-coerce" + ] + }, + "unsafe-coerce": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-IqIYW4Vkevn8sI+6aUwRGvd87tVL36BBeOr0cGAE7t0=", + "dependencies": [] + } + } +} diff --git a/spago.yaml b/spago.yaml new file mode 100644 index 0000000..623f950 --- /dev/null +++ b/spago.yaml @@ -0,0 +1,20 @@ +package: + name: react-basic + publish: + license: Apache-2.0 + version: 17.0.0 + location: + githubOwner: lumihq + githubRepo: purescript-react-basic + dependencies: + - effect: ">=4.0.0 <5.0.0" + - prelude: ">=6.0.2 <7.0.0" + - record: ">=4.0.0 <5.0.0" + test: + main: Test.Main + dependencies: + - effect +workspace: + extraPackages: {} + packageSet: + registry: 63.6.0 diff --git a/src/React/Basic.js b/src/React/Basic.js index 264d3b3..e428c2e 100644 --- a/src/React/Basic.js +++ b/src/React/Basic.js @@ -1,6 +1,5 @@ -import React from "react"; -const createElement = React.createElement; -const Fragment = React.Fragment; +import * as React from "react"; +import { createElement, Fragment } from "react"; export const empty = null; @@ -36,4 +35,4 @@ export function contextProvider(context) { export function contextConsumer(context) { return context.Consumer; -} +} \ No newline at end of file From 269edfa42b7ca3c9430ffb629b60af4f0aa24b4f Mon Sep 17 00:00:00 2001 From: Serhii Khoma Date: Fri, 28 Mar 2025 08:21:38 +0700 Subject: [PATCH 2/4] feat: update github ci --- .github/ISSUE_TEMPLATE/bug-report.md | 19 ++++++++ .github/ISSUE_TEMPLATE/change-request.md | 21 +++++++++ .github/ISSUE_TEMPLATE/config.yml | 8 ++++ .github/PULL_REQUEST_TEMPLATE.md | 11 +++++ .github/workflows/ci.yml | 55 ++++++------------------ 5 files changed, 73 insertions(+), 41 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/change-request.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..b79b995 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,19 @@ +--- +name: Bug report +about: Report an issue +title: "" +labels: bug +assignees: "" +--- + +**Describe the bug** +A clear and concise description of the bug. + +**To Reproduce** +A minimal code example (preferably a runnable example on [Try PureScript](https://try.purescript.org)!) or steps to reproduce the issue. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/change-request.md b/.github/ISSUE_TEMPLATE/change-request.md new file mode 100644 index 0000000..a2ee685 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/change-request.md @@ -0,0 +1,21 @@ +--- +name: Change request +about: Propose an improvement to this library +title: "" +labels: "" +assignees: "" +--- + +**Is your change request related to a problem? Please describe.** +A clear and concise description of the problem. + +Examples: + +- It's frustrating to have to [...] +- I was looking for a function to [...] + +**Describe the solution you'd like** +A clear and concise description of what a good solution to you looks like, including any solutions you've already considered. + +**Additional context** +Add any other context about the change request here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..8d7661e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: PureScript Discourse + url: https://discourse.purescript.org/ + about: Ask and answer questions on the PureScript discussion forum. + - name: PureScript Discord + url: https://purescript.org/chat + about: Ask and answer questions on the PureScript chat. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d8780f7 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +**Description of the change** +Clearly and concisely describe the purpose of the pull request. If this PR relates to an existing issue or change proposal, please link to it. Include any other background context that would help reviewers understand the motivation for this PR. + +--- + +**Checklist:** + +- [ ] Added the change to the changelog's "Unreleased" section with a link to this PR and your username +- [ ] Linked any existing issues or proposals that this pull request should close +- [ ] Updated or added relevant documentation in the README and/or documentation directory +- [ ] Added a test for the contribution (if applicable) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e8feaa..7f61f24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,63 +2,36 @@ name: CI on: push: - branches: [main] + branches: [master, main] pull_request: - branches: [main] + branches: [master, main] jobs: build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up PureScript toolchain - uses: purescript-contrib/setup-purescript@v2.0.0 + - name: Set up a PureScript toolchain + uses: purescript-contrib/setup-purescript@main with: - purescript: "0.15.0" + purescript: "latest" purs-tidy: "latest" + spago: "unstable" - name: Cache PureScript dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: - key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }} + key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.lock') }} path: | .spago output - - name: Set up Node toolchain - uses: actions/setup-node@v2 - with: - node-version: "14.x" - - name: Cache NPM dependencies - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - name: Install NPM dependencies - run: npm install - - - name: Build the project - run: npm run build + - name: Build source + run: spago build --censor-stats --strict --ensure-ranges --pedantic-packages - name: Run tests - run: npm run test - - # - name: Check formatting - # run: purs-tidy check src test + run: spago test --offline --censor-stats --strict --pedantic-packages - - name: Verify Bower & Pulp - run: | - npm install bower pulp@16.0.0-0 - npx bower install - npx pulp build -- --censor-lib --strict - if [ -d "test" ]; then - npx pulp test - fi + - name: Verify formatting + run: purs-tidy check src test From e1b481b698f0671d7de67f92090a789e5f068591 Mon Sep 17 00:00:00 2001 From: Serhii Khoma Date: Fri, 28 Mar 2025 08:26:50 +0700 Subject: [PATCH 3/4] feat: purs-tidy --- .github/workflows/ci.yml | 6 +++--- src/React/Basic.purs | 36 ++++++++++++++++++------------------ src/React/Basic/Events.purs | 18 ++++++++---------- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f61f24..8fa44dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,8 @@ jobs: - name: Build source run: spago build --censor-stats --strict --ensure-ranges --pedantic-packages - - name: Run tests - run: spago test --offline --censor-stats --strict --pedantic-packages + # - name: Run tests + # run: spago test --offline --censor-stats --strict --pedantic-packages - name: Verify formatting - run: purs-tidy check src test + run: purs-tidy check src test \ No newline at end of file diff --git a/src/React/Basic.purs b/src/React/Basic.purs index 2753832..a0b745f 100644 --- a/src/React/Basic.purs +++ b/src/React/Basic.purs @@ -45,20 +45,20 @@ foreign import fragment :: Array JSX -> JSX -- | Create a `JSX` node from a `ReactComponent`, by providing the props. -- | -- | __*See also:* `ReactComponent`, `elementKeyed`__ -foreign import element :: - forall props. - ReactComponent { | props } -> - { | props } -> - JSX +foreign import element + :: forall props + . ReactComponent { | props } + -> { | props } + -> JSX -- | Create a `JSX` node from a `ReactComponent`, by providing the props and a key. -- | -- | __*See also:* `ReactComponent`, `element`, React's documentation regarding the special `key` prop__ -foreign import elementKeyed :: - forall props. - ReactComponent { | props } -> - { key :: String | props } -> - JSX +foreign import elementKeyed + :: forall props + . ReactComponent { | props } + -> { key :: String | props } + -> JSX -- | Represents a traditional React component. Useful for JavaScript interop and -- | FFI. For example: @@ -82,15 +82,15 @@ foreign import data ReactContext :: Type -> Type -- | __*See also:* `provider`, `consumer`, React's documentation regarding Context__ foreign import createContext :: forall a. a -> Effect (ReactContext a) -foreign import contextProvider :: - forall a. - ReactContext a -> - ReactComponent { value :: a, children :: Array JSX } +foreign import contextProvider + :: forall a + . ReactContext a + -> ReactComponent { value :: a, children :: Array JSX } -foreign import contextConsumer :: - forall a. - ReactContext a -> - ReactComponent { children :: a -> Array JSX } +foreign import contextConsumer + :: forall a + . ReactContext a + -> ReactComponent { children :: a -> Array JSX } -- | Create a provider `JSX` given a context value and children. -- | diff --git a/src/React/Basic/Events.purs b/src/React/Basic/Events.purs index 115c134..4e6f7af 100644 --- a/src/React/Basic/Events.purs +++ b/src/React/Basic/Events.purs @@ -22,8 +22,7 @@ import Type.Proxy (Proxy(..)) -- | An event handler, which receives a `SyntheticEvent` and performs some -- | effects in return. -type EventHandler - = EffectFn1 SyntheticEvent Unit +type EventHandler = EffectFn1 SyntheticEvent Unit -- | Event data that we receive from React. foreign import data SyntheticEvent :: Type @@ -38,8 +37,7 @@ foreign import data SyntheticEvent :: Type -- | \value -> setState \_ -> { value } -- | } -- | ``` -newtype EventFn a b - = EventFn (a -> b) +newtype EventFn a b = EventFn (a -> b) -- | Unsafely create an `EventFn`. This function should be avoided as it can allow -- | a `SyntheticEvent` to escape its scope. Accessing a React event's properties is only @@ -114,10 +112,10 @@ instance mergeCons :: -- | \{ targetValue, timeStamp } -> setState \_ -> { ... } -- | } -- | ``` -merge :: - forall a fns fns_list r. - RowToList fns fns_list => - Merge fns_list fns a r => - Record fns -> - EventFn a (Record r) +merge + :: forall a fns fns_list r + . RowToList fns fns_list + => Merge fns_list fns a r + => Record fns + -> EventFn a (Record r) merge = mergeImpl (Proxy :: Proxy fns_list) From db9ccaa3467730bfdc0fcd31a727ca9018e91194 Mon Sep 17 00:00:00 2001 From: Serhii Khoma Date: Sat, 29 Mar 2025 17:27:28 +0700 Subject: [PATCH 4/4] refactor: use lambdas --- src/React/Basic.js | 54 +++++++++++++---------------------- src/React/Basic/StrictMode.js | 4 +-- 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/src/React/Basic.js b/src/React/Basic.js index e428c2e..7c67cde 100644 --- a/src/React/Basic.js +++ b/src/React/Basic.js @@ -1,38 +1,24 @@ import * as React from "react"; -import { createElement, Fragment } from "react"; export const empty = null; -export function keyed(key) { - return (child) => - createElement(Fragment, { key: key }, child); -} - -export function element(component) { - return (props) => - Array.isArray(props.children) - ? createElement.apply(null, [component, props].concat(props.children)) - : createElement(component, props); -} - -export function elementKeyed(component) { - return (props) => - createElement(component, props); -} - -export function fragment(children) { - return createElement.apply(null, [Fragment, null].concat(children)); -} - -export function createContext(defaultValue) { - return () => - React.createContext(defaultValue); -} - -export function contextProvider(context) { - return context.Provider; -} - -export function contextConsumer(context) { - return context.Consumer; -} \ No newline at end of file +export const keyed = (key) => (child) => + React.createElement(React.Fragment, { key: key }, child); + +export const element = (component) => (props) => + Array.isArray(props.children) + ? React.createElement.apply(null, [component, props].concat(props.children)) + : React.createElement(component, props); + +export const elementKeyed = (component) => (props) => + React.createElement(component, props); + +export const fragment = (children) => + React.createElement.apply(null, [React.Fragment, null].concat(children)); + +export const createContext = (defaultValue) => () => + React.createContext(defaultValue); + +export const contextProvider = (context) => context.Provider; + +export const contextConsumer = (context) => context.Consumer; \ No newline at end of file diff --git a/src/React/Basic/StrictMode.js b/src/React/Basic/StrictMode.js index f4fad04..26a5c46 100644 --- a/src/React/Basic/StrictMode.js +++ b/src/React/Basic/StrictMode.js @@ -1,2 +1,2 @@ -import React from "react"; -export const strictMode_ = React.StrictMode; +import * as React from "react"; +export const strictMode_ = React.StrictMode; \ No newline at end of file