aberlaas 2.9.0 → 2.11.0

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.
Files changed (70) hide show
  1. package/bin/aberlaas.js +1 -1
  2. package/configs/eslint.js +3 -0
  3. package/configs/lintstaged.js +2 -24
  4. package/configs/prettier.js +3 -4
  5. package/configs/stylelint.js +3 -41
  6. package/configs/vite.js +2 -41
  7. package/{main.js → lib/main.js} +26 -30
  8. package/package.json +37 -45
  9. package/commands/ci/index.js +0 -47
  10. package/commands/compress/dummy.js +0 -11
  11. package/commands/compress/index.js +0 -41
  12. package/commands/compress/png.js +0 -49
  13. package/commands/init/helper.js +0 -192
  14. package/commands/init/index.js +0 -59
  15. package/commands/init/module.js +0 -111
  16. package/commands/init/monorepo.js +0 -261
  17. package/commands/lint/circleci.js +0 -81
  18. package/commands/lint/css.js +0 -73
  19. package/commands/lint/helpers/prettier.js +0 -54
  20. package/commands/lint/index.js +0 -50
  21. package/commands/lint/js.js +0 -73
  22. package/commands/lint/json.js +0 -60
  23. package/commands/lint/yml.js +0 -62
  24. package/commands/precommit/index.js +0 -33
  25. package/commands/readme/index.js +0 -181
  26. package/commands/setup/circleci.js +0 -60
  27. package/commands/setup/github.js +0 -42
  28. package/commands/setup/helpers/circleci.js +0 -43
  29. package/commands/setup/helpers/github.js +0 -72
  30. package/commands/setup/helpers/npm.js +0 -16
  31. package/commands/setup/helpers/ssh.js +0 -77
  32. package/commands/setup/index.js +0 -52
  33. package/commands/setup/renovate.js +0 -54
  34. package/commands/test/index.js +0 -124
  35. package/configs/eslint.cjs +0 -154
  36. package/configs/node.cjs +0 -9
  37. package/configs/vite/test/setupFiles/captureOutput.js +0 -4
  38. package/configs/vite/test/setupFiles/dedent.js +0 -4
  39. package/configs/vite/test/setupFiles/fit-xit-fdescribe-xdescribe.js +0 -13
  40. package/configs/vite/test/setupFiles/jest-extended.js +0 -10
  41. package/configs/vite/test/setupFiles/testName.js +0 -9
  42. package/helper.js +0 -115
  43. package/templates/LICENSE +0 -9
  44. package/templates/_circleci/config.yml +0 -42
  45. package/templates/_eslintignore.conf +0 -12
  46. package/templates/_eslintrc.cjs +0 -3
  47. package/templates/_gitattributes +0 -4
  48. package/templates/_github/README.template.md +0 -7
  49. package/templates/_github/renovate.json +0 -3
  50. package/templates/_gitignore +0 -29
  51. package/templates/_yarnrc.yml +0 -15
  52. package/templates/lerna.json +0 -6
  53. package/templates/lib/__tests__/main.js +0 -13
  54. package/templates/lib/main.js +0 -5
  55. package/templates/lintstaged.config.js +0 -5
  56. package/templates/prettier.config.js +0 -5
  57. package/templates/scripts/ci +0 -6
  58. package/templates/scripts/compress +0 -4
  59. package/templates/scripts/docs/build +0 -4
  60. package/templates/scripts/docs/build-prod +0 -4
  61. package/templates/scripts/docs/cms +0 -4
  62. package/templates/scripts/docs/serve +0 -4
  63. package/templates/scripts/hooks/pre-commit +0 -11
  64. package/templates/scripts/lib/release +0 -5
  65. package/templates/scripts/lib/test +0 -5
  66. package/templates/scripts/lib/test-watch +0 -5
  67. package/templates/scripts/lint +0 -4
  68. package/templates/scripts/lint-fix +0 -4
  69. package/templates/stylelint.config.js +0 -5
  70. package/templates/vite.config.js +0 -5
package/helper.js DELETED
@@ -1,115 +0,0 @@
1
- import path from 'path';
2
- import * as url from 'url';
3
- import { _ } from 'golgoth';
4
- import { glob } from 'firost';
5
- import findUp from 'find-up';
6
-
7
- export default {
8
- /**
9
- * Return absolute path to the host dir
10
- * @returns {string} Absolute path to host dir
11
- **/
12
- hostRoot() {
13
- return process.cwd();
14
- },
15
- /**
16
- * Return an absolute path to a file in the host
17
- * @param {string} relativePath Relative path from the host root
18
- * @returns {string} Absolute path to the host file
19
- **/
20
- hostPath(relativePath = '') {
21
- return path.resolve(this.hostRoot(), relativePath);
22
- },
23
- /**
24
- * Return absolute path to the aberlaas directory
25
- * @returns {string} Absolute path to aberlaas dir
26
- **/
27
- aberlaasRoot() {
28
- return url.fileURLToPath(new URL('.', import.meta.url));
29
- },
30
- /**
31
- * Return an absolute path to a file in the aberlaas directory
32
- * @param {string} relativePath Relative path from the aberlaas root
33
- * @returns {string} Absolute path to the aberlaas file
34
- **/
35
- aberlaasPath(relativePath = '') {
36
- return path.resolve(this.aberlaasRoot(), relativePath);
37
- },
38
- /**
39
- * Find files in host directory following glob patterns. Will exclude some
40
- * directories by default, and allow specifying only specific file extensions
41
- * @param {Array} userPattern Patterns to match
42
- * @param {Array} safeExtensions Optional array of extensions to safelist. If
43
- * set, only files of this extensions will be returned
44
- * @returns {Array} Array of files matching the patterns
45
- **/
46
- async findHostFiles(userPattern, safeExtensions = []) {
47
- const patterns = _.castArray(userPattern);
48
- // Making all path relative to the host
49
- const globs = _.map(patterns, (pattern) => {
50
- return this.hostPath(pattern);
51
- });
52
-
53
- // Exclude folders that shouldn't be included
54
- const blockedFolders = [
55
- 'build',
56
- 'dist',
57
- 'fixtures',
58
- 'node_modules',
59
- 'tmp',
60
- 'vendors',
61
- '.git',
62
- '.yarn',
63
- ];
64
- _.each(blockedFolders, (blockedFolder) => {
65
- const deepFolder = `**/${blockedFolder}/**`;
66
- globs.push(`!${this.hostPath(deepFolder)}`);
67
- });
68
-
69
- // Expanding globs
70
- let allFiles = await glob(globs, { directories: false });
71
-
72
- if (_.isEmpty(safeExtensions)) {
73
- return allFiles;
74
- }
75
-
76
- // Keep only files of specified extensions
77
- allFiles = _.filter(allFiles, (filepath) => {
78
- const extension = path.extname(filepath);
79
- const extensionWithoutDot = _.replace(extension, '.', '');
80
- return (
81
- _.includes(safeExtensions, extension) ||
82
- _.includes(safeExtensions, extensionWithoutDot)
83
- );
84
- });
85
-
86
- return allFiles;
87
- },
88
- /**
89
- * Guess a path to a config file by first checking the specific path, then the
90
- * host folder and finally fallbacking on the aberlaas default
91
- * @param {string} userPath User specific config file
92
- * @param {string} upFile File to look for up the directory tree
93
- * @param {string} aberlaasPath Path to the aberlaas default file, relative to the aberlaas directory
94
- * @returns {string} Path to config file
95
- **/
96
- async configFile(userPath, upFile, aberlaasPath) {
97
- // Taking value from --config in CLI in priority
98
- if (userPath) {
99
- return this.hostPath(userPath);
100
- }
101
-
102
- // Checking for custom config in the host
103
- if (upFile) {
104
- const upPath = await findUp(upFile, {
105
- cwd: this.hostRoot(),
106
- });
107
- if (upPath) {
108
- return upPath;
109
- }
110
- }
111
-
112
- // Fallback on default config in aberlaas
113
- return this.aberlaasPath(aberlaasPath);
114
- },
115
- };
package/templates/LICENSE DELETED
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) {author}
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,42 +0,0 @@
1
- version: 2.1
2
-
3
- aliases:
4
- - &defaults
5
- docker:
6
- - image: cimg/node:{nodeVersion}
7
- - &restore_cache
8
- restore_cache:
9
- key: yarn-cache-{{ checksum "yarn.lock" }}
10
- - &install_yarn
11
- run:
12
- name: 'Installing correct yarn version'
13
- command: |
14
- corepack enable --install-directory="/home/circleci/bin"
15
- yarn set version {yarnVersion}
16
- - &install_dependencies
17
- run:
18
- name: 'Installing dependencies'
19
- command: 'yarn install'
20
- - &save_cache
21
- save_cache:
22
- key: yarn-cache-{{ checksum "yarn.lock" }}
23
- paths:
24
- - ~/.cache/yarn
25
-
26
- jobs:
27
- ci:
28
- <<: *defaults
29
- steps:
30
- - checkout
31
- - *restore_cache
32
- - *install_yarn
33
- - *install_dependencies
34
- - *save_cache
35
- - run: 'yarn run ci'
36
-
37
- workflows:
38
- version: 2
39
- # On every commit
40
- commit:
41
- jobs:
42
- - ci
@@ -1,12 +0,0 @@
1
- # Hidden files are ignored by default by ESLint
2
- # The following line will unignore them
3
- !.*
4
-
5
- # node_modules in subfolders are not ignored by default
6
- node_modules/
7
-
8
- # .yarn contains the yarn source code, we don't need to lint it
9
- .yarn/
10
-
11
- # Ignore the documentation for now, I haven't migrated it to ESM yet
12
- docs/
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ['./node_modules/aberlaas/configs/eslint.cjs'],
3
- };
@@ -1,4 +0,0 @@
1
- /.yarn/** linguist-vendored
2
- /.yarn/releases/* binary
3
- /.yarn/plugins/**/* binary
4
- /.pnp.* binary linguist-generated
@@ -1,7 +0,0 @@
1
- # {package.name}
2
-
3
- {index}
4
-
5
- ## Documentation
6
-
7
- The complete documentation can be found on {package.homepage}
@@ -1,3 +0,0 @@
1
- {
2
- "extends": ["config:js-lib", "aberlaas"]
3
- }
@@ -1,29 +0,0 @@
1
- # Hidden files
2
- .DS_Store
3
- .envrc
4
-
5
- # Directories
6
- build/
7
- dist/
8
- node_modules/
9
- tmp/
10
-
11
- # Files
12
- Thumbs.db
13
- lerna-debug.log
14
- npm-debug.log
15
- yarn-error.log
16
- *~
17
-
18
- # Yarn
19
- # https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
20
- .yarn/*
21
- !.yarn/patches
22
- !.yarn/plugins
23
- !.yarn/releases
24
- !.yarn/sdks
25
- !.yarn/versions
26
-
27
-
28
- # Netlify
29
- .netlify
@@ -1,15 +0,0 @@
1
- compressionLevel: 0
2
-
3
- defaultSemverRangePrefix: ''
4
-
5
- enableGlobalCache: true
6
-
7
- # Keep old-school saving of dependencies in node_modules
8
- # This makes debugging imported modules so much easier
9
- nodeLinker: node-modules
10
-
11
- # Use hardlinks to a global cache
12
- nmMode: hardlinks-local
13
-
14
- # Make sure each workspace has its own local node_modules
15
- nmHoistingLimits: workspaces
@@ -1,6 +0,0 @@
1
- {
2
- "version": "0.0.1",
3
- "useWorkspaces": true,
4
- "packages": ["lib", "docs"],
5
- "npmClient": "yarn"
6
- }
@@ -1,13 +0,0 @@
1
- import current from '../main.js';
2
-
3
- describe('main', () => {
4
- describe('run', () => {
5
- it('should pass', async () => {
6
- const input = 'something';
7
-
8
- const actual = current.run(input);
9
-
10
- expect(actual).toBe('something');
11
- });
12
- });
13
- });
@@ -1,5 +0,0 @@
1
- export default {
2
- run(input) {
3
- return input;
4
- },
5
- };
@@ -1,5 +0,0 @@
1
- import config from 'aberlaas/configs/lintstaged';
2
-
3
- export default {
4
- ...config,
5
- };
@@ -1,5 +0,0 @@
1
- import config from 'aberlaas/configs/prettier';
2
-
3
- export default {
4
- ...config,
5
- };
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- echo "node $(node --version), yarn $(yarn --version)"
5
-
6
- aberlaas ci "$@"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- aberlaas compress "${@:-$INIT_CWD}"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- echo "TODO: Set a default script"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- echo "TODO: Set a default script"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- echo "TODO: Set a default script"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- echo "TODO: Set a default script"
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env sh
2
- # This script *should be* automatically triggered before each git commit.
3
- #
4
- # If it doesn't work, make sure your local git repo is configured to use
5
- # ./scripts/hooks as the base directory for git hooks.
6
- #
7
- # If not, run:
8
- # $ git config core.hooksPath scripts/hooks
9
- set -e
10
-
11
- yarn run aberlaas precommit
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- yarn run test
5
- lerna publish --yes "$@"
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- cd ./lib
5
- aberlaas test "$@"
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- cd ./lib
5
- aberlaas test --watch "$@"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- aberlaas lint "${@:-$INIT_CWD}"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- aberlaas lint --fix "${@:-$INIT_CWD}"
@@ -1,5 +0,0 @@
1
- import config from 'aberlaas/configs/stylelint';
2
-
3
- export default {
4
- ...config,
5
- };
@@ -1,5 +0,0 @@
1
- import config from 'aberlaas/configs/vite';
2
-
3
- export default {
4
- ...config,
5
- };