text:
JsonPath-rw Extractor

What:
As a pyresttest user who needs to do more detailed JSON analysis, I would like to be able to use full jsonpath support in working with request bodies (extraction for variables and content analysis).  This should be available if the library is installed and fail if not.
How:
I would like to add a jsonpath-rw extractor, set up to auto-register in the same way as the jsonschema validator.
It will also require adding extending the autoload extensions to iterate through a list of extensions.  For now, that's sufficient but it might be desirable to try to autoload all of the 'ext' folder content.
This is an isolated task, easy enough for someone to execute as a PR.

JMESPath may be a better option for some use cases, and supports returning the last element in an array, for example.

Sam - is it something and a junior-midlevel python coder can help you with?

@marklz Absolutely!  It probably will not require much code to do the coupling, and all the aspects needed have documentation and examples (JSONschema extension, extensions.md for how to write an extension, and resttest.py loading of the jsonschema extension).  Fairly easy to throw together tests for this as well.

looked briefly at JMESPath ( https://github.com/jmespath/jmespath.py and the spec in the link above) - is it much more complex than this? I'm surely missing something...
import jmespath

class JMESPathExtractor(AbstractExtractor):
    """ Extractor that uses JMESPath syntax
		See http://jmespath.org/specification.html for details
    """
    extractor_type = 'jmespath'
    is_body_extractor = True

    def extract_internal(self, query=None, args=None, body=None, headers=None):
        try:
            body = json.loads(body)
            return jmespath.search(query, body)
        except ValueError:
            raise ValueError("Not legal JSON!")

    @classmethod
    def parse(cls, config):
        base = JMESPathExtractor()
        return cls.configure_base(config, base)
        return base

@marklz Nope, not much more complex than that for the core!  There's a couple more pieces to get it PR-ready, but not big ones.  First we need some basic unit tests (and I'm not sure here if JMESPath for python returns JSON text fragments or Python objects, but if  the first one, we need to call the json.loads function to parse them so the comparators work).
Second, is an autoload for the extension like we have for the jsonschema validator.  So, less than a half-dozen lines of code, and there's already an example to work from.
Third:  an entry in the advanced_guide with the registered name & description, a syntax example, and a link to the JMESPath page (for more advanced uses).
Finally: I do apologize for the delay!  I've been sick with flu the last few days and only just got well enough to start looking at code again.
This looks like it would be a great addition to PyrestTest, and thank you!

No worry about reply times - I have a full time job too :-)

Unit tests - I'm actually thinking to piggy back on JMESPath unit tests in https://github.com/jmespath/jmespath.py/tree/develop/tests/compliance; I can add code to test_validators.py that reads static texts as jmespath-compliance-1.json,  jmespath-compliance-2.json etc, and then do queries and check for results - all based on JMESPath tests.Does it make sense or is it too little or too much?

autoload - I see two options here:
Option 1 - add code to validators.py, and at the end of validators.py, next to similar statements add

register_extractor('jmespath', JMESPathExtractor.parse)

Option 2 - create a extractor_jmespath.py in ext/ folder, and at the end of that file add - not clear what. jsonschema has
EXTRACTORS = {'jmespath': JMESPathExtractor.parse}

and then in resttest.py add
try:
    import jmespath
    register_extensions('ext.extractor_jmespath')
except ImportError as ie:
    logging.debug(
        "Failed to load jmespath extractor, make sure the jmespath module is installed if you wish to use jmespath extractor.")

So, which way should I go?

documentation - I'll do format of jsonpath_mini and contents of http://jmespath.org/tutorial.html, if it's ok with you

Mark.

Ah, those full-time jobs!
Unit tests:
I think that what you describe is more work than you really need.  Really we only need to exercise config parsing, basic query use, templating in the query, and error handling (including empty value returns).  As a nice-to-have, it would be helpful to have a test in a ComparatorValidator.
Autoload:
Option 2, please!  This way it's possible to successfully run PyRestTest without the Jmespath library installed, but if the library is present the extension is available.  And yes, the example you gave really is all you need there (the extension loader looks for registry variables) -- both snippets look correct to me at first glance.
On consideration, it would be nice to convert the extension_use_test.sh to some form of functional test for autoloading extensions (that only runs if libraries are present)... but I'm certainly not making that a PR requirement since it's something I ought to have done a while back.
Documentation:
Ha!  It doesn't even need that much, just an example of syntax for using the extractor and what that returns, and a link to the tutorial there.
Hope that makes your life easier as you have a fulltime job too! ;-)

Can't register extension - what am I doing wrong?
{code}
[mzusman@pioneer-dev36 pyresttest]$ pyresttest http://172.17.230.6 aa.yaml --import_extensions 'ext.extractor_jmespath'
Traceback (most recent call last):
File "/usr/bin/pyresttest", line 4, in
resttest.command_line_run(sys.argv[1:])
File "/usr/lib/python2.6/site-packages/pyresttest/resttest.py", line 863, in command_line_run
main(args)
File "/usr/lib/python2.6/site-packages/pyresttest/resttest.py", line 769, in main
register_extensions(extensions)
File "/usr/lib/python2.6/site-packages/pyresttest/resttest.py", line 709, in register_extensions
module = import(ext, globals(), locals(), package)
ImportError: No module named extractor_jmespath
[mzusman@pioneer-dev36 pyresttest]$ !ls
ls -ltr ext
total 20
-rw-rw-r-- 1 mzusman mzusman 1890 Nov 30 20:28 validator_jsonschema.py
-rw-rw-r-- 1 mzusman mzusman  126 Nov 30 20:28 init.py
-rw-rw-r-- 1 mzusman mzusman 1068 Dec  3 11:15 extractor_jmespath.py
-rw-rw-r-- 1 mzusman mzusman  296 Dec  3 11:41 init.pyc
-rw-rw-r-- 1 mzusman mzusman 1676 Dec  3 11:41 extractor_jmespath.pyc
{code}

@marklz Simple, if it's using the --import_extensions argument, the path should be pyresttest.ext.extractor_jmespath, I believe -- it's relative to current folder.    If you're doing import like the jsonschema extractor, it's of course going to omit the first bit.

Good news - autoloader works all is well; I was running pyresttest - which was /usr/bin/pyrestest!
Once I started doing
python resttest.py http://172.17.230.6 aa.yaml

we started to pick up correct code. Without any modifications, run my initial test - first two tests runn correctly, throws exception on 3rd one. I'll debug it tomorrow, but it's a nice progress
- test:
    - name: "correct url, correct authentication"
    - url: "/api/1.0/config/element/terminal/"
    - auth_username: "admin"
    - auth_password: "admin"
    - expected_status: [200]
    - validators:
        - compare: {jmespath: 'errors', comparator: 'count_eq', expected: 0 }
        - compare: {jmespath: 'meta.count', comparator: 'gt', expected: 0 }
        - compare: {jmespath: 'data.0.obj_attributes.mgmtsubnetmask', comparator: 'regex', expected: '255.255.255.*' }

@marklz Excellent!

I'm going over http://jmespath.org/tutorial.html and it looks good so far:

I've created a few simple input files

[mzusman@pioneer-dev36 pyresttest]$ for f in *; do echo ====== $f =====; cat $f; done
====== jmespath-test-1 =====
{"a": "foo", "b": "bar", "c": "baz"}
====== jmespath-test-2 =====
{"a": {"b": {"c": {"d": "value"}}}}
====== jmespath-test-3 =====
["a", "b", "c", "d", "e", "f"]
====== jmespath-test-4 =====
{"a": {
  "b": {
    "c": [
      {"d": [0, [1, 2]]},
      {"d": [3, 4]}
    ]
  }
}}
====== jmespath-test-5 =====
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
====== jmespath-test-6 =====
{
  "people": [
    {"first": "James", "last": "d"},
    {"first": "Jacob", "last": "e"},
    {"first": "Jayden", "last": "f"},
    {"missing": "different"}
  ],
  "foo": {"bar": "baz"}
}

I have a test configuration

[mzusman@pioneer-dev36 pyresttest]$ cat aa.yaml
---
- config:
    - testset: "Basic tests"

- test:
    - name: "test-1"
    - url: "/jmespath-test-1"
    - expected_status: [200]
    - validators:
        - compare: {jmespath: 'a', comparator: 'eq', expected: 'foo' }
        - compare: {jmespath: 'b', comparator: 'eq', expected: 'bar' }
        - compare: {jmespath: 'c', comparator: 'eq', expected: 'baz' }

- test:
    - name: "test-2"
    - url: "/jmespath-test-2"
    - expected_status: [200]
    - validators:
        - compare: {jmespath: 'a.b.c.d', comparator: 'eq', expected: 'value' }

- test:
    - name: "test-3"
    - url: "/jmespath-test-3"
    - expected_status: [200]
    - validators:
        - compare: {jmespath: '[1]', comparator: 'eq', expected: 'b' }

- test:
    - name: "test-4"
    - url: "/jmespath-test-4"
    - expected_status: [200]
    - validators:
        - compare: {jmespath: 'a.b.c[0].d[1][0]', comparator: 'eq', expected: 1 }

- test:
    - name: "test-5"
    - url: "/jmespath-test-5"
    - expected_status: [200]
    - validators:
        - compare: {jmespath: 'length([0:5])', comparator: 'eq', expected: 5 }
        - compare: {jmespath: '[1:3]', comparator: 'eq', expected: '[1, 2]' }
        - compare: {jmespath: '[::2]', comparator: 'eq', expected: '[0, 2, 4, 6, 8]' }
        - compare: {jmespath: '[5:0:-1]', comparator: 'eq', expected: '[5, 4, 3, 2, 1]' }

- test:
    - name: "test-6"
    - url: "/jmespath-test-6"
    - expected_status: [200]
    - validators:
        - compare: {jmespath: 'people[*].first', comparator: 'eq', expected: "['James', 'Jacob', 'Jayden']" }
        - compare: {jmespath: 'people[:2].first', comparator: 'eq', expected: "['James', 'Jacob']" }

everything passes

[mzusman@pioneer-dev36 pyresttest]$ python resttest.py http://pioneer-dev36.eng.idirect.net/~mzusman/pyresttest aa.yaml |& tee aa
1: jmespath : query = a  result = foo type = <type 'str'>
1: jmespath : query = b  result = bar type = <type 'str'>
1: jmespath : query = c  result = baz type = <type 'str'>
1: jmespath : query = a.b.c.d  result = value type = <type 'str'>
1: jmespath : query = [1]  result = b type = <type 'str'>
1: jmespath : query = a.b.c[0].d[1][0]  result = 1 type = <type 'int'>
1: jmespath : query = length([0:5])  result = 5 type = <type 'int'>
1: jmespath : query = [1:3]  result = [1, 2] type = <type 'list'>
1: jmespath : query = [::2]  result = [0, 2, 4, 6, 8] type = <type 'list'>
1: jmespath : query = [5:0:-1]  result = [5, 4, 3, 2, 1] type = <type 'list'>
1: jmespath : query = people[*].first  result = ['James', 'Jacob', 'Jayden'] type = <type 'list'>
1: jmespath : query = people[:2].first  result = ['James', 'Jacob'] type = <type 'list'>
Test Group Default SUCCEEDED: 6/6 Tests Passed!

I assume that for real unit tests, I'll have to convert URL requests to reading files - how do I handle from packaging POV? Put input files into ext? Into some other place?
Mark.

Documentation - it will look like this.
Unit tests - I'm trying to run them as

python resttest.py --verbose ext/jmespath-test.yaml --log=DEBUG --test=ext/jmespath-test-all

and get no output. When I run against URL, all is well - I get
[mzusman@pioneer-dev36 pyresttest]$  python resttest.py http://pioneer-dev36.eng.idirect.net/~mzusman/pyresttest ext/jmespath-test.yaml
Test Group Default SUCCEEDED: 1/1 Tests Passed!

what am I doing wrong?
Mark.

@marklz This is looking really great! For your real unit tests, we really only need to test that:

JMESPath extension loads (a functional test with very basic query against the included Djano/Tastypie mini-app). If you've already got YAML tests, this example in function tests may help as well.
Unit test that queries are parsed in a few, simple cases using an inline JSON fragment (no need to read long bodies from files).  We need to make sure it handles invalid JSON gracefully with exceptions, as well as returning None if the query has no matches.

As far as structure for tests goes:  for functional tests (pyresttest/functionaltests.py), add a conditional to the functional tests to run if JMESPath can import, i.e.:
try:
   import JMESPath
   def run_jmespath_test(self):
      do_my_testing_here
catch ImportError:
   pass  # Doesn't run JMESPath test if can't import library

For unit tests, we need a test class in pyresttest/ext/test_jmespath.py.
I'll probably have to tweak the test execution scripts a little bit for that, but there's other use cases too.
Documentation:
This approach works well, but I'd say it doesn't need to be as long - maybe 4-5 examples covering first the simplest case and then a couple other smaller ones.  They can always refer to the JMESPath docs for more complex syntax examples.
Running without URL:
This isn't supposed to work, if it's not generating output indicating you need both a URL and a test file, then I think that's a bug (and I need to investigate it).

I fixed cut down on documentation, but I'm unclear on where to put unit tests. I see two options:

add something like test_validator_error_responses(), only with more tests; I think that this is what you were talking about when you mentioned "Unit test that queries are parsed in a few, simple cases using an inline JSON fragment" - and this goes into pyresttest/ext/test_jmespath.py. Here I'm all clear what to do.
something that goes into into pyresttest/functionaltests.py and has conditional import and all that - this is where I'm not quite sure how to code it.
as for invocation without output, it works as design - here's code in parsing command line arguments

    # Handle url/test as named, or, failing that, positional arguments
    if not args['url'] or not args['test']:
        if len(unparsed_args) == 2:
            args[u'url'] = unparsed_args[0]
            args[u'test'] = unparsed_args[1]
        elif len(unparsed_args) == 1 and args['url']:
            args['test'] = unparsed_args[0]
        elif len(unparsed_args) == 1 and args['test']:
            args['url'] = unparsed_args[0]
        else:
            parser.print_help()
            parser.error(
                "wrong number of arguments, need both url and test filename, either as 1st and 2nd parameters or via --url and --test")

we have only length(unparsed_args) == 1, unparsed_args[0] is ext/jmespath-test.yaml, it's assumed to be url, which is latter happily opened and processed...
Mark.

something like test_validator_error_responses()

Exactly!  And also something like test_parse_validator_extracttest.

something that goes into into pyresttest/functionaltests.py

That's the snippet I posted earlier, with the imports.  Because imports don't have to be at the top of python files and can be executed conditionally, like I'd listed earlier
try:
   import JMESPath
   def run_jmespath_test(self):
      do_my_testing_here
catch ImportError:
   pass  # Doesn't run JMESPath test if can't import library

Except do_my_testing_here is something similar to: https://github.com/svanoort/pyresttest/blob/master/pyresttest/functionaltest.py#L111
At least, I think this should work, I have not actually tested it yet!
Also pay no mind to how horrifyingly awful some of the other test syntax is -- eventually I need to rework the internal Python APIs to be somewhat more elegant (probably mimicking frisby.js a bit), but that's going to be a future-roadmap thing, around the PyRestTest 2.0 release probably.  ;-)

as for invocation without output, it works as design

D'oh!

I somehow manage to fail in both tests:

test_validators.py - I've added code

    def test_parse_validator_jmespath_extracttest(self):
        """ Test parsing for jmespath extract test """
        config = {
            'jmespath': 'key.val',
            'test': 'exists'
        }
        myjson_pass = '{"id": 3, "key": {"val": 3}}'
        myjson_fail = '{"id": 3, "key": {"valley": "wide"}}'
        validator = validators.ExtractTestValidator.parse(config)

and get

Traceback (most recent call last):
  File "test_validators.py", line 493, in test_parse_validator_jmespath_extracttest
    validator = validators.ExtractTestValidator.parse(config)
  File "/home/mzusman/work/pyresttest/pyresttest/validators.py", line 454, in parse
    extractor = _get_extractor(config)
  File "/home/mzusman/work/pyresttest/pyresttest/validators.py", line 307, in _get_extractor
    'No valid extractor name to use in input: {0}'.format(config_dict))
Exception: No valid extractor name to use in input: {'test': 'exists', 'jmespath': 'key.val'}

How do I force loading of jmespath extractor?

functionaltest.py - it asks for django - do I have to set it up, together with local webserver?

+ python pyresttest/functionaltest.py
Traceback (most recent call last):
  File "pyresttest/functionaltest.py", line 10, in <module>
    from django.core.management import call_command
ImportError: No module named django.core.management

For the test_validators unit test, the problem is very simple: resttest.py isn't loaded by the validators module, so the extension is never loaded.  Resttest can't be imported there, since resttest imports validators, and if they load each other we get an endless loop (this is why the functional test exists, to exercise the auto-import).
The solution is simple:  for the extension test, we'll need to explicitly do the try-import section (in case the library isn't installed) and then at the beginning of the test call the validators.register_extractor (after importing the extension):  https://github.com/marklz/pyresttest/blob/master/pyresttest/validators.py#L542
Be warned, it may be a little tricky to get the import right for this!
For the functional test:
I've got instructions for how to build and test  but you'll basically need (on python 2.7):
sudo pip install 'django >=1.6, <1.7' django-tastypie pycurl pyyaml mock

@marklz  ^

Good news - test_validators unit test is done
Bad news - I'm still buffled by functional test. This is where I am:

code in functionaltest.py

    def test_get_validators_jmespath_fail(self):
        """ Test validators that should fail """
        test = Test()
        test.url = self.prefix + '/api/person/'
        test.validators = list()
        print 'jmespath validators: ' + str(test.validators)
        cfg_exists = {'jmespath': 'meta.limit', 'test': 'exists'}
        test.validators.append(
            validators.parse_validator('extract_test', cfg_exists))
        test_response = resttest.run_test(test)
        print 'jmespath response: ' + str(test_response)

result of execution (I've added spaces for readability):
...
[21/Dec/2015 23:26:48] "GET /api/person/ HTTP/1.1" 200 436
.jmespath validators: []
{
   "meta":
     {"limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 3},
   "objects": [
      {"first_name": "Gaius", "id": 1, "last_name": "Baltar", "login": "gbaltar", "resource_uri": "/api/person/1/"},
      {"first_name": "Leeroy", "id": 2, "last_name": "Jenkins", "login": "jenkins", "resource_uri": "/api/person/2/"},
      {"first_name": "Bilbo", "id": 3, "last_name": "Baggins", "login": "bbaggins", "resource_uri": "/api/person/3/"}
   ]
}
[('date', 'Mon, 21 Dec 2015 23:26:48 GMT'), ('server', 'WSGIServer/0.1 Python/2.6.6'), ('vary', 'Accept'), ('x-frame-options', 'SAMEORIGIN'), ('content-type', 'application/json'), ('cache-control', 'no-cache')]
jmespath response:
{
   "body":
    "{\"meta\":
       {\"limit\": 20, \"next\": null, \"offset\": 0, \"previous\": null, \"total_count\": 3},
   \"objects\": [
       {\"first_name\": \"Gaius\", \"id\": 1, \"last_name\": \"Baltar\", \"login\": \"gbaltar\", \"resource_uri\": \"/api/person/1/\"},
      {\"first_name\": \"Leeroy\", \"id\": 2, \"last_name\": \"Jenkins\", \"login\": \"jenkins\", \"resource_uri\": \"/api/person/2/\"},
    {\"first_name\": \"Bilbo\", \"id\": 3, \"last_name\": \"Baggins\", \"login\": \"bbaggins\", \"resource_uri\": \"/api/person/3/\"}
   ]
}",
"response_headers": [
    ["date", "Mon, 21 Dec 2015 23:26:48 GMT"],
    ["server", "WSGIServer/0.1 Python/2.6.6"],
    ["vary", "Accept"],
    ["x-frame-options", "SAMEORIGIN"],
    ["content-type", "application/json"],
    ["cache-control", "no-cache"]
],
"response_code": 200,
"passed": false,
"test": {
   "validators": [
        {  "extractor": {"query": "meta.limit", "is_templated": false}, "test_fn": {},
            "config": {"test": "exists", "jmespath": "meta.limit"}, "test_name": "exists"
        }
   ],
"expected_status": [200],
"_headers": {},
"_url": "http://localhost:8000/api/person/",
"templated": {}},
"failures": [
   {
      "failure_type": "Extractor Exception",
       "message": "Exception thrown while running extraction from body",
        "validator": {"extractor": {"query": "meta.limit", "is_templated": false}, "test_fn": {}, "config": {"test": "exists", "jmespath": "meta.limit"}, "test_name": "exists"},
      "details": "Traceback (most recent call last):\n
          File \"/home/mzusman/work/pyresttest/pyresttest/validators.py\", line 466, in validate\n
                   body=body, headers=headers, context=context)\n
          File \"/home/mzusman/work/pyresttest/pyresttest/validators.py\", line 177, in extract\n
                   return self.extract_internal(query=query, body=body, headers=headers, args=self.args)\n
          File \"/home/mzusman/work/pyresttest/pyresttest/ext/extractor_jmespath.py\", line 39, in extract_internal\n    raise ValueError(\"Invalid query: \" + query + \" : \" + str(e))\nValueError: Invalid query: meta.limit : malformed string\n"
     }
 ]
}

What am I doing wrong? I've tried to specify any query I can think of, but jmespath rejects it anyway as malformed string....

Mark.

@marklz Wanna jump on gitter and discuss? I'm at a local python project night and now would be perfect timing! :-)

@marklz Specifically, https://gitter.im/svanoort/pyresttest

@marklz I've got the fix (tested with a clone of your code):
This: https://github.com/marklz/pyresttest/blob/master/pyresttest/ext/extractor_jmespath.py#L30
Should instead be:
res = jmespath.search(query, json.loads( body ) )
Ast.eval and json.loads are not interchangeable (the first loads a python object, the second loads json).  The two syntaxes are very similar but not interchangeable.

@marklz It's now merged in; whew, let it never be said that dual python 2/3 compatibility is easy!  Had to make some changes to get everything to play nicely now.

authors: marklz svanoort

repo: svanoort/pyresttest


text:
sysctl::apply doesn't apply the sysctl params changes after provisioning

Hi there
Yesterday I was using the sysctl cookbook for the first time to manage some ipv6 related kernel params. I noticed though that after a chef-client run, the params were not being taken into account, meaning that the changes were being set correctly but were not being applied by sysctl.
I'm not sure whether the following is expected behaviour, is by design, or neither of both so probably you can clarify it to me (and future comers).
What I was trying to do was to basically disable ipv6 capabilities so to have the web server handle only IPv4.
Following the interested files.
The attributes:
# attributes/sysctl.rb

default['sysctl']['allow_sysctl_conf'] = true
default['sysctl']['params']['net']['ipv6']['conf']['all']['forwarding'] = 0
default['sysctl']['params']['net']['ipv6']['conf']['all']['accept_source_route'] = 0
default['sysctl']['params']['net']['ipv6']['conf']['all']['accept_redirects'] = 0
default['sysctl']['params']['net']['ipv6']['conf']['all']['disable_ipv6'] = 1

default['sysctl']['params']['net']['ipv6']['conf']['default']['forwarding'] = 0
default['sysctl']['params']['net']['ipv6']['conf']['default']['accept_source_route'] = 0
default['sysctl']['params']['net']['ipv6']['conf']['default']['accept_redirects'] = 0
default['sysctl']['params']['net']['ipv6']['conf']['default']['disable_ipv6'] = 1

default['sysctl']['params']['net']['ipv6']['conf']['enp0s3']['disable_ipv6'] = 1
default['sysctl']['params']['net']['ipv6']['conf']['lo']['disable_ipv6'] = 1

The recipe:
# recipes/default.rb

include_recipe 'sysctl::apply'
# other "include_recipe" lines

I always needed to run sysctl -p /path/to/chef-sysctl-params-file to have the changes applied.
Is this behaviour expected?
I was applying this against the CentOS 7 box provided by OpsCode.
Thanks!

While double checking the README again I realized:

The configuration will be written out when sysctl::apply gets run, which allows the parameters set to be persisted during a reboot.

It doesn't specify anything except the reboot. So I guess that it is intended behaviour not to apply the changes straight away but at the next reboot.
Will let this open just so to have the author(s) confirm.
cc @svanzoest
Thanks!

@walterdolce do you have log output for this? It should apply the attributes, so I am wondering if it ran into some issue our the procps service function on centos 7 has changed. You should also see the config file in /etc/sysctl.d.

Yep attributes get set correctly in the /etc/sysctl.d/99-chef-attributes.conf file.
It's just that after applying them they don't have effect. So you'd need to manually use the sysctl -p command.
After looking at the cookbook though I changed strategy and I directly used the sysctl::default recipe and used the sysctl_param LWRP giving it a hash of sysctl parameters => values. This way they get applied straight away.

I ran into the same problem when adding support for SLES 12, which also uses systemd. Changing the template resource to notify service[procps] with :restart instead of :start resolved the problem. I have not yet run the full test suite to see if this change has any negative effects elsewhere.

I can confirm that there is a similar behavior on Debian 8 with systemd as well.  Restarting procps instead of using :start seems to be the solution as well.

Thanks for all the feedback on this. I have been tied up on other things, but I hope to work on release soon and plan to include some of the ideas discussed in here.

Was just about to submit a pr for the same changes @joerocklin made. Any word on when this will be pulled in?

I would also like to know when the :restart on the template will be put in place. Thanks!

It looks like this works everywhere, so we have moved to using restart which will be in the next release

Awesome, thanks @svanzoest !

0.7.0 has been released with restart.

source: gharchive/issue

authors: fletchowns joerocklin jslusher lmickh svanzoest walterdolce

repo: svanzoest-cookbooks/sysctl

license_type: permissive

license_source: bigquery


text:
scss and ie. bootstrap fails to build with svelte-ts

npm create vite@latest sv2
# choose svelte-ts
cd sv2
npx svelte-add@latest scss
npm install
npm run dev
...
Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
12:30:52 [vite] Internal server error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
  Plugin: vite:import-analysis
  File: /tmp/sv2/src/App.svelte
  2  |    import svelteLogo from './assets/svelte.svg'
  3  |    import Counter from './lib/Counter.svelte'
  4  |  </script>
     |           ^
  5  |
  6  |  <main>
      at formatError (file:///tmp/sv2/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:35330:46)
      at TransformContext.error (file:///tmp/sv2/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:35326:19)
      at TransformContext.transform (file:///tmp/sv2/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:40190:22)
      at async Object.transform (file:///tmp/sv2/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:35579:30)
      at async loadAndTransform (file:///tmp/sv2/node_modules/vite/dist/node/chunks/dep-0fc8e132.js:39888:29)

Diff between svelte-ts and svelte projects
Common subdirectories: sv1/.vscode and sv2/.vscode
diff '--color=auto' sv1/README.md sv2/README.md
1c1
< # Svelte + Vite
---
> # Svelte + TS + Vite
3c3
< This template should help get you started developing with Svelte in Vite.
---
> This template should help get you started developing with Svelte and TypeScript in Vite.
21c21
< This template contains as little as possible to get started with Vite + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
---
> This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
33c33
< **Why enable `checkJs` in the JS template?**
---
> **Why enable `allowJs` in the TS template?**
35c35
< It is likely that most cases of changing variable types in runtime are likely to be accidental, rather than deliberate. This provides advanced typechecking out of the box. Should you like to take advantage of the dynamically-typed nature of JavaScript, it is trivial to change the configuration.
---
> While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.
43,44c43,44
< ```js
< // store.js
---
> ```ts
> // store.ts
diff '--color=auto' sv1/index.html sv2/index.html
7c7
<     <title>Vite + Svelte</title>
---
>     <title>Vite + Svelte + TS</title>
11c11
<     <script type="module" src="/src/main.js"></script>
---
>     <script type="module" src="/src/main.ts"></script>
Only in sv1: jsconfig.json
Only in sv2: node_modules
Only in sv2: package-lock.json
diff '--color=auto' sv1/package.json sv2/package.json
2c2
<   "name": "sv1",
---
>   "name": "sv2",
9c9,10
<     "preview": "vite preview"
---
>     "preview": "vite preview",
>     "check": "svelte-check --tsconfig ./tsconfig.json"
12a14
>     "@tsconfig/svelte": "^3.0.0",
13a16,19
>     "svelte-check": "^2.8.0",
>     "svelte-preprocess": "^4.10.7",
>     "tslib": "^2.4.0",
>     "typescript": "^4.6.4",
15,16c21
<     "sass": "^1.53.0",
<     "svelte-preprocess": "^4.10.7"
---
>     "sass": "^1.53.0"
Common subdirectories: sv1/public and sv2/public
Common subdirectories: sv1/src and sv2/src
diff '--color=auto' sv1/svelte.config.js sv2/svelte.config.js
1c1
< import preprocess from "svelte-preprocess";
---
> import sveltePreprocess from "svelte-preprocess";
3c3,5
< const config = {
---
> export default {
>   // Consult https://github.com/sveltejs/svelte-preprocess
>   // for more information about preprocessors
5c7
<     preprocess({
---
>     sveltePreprocess({
12,13d13
<
< export default config;
Only in sv2: tsconfig.json
Only in sv2: tsconfig.node.json
diff '--color=auto' sv1/vite.config.js sv2/vite.config.js
1,7c1
< import { defineConfig } from "vite";
< import { svelte } from "@sveltejs/vite-plugin-svelte";
<
< // https://vitejs.dev/config/
< export default defineConfig({
<   plugins: [svelte()],
<
---
> const config = {
15c9,11
< });
---
> };
>
> export default config;
Only in sv2: vite.config.ts

Works fine with vite.config.js copied from plain svelte project.

Thanks for the information, and I'm sorry about this bug. I will close this in favor of #234 to keep discussion there

authors: babichjacob kac-

repo: svelte-add/svelte-add

license: MIT

license_source: github-api


text:
POST that returns 303 in +server.js end up being 200 in the client

Describe the bug
// POST@+server.js
return new Response(JSON.stringify(something), {
  headers: {
    status: 303,
    location: '/somewhere',
  }
})

doesn't redirect. It's interpreted as a 200 response.
Request Method: POST
Status Code: 200 OK
Remote Address: 127.0.0.1:5173

Reproduction
<button on:click={_ => fetch('/endpoint', {
  method: 'POST',
})}>Better redirect</button>

export function POST() {
  return new Response(null, {
    headers: {
      status: 303,
      location: '/somewhere',
    }
  })
}

Logs
No response
System Info
System:
    OS: macOS 12.5.1
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 1.44 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.0 - /usr/local/bin/node
    Yarn: 1.22.15 - /usr/local/bin/yarn
    npm: 8.1.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 104.0.5112.101
    Firefox: 102.0.1
    Safari: 15.6.1
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.64
    @sveltejs/kit: next => 1.0.0-next.416
    svelte: ^3.44.0 => 3.49.0
    vite: ^3.0.0 => 3.0.8

Severity
serious, but I can work around it
Additional Information
No response

status is a top-level property. You've got it inside headers

In my case it does not redirect, nothing happens.

In my case it does not redirect, nothing happens.

I've learnt that's the default behaviour. Redirection won't happen by sole HTTP response. I've followed a recommendation from the Discord channel.
if (response.redirected) goto(response.url)

authors: Rich-Harris caesar-exploit ehzro3

repo: sveltejs/kit


text:
Build breaks since 1.15.11 when importing a file asynchronously in onMount (and using a monorepo?)

Describe the bug
Since the v1.15.11, the build breaks when importing a file asynchronously in onMount like so:
<script lang="ts">
    import { onMount } from 'svelte'
    import { defineConfig, renderStudio } from 'sanity'

    let studioEl: HTMLDivElement

    onMount(async () => {
        const { default: config } = await import('sanity-studio/sanity.config')
        //                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        if (studioEl) {
            const sanityConfig = defineConfig({
                ...config,
                // Replace options with env variables
                projectId: import.meta.env.VITE_SANITY_ID,
                dataset: import.meta.env.VITE_SANITY_DATASET,
            })

            renderStudio(studioEl, sanityConfig)
        }
    })
</script>

Rolling back to 1.15.10 works as expected, it build fine. 1.16.00 also breaks builds.
Reproduction
My project is quite big and using a monorepo so a repro would be complex but it is definitely linked to importing a file from another Monorepo package, or importing a file using await import()
Logs
[vite-plugin-sveltekit-compile] Could not find file ".svelte-kit/generated/client-optimized/nodes/4.js" in Vite manifest
✓ built in 17.38s
error during build:
Error: Could not find file ".svelte-kit/generated/client-optimized/nodes/4.js" in Vite manifest
    at resolve_symlinks (file:///Users/flayks/sites/project/website/node_modules/.pnpm/@sveltejs+kit@1.15.11_svelte@3.58.0_vite@4.3.4/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js:77:28)
    at find_deps (file:///Users/flayks/sites/project/website/node_modules/.pnpm/@sveltejs+kit@1.15.11_svelte@3.58.0_vite@4.3.4/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js:58:26)
    at file:///Users/flayks/sites/project/website/node_modules/.pnpm/@sveltejs+kit@1.15.11_svelte@3.58.0_vite@4.3.4/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js:72:18
    at Array.forEach (<anonymous>)
    at build_server_nodes (file:///Users/flayks/sites/project/website/node_modules/.pnpm/@sveltejs+kit@1.15.11_svelte@3.58.0_vite@4.3.4/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js:33:22)
    at Object.handler (file:///Users/flayks/sites/project/website/node_modules/.pnpm/@sveltejs+kit@1.15.11_svelte@3.58.0_vite@4.3.4/node_modules/@sveltejs/kit/src/exports/vite/index.js:737:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PluginDriver.hookParallel (file:///Users/flayks/sites/project/website/node_modules/.pnpm/rollup@3.21.4/node_modules/rollup/dist/es/shared/node-entry.js:24459:17)
    at async file:///Users/flayks/sites/project/website/node_modules/.pnpm/rollup@3.21.4/node_modules/rollup/dist/es/shared/node-entry.js:25820:13
    at async catchUnfinishedHookActions (file:///Users/flayks/sites/project/website/node_modules/.pnpm/rollup@3.21.4/node_modules/rollup/dist/es/shared/node-entry.js:24900:20)

System Info
System:
    OS: macOS 13.3
    CPU: (12) arm64 Apple M2 Max
    Memory: 422.41 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/Library/pnpm/node
    npm: 9.6.5 - ~/Library/pnpm/npm
  Browsers:
    Brave Browser: 112.1.50.121
    Firefox: 110.0.1
    Safari: 16.4

Severity
blocking an upgrade
Additional Information
No response

cc @gtm-nayan , probably related to #9808 - though we still need a reproduction if that snippet isn't enough to reproduce

Sure, I'll try to reproduce that with a very basic repro

@dummdidumm it might be related to Sanity at this stage? Not very sure, but I tried to reproduce it as minimal as possible using my use case: rendering a Sanity Studio on a route using onMount
https://github.com/flayks/sk-bug-1.15.11
As it, the build breaks with a similar error. If you comment the line #3, it builds normally 🤷
import { defineConfig, renderStudio } from 'sanity'

it was probably #9811 instead, although it seems I forgot to push the changeset for that one.
Some of my assumptions around how the vite manifest works didn't hold true, I thought the nodes would be present as is in the manifest but they get renamed if the bundler decides to put in more stuff into them.
Does anyone know if there is a way in vite/rollup to track which chunk a module ends up in?

I have the same error:
Error: Could not find file ".svelte-kit/generated/client-optimized/nodes/15.js" in Vite manifest
    at resolve_symlink

Also using Sanity Studio.
SanityStudio.svelte
<script lang="ts">
	import { renderStudio, defineConfig, type StudioProps } from 'sanity';
	import { onMount } from 'svelte';

	export let config: StudioProps['config'];

	let studioEl: HTMLDivElement;

	onMount(() => {
		if (studioEl) {
			const sanityConfig = defineConfig(config);

			renderStudio(studioEl, sanityConfig);
		}
	});
</script>

<svelte:head>
	<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
	<meta name="robots" content="noindex" />
	<meta name="referrer" content="same-origin" />
</svelte:head>

<div id="studio">
	<div bind:this={studioEl} />
</div>

<style>
	:global(body) {
		margin: 0;
	}

	#studio {
		height: 100vh;
	}

	#studio > div {
		height: 100%;
	}
</style>

<script lang="ts">
	import config from '$core/sanity/sanity.config';
	import SanityStudio from '$components/misc/SanityStudio.svelte';
</script>

<SanityStudio {config} />

Sanity's config looks like this
import { defineConfig } from 'sanity';

export default defineConfig({
	basePath: '/studio',
	projectId,
	dataset,
	title: 'landing.gallery',
});

Similar error on build here with https://github.com/brandtam/sveltekit-sanity-starter
If you clone and build now it works. But if you change
"@sveltejs/kit": "1.15.10",

to
"@sveltejs/kit": "1.15.10",

in package.json to allow a for a newer version of Kit and then build it will break with the Error: Could not find file ".svelte-kit/generated/client-optimized/nodes/5.js" in Vite manifest error.

I don't use sanity, but got the same error.

authors: brandtam dummdidumm flayks gtm-nayan gyurielf multiplehats


text:
[feat] i18n: lang in route

This implements the routing portion of #553
Possible basis for #1274
This tries to emulate a similar behavior that is already in use in other JamStack frameworks (e.g. https://i18n.nuxtjs.org/ or https://nextjs.org/docs/advanced-features/i18n-routing)
Implemented behavior

new svelte option => kit.i18n => {defaultLocale, locales[] }
svelte context module load function has optional lang param (to get CMS content, or strings from a dictionary)
lang is injected into $app/page
router gets props defaultLocale and locales
router has new method switchLocalePath
switchLocalePath is accessible through $app/navigation
locales and defaultLocale are now availble throuch $app/stores.i18n

Open issues
open issues that I can think of:

[x]  tests need to be adpted
[x] example project needs to be removed
[x] docs are not written
[x] packages/kit/src/core/config/options.js needs correction
[ ] test adapters

[x] static
[ ] node
[ ] cloudflare
[ ] netlify
[ ] vercel

[x] language switcher needs to be implemented
[x] client side navigation lang injection
[x] make locales accesible through $app/stores.i18n for generating language switchers
[x] do we need lang prefix for api routes too?
[x] add i18nRoute function to prefix routes with current lang
[x] add changeset
[x] fix npm run check

Nice! Does it work already? Does it compile to static folders when using the static build?

It works in dev environment, but adapters are not adapted yet

After a little fix dev and static export work.
I guess the other adapters should also work 🤷♂

Great work so far! Can't wait until this gets merged 😄

Thank you for the work, I hope that this will be available soon. I wonder if there will also a possibility to define localized route paths or exclude routes from some locales?

Thank you for the work, I hope that this will be available soon. I wonder if there will also a possibility to define localized route paths or exclude routes from some locales?

Could you elaborate with an example?
If I understand you correctly you would want something like this in svelte config
i18n: {
  localizedRoutes: [
    { route: '/onlyEn', lang: 'en' }
  ],
  excludedRoutes: [
    { route: '/noDeAndFr', langs: ['de', 'fr' ]}
  ]
}

It might help in reviewing this to have some documentation in the documentation/docs directory. It'd give a better understanding of how the feature is to be used

@dreitzner
Yes kind of, I was thinking about something like:
const routes = {
 about: {
    en: 'about',
    de: 'ueber-uns',
  },
  impressum: {
    de: 'impressum',
  }
};

I'm not sure the comment section of a PR is the right place to discuss how route segment translation should work
but here's my 2ct.

adding a potentially huge map in svelte.config.js is detrimental to it's readability. prefer an external file
mapping needs to work 2-way and must be deterministic / free of ambiguities
keep the structure as simple as possible. both lang: 'aa' , langs: ['aa','bb'] would be confusing and make implementation more complex.

@dreitzner
Yes kind of, I was thinking about something like:
const routes = {
 about: {
    en: 'about',
    de: 'ueber-uns',
  },
  impressum: {
    de: 'impressum',
  }
};

@floratmin that would be nice indeed, but I think it would be great to implement a basic structure first and then extend it at a later point.

It might help in reviewing this to have some documentation in the documentation/docs directory. It'd give a better understanding of how the feature is to be used

That would have been the next step, as soon as my time allows it (full-time job, three kids and a fourth almost here takes up some time 😂)

@benmccann i resolved all merge conflicts, added docs, removed the sample project, did some cleanup.
Is it ok, in you opinion to omit api routes from being i18n? If needed it can be an url param anyway, and if really needed, then it can be extended at a later point. If you do not agree, I can try to adapt the endpoints too, but I'd rather not 😉

So from what I understand, no real redirection nor translation is happening here. The path is only changed to be prefixed with the current language, and the old URL is pushed to history. Is that it?

So from what I understand, no real redirection nor translation is happening here. The path is only changed to be prefixed with the current language, and the old URL is pushed to history. Is that it?

@Marr11317, yes, the "only" thing that happens is:

extend code generation (routes, lang injection in the need places)
utility functions to change language
stores to access the data

Translations can build on top of this ticket. I'm not convinced that this can be generalized, because there are so many valid use cases (internal transition files in JSON, js, MD, ..., or many different CMS', fallback to default language, redirect to language, partial translation, ...). But it might be nice to have a suggested way available.

Sorry for that "only", I didn’t mean it negatively. The work that has been done is amazing and is definitely a solid foundation for integrating a translation library.

Sorry for that "only", I didn’t mean it negatively. The work that has been done is amazing and is definitely a solid foundation for integrating a translation library.

No worries, didn't understand it in a negative way. Thanks

My fourth child was born today. I might not be as quick to respond in the next 3 weeks.

Kinda silly question, but is this ready for production (not really mission-critical) use? I can't wait for this to be merged.

Kinda silly question, but is this ready for production (not really mission-critical) use? I can't wait for this to be merged.

Kinda silly answer:

yes it is fully working
I am in the process of building a test project for adapters, but between my jobs and my family, it is not moving as fast as I'd like
it would be great if some people could try and help with testing the adapters (and provide a link to the deployed test version)

Hi all, quick update on i18n. We just finished support for unicode URLs in 1.0.0-next.163, which seemed like a prerequisite to i18n and was something I wanted to get done before looking at this. This was rather complicated because it involved changes to SvelteKit, Vite, sirv, and polka over multiple releases of each of those libraries. We should be unblocked now as a result.
However, that being said, we're prioritizing just getting things working as they are before adding new features like i18n. I understand that i18n is a blocking issue for many people and appreciate that this is an issue folks are willing to chip in on, so we'll try to balance that and not let this sit forever without some more feedback. No promises on when we might be able to get to this, but I did want to let everyone know we haven't forgotten about it!
We're also looking at ways to keep the project momentum going, so have added several new maintainers over the past year and are discussing starting to use the donations we've received to get some part-time help as well

@dreitzner would you be able to share your test-project? If yes, I could have do a testdrive on node + vercel.

Is there anything this lets you do that you can't do today? I would expect you could just create a folder named [lang] and a store for the language and that would give you everything you need. You could update the URL when the languages changes with something like:
lang.subscribe(value => {
	goto(`/${value}${url.substring(url.indexOf('/', 1))}`);
});

Is there anything this lets you do that you can't do today? I would expect you could just create a folder named [lang] and a store for the language and that would give you everything you need. You could update the URL when the languages changes with something like:
lang.subscribe(value => {
	goto(`/${value}${url.substring(url.indexOf('/', 1))}`);
});

The problem would be that ALL routes would have to be duplicated and kept in sync (base language and [lang]).
Also with adapter static, there would be a need to have a link to each language, which might complicate things.
Also for SSR with context="module" it might be a bit trickier to get the right language.

The problem would be that ALL routes would have to be duplicated and kept in sync (base language and [lang]).

I don't understand what you mean by this. Are you referring to usage with a particular adapter or some more specific scenario? I was thinking you'd just move all your routes one level deeper. Create src/[lang] and then move all your routes into the [lang] folder. You wouldn't have to duplicate any routes

Also with adapter static, there would be a need to have a link to each language, which might complicate things.

Sure, a link, button, dropdown or some way to choose the language. Wouldn't you need that with this PR as well?

Also for SSR with context="module" it might be a bit trickier to get the right language.

How would it be tricky? You can just access params.lang

@benmccann I hope I understood your comments correctly.

I don't understand what you mean by this. Are you referring to usage with a particular adapter or some more specific scenario? I was thinking you'd just move all your routes one level deeper. Create src/[lang] and then move all your routes into the [lang] folder. You wouldn't have to duplicate any routes

the usual behavior is that a default locale lives inside of /. If I move eveerything into src/[lang] I'll no longer have a base route without i18n prefix.

Sure, a link, button, dropdown or some way to choose the language. Wouldn't you need that with this PR as well?
my PR adds the pages to the manifest => static export should render all of them

@benbender after I fixed some troubles after pulling upstream I created the test branch.
Thank you for offering to hel <3
https://github.com/dreitzner/kit/tree/553-test-branch/examples/i18n

the usual behavior is that a default locale lives inside of /. If I move eveerything into src/[lang] I'll no longer have a base route without i18n prefix.

Typo on my part. I meant src/routes/[lang] and have updated the comment

the usual behavior is that a default locale lives inside of /. If I move eveerything into src/[lang] I'll no longer have a base route without i18n prefix.

Typo on my part. I meant src/routes/[lang] and have updated the comment

I believe that what he meant is that if the base url is example.com, then:
example.com/index.html // main english page
example.com/fr/index.html //main french page
example.com/es/index.html // main spanish page
etc.

when no path is provided, it should default to the main english page.

the usual behavior is that a default locale lives inside of /. If I move eveerything into src/[lang] I'll no longer have a base route without i18n prefix.

Typo on my part. I meant src/routes/[lang] and have updated the comment

I believe that what he meant is that if the base url is example.com, then:
example.com/index.html // main english page
example.com/fr/index.html //main french page
example.com/es/index.html // main spanish page
etc.

when no path is provided, it should default to the main english page.

Thank you for helping out explaining it.
This is a perfect example of what I wanted to convey.

Ah, so basically there needs to be a way to specify an optional route parameter. I think that might be a more generic solution than building language support directly into the routing

I believe that what he meant is that if the base url is example.com, then:
example.com/index.html // main english page
example.com/fr/index.html //main french page
example.com/es/index.html // main spanish page
etc.

when no path is provided, it should default to the main english page.

Wouldn't it be better to not commit the language parameter for the default language? I know most websites omit /en and so does NextJS but I think that is rooted in "we started with one language (English) and added other languages later". Having a language parameter for every language, including the default one (which often is not English btw), seems reasonable to me.
The example above would become

example.com/en/index.html // main english page
example.com/fr/index.html //main french page
example.com/es/index.html // main spanish page

Imho the question here is not only if $things can't be achieved in any other way in sveltekit, but more about providing common, basic building blocks for common tasks/ways/interfaces (like i18n) which help to build upon in a common way and to not "reinvent the wheel" over and over again in many projects by many developers. Imho that's a great way to lower the burden for devs and help them to concentrate on those business-logic-tasks they actually want to solve.

I agree we should make things like i18n easy to setup and use. However, if we can allow users to code it with just a few lines, that's often better than building it in. E.g. there's disagreement here about whether or not the default language should be included in the URL. We'd end up also needing an option to control that. And what if the user wants to put the language as a subdomain instead of in the route (e.g. like LinkedIn)? That would again require another option. What if instead of sub-domains the user has different domains like google.com, google.co.uk, google.nl? You end up with an explosion of functionality in core to handle every use case, which could have been much simpler if we just provided easy-to-use building blocks. I find this PR to be quite opinionated on a certain way to include the lang in the route, when there are multiple ways to do it

@benmccann the two ways of doing it using subdomains you mentioned aren't really relevant here because a web proxy would have to route them to sub paths in the app anyway. I agree that the lang subpath should be optional, but otherwise sveltekit desperately needs something like this asap.

a web proxy would have to route them to sub paths in the app anyway

That's one way you could implement it, but you could also have the application check the Host header

sveltekit desperately needs something like this asap

You can already easily implement it in any app except for the optional routing segment

Imho, nextjs got all the major usecases right on their try to handle this: https://nextjs.org/docs/advanced-features/i18n-routing. The usage-experience of their implementation is simply pleasant, as you don't notice it if you don't need it and simply can configure some options to get a working system for most basic usecases as a opt-in when you need it.
One alternative, if we would say we don't want it in core, as its easily achivable, could be, to have default-implementations for such kinds of problems inside a "recipe"-repo or similar. It would, at least, give the benefit of having default solutions to common problems without much overhead for the users...

One alternative, if we would say we don't want it in core, as its easily achivable, could be, to have default-implementations for such kinds of problems inside a "recipe"-repo or similar. It would, at least, give the benefit of having default solutions to common problems without much overhead for the users...

The way we've been handling "recipe" type stuff is with Svelte Adders. It lets you setup all kinds of things like TailWind or Jest with a single command: https://github.com/svelte-add/svelte-add#-built-in-integration-adders

@benmccann Yes and no. Don't think it serves the purpose on an practical level as it is not officially endorsed, referenced in the docs etc. It's there, but it's not the neccessarily the obvious solution. The default solution in the sense that you don't need to search for it or think about it, if you have a common problem.
What I had in mind is more something like the solution of blitzjs: https://github.com/blitz-js/blitz/tree/canary/recipes

It is referenced in the docs: https://kit.svelte.dev/faq#how-do-i-use-x-with-sveltekit-how-do-i-setup-library-x
They're also listed on https://sveltesociety.dev/templates which we point folks to for this type of info
Happy to have ideas on how to make that more discoverable if folks are missing it

Happy to have ideas on how to make that more discoverable if folks are missing it

I did a search for svelte-adder in this repo and had 0 results. This could obviously be improved. Additionally I'm unable to find any reference on https://kit.svelte.dev/docs or on https://github.com/svelte-add/svelte-add. If it's the endorsed solution, I would say its not obvious (at least not to me). And, ideally, it could be moved into this repo to make it obvious...

I'll try to summarize:

google.com/.co.uk/... is not a fair comparison, as they have many different servers that are bound to their specific URL. To have a server for each language would be possible today without any hassle
whenever there is a REAL need to include domains/subdomains for i18n (because there is only one server that handles all), then lets talk about it then. Without a real usecase this would be an useless discussion.
@benmccann what this PR offers is currently NOT possible with svelte-kit (I tried, but adapter static will not work as expected)
the pattern implemented by this PR is well know and kinda expected with i18n. See NUXT, NEXT (they are what kit is for svelte) and many other frameworks
@benmccann an optional route parameter might be nice, but I am not sure how a static export will work, because the specific localized routes will no longer show up in the manifest
I am not convinced if this can be solved with something like svelte adders, as there are no sufficient hooks into the build system. If there would be a way to write build plugins (that can hook into all the stages where it is needed), it might be a good idea to extract it into it's own package that can be added in. In that case I would still argue that this should be part of the kit project (as it's won package), as it is such a basic need (see original issue by Rich).
Having the current locale available in load and in the component is necessary, if you want to translate anything

I hope I didn't leave anything out :)

@dreitzner Thank you so much for working on this!
I would add one thing (which has already been mentioned earlier) to your summary: the ability to translate route params (eg: /en/about to /fr/a-propos. I think this is pretty essential.
If it helps, I am currently working on 2 different multilingual Sveltekit projects (in production). Here is a simplified version of the routes structure I use:
routes
  [locale]
    [...url].svelte

I can then grab the url param and query the data from my CMS with it. This works well but does have some limitations. I will use prerendering as an exemple here, but this applies to every situation where you need a different configuration from one page to another.
Say I have a mostly static site that I can prerender, but I also have an account page that is dynamic. I can only write export prerender = true; in my [...url].svelte file. If I want to turn off prerendering for my account page, I have to create a separate account.svelte file. This works, until I want to translate the slug (/en/account to /fr/compte). Now I have to duplicate not only the file (create compte.svelte), but also my [locale] folder. The file structure shown above then becomes:
routes
  en
    account.svelte
    [...url].svelte
  fr
    compte.svelte
    [...url].svelte

Even though both [...url].svelte and the account page files are the same in each locale folder, I have to duplicate them. It also becomes more work to add a new language, as I have to hardcode them in the file structure.
I don't know if this is possible, but would there be a way to only have one default version of my file structure (associated with the default language), and a config file where I can just specify the translated slugs of every non-dynamic routes. Something like:
routes
  [locale]
    account.svelte
    [...url].svelte

(This is just a rough exemple, this configuration format could be anything you'd like, as long as it allows translating routes)
{
  i18n: {
    localizedRoutes: [
      {
        slug: 'account',
        alternates: [
          {
            lang: 'fr',
            slug: 'compte'
          ]
        ]
      }
    ]
  }
}

@f-elix I agree, that this would be an excellent feature to add on top of this PR.
I was thinking that it can be extended similar to what nuxt is doing with their i18n.
I am not sure which way it will go (page level config, svelte config), but nuxt offers them both.
My tendency would be to have this config on a page level, but there am some smart people out there who might think of some reason why something else might be better for kit 😊

an optional route parameter might be nice, but I am not sure how a static export will work

Static export would work work fine with an optional route parameter. It's the same as every other dynamic parameter that we have today which all work today with static export. I'm not against adding support for i18n in core, but if we can do it in a more generic way that provides value for other use cases that seems preferable. I think supporting optional route segments would allow you to implement this feature in a more generic way rather than coding something this specific

Having the current locale available in load and in the component is necessary, if you want to translate anything

I agree that you need a way to access the locale. Can you use a store for that?

Having the current locale available in load and in the component is necessary, if you want to translate anything

I agree that you need a way to access the locale. Can you use a store for that?

A store works fine for the client (and should be pretty straight forward). But what about the load function in ssr when you want to fetch something from your CMS and need the lang. You would need to write some code just for that.
Concerning optional fall through routes: I think I did not communicate my use case very well concerning static export. Assume you have 10 languages (some requirement from a current project at work). If you want the crawler to know about any of those languages you would need to link to all of them, right? With this PR the manifest gets extended, which in turn allows you to crawl the site without cross linking it (with 10 languages this gets out of hand quite fast).
But if optional fall through routes would work, than this could be awesome.

Yes, adding a link is one option. You're quite likely to have a link somewhere in the application or else how would users change their language? You could automatically detect, but usually there's still a way to change. The other option would be to set the prerender.entries option: https://kit.svelte.dev/docs#configuration-prerender

What do you think about supporting something like Mozilla:
https://projectfluent.org/
?
It is about supporting variables, word variations and numeric variants for individual languages.

What do you think about supporting something like Mozilla: https://projectfluent.org/ ?
It is about supporting variables, word variations and numeric variants for individual languages.

I don't think this pr should make any move in regard to a "recommended library".
However, to answer you question, although having a steeper learning curve, fluent is a very nice project and its syntax makes it easy to read compared to others.
I realize that I forgot to post it here, so:

I have been working on a template that implements a few of the features described in this thread.
Have a look at it and tell me  what you think

Am I right that this PR in general does multiply routes for a list of language prefixes automatically.
I also created a PR #1130 that adds a generic extension point to routes exactly for this, but is not limited to i18n. I have not looked into the code of your PR, but maybe our PRs are not so different. I took a more generic route so that i18n as a specialisation can be plugged in as a function. Translation of route segments also can be applied. Maybe we could join forces.

Closed in favor of using (non-greedy rest route parameters)[https://kit.svelte.dev/docs/routing#advanced-routing-rest-parameters]

source: gharchive/pull-request

authors: Marr11317 SpheeresX benbender benmccann cor dominikg dreitzner f-elix floratmin lukaszpolowczyk maelp pz-mxu samuelstroschein schindld


text:
[fix] change Vite's output directory from _app to client

This fixes an issue that @userquin ran into trying to make vite-plugin-pwa work with SvelteKit. He was using Vite/Rollup's emit to output a service worker manifest and expecting it to be served from the root directory, but it was ending up under _app. _app is arguable only for stuff generated by SvelteKit though. I could imagine lots of other things like a robots.txt or something you might want to generate with a Vite plugin that need to go in a certain location and are impossible to put there today.
I also think the code ends up being a little nicer this was as we don't end up having to specify the app dir in quite as many places
I'm splitting this out from https://github.com/sveltejs/kit/pull/5601 as that PR was becoming too unwieldy

This introduces a very minor bug — workers are no longer written to _app/assets/worker-xyz123.js, but are instead written to assets/worker-xyz123.js. Neither behaviour is correct (ideally it would be _app/immutable/worker-xyz123.js; that will be possible with the next release of Vite thanks to https://github.com/vitejs/vite/pull/9212), but putting workers outside _app feels slightly naughtier.
Not enough to prevent merging this PR, but worth noting nonetheless

authors: Rich-Harris benmccann


text:
Swagger core 1.5 does not allow spec filtering of definitions

We have a use case in which we want to produce different swagger docs derived from the same API. Implementing the AbstractSpecFilter is what we need. However, it lacks the hook for filtering specific definitions. Using  isRemovingUnreferencedDefinitions is too broad for our use case.
We suggest add an  isDefinitionAllowed method to address this use case.

implemented in #2820

authors: frantuma shauera

repo: swagger-api/swagger-core


text:
Feature Request: combine json-schema

This is a long shot, but it would make a HUGE step forward towards a complete solution:
I generate my JSON schema using ts-json-schema-generator. I then (manually) copy this schema into the swagger file with a few changes (replace $ref if necessary).
First step would be to point components.schemas to an external file, this file being the JSON schema. Then we could imagine an integrated way to generate the schema by scanning folders.

Hi @roinou. Thank you for opening the issue. Yes, we could consider a solution like that. Thank you for the suggestion and any news about it, I'll let you know.

authors: davibaltar roinou

repo: swagger-autogen/swagger-autogen


text:
Examples: Fix doc typos in accounts.

Describe the PR
Fix few documentation typos.
Additional context
Not a big deal, but I'm sure I'm not the only one seeing them 😊

I believe this could introduce errors when people copy/paste the example.

Thanks for the awesome package!

Codecov Report

Merging #643 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #643   +/-   ##
=======================================
  Coverage   85.74%   85.74%
=======================================
  Files           7        7
  Lines        1726     1726
=======================================
  Hits         1480     1480
  Misses        154      154
  Partials       92       92

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4676cb1...c6d9620. Read the comment docs.

Thanks

authors: codecov-io sdghchj thylong

repo: swaggo/swag


text:
How to show the app?

I've followed the directions from VPS.md to set up stringer on my VPS.
Everything runs smoothly, however, when I go to the URL that points to this directory, I got the directory listing instead of the app. See image attached.

Maybe I'm missing something fundamental here, but how can I show this app?

@jiehanzheng
Could you please provide your systemd service file?
Do you also have a nginx config for stringer?
I'm trying to get this working on a VPS and just "autostart" stringer when the server boots up...
Thanks in advance!

repo: swanson/stringer

license: mit


text:
Display Profile SWR

My-Profile needs a new display:
https://github.com/swarmcity/sc-boardwalk-production/wiki/Display-profile-swr

@xardas check if done

TODO: Desktop version

Desktop version:

Adapted mobile version (new margins):

authors: faffydee kikipluche n3xco

repo: swarmcity/SwarmCitySite


text:
rootston: Xwayland windows freeze on fullscreen

rootston.ini:
[core]
xwayland=true

[keyboard]
meta-key = Logo

[bindings]
Logo+Shift+e = exit
Logo+q = close
Logo+m = maximize
Logo+Escape = break_pointer_constraint
Logo+Tab = next_window
Logo+Return = exec glxgears -fullscreen

Launching rootston, pressing Logo+Return to launch glxgears and then pressing Logo+m results in the following:

everything freezes for about 2 seconds;
one more frame of glxgears is drawn and the mouse cursor unfreezes;
a second later, everything freezes again for about a second;
the mouse cursor unfreezes, glxgears stays frozen.

Closing glxgears via Logo+q results in it hanging if launched from a terminal, and Ctrl+c is needed to quit it.
Rootston log: https://gist.github.com/YaLTeR/28ae376b565fff2e107c12fe01a48eb3#file-rootston-log
I observed similar behavior with another Xwayland client (a game), except it also crashed after hanging. Backtrace for that: https://gist.github.com/YaLTeR/28ae376b565fff2e107c12fe01a48eb3#file-backtrace

This isn't related to direct scan-out.

Can you reproduce in Weston?

Weston acts... very strangely for me with glxgears. Attempting to maximize it or bring fullscreen seem to set the window to the correct size, but its position is way off, so it's not actually fullscreen. weston-terminal seems to be maximizing and fullscreening correctly though. So to sum up I wasn't able to test this.

When running rootston as a Wayland client, upon maximizing glxgears just freezes and doesn't unfreeze.
rootston.log
There's an xcb error printed to the log when I hit maximize:
[xwayland/xwm.c:1264] xcb error: op ConfigureWindow (no minor), code Alloc (no extension), sequence 152, value 0

@YaLTeR Can this be closed as Rootston isnt here anymore?

Maybe move this into the rootston repo? I believe you can move issues on GitHub now.

authors: YaLTeR emersion panaman67

repo: swaywm/wlroots


text:
xwayland's SIGUSR1 kills sway on platforms where the OpenGL DSO uses threads

Sway needs to mask out SIGUSR1 before loading any DSOs such as OpenGL drivers -- like Weston does. Otherwise if the GPU driver DSO spawns its own threads (ARM Mali does) those threads won't have SIGUSR1 blocked and xwayland will kill sway.
Pull request to fix: https://github.com/swaywm/wlroots/pull/1815
This issue replaces https://github.com/swaywm/sway/issues/4538

No need to open multiple issues -- we are aware of the issue, a pull request is enough.

authors: a-m-joseph emersion


text:
make rootston commands seat aware

The "close" command should close the focused window for the seat.
The "next_window" command should focus the next window in the seat's focus stack (not implemented).

focus the next window in the seat's focus stack

Tried implementing this, but I'm running into issues: in which order should we render views on outputs? It seems that we should keep a global view stack. When should a view be moved on top of this stack?

authors: acrisci emersion


text:
ESM(TypeScript) => CJS Doesn't Preserve Import Order

Describe the bug
While transpiling TypeScript code, TSC preserves the order while SWC doesn't and just puts all the imports to the top.
It can cause errors in some situations. The code below is the minimum reproduction of the problem I've faced.
I'm not sure if it's just an implementation detail of TSC or a spec but the resulting code is different and it can causes errors.
Input code
parent.ts
class ParentClass {}

import { ChildClass } from './child'

const child = new ChildClass()

child.ts
import { ParentClass } from './parent'

class ChildClass extends ParentClass {}

Config
{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": false
    },
    "target": "es2018"
  },
  "module": {
    "type": "commonjs"
  }
}

Expected behavior
require() statement should be at the same place where import statement was at
(at least that's what TSC does)
Version
The version of @swc/core: 1.2.58
Additional context
Since the problem can be solved by using require() instead of import, fixing this issue isn't that needed.

Duplicate of https://github.com/swc-project/swc/issues/1686
To follow the specification, import statements should be hoisted and tsc is simply doing wrong thing.
Official typescript compiler has a PR to fix the wrong behavior. (See https://github.com/microsoft/TypeScript/pull/39764)

repo: swc-project/swc


text:
Program instead of Module

This pr adds an option to parse file as script, not module.
Related: https://github.com/swc-project/swc/issues/491

bors r+


text:
update docker to use focal + 5.5

generator now requires 5.5

@swift-server-bot test this please

@swift-server-bot test this please

@swift-server-bot test this please

@swift-server-bot test this please

I created 5.6 branch as well:
https://github.com/apple/swift-package-collection-generator/tree/5.6

@swift-server-bot test this please

@swift-server-bot test this please

authors: tomerd yim-lee

repo: swift-server/sswg-collection


text:
[embedded] [docs] Swift Embedded docs - update Pico SDK example in Integrating With SDKs

This PR updates the "Integrating With SDKs" Swift Embedded tutorial, following the latest changes in the swift-embedded-examples repository (apple/swift-embedded-examples#58). It adds support for the Raspberry Pi Pico 2 (RP2350) in both ARM and RISC-V modes.
This is a partial improvement. To fully support the Pico SDK 2.0 changes (and also fix other silent issues that may arise with any SDK version in complex projects based on this), further modifications are needed, both described in apple/swift-embedded-examples#59 (currently awaiting a review / suggestions before submitting a PR):

Pass the Pico SDK compiler definitions to swiftc
Pico SDK 2.0.1 will fix an issue when building for RISC-V

Suggestions regarding this PR and / or the issues linked above are very much welcome!

I decided to convert this to a draft until the compiler definitions issue described above gets fixed in the swift-embedded-examples repo (https://github.com/apple/swift-embedded-examples/issues/59).

I fixed the "Pass the Pico SDK compiler definitions to swiftc" part and published a PR on the main swift-embedded-examples (apple/swift-embedded-examples#63) repo. I mirrored the changes here in my latest commit.
I will mark this as ready for review once the PR on the examples repo gets merged.

repo: swiftlang/swift


text:
Adjust file naming to official Angular 2 styleguide

All the files should be named following the official Angular 2 styleguide. Example: Chart.ts -> chart.component.ts etc..

I believe @ocombe did this? Are we complete w/ this?

yes

authors: amcdnl juristr ocombe


text:
Column resize sometimes gives weird behaviour on mouse resize/click

If you resize column with a mouse click & drag a couple of times, sometimes it jumps to a weird position or doesn't "unclick" at all. More details: https://drive.google.com/file/d/0B5-IASgGnqwdN214NmVrWFkzb3M/view (problems visible from ~0:20).
After a couple of resizing clicks, the sort button stops working as well - you have to click on it multiple times, sometimes the click resizes the column instead of changing sort direction - etc.
Any ideas what exactly can be wrong? ;s

Yep noticed the same thing too.

Ya, I've seen this before too. I could never narrow it down what exactly was causing it.
Something is going odd in this method I think - https://github.com/swimlane/angular2-data-table/blob/master/src/directives/Draggable.ts#L40

Fixed in the commits above. Ready to merge.

O, sorry, not yet, its not fixed. The problem appeared when event.movementX was equal to 0 and so then variable jumped to (event.screenX - this.prevScreenX). I'll make push force better commit in a sec.

Now it's fixed.

Sorry for spamming. Previous way just wasn't good and was buggy. Now I simplified it and it works 100%.

You're awesome! :)

authors: amcdnl amiller29au jtomaszewski


text:
ERROR TypeError: Cannot read property 'length' of undefined

I'm submitting a ...  (check one with "x")
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior
I got many:

ERROR TypeError: Cannot read property 'length' of undefined

and everything is broken. This happens in version 11.1.3, but everything is fine in 11.0.4
Expected behavior
should work fine
Reproduction of the problem
I've just updated to the latest version.
Please tell us about your environment:

Table version:  the bug happens in 11.1.3,  but not in 11.0.4

Angular version:  5.0.3

Browser:  Chrome

Language:  TypeScript 2.4.2

Can you provide a demo? I've saw it in the unit tests but those are passing now.

Saw same issue at work today trying to upgrade angular and datatable to latest. Hopefully I can provide a demo tomorrow or over the weekend.

@amcdnl  Did a quick test and seems it errs when initial state is an unassigned variable. This might be expected behaviour?
  badRows: Item[]; // <- will err
  goodRows: Item[] = []; // <- smooth sailing
Checked 11.1.3 & 11.1.4

Yes same error for me after upgrading, it seems now rows property must be pre init with empty array, this wasn't before aso

Hmm...its probably cuz of all the CD bypassing I'm doing now. Just need have a default initalizer for these i suppose.

Also the same error in 11.1.5 for me and no problems with 11.0.4.

Had the same Problem. I "npm update" and restarted VS code and it started working again. Maybe it helps somebody

Looks like this was fixed with:
https://github.com/swimlane/ngx-datatable/commit/2739d3f3f0a19c54dd485ce51badc2b9f9262bf5

authors: Logic-Bits ShinDarth amcdnl darrenwwilliams mburger81 nsmithdev petterhoel

repo: swimlane/ngx-datatable


text:
Large format dialog

Summary
This PR provides <ngx-large-format-dialog-content> component as wrapper for Dialog content to achieve Large Format dialog looks with custom styles.
Basic

Basic with Footer

Basic with Custom Close/Cancel text

Stepper

Tabs

Drawers
Full width

Half width

1/3 width

With DialogDrawerContent

Checklist

[ ] *Added unit tests
[x] *Added a code reviewer
[x] Added changes to /projects/swimlane/ngx-ui/CHANGELOG.md under HEAD (Unreleased)
[x] Updated the demo page
[x] Included screenshots of visual changes

*required

Tested.  Looks great!  A few comments on the styles:
Can we make the stepper a little more flexable:

@Hypercubed

Stepper Flexible?

In what sense? So if the space for the steps are too small and the text is long, we truncate it? break it on a new line?

Tabs

This is based off of the design (font-size and everything of the tabs' labels).
Probably going to need to Mike's inputs here, cc @mcwenger

Fot the stepper... I should have captured the entire screen... but in that case there was a lot of padding on the left and right.  Seams like it could grow a little with the content.

Tabs are great as-is, with the demo reset to the default horizontal spacing. Vertical spacing is intentional per visual cohesiveness of the header items (title, tabs/stepper, close/cancel).
Last items for me is to look at the stepper spread, will review asap.

@mcwenger Just pushed latest. Please check the Confirmation flow as follow

Also, the Drawer demo at the bottom has been updated. Please check the contextual drawers' styles as well

authors: Hypercubed mcwenger nartc

repo: swimlane/ngx-ui


text:
specify condition to perform Angular JS Injection

Indicate that ng-app in a root element is needed to inject Angular JS template. Injecting below payload without a root element with ng-app will not result in a successful injection

Unsubscribe
On Fri, Jan 5, 2024 at 11:26 Swissky @.***> wrote:

Merged #701 https://github.com/swisskyrepo/PayloadsAllTheThings/pull/701
into master.
—
Reply to this email directly, view it on GitHub
https://github.com/swisskyrepo/PayloadsAllTheThings/pull/701#event-11399168621,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AM2TK6BHL2GD5I3QQ4DSRSDYM7BLVAVCNFSM6AAAAABBFOPHNWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGM4TSMJWHA3DEMI
.
You are receiving this because you are subscribed to this thread.Message
ID: <swisskyrepo/PayloadsAllTheThings/pull/701/issue_event/11399168621@
github.com>

Unsubscribe

Unsubscribe

authors: Flendermens Vunnm deliriumalbus sachinjung

repo: swisskyrepo/PayloadsAllTheThings


text:
Consider using nm to estimate completion progress

Right now we use explicit markup in pxd file to track completion progress but we could see how many of symbols from imgui object file is already used. I think nm might be a good tool for this.

Now completion script accepts three subcommands:

with-pxd that returns summary of declarative completion markers
with-nm that analyses object files created before linking to see what symbols are really used
missing that lists missing API elements (symbols detangled with c++filt)

repo: swistakm/pyimgui


text:
[Enhancement Idea] Texts Assignment history

I wish I could translate the letters A and B to make it easier to understand.
In Room I would put "Local" [PT-BR].
And in A and B, respectively:
Main hall [Salão principal]
Auxiliary Classroom 1 [Sala B]

Hi @joaochris. Sure. I will add the necessary strings for them. I need to verify the form where we select a person for an assignment as well, since I could see that we may be run out of space with what we have currently.

This was added and will be released with v3.

authors: joaochris rhahao


text:
ci(staging-deploy): persist credentials set to false in code checkout

Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

Checklist:

[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] My changes generate no new warnings
[ ] Any dependent changes have been merged and published in downstream modules

:tada: This PR is included in version 1.0.2-beta.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:

:tada: This PR is included in version 2.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:

:tada: This PR is included in version 3.0.0-beta.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


text:
🛑 BestQA_GO is down

In 1ee1f45, BestQA_GO (https://www.bestqa.net/go/bestqa_dev/up) was down:

HTTP code: 0
Response time: 0 ms

Resolved: BestQA_GO is back up in fab40ac.

repo: swuecho/upptime


text:
🛑 Random site is down

In 7891bd2, Random site (https://www.southernjive.co.uk) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Random site is back up in 7397ef5.

repo: sxa/aoupptime


text:
Git Bash / mintty image previews do not work any more

What system are you running Yazi on?
Windows
What terminal are you running Yazi in?
mintty 3.7.0 (x86_64-pc-msys) (This is the Git Bash terminal installed with Git for Windows)
Did you try the latest code to see if this problem got fixed?
Not tried, and I'll explain why below
yazi --debug output

Yazi
    Version: 0.2.5 (c65a14c 2024-04-23)
    OS: windows-x86_64 (windows)
    Debug: false

Emulator
    Emulator.via_env: ("xterm", "mintty")
    Emulator.via_csi: Ok(Unknown([]))
    Emulator.detect: Mintty

Adaptor
    Adaptor.matches: Iterm2

Desktop
    XDG_SESSION_TYPE: None
    WAYLAND_DISPLAY: None
    DISPLAY: Some("needs-to-be-defined")

SSH
    shared.in_ssh_connection: false

WSL
    /proc/sys/fs/binfmt_misc/WSLInterop: false

Variables
    SHELL: Some("C:\\Users\\KhanH\\scoop\\apps\\git\\2.44.0\\usr\\bin\\bash.exe")
    EDITOR: None
    ZELLIJ_SESSION_NAME: None
    YAZI_FILE_ONE: Some("C:\\Users\\KhanH\\scoop\\apps\\git\\current\\usr\\bin\\file.exe")
    YAZI_CONFIG_HOME: None

file(1)
    Version: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: "file-5.45\nmagic file from /usr/share/misc/magic\n", stderr: "" })

Text Opener
    default: Some(Opener { run: "code \"%*\"", block: false, orphan: true, desc: "code", for_: None, spread: true })
    block: Some(Opener { run: "code -w \"%*\"", block: true, orphan: false, desc: "code (block)", for_: None, spread: true })

tmux
    TMUX: false

Ueberzug++
    Version: Err(Error { kind: NotFound, message: "program not found" })

--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "C:\\Users\\KhanH\\AppData\\Roaming\\yazi\\state" directory.

Describe the bug
Image Previews do not seem to work anymore on Git Bash / mintty. I tried yazi on Git Bash a few months ago and it seemed to work.

Expected Behavior
Images should show on Git Bash as it supports iterm and sixels.
To Reproduce
Run yazi on Git Bash.
Configuration
no config
Anything else?
No response

Does the image preview in Yazi v0.2.4 work in Mintty?

I tested 0.1.5 and a few of the 0.2.x versions (include 0.2.4) but they do not work.

authors: RioNight sxyazi

repo: sxyazi/yazi


text:
Revert HTML templates and make everything typed using builder API

Closes #556
Supersedes #537

This PR has become a giant mess and so it will probably be easier to restart again, this time splitting it up into more incremental chunks. Also I really don't want to go through all these merge conflicts!

repo: sycamore-rs/sycamore


text:
Feature Request: Move tabs with hotkeys

Hi there, first I want to say that I love this extension, it's beautiful in both its design and implementation. One thing I wish Chrome had by default was the ability to move the position of tabs using hotkeys. At the moment, I'm using an extension that gives me this functionality (with the hotkeys CMD+. to go right and CMD+, to go left), but I think this would be an excellent addition to your already powerful extension.

Hey @AndyMakous,
Thanks for your feedback!
The Tab Modifier goal remains to act on targeted tabs you have specified.
You are suggesting a feature that involves all tabs. I understand that you would like to have only one extension that acts on tabs. This is important for modularization purpose to build focused extensions on small features/scopes.
If there is already extension that allows you to move tabs with hotkeys, no reason to copy that feature. Don't hesitate to share this extension here.
Hope you share/understand my position.
Bests

Thanks for the prompt response! I do understand your position and didn't really think of the extension's goal that way. For anyone who comes across this in the future, the extension I use mentioned in the OP is Tab Mover.

authors: AndyMakous sylouuu

repo: sylouuu/chrome-tab-modifier


text:
🛑 Earth Works Lawn Cares is down

In cb39bec, Earth Works Lawn Cares (https://earthworkslawncares.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Earth Works Lawn Cares is back up in cf030ea after 43 minutes.

repo: symapex/upsite


text:
🛑 Bricktically is down

In 2424ac1, Bricktically (https://bricktically.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Bricktically is back up in b25d17a after 17 minutes.


text:
🛑 Bricktically is down

In 8a6deb2, Bricktically (https://bricktically.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Bricktically is back up in ef18088 after 36 minutes.


text:
🛑 Rigid Ground Work is down

In 7545501, Rigid Ground Work (https://rigidgroundwork.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Rigid Ground Work is back up in c302f3b after 1 hour, 5 minutes.


text:
🛑 Cedar Built Floors is down

In fb999a5, Cedar Built Floors (https://cedarbuiltfloors.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Cedar Built Floors is back up in 7194d87.


text:
🛑 Cedar Built Floors is down

In ba71d11, Cedar Built Floors (https://cedarbuiltfloors.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Cedar Built Floors is back up in 70a7baa after 1 hour, 7 minutes.


text:
🛑 Speedy Auto Clean is down

In 3fb2bc2, Speedy Auto Clean (https://speedyautoclean.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Speedy Auto Clean is back up in f2eafa3 after 16 minutes.


text:
🛑 Prism Carpet Cleaning is down

In e9aad6d, Prism Carpet Cleaning (https://prismcarpetcleaningtx.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Prism Carpet Cleaning is back up in 7065745 after 16 minutes.


text:
🛑 Prism Carpet Cleaning is down

In c36c000, Prism Carpet Cleaning (https://prismcarpetcleaningtx.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Prism Carpet Cleaning is back up in ea831ce after 10 minutes.


text:
🛑 Crycket Pest Control is down

In ef5d0aa, Crycket Pest Control (https://crycketpestcontrol.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Crycket Pest Control is back up in 9fe7596 after 10 minutes.


text:
🛑 Arborcare Ohio is down

In 1eee251, Arborcare Ohio (https://arborcareohio.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Arborcare Ohio is back up in 9c1df76 after 1 hour, 24 minutes.


text:
🛑 Tidy Train Cleaners is down

In dd6fb38, Tidy Train Cleaners (https://tidytraincleaners.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Tidy Train Cleaners is back up in adf7102 after 9 minutes.


text:
🛑 Clean Kind is down

In 9f6fefa, Clean Kind (https://cleankindphx.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Clean Kind is back up in cc03e7f after 10 minutes.


text:
🛑 Wall Doctor Denver is down

In 0bdd601, Wall Doctor Denver (https://walldoctordenver.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Wall Doctor Denver is back up in 8ec089c.


text:
🛑 Earth Works Lawn Cares is down

In 10efa11, Earth Works Lawn Cares (https://earthworkslawncares.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Earth Works Lawn Cares is back up in 0fb5e1d after 1 hour, 24 minutes.


text:
🛑 The Weekly Squeaky Clean is down

In 9634316, The Weekly Squeaky Clean (https://theweeklysqueakyclean.com/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: The Weekly Squeaky Clean is back up in 8647b47.


text:
add mongodb containers and depended libraries

Adding mongo DB container and depended libraries

@nyeholt can you please review this PR?

repo: symbiote-library/docker-project


text:
Default jquery is breaking sites

A site with an existing jquery inclusion, breaks due to the double inclusion of jquery

I'm not sure if there's a simple way around this actually. If it's already being included, we likely want to stick with that version and not add another into the requirements. But, we need a way to detect that (and it may not always come from the requirements). Taking a step back, it seems like the JS for this module could do with a fresh coat of paint so it doesn't even need the dependency.

authors: Firesphere nglasl

repo: symbiote/silverstripe-memberprofiles


text:
Updating .lock files for security reasons

Currently, composer install as well as Travis CI fails, because of symfony/http-foundation (v4.1.1):
https://symfony.com/blog/cve-2018-14773-remove-support-for-legacy-and-risky-http-headers

This PR updates the composer.lock and symfony.lock files to use the latest Symfony 4.1.3. Should also fix Travis breakage on #845.

The build now breaks on this:
PHPUnit 6.5.11 by Sebastian Bergmann and contributors.

Testing Project Test Suite
..................................................                50 / 50 (100%)

Time: 1.03 minutes, Memory: 56.25MB

OK (50 tests, 92 assertions)

Remaining deprecation notices (1)

  1x: Doctrine\Common\ClassLoader is deprecated.
    1x in BlogControllerTest::testAdminBackendHomePage from App\Tests\Controller\Admin

Which is something that (i think) needs to be fixed upstream:
https://github.com/symfony/symfony/issues/28119

a solution to avoid this issue would be to update Symfony packages, but not Doctrine ones (until Doctrine ORM makes another release removing the usage of the deprecated API)

@bshaffer the demo app works. It reports being affected by a security vulnerability, but that's not "not working".
And this PR cannot be merged as is, as it turns the CI red.

@stof

a solution to avoid this issue would be to update Symfony packages, but not Doctrine ones

I've updated the PR like that, but now Travis passes on PHP 7.2, but not on PHP 7.1:
Executing script security-checker security:check [KO]
 [KO]
Script security-checker security:check returned with error code 1
!!
!!    An error occurred: gnutls_handshake() failed: Handshake failed.
!!
!!
Script @auto-scripts was called via post-install-cmd
The command "composer install" failed and exited with 1 during .
Your build has been stopped.

Suggestions on how to proceed?

I meant it doesn't work because it throws an error on create-project. You're right, if you ignore the error it works. But it breaks build scripts unless you suppress the error with  || true

Update: That took a little bit of trial and error, but the tests are green again.

Updated symfony/* components to 4.1.3
Updated composer/ca-bundle to 1.1.2
Set Travis to use PHP 7.1.18, instead of 7.1.6 or something

See here for details on the TLS issue workaround: https://github.com/travis-ci/travis-ci/issues/6339
If/when Travis fixes this properly, i'll revert travis.yml to use plain 7.1 again.

@bobdenotter I warmly appreciate your work to fix this issue and to investigate all these problems. Sorry for the late merge.

@javiereguiluz You're welcome! I noticed some breakage in the NPM/Encore worklfow as well. Now that this has been merged, expect a PR to straighten that one out, too.

authors: bobdenotter bshaffer javiereguiluz stof

repo: symfony/demo


text:
Abandoned packets

It gives warning when i create new project and install the orm package.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.

Yep, nothing we can do about here.

authors: ahmetilhann nicolas-grekas

repo: symfony/orm-pack


text:
[LiveComponent] Error on Vector props hydratation

I'm using php-ds. But it seems to be highly unsupported by symfony ux. It's really complicated to have something working with. But here is something that looks more like an error to me than something unsupported. Issues with Doctrine collections may be connected.
Here is an example of a component:
class Options
{
    // a vector because they are ordered, it avoids storing the order elsewhere or weird array manipulation
Opt
    /** @var Vector<Option> */
    #[LiveProp(useSerializerForHydration: true, serializationContext: ['groups' => self::SERIALIZATION_GROUP])]
    public Vector $selectedOptions;
}

Looks ok isn't it? Yep, but it does not work. Because the LiveComponentHydrator transforms the type Vector to Option[], you guess the rest: it results in an array, an array is not a Vector, so it fails.
Here is the location of the error:
https://github.com/symfony/ux/blob/6b8b305805f955a085b811acdf9ec7ab029d3def/src/LiveComponent/src/LiveComponentHydrator.php#L268-L272
Not sure how you want to fix this, it looks not easy.

Hi @Nek- .. did you try with a custom hydration extension ?
https://symfony.com/bundles/ux-live-component/current/index.html#hydration-extensions

@smnandre yes, but it does not work because it does not work like the serializer: I need a vector hydration extension but it needs to hydrate the content as well and cannot use the doctrine hydration extension (it's internal!). AFAIK hydration extensions do not cascade well like the normalizers does. I ended up with an array.

How would you fix this ? What i get here is that the propertyinfo consider your var as a collection, right ?

The issue is very specific on this else:
https://github.com/symfony/ux/blob/6b8b305805f955a085b811acdf9ec7ab029d3def/src/LiveComponent/src/LiveComponentHydrator.php#L270
It needs to be an elseif ($type  == 'array') (smth like that)

If it's a collection, we need to specify the "children" type (tha'ts the idea of the [] notation). Else, serializer must know how to handle it.
So i think this should return false
            if ($propMetadata->collectionValueType()) {

https://github.com/symfony/ux/blob/6b8b305805f955a085b811acdf9ec7ab029d3def/src/LiveComponent/src/LiveComponentHydrator.php#L266

authors: Nek- smnandre

repo: symfony/ux


text:
Use config-standard without ECS for PhpStorm integration

PhpStorm has native integration with php-cs-fixer, as it can replace the built in coding style fixers (https://www.jetbrains.com/phpstorm/whatsnew/#php-tools-integration - see Use external formatters for PHP
). However, that means that ECS cannot be used to load these rules, and we must use php-cs-fixer directly.
It would be great if there was documentation, or an easy way to make use of config-standard without having to rely upon ECS, given that the documentation states it isn't required, but it's easiest to use it with ECS.

ECS is not nativelly supported by PhpStorm. That would have to handled in the IDE directly.
On the other hand, using these tools withing IDE requires redundant manual work. Better let CI handle this :)

repo: symplify/symplify