Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@ drush/contrib/
!.docker/config
!.docker/scripts
!.env
!.eslintrc.json
!.eslintignore
!.eslintrc.json
!.prettierignore
!.prettierrc.json
!.sass-lint.yml
!.stylelintrc.js
!.twig-cs-fixer.php
!gherkinlint.json
!Gruntfile.js
!auth.json
!behat.yml
!composer.json
!composer.lock
!yarn.lock
!package.json
!gherkinlint.json
!package-lock.json
!.prettierignore
!.prettierrc.json
!package.json
!patches
!phpcs.xml
!phpmd.xml
!phpstan.neon
!phpunit.xml
!postcss.config.js
!rector.php
!scripts
!tests
!yarn.lock

#;< HOSTING_ACQUIA
!hooks
Expand Down
12 changes: 6 additions & 6 deletions .gitignore.artifact
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ web/sites/default/files
web/sites/simpletest

# Ignore non-production Drupal Scaffold files.
web/sites/default/example.services.local.yml
web/sites/default/example.settings.local.php
web/sites/default/default.services.local.yml
web/sites/default/default.settings.local.php
web/sites/default/example.services.local.yml
web/sites/default/example.settings.local.php

# Ignore custom theme asset sources.
web/themes/custom/your_site_theme/.eslintrc.json
web/themes/custom/your_site_theme/fonts
web/themes/custom/your_site_theme/images
web/themes/custom/your_site_theme/js
web/themes/custom/your_site_theme/scss
web/themes/custom/your_site_theme/Gruntfile.js
web/themes/custom/your_site_theme/node_modules
web/themes/custom/your_site_theme/package.json
web/themes/custom/your_site_theme/postcss.config.js
web/themes/custom/your_site_theme/scss
web/themes/custom/your_site_theme/yarn.lock
web/themes/custom/your_site_theme/.eslintrc.json
web/themes/custom/your_site_theme/node_modules

#;< HOSTING_ACQUIA
# Do not ignore Acquia hooks.
Expand Down
1 change: 0 additions & 1 deletion .vortex/docs/content/drupal/theme-scaffold.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ your_site_theme/
├── your_site_theme.libraries.yml # Asset libraries
├── your_site_theme.theme # Theme functions
├── package.json # Node.js dependencies
├── Gruntfile.js # Build configuration
└── logo.svg # Theme logo
```

Expand Down
7 changes: 3 additions & 4 deletions .vortex/installer/src/Prompts/Handlers/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,10 @@ protected static function findThemeFile(string $dir, string $webroot, ?string $t

protected static function isVortexTheme(string $dir): bool {
$c1 = file_exists($dir . '/scss/_variables.scss');
$c2 = file_exists($dir . '/Gruntfile.js');
$c3 = file_exists($dir . '/package.json');
$c4 = File::contains($dir . '/package.json', 'build-dev');
$c2 = file_exists($dir . '/package.json');
$c3 = File::contains($dir . '/package.json', 'build-dev');

return $c1 && $c2 && $c3 && $c4;
return $c1 && $c2 && $c3;
}
Comment on lines 238 to 244
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider more robust JSON parsing for theme detection.

The current string search for 'build-dev' in package.json works but could theoretically match in comments or string values. For more robust detection, consider parsing the JSON and checking for the existence of scripts.build-dev.

🔎 Optional improvement using JSON parsing
 protected static function isVortexTheme(string $dir): bool {
   $c1 = file_exists($dir . '/scss/_variables.scss');
   $c2 = file_exists($dir . '/package.json');
-  $c3 = File::contains($dir . '/package.json', 'build-dev');
+  $c3 = false;
+  if ($c2) {
+    $package = json_decode(file_get_contents($dir . '/package.json'), true);
+    $c3 = isset($package['scripts']['build-dev']);
+  }
 
   return $c1 && $c2 && $c3;
 }


}
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ drush/contrib/
!.docker/config
!.docker/scripts
!.env
!.eslintrc.json
!.eslintignore
!.eslintrc.json
!.prettierignore
!.prettierrc.json
!.sass-lint.yml
!.stylelintrc.js
!.twig-cs-fixer.php
!gherkinlint.json
!Gruntfile.js
!auth.json
!behat.yml
!composer.json
!composer.lock
!yarn.lock
!package.json
!gherkinlint.json
!package-lock.json
!.prettierignore
!.prettierrc.json
!package.json
!patches
!phpcs.xml
!phpmd.xml
!phpstan.neon
!phpunit.xml
!postcss.config.js
!rector.php
!scripts
!tests
!yarn.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
{
"extends": "../../../core/.eslintrc.legacy.json"
"extends": [
"airbnb-base",
"plugin:prettier/recommended",
"plugin:yml/recommended"
],
"root": true,
"env": {
"browser": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 2020
},
"plugins": [
"jsdoc"
],
"globals": {
"Drupal": true,
"drupalSettings": true,
"drupalTranslations": true,
"jQuery": true,
"_": true,
"Cookies": true,
"Backbone": true,
"htmx": true,
"loadjs": true,
"Shepherd": true,
"Sortable": true,
"once": true,
"CKEditor5": true,
"tabbable": true,
"transliterate": true,
"bodyScrollLock" : true,
"FloatingUIDOM": true
},
"rules": {
"prettier/prettier": "error",
"consistent-return": ["off"],
"no-underscore-dangle": ["off"],
"max-nested-callbacks": ["warn", 3],
"import/no-mutable-exports": ["warn"],
"no-plusplus": ["warn", {
"allowForLoopAfterthoughts": true
}],
"no-param-reassign": ["off"],
"no-prototype-builtins": ["off"],
"jsdoc/require-returns": ["off"],
"jsdoc/require-returns-type": ["warn"],
"jsdoc/require-returns-description": ["warn"],
"jsdoc/require-returns-check": ["warn"],
"jsdoc/require-param": ["warn"],
"jsdoc/require-param-type": ["warn"],
"jsdoc/require-param-description": ["warn"],
"jsdoc/check-param-names": ["warn"],
"jsdoc/valid-types": ["warn"],
"jsdoc/require-param-name": ["warn"],
"jsdoc/check-tag-names": ["warn"],
"no-unused-vars": ["warn"],
"operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }],
"yml/indent": ["error", 2]
},
"settings": {
"jsdoc": {
"tagNamePreference": {
"returns": "return",
"property": "prop"
}
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Your Site Theme

Custom Drupal theme for the project.

## Requirements

- Node.js (LTS version recommended)
- Yarn

## Installation

```bash
yarn install
```

## Commands

| Command | Description |
|----------------------|------------------------------------------------|
| `yarn run build` | Production build (minified, no source maps) |
| `yarn run build-dev` | Development build (expanded, with source maps) |
| `yarn run watch` | Watch for changes and rebuild automatically |
| `yarn run lint` | Check code style (JS and SCSS) |
| `yarn run lint-fix` | Fix code style issues automatically |
Loading