csspin-frontend 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,128 @@
1
+ # -*- mode: python; coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2024 CONTACT Software GmbH
4
+ # https://www.contact-software.com/
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """
19
+ Spin plugin wrapper for the tool cypress.
20
+
21
+ Allows running cypress tests in a spin environment. Therefore this plugin will
22
+ start the services necessary for the testing.
23
+ """
24
+
25
+ import os
26
+
27
+ try:
28
+ from csspin import config, die, option, setenv, sh, task
29
+ except ImportError:
30
+ from spin import config, die, option, setenv, sh, task
31
+
32
+ defaults = config(
33
+ version="13.6.3",
34
+ base_url="http://localhost:8080",
35
+ browser="chrome",
36
+ requires=config(
37
+ spin=[
38
+ "spin_ce.ce_services",
39
+ "spin_ce.mkinstance",
40
+ "csspin_frontend.node",
41
+ "spin_python.python",
42
+ ],
43
+ npm=["cypress@{cypress.version}"],
44
+ ),
45
+ )
46
+
47
+
48
+ def _run_cypress( # pylint: disable=keyword-arg-before-vararg
49
+ cfg,
50
+ instance,
51
+ run=True,
52
+ *args,
53
+ ):
54
+ from ce_services import RequireAllServices
55
+ from spin_ce.ce_services import extract_service_config
56
+
57
+ subcommand = "run" if run else "open"
58
+ inst = os.path.abspath(instance or cfg.mkinstance.base.instance_location)
59
+ if not os.path.isdir(inst):
60
+ die(f"Cannot find the CE instance '{inst}'.")
61
+ setenv(CADDOK_BASE=inst)
62
+ setenv(CYPRESS_adminpwd="{mkinstance.base.instance_admpwd}")
63
+
64
+ with RequireAllServices(cfg_overwrite=extract_service_config(cfg)):
65
+ if subcommand == "run":
66
+ sh(
67
+ "npx",
68
+ "cypress",
69
+ subcommand,
70
+ "--project",
71
+ "{spin.project_root}",
72
+ "--config",
73
+ f"baseUrl={cfg.cypress.base_url}",
74
+ "--browser",
75
+ f"{cfg.cypress.browser}",
76
+ *args,
77
+ )
78
+ else:
79
+ sh(
80
+ "npx",
81
+ "cypress",
82
+ subcommand,
83
+ "--project",
84
+ f"{cfg.spin.project_root}",
85
+ "--config",
86
+ f"baseUrl={cfg.cypress.base_url}",
87
+ *args,
88
+ )
89
+
90
+
91
+ @task(when="cept")
92
+ def cypress(
93
+ cfg,
94
+ instance: option(
95
+ "-i", # noqa: F821
96
+ "--instance", # noqa: F821
97
+ help="Directory of the CONTACT Elements instance.", # noqa: F722
98
+ ),
99
+ coverage: option( # pylint: disable=unused-argument
100
+ "-c", # noqa: F821
101
+ "--coverage", # noqa: F821
102
+ is_flag=True,
103
+ help="Run the tests while collecting coverage.", # noqa: F722
104
+ ), # Needed for cept workflow
105
+ args,
106
+ ):
107
+ """Run the 'cypress run' command."""
108
+ _run_cypress(cfg, instance, True, *args)
109
+
110
+
111
+ @task("cypress:open")
112
+ def cypress_open(
113
+ cfg,
114
+ instance: option(
115
+ "-i", # noqa: F821
116
+ "--instance", # noqa: F821
117
+ help="Directory of the CONTACT Elements instance.", # noqa: F722
118
+ ),
119
+ coverage: option( # pylint: disable=unused-argument
120
+ "-c", # noqa: F821
121
+ "--coverage", # noqa: F821
122
+ is_flag=True,
123
+ help="Run the tests while collecting coverage.", # noqa: F722
124
+ ), # Needed for cept workflow
125
+ args,
126
+ ):
127
+ """Run the 'cypress open' command."""
128
+ _run_cypress(cfg, instance, False, *args)
@@ -0,0 +1,17 @@
1
+ # -*- mode: yaml; coding: utf-8 -*-
2
+ #
3
+ # Schema of the cypress plugin for csspin
4
+
5
+ cypress:
6
+ type: object
7
+ help: Configuration of the cypress plugin.
8
+ properties:
9
+ version:
10
+ type: str
11
+ help: Cypress version
12
+ base_url:
13
+ type: str
14
+ help: The URL to connect Cypress with
15
+ browser:
16
+ type: str
17
+ help: The browser to run Cypress in
@@ -0,0 +1,112 @@
1
+ # -*- mode: python; coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2024 CONTACT Software GmbH
4
+ # https://www.contact-software.com/
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Module implementing the jest plugin for csspin."""
19
+
20
+ import os
21
+
22
+ from path import Path
23
+
24
+ try:
25
+ from csspin import Verbosity, config, die, interpolate1, option, setenv, sh, task
26
+ except ImportError:
27
+ from spin import Verbosity, config, die, interpolate1, option, setenv, sh, task
28
+
29
+ defaults = config(
30
+ coverage=False,
31
+ coverage_opts=[
32
+ "--coverage",
33
+ f"--coverageDirectory={{spin.project_root}}{os.path.sep}jest_coverage",
34
+ ],
35
+ opts=[
36
+ "--ci",
37
+ "--passWithNoTests",
38
+ "--noStackTrace",
39
+ ],
40
+ report_opts=["--reporters=default", "--reporters=@casualbot/jest-sonar-reporter"],
41
+ source="{spin.project_root}/cs",
42
+ requires=config(
43
+ spin=[
44
+ "spin_python.python",
45
+ "csspin_frontend.node",
46
+ "spin_ce.mkinstance",
47
+ ],
48
+ python=["cs.web"],
49
+ ),
50
+ )
51
+
52
+
53
+ def configure(cfg):
54
+ """Configure the jest plugin"""
55
+ for path in Path(interpolate1(cfg.jest.source)).walk():
56
+ if any(conf in path for conf in ("jest.config.js", "jest.config.json")):
57
+ break
58
+ else:
59
+ die("No jest.conf.json or jest.conf.js found for this project!")
60
+
61
+
62
+ @task(when="test")
63
+ def jest( # pylint: disable=too-many-arguments,too-many-positional-arguments
64
+ cfg,
65
+ instance: option(
66
+ "-i", # noqa: F821
67
+ "--instance", # noqa: F821
68
+ default=None,
69
+ help="Directory of the CONTACT Elements instance.", # noqa: F722
70
+ ),
71
+ coverage: option(
72
+ "-c", # noqa: F821
73
+ "--coverage", # noqa: F821
74
+ is_flag=True,
75
+ help="Run the tests while collecting coverage.", # noqa: F722
76
+ ),
77
+ with_test_report: option(
78
+ "--with-test-report", # noqa: F722
79
+ is_flag=True,
80
+ help="Create a test execution report.", # noqa: F722
81
+ ),
82
+ debug: option(
83
+ "--debug", is_flag=True, help="Start debug server." # noqa: F722,F821
84
+ ),
85
+ args,
86
+ ):
87
+ """Run jest tests against a CE instance."""
88
+ if not (
89
+ instance := Path(instance or cfg.mkinstance.base.instance_location).absolute()
90
+ ).is_dir():
91
+ die(f"Cannot find CE instance '{instance}'.")
92
+
93
+ opts = cfg.jest.opts
94
+ if cfg.verbosity > Verbosity.NORMAL:
95
+ opts.append("--verbose")
96
+ if coverage or cfg.jest.coverage:
97
+ opts.extend(cfg.jest.coverage_opts)
98
+ if debug:
99
+ opts.append("--debug")
100
+ if with_test_report and cfg.jest.report_opts:
101
+ sh(
102
+ "yarn",
103
+ "add",
104
+ "@casualbot/jest-sonar-reporter",
105
+ env={"NODE_PATH": instance / "node_modules"},
106
+ cwd=instance,
107
+ )
108
+ opts.extend(cfg.jest.report_opts)
109
+
110
+ setenv(CADDOK_BASE=instance)
111
+ sh("webmake", "-D", instance, "run-tests", cfg.spin.project_name, *opts, *args)
112
+ setenv(CADDOK_BASE=None)
@@ -0,0 +1,26 @@
1
+ # -*- mode: yaml; coding: utf-8 -*-
2
+ #
3
+ # Schema of the jest plugin for csspin
4
+
5
+ jest:
6
+ type: object
7
+ help: Configuration of the jest plugin.
8
+ properties:
9
+ coverage:
10
+ type: bool
11
+ help: Run jest with collecting coverage
12
+ coverage_opts:
13
+ type: list
14
+ help: |
15
+ List of options to pass to jest when running with coverage
16
+ enabled.
17
+ opts:
18
+ type: list
19
+ help: List of options to pass to jest.
20
+ report_opts:
21
+ type: list
22
+ help: |
23
+ List of options to pass to jest when generating test reports.
24
+ source:
25
+ type: str
26
+ help: The source directory when looking for jest.config.json.
@@ -0,0 +1,143 @@
1
+ # -*- mode: python; coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2024 CONTACT Software GmbH
4
+ # https://www.contact-software.com/
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Module implementing the jsconfig plugin for csspin
19
+
20
+ This plugin searches for JavaScript packages in order to create a jsconfig.json
21
+ file that can be interpreted by IDE's to enhance syntax highlighting,
22
+ quick-fixes, documentation previews, and more.
23
+ """
24
+
25
+ import fnmatch
26
+ import json
27
+ import os
28
+ import re
29
+
30
+ from path import Path
31
+
32
+ try:
33
+ from csspin import config, confirm, echo, exists, info, option, rmtree, task, warn
34
+ except ImportError:
35
+ from spin import config, confirm, echo, exists, info, option, rmtree, task, warn
36
+
37
+ defaults = config(
38
+ includes=["cs/**/*"],
39
+ excludes=[
40
+ "**/build",
41
+ "**/node_modules",
42
+ ],
43
+ search_dirs=["{python.site_packages}"],
44
+ base_url="{spin.project_root}",
45
+ requires=config(spin=["spin_python.python"]),
46
+ )
47
+
48
+
49
+ def finalize_provision(cfg): # pylint: disable=unused-argument
50
+ """Create a jsconfig.json file if not already present."""
51
+ if not exists(cfg.spin.project_root / "jsconfig.json"):
52
+ generate_jsconfig(cfg)
53
+ else:
54
+ info("jsconfig.json already exists, not generating new one.")
55
+
56
+
57
+ @task()
58
+ def jsconfig(
59
+ cfg,
60
+ skip_confirmation: option(
61
+ "--yes", # noqa: F821
62
+ "-y", # noqa: F821
63
+ "skip_confirmation", # noqa: F821
64
+ is_flag=True,
65
+ hidden=True,
66
+ ),
67
+ ):
68
+ """Generate a jsconfig.json file"""
69
+ if not (
70
+ not exists("jsconfig.json")
71
+ or skip_confirmation
72
+ or confirm("You are about to override the jsconfig.json. Continue?")
73
+ ):
74
+ generate_jsconfig(cfg)
75
+
76
+
77
+ def generate_jsconfig(cfg):
78
+ """Generates the jsconfig.json file"""
79
+
80
+ paths_by_package_names = {}
81
+ exclude_patterns = [
82
+ re.compile(fnmatch.translate(pattern)) for pattern in cfg.jsconfig.excludes
83
+ ]
84
+
85
+ for dir_to_search in cfg.jsconfig.search_dirs:
86
+ info(f"Searching for package.json files in {dir_to_search}")
87
+
88
+ for dirpath, _, filenames in os.walk(dir_to_search):
89
+ if any(pattern.search(dirpath) for pattern in exclude_patterns):
90
+ continue
91
+
92
+ dirpath = Path(dirpath)
93
+ for filename in filenames:
94
+ if filename != "package.json":
95
+ continue
96
+
97
+ info(f"Found {filename} at {dirpath}")
98
+ try:
99
+ # Get the package's name and use it as the key for the list
100
+ # of relative paths that lead to this package. We might have
101
+ # multiple paths in case the search_dirs contain multiple
102
+ # versions of the same cs package.
103
+ with open(
104
+ dirpath / filename,
105
+ "r",
106
+ encoding="utf-8",
107
+ ) as json_file:
108
+
109
+ if package_name := json.load(json_file).get("name"):
110
+ # Add package path to the list for the package name
111
+ paths_by_package_names.setdefault(package_name, []).append(
112
+ dirpath.relpath(cfg.spin.project_root)
113
+ )
114
+ except (IOError, json.JSONDecodeError) as ex:
115
+ warn(f"Error when trying to handle {filename}: {str(ex)}")
116
+
117
+ jsconfig_json = {
118
+ "include": cfg.jsconfig.includes,
119
+ "exclude": cfg.jsconfig.excludes,
120
+ "compilerOptions": {"baseUrl": cfg.jsconfig.base_url, "paths": {}},
121
+ }
122
+
123
+ for package_name, paths in paths_by_package_names.items():
124
+ jsconfig_json["compilerOptions"]["paths"][package_name] = [
125
+ path.replace(os.sep, "/") for path in paths
126
+ ]
127
+
128
+ with open(
129
+ target_jsconfig_path := cfg.spin.project_root / "jsconfig.json",
130
+ "w",
131
+ encoding="utf-8",
132
+ ) as jsconfig_file:
133
+ json.dump(jsconfig_json, jsconfig_file, indent=4, sort_keys=True)
134
+
135
+ echo(
136
+ f"jsconfig.json generated successfully: {target_jsconfig_path}!",
137
+ "Some IDE's may require a restart to apply the config.",
138
+ )
139
+
140
+
141
+ def cleanup(cfg):
142
+ """Remove the jsconfig.json file"""
143
+ rmtree(cfg.spin.project_root / "jsconfig.json")
@@ -0,0 +1,24 @@
1
+ # -*- mode: yaml; coding: utf-8 -*-
2
+ #
3
+ # Schema of the jsconfig plugin for csspin
4
+
5
+ jsconfig:
6
+ type: object
7
+ help: Configuration of the jsconfig plugin.
8
+ properties:
9
+ includes:
10
+ type: list
11
+ help: List of source paths of the current JS project
12
+ excludes:
13
+ type: list
14
+ help: |
15
+ List of source paths to JS projects to exclude from searching of
16
+ package.json
17
+ search_dirs:
18
+ type: list
19
+ help: |
20
+ Relative paths to directories to search JS projects to be mapped
21
+ to JS modules in jsconfig.json:compilerOptions.paths
22
+ base_url:
23
+ type: str
24
+ help: The path to the current JS project
@@ -0,0 +1,177 @@
1
+ # -*- mode: python; coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2020 CONTACT Software GmbH
4
+ # https://www.contact-software.com/
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """This module implements the node plugin for csspin.
19
+
20
+ This plugin allows you to use Node.js in your spin environment. It can be
21
+ configured to use a specific version of Node.js or to use the system's Node.js
22
+ interpreter. If a version is specified, the plugin will install the specified
23
+ version of Node.js using nodeenv. The plugin also installs npm and other
24
+ required npm packages.
25
+ """
26
+
27
+ import sys
28
+ from os import symlink
29
+ from textwrap import dedent
30
+
31
+ try:
32
+ from csspin import (
33
+ Path,
34
+ config,
35
+ copy,
36
+ die,
37
+ exists,
38
+ get_requires,
39
+ interpolate1,
40
+ memoizer,
41
+ rmtree,
42
+ setenv,
43
+ sh,
44
+ writetext,
45
+ )
46
+ from csspin.tree import ConfigTree
47
+ except ImportError:
48
+ from spin import (
49
+ Path,
50
+ config,
51
+ copy,
52
+ die,
53
+ exists,
54
+ get_requires,
55
+ interpolate1,
56
+ memoizer,
57
+ rmtree,
58
+ setenv,
59
+ sh,
60
+ writetext,
61
+ )
62
+ from spin.tree import ConfigTree
63
+
64
+ defaults = config(
65
+ version=None,
66
+ use=None,
67
+ mirror=None,
68
+ ignore_ssl_certs=False,
69
+ requires=config(
70
+ spin=["spin_python.python"],
71
+ python=["nodeenv"],
72
+ npm=["sass", "yarn"],
73
+ ),
74
+ )
75
+
76
+
77
+ def configure(cfg: ConfigTree) -> None:
78
+ """Configure the node plugin"""
79
+ if interpolate1("{node.use}") != "None":
80
+ cfg.node.requires.python = []
81
+
82
+ if cfg.node.version is None and not cfg.node.use:
83
+ die(
84
+ "Spin's Node.js plugin does not set a default version.\n"
85
+ "Please choose a version in spinfile.yaml by setting"
86
+ " node.version"
87
+ )
88
+ if cfg.node.version == "system":
89
+ die("Can't use node.version=system. Try node.use instead.")
90
+
91
+ if cfg.node.use and not exists(cfg.node.use):
92
+ import shutil
93
+
94
+ if not (interpreter := shutil.which(cfg.node.use)):
95
+ die(f"Could not finde Node interpreter '{cfg.node.use}'")
96
+ cfg.node.use = Path(interpreter)
97
+
98
+
99
+ def provision(cfg: ConfigTree, *args: str) -> None:
100
+ """Provision the node plugin"""
101
+ npm = cfg.python.scriptdir / "npm"
102
+ if sys.platform == "win32":
103
+ npm += ".cmd"
104
+ npm_prefix_path = cfg.python.venv / "Scripts"
105
+ node_path = npm_prefix_path / "node_modules"
106
+ else:
107
+ npm_prefix_path = cfg.python.venv
108
+ node_path = npm_prefix_path / "lib" / "node_modules"
109
+
110
+ with memoizer("{python.venv}/nodeversions.memo") as m:
111
+ if cfg.node.use:
112
+ if not m.check(cfg.node.use):
113
+ setenv(
114
+ NODE_PATH=node_path,
115
+ NPM_CONFIG_PREFIX=npm_prefix_path,
116
+ )
117
+ node_dir = cfg.node.use.dirname()
118
+ if sys.platform == "win32":
119
+ copy(cfg.node.use, cfg.python.scriptdir)
120
+ create_npm_cmd(cfg, node_dir)
121
+ else:
122
+ copy(cfg.node.use, cfg.python.scriptdir)
123
+ symlink(node_dir / "npm", cfg.python.scriptdir / "npm")
124
+ m.add(cfg.node.use)
125
+
126
+ elif cfg.node.version and (
127
+ cfg.node.version in ("latest", "lts") or not m.check(cfg.node.version)
128
+ ):
129
+ setenv(
130
+ NODE_PATH=node_path,
131
+ NPM_CONFIG_PREFIX=npm_prefix_path,
132
+ )
133
+ cmd = [
134
+ cfg.python.python,
135
+ "-mnodeenv",
136
+ "--python-virtualenv",
137
+ f"--node={cfg.node.version}",
138
+ ]
139
+ if cfg.node.mirror:
140
+ cmd.append(f"--mirror={cfg.node.mirror}")
141
+ if cfg.node.ignore_ssl_certs:
142
+ cmd.append("--ignore-ssl-certs")
143
+ sh(*cmd, *args)
144
+ m.add(cfg.node.version)
145
+
146
+ for plugin in cfg.spin.topo_plugins:
147
+ plugin_module = cfg.loaded[plugin]
148
+ for req in get_requires(plugin_module.defaults, "npm"):
149
+ if not m.check(req):
150
+ sh(npm, "install", "-g", req)
151
+ m.add(req)
152
+
153
+
154
+ def create_npm_cmd(cfg: ConfigTree, node_dir: Path) -> None:
155
+ """Writes an npm.cmd into the venv's Scripts directory which can be used to
156
+ execute npm.cmd from another directory.
157
+ """
158
+ cmd = dedent(
159
+ rf"""
160
+ @echo off
161
+ setlocal
162
+
163
+ set NPM_EXEC={node_dir}\npm.cmd
164
+ if not exist "%NPM_EXEC%" (
165
+ echo Error: npm not found at %NPM_EXEC%
166
+ exit /b 1
167
+ )
168
+ "%NPM_EXEC%" %*
169
+ endlocal
170
+ """
171
+ )
172
+ writetext(cfg.python.scriptdir / "npm.cmd", cmd)
173
+
174
+
175
+ def cleanup(cfg: ConfigTree) -> None: # pylint: disable=W0613
176
+ """Remove directories and files generated by the frontend plugin."""
177
+ rmtree("node_modules")
@@ -0,0 +1,20 @@
1
+ # -*- mode: yaml; coding: utf-8 -*-
2
+ #
3
+ # Schema of the node plugin for csspin
4
+
5
+ node:
6
+ type: object
7
+ help: Configuration of the Node plugin.
8
+ properties:
9
+ version:
10
+ type: str
11
+ help: NodeJS version
12
+ use:
13
+ type: path
14
+ help: Alternative path to a local NodeJS executable
15
+ mirror:
16
+ type: str
17
+ help: Proxy to get NodeJS sources from
18
+ ignore_ssl_certs:
19
+ type: bool
20
+ help: If enabled, ignoring SSL certificate validation checks.
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: csspin-frontend
3
+ Version: 2.0.0
4
+ Summary: Plugin-package for csspin providing frontend related plugins
5
+ Author-email: CONTACT Software GmbH <info@contact-software.com>
6
+ Maintainer-email: Waleri Enns <waleri.enns@contact-software.com>, Benjamin Thomas Schwertfeger <benjaminthomas.schwertfeger@contact-software.com>, Fabian Hafer <fabian.hafer@contact-software.com>
7
+ License-Expression: Apache-2.0
8
+ Project-URL: Homepage, https://contact-software.com
9
+ Classifier: Environment :: Console
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/x-rst
22
+ License-File: LICENSE
23
+ Requires-Dist: csspin-python
24
+ Requires-Dist: tomli; python_version < "3.11"
25
+ Dynamic: license-file
26
+
27
+ |Latest Version| |Python| |License|
28
+
29
+ `csspin-frontend` is maintained and published by `CONTACT Software GmbH`_ and
30
+ serves plugins for frontend development of CONTACT Elements-based applications
31
+ using the `csspin`_ task runner.
32
+
33
+ The following plugins are available:
34
+
35
+ - `csspin_frontend.cypress`: Provides tasks for running Cypress tests.
36
+ - `csspin_frontend.jest`: Provides tasks for running Jest tests.
37
+ - `csspin_frontend.jsconfig`: Provides tasks for managing JavaScript
38
+ configurations.
39
+ - `csspin_frontend.node`: Provides tasks for provisioning and managing Node.js
40
+ and npm.
41
+
42
+ Prerequisites
43
+ -------------
44
+
45
+ `csspin` is available on PyPI and can be installed using pip, pipx or any other
46
+ Python package manager, e.g.:
47
+
48
+ .. code-block:: console
49
+
50
+ python -m pip install csspin
51
+
52
+ Using csspin-frontend
53
+ ---------------------
54
+
55
+ The `csspin-frontend` package and its plugins can be installed by defining those
56
+ within the `spinfile.yaml` configuration file of your project.
57
+
58
+ .. code-block:: yaml
59
+
60
+ spin:
61
+ project_name: my_project
62
+
63
+ # To develop plugins comfortably, install the packages editable as
64
+ # follows and add the relevant plugins to the list 'plugins' below
65
+ plugin_packages:
66
+ - csspin-frontend
67
+
68
+ # The list of plugins to be used for this project.
69
+ plugins:
70
+ - csspin_frontend.node
71
+
72
+ python: # Required since csspin_frontend.node depends on csspin_python.python
73
+ version: 3.9.8
74
+
75
+ node:
76
+ version: 18.17.1
77
+
78
+ .. NOTE:: Assuming that `my_project` is a component based on CONTACT Elements CE16+.
79
+
80
+ If the `spinfile.yaml` is configured correctly, you can provision the project
81
+ using `spin provision`, that will automatically create a Python virtual
82
+ environment, install NodeJS and install the required dependencies.
83
+
84
+ .. _`CONTACT Software GmbH`: https://contact-software.com
85
+ .. |Python| image:: https://img.shields.io/pypi/pyversions/csspin-frontend.svg?style=flat
86
+ :target: https://pypi.python.org/pypi/csspin_frontend/
87
+ :alt: Supported Python Versions
88
+ .. |Latest Version| image:: http://img.shields.io/pypi/v/csspin-frontend.svg?style=flat
89
+ :target: https://pypi.python.org/pypi/csspin-frontend/
90
+ :alt: Latest Package Version
91
+ .. |License| image:: http://img.shields.io/pypi/l/csspin-frontend.svg?style=flat
92
+ :target: https://www.apache.org/licenses/LICENSE-2.0.txt
93
+ :alt: License
94
+ .. _`csspin`: https://pypi.org/project/csspin
@@ -0,0 +1,13 @@
1
+ csspin_frontend/cypress.py,sha256=wje0aREjfhpeooc2-FiHSShpuqSDxhthut9qHHWMFYM,3739
2
+ csspin_frontend/cypress_schema.yaml,sha256=hN8tcPmtwLfTFFEGN15_L67t3ZeJ3z4VTMSY-4RG0Fk,420
3
+ csspin_frontend/jest.py,sha256=6_IjZcIj4himZqOuT5USJ9qYg0sAepbg-DLfL8u8YAs,3460
4
+ csspin_frontend/jest_schema.yaml,sha256=WOxdnftWAfHoSmiAv2tKXQ49uYAoPAKb-j6jnQDbMLo,762
5
+ csspin_frontend/jsconfig.py,sha256=270wRu78hmXbNR2UMXR1DVita8a_pAe7zMj3vIm4rv0,4769
6
+ csspin_frontend/jsconfig_schema.yaml,sha256=LvBGHQGUEXfVTGUFR39zvd8bWEK84OMVkxg6Wxqj4Go,757
7
+ csspin_frontend/node.py,sha256=Ym8uuxKeArePjbtFleMfIEY2apaLVWOg85MpK_s_1j8,5372
8
+ csspin_frontend/node_schema.yaml,sha256=8S4QAbqYJit3BO14Tf-gvQtuUb_Up7pCf5aGupYGnao,545
9
+ csspin_frontend-2.0.0.dist-info/licenses/LICENSE,sha256=4MAecetnRTQw5DlHtiikDSzKWO1xVLwzM5_DsPMYlnE,10172
10
+ csspin_frontend-2.0.0.dist-info/METADATA,sha256=FFy9cznSTia3GWBrfA7_spIkw-urZKB4HkjoE-xMttA,3567
11
+ csspin_frontend-2.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ csspin_frontend-2.0.0.dist-info/top_level.txt,sha256=J7rTjZBc8bfI5qGjN7z6ZelkkrEM7DFjWaku95ohiy0,16
13
+ csspin_frontend-2.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1 @@
1
+ csspin_frontend