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.
- package/bin/aberlaas.js +1 -1
- package/configs/eslint.js +3 -0
- package/configs/lintstaged.js +2 -24
- package/configs/prettier.js +3 -4
- package/configs/stylelint.js +3 -41
- package/configs/vite.js +2 -41
- package/{main.js → lib/main.js} +26 -30
- package/package.json +37 -45
- package/commands/ci/index.js +0 -47
- package/commands/compress/dummy.js +0 -11
- package/commands/compress/index.js +0 -41
- package/commands/compress/png.js +0 -49
- package/commands/init/helper.js +0 -192
- package/commands/init/index.js +0 -59
- package/commands/init/module.js +0 -111
- package/commands/init/monorepo.js +0 -261
- package/commands/lint/circleci.js +0 -81
- package/commands/lint/css.js +0 -73
- package/commands/lint/helpers/prettier.js +0 -54
- package/commands/lint/index.js +0 -50
- package/commands/lint/js.js +0 -73
- package/commands/lint/json.js +0 -60
- package/commands/lint/yml.js +0 -62
- package/commands/precommit/index.js +0 -33
- package/commands/readme/index.js +0 -181
- package/commands/setup/circleci.js +0 -60
- package/commands/setup/github.js +0 -42
- package/commands/setup/helpers/circleci.js +0 -43
- package/commands/setup/helpers/github.js +0 -72
- package/commands/setup/helpers/npm.js +0 -16
- package/commands/setup/helpers/ssh.js +0 -77
- package/commands/setup/index.js +0 -52
- package/commands/setup/renovate.js +0 -54
- package/commands/test/index.js +0 -124
- package/configs/eslint.cjs +0 -154
- package/configs/node.cjs +0 -9
- package/configs/vite/test/setupFiles/captureOutput.js +0 -4
- package/configs/vite/test/setupFiles/dedent.js +0 -4
- package/configs/vite/test/setupFiles/fit-xit-fdescribe-xdescribe.js +0 -13
- package/configs/vite/test/setupFiles/jest-extended.js +0 -10
- package/configs/vite/test/setupFiles/testName.js +0 -9
- package/helper.js +0 -115
- package/templates/LICENSE +0 -9
- package/templates/_circleci/config.yml +0 -42
- package/templates/_eslintignore.conf +0 -12
- package/templates/_eslintrc.cjs +0 -3
- package/templates/_gitattributes +0 -4
- package/templates/_github/README.template.md +0 -7
- package/templates/_github/renovate.json +0 -3
- package/templates/_gitignore +0 -29
- package/templates/_yarnrc.yml +0 -15
- package/templates/lerna.json +0 -6
- package/templates/lib/__tests__/main.js +0 -13
- package/templates/lib/main.js +0 -5
- package/templates/lintstaged.config.js +0 -5
- package/templates/prettier.config.js +0 -5
- package/templates/scripts/ci +0 -6
- package/templates/scripts/compress +0 -4
- package/templates/scripts/docs/build +0 -4
- package/templates/scripts/docs/build-prod +0 -4
- package/templates/scripts/docs/cms +0 -4
- package/templates/scripts/docs/serve +0 -4
- package/templates/scripts/hooks/pre-commit +0 -11
- package/templates/scripts/lib/release +0 -5
- package/templates/scripts/lib/test +0 -5
- package/templates/scripts/lib/test-watch +0 -5
- package/templates/scripts/lint +0 -4
- package/templates/scripts/lint-fix +0 -4
- package/templates/stylelint.config.js +0 -5
- 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/
|
package/templates/_eslintrc.cjs
DELETED
package/templates/_gitattributes
DELETED
package/templates/_gitignore
DELETED
|
@@ -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
|
package/templates/_yarnrc.yml
DELETED
|
@@ -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
|
package/templates/lerna.json
DELETED
package/templates/lib/main.js
DELETED
package/templates/scripts/ci
DELETED
|
@@ -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
|
package/templates/scripts/lint
DELETED