@eik/common 4.0.0-next.3 → 4.0.0-next.6
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/.eslintignore +2 -0
- package/.eslintrc +34 -0
- package/.github/workflows/publish.yml +69 -0
- package/.github/workflows/test.yml +45 -0
- package/.prettierignore +17 -0
- package/.prettierrc +20 -0
- package/CHANGELOG.md +60 -0
- package/eikjson.d.ts +41 -0
- package/fixtures/client-with-bare-imports.js +16 -0
- package/fixtures/client.js +6 -0
- package/fixtures/client.js.map +0 -0
- package/fixtures/folder/client.js +6 -0
- package/fixtures/folder/styles.css +0 -0
- package/fixtures/icons/checkbox-sprite.svg +46 -0
- package/fixtures/nested/client.js.map +0 -0
- package/fixtures/nested/styles.css.map +0 -0
- package/fixtures/styles.css +0 -0
- package/fixtures/styles.css.map +0 -0
- package/package.json +6 -62
- package/packages/config-loader/.prettierignore +17 -0
- package/packages/config-loader/index.js +13 -0
- package/packages/config-loader/package.json +42 -0
- package/{lib → packages/config-loader/src}/classes/file-mapping.js +2 -2
- package/{lib → packages/config-loader/src}/classes/local-file-location.js +0 -0
- package/{lib → packages/config-loader/src}/classes/read-file.js +2 -1
- package/{lib → packages/config-loader/src}/classes/remote-file-location.js +0 -0
- package/{lib → packages/config-loader/src}/classes/resolved-files.js +3 -2
- package/{lib/helpers → packages/config-loader/src}/config-store.js +4 -4
- package/{lib/classes → packages/config-loader/src}/eik-config.js +14 -10
- package/{lib/classes → packages/config-loader/src/errors}/custom-error.js +4 -2
- package/{lib/classes → packages/config-loader/src/errors}/invalid-config-error.js +4 -2
- package/{lib/classes → packages/config-loader/src/errors}/missing-config-error.js +4 -2
- package/{lib/classes → packages/config-loader/src/errors}/multiple-config-sources-error.js +4 -2
- package/{lib/classes → packages/config-loader/src/errors}/no-files-matched-error.js +5 -3
- package/{lib/classes → packages/config-loader/src/errors}/single-dest-multiple-source-error.js +4 -2
- package/{lib/helpers → packages/config-loader/src}/get-defaults.js +7 -6
- package/{lib/helpers → packages/config-loader/src}/local-assets.js +2 -1
- package/{lib/helpers → packages/config-loader/src/utils}/resolve-files.js +3 -2
- package/packages/config-loader/test/assets/esm.css +0 -0
- package/packages/config-loader/test/assets/esm.css.map +0 -0
- package/packages/config-loader/test/assets/esm.js +0 -0
- package/packages/config-loader/test/assets/esm.js.map +0 -0
- package/packages/config-loader/test/config-store.test.js +231 -0
- package/packages/config-loader/test/eik-config/cwd.test.js +35 -0
- package/packages/config-loader/test/eik-config/map.test.js +31 -0
- package/packages/config-loader/test/eik-config/mappings.test.js +507 -0
- package/packages/config-loader/test/eik-config/out.test.js +54 -0
- package/packages/config-loader/test/eik-config/server.test.js +32 -0
- package/packages/config-loader/test/eik-config/toJSON.test.js +19 -0
- package/packages/config-loader/test/eik-config/token.test.js +49 -0
- package/packages/config-loader/test/eik-config/type.test.js +22 -0
- package/packages/config-loader/test/eik-config/validate.test.js +31 -0
- package/packages/config-loader/test/eik-config/version.test.js +22 -0
- package/packages/config-loader/test/eik.json +10 -0
- package/packages/config-loader/test/local-assets.test.js +125 -0
- package/packages/config-loader/test/local-file-location/absolute.test.js +35 -0
- package/packages/config-loader/test/local-file-location/contentType.test.js +55 -0
- package/packages/config-loader/test/local-file-location/extension.test.js +20 -0
- package/packages/config-loader/test/local-file-location/mimeType.test.js +43 -0
- package/packages/config-loader/test/read-file.test.js +60 -0
- package/packages/config-loader/test/resolve-files.test.js +257 -0
- package/packages/config-loader/test/resolved-files/iterator.test.js +17 -0
- package/packages/config-loader/test/tmp/.gitkeep +0 -0
- package/packages/schemas/.prettierignore +17 -0
- package/packages/schemas/eikjson.d.ts +41 -0
- package/packages/schemas/index.js +7 -0
- package/packages/schemas/package.json +40 -0
- package/{lib/schemas → packages/schemas/src}/assert.js +3 -2
- package/{lib/schemas → packages/schemas/src}/eikjson.schema.json +0 -0
- package/{lib/schemas → packages/schemas/src}/validate.js +12 -8
- package/{lib/schemas → packages/schemas/src}/validation-error.js +1 -1
- package/packages/schemas/test/assert.js +207 -0
- package/packages/schemas/test/index.js +182 -0
- package/packages/utils/.prettierignore +17 -0
- package/packages/utils/index.js +20 -0
- package/packages/utils/package.json +29 -0
- package/{lib/helpers → packages/utils/src}/path-slashes.js +0 -0
- package/packages/utils/src/stream.js +21 -0
- package/{lib/helpers → packages/utils/src}/type-slug.js +0 -0
- package/{lib/helpers → packages/utils/src}/type-title.js +0 -0
- package/packages/utils/tests/eik.json +10 -0
- package/packages/validators/.prettierignore +17 -0
- package/packages/validators/package.json +34 -0
- package/packages/validators/src/index.js +53 -0
- package/packages/validators/test/index.js +238 -0
- package/release/eik-common-4.0.0-next.6.tgz +0 -0
- package/release.config.js +27 -0
- package/renovate.json +6 -0
- package/tsconfig.json +30 -0
- package/lib/helpers/index.js +0 -25
- package/lib/index.js +0 -17
- package/lib/schemas/index.js +0 -8
- package/lib/stream.js +0 -14
- package/lib/validators/index.js +0 -66
- package/types/classes/custom-error.d.ts +0 -7
- package/types/classes/eik-config.d.ts +0 -57
- package/types/classes/file-mapping.d.ts +0 -19
- package/types/classes/invalid-config-error.d.ts +0 -13
- package/types/classes/local-file-location.d.ts +0 -36
- package/types/classes/missing-config-error.d.ts +0 -13
- package/types/classes/multiple-config-sources-error.d.ts +0 -9
- package/types/classes/no-files-matched-error.d.ts +0 -13
- package/types/classes/read-file.d.ts +0 -15
- package/types/classes/remote-file-location.d.ts +0 -21
- package/types/classes/resolved-files.d.ts +0 -19
- package/types/classes/single-dest-multiple-source-error.d.ts +0 -13
- package/types/helpers/config-store.d.ts +0 -30
- package/types/helpers/get-defaults.d.ts +0 -2
- package/types/helpers/index.d.ts +0 -15
- package/types/helpers/local-assets.d.ts +0 -8
- package/types/helpers/path-slashes.d.ts +0 -32
- package/types/helpers/resolve-files.d.ts +0 -12
- package/types/helpers/type-slug.d.ts +0 -2
- package/types/helpers/type-title.d.ts +0 -2
- package/types/index.d.ts +0 -115
- package/types/schemas/assert.d.ts +0 -11
- package/types/schemas/index.d.ts +0 -79
- package/types/schemas/validate.d.ts +0 -26
- package/types/schemas/validation-error.d.ts +0 -8
- package/types/stream.d.ts +0 -2
- package/types/validators/index.d.ts +0 -8
package/.eslintignore
ADDED
package/.eslintrc
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parser": "@babel/eslint-parser",
|
|
3
|
+
"extends": [
|
|
4
|
+
"airbnb-base",
|
|
5
|
+
"prettier"
|
|
6
|
+
],
|
|
7
|
+
"plugins": [
|
|
8
|
+
"prettier"
|
|
9
|
+
],
|
|
10
|
+
"parserOptions": {
|
|
11
|
+
"ecmaVersion": 11,
|
|
12
|
+
"sourceType": "module",
|
|
13
|
+
"requireConfigFile": false
|
|
14
|
+
},
|
|
15
|
+
"rules": {
|
|
16
|
+
"import/prefer-default-export": "off",
|
|
17
|
+
"import/extensions": [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
"js": "ignorePackages",
|
|
21
|
+
"json": "ignorePackages"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"class-methods-use-this": [
|
|
25
|
+
0
|
|
26
|
+
],
|
|
27
|
+
"no-underscore-dangle": [
|
|
28
|
+
0
|
|
29
|
+
],
|
|
30
|
+
"no-restricted-syntax": [
|
|
31
|
+
0
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Release and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
- alpha
|
|
8
|
+
- beta
|
|
9
|
+
- next
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v3
|
|
17
|
+
- name: Setup Node.js
|
|
18
|
+
uses: actions/setup-node@v3
|
|
19
|
+
with:
|
|
20
|
+
node-version: 16.x
|
|
21
|
+
- name: install dependencies
|
|
22
|
+
run: |
|
|
23
|
+
npm install --workspaces
|
|
24
|
+
env:
|
|
25
|
+
CI: true
|
|
26
|
+
- name: lint files
|
|
27
|
+
run: |
|
|
28
|
+
npm run lint --workspaces
|
|
29
|
+
env:
|
|
30
|
+
CI: true
|
|
31
|
+
- name: style check files
|
|
32
|
+
run: |
|
|
33
|
+
npm run style:check --workspaces
|
|
34
|
+
env:
|
|
35
|
+
CI: true
|
|
36
|
+
- name: typecheck files
|
|
37
|
+
run: |
|
|
38
|
+
npm run typecheck --workspaces
|
|
39
|
+
env:
|
|
40
|
+
CI: true
|
|
41
|
+
- name: check eik json schema is up to date
|
|
42
|
+
run: |
|
|
43
|
+
npm run schema:outdated --workspaces
|
|
44
|
+
env:
|
|
45
|
+
CI: true
|
|
46
|
+
- name: run tests
|
|
47
|
+
run: |
|
|
48
|
+
npm test --workspaces
|
|
49
|
+
|
|
50
|
+
release:
|
|
51
|
+
name: Release
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
needs: [test]
|
|
54
|
+
steps:
|
|
55
|
+
- name: Checkout
|
|
56
|
+
uses: actions/checkout@v3
|
|
57
|
+
- name: Setup Node.js
|
|
58
|
+
uses: actions/setup-node@v3
|
|
59
|
+
with:
|
|
60
|
+
node-version: 16.x
|
|
61
|
+
- name: npm install
|
|
62
|
+
run: |
|
|
63
|
+
npm install --workspaces
|
|
64
|
+
- name: npx semantic-release
|
|
65
|
+
run: |
|
|
66
|
+
npx semantic-release
|
|
67
|
+
env:
|
|
68
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
69
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Run Lint and Tests
|
|
2
|
+
|
|
3
|
+
on: push
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
os: [ubuntu-latest, macOS-latest, windows-latest]
|
|
11
|
+
node-version: [16.x, 18.x]
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v3
|
|
14
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
15
|
+
uses: actions/setup-node@v3
|
|
16
|
+
with:
|
|
17
|
+
node-version: ${{ matrix.node-version }}
|
|
18
|
+
- name: install dependencies
|
|
19
|
+
run: |
|
|
20
|
+
npm install --workspaces
|
|
21
|
+
env:
|
|
22
|
+
CI: true
|
|
23
|
+
- name: lint files
|
|
24
|
+
run: |
|
|
25
|
+
npm run lint --workspaces
|
|
26
|
+
env:
|
|
27
|
+
CI: true
|
|
28
|
+
- name: style check files
|
|
29
|
+
run: |
|
|
30
|
+
npm run style:check --workspaces
|
|
31
|
+
env:
|
|
32
|
+
CI: true
|
|
33
|
+
- name: typecheck files
|
|
34
|
+
run: |
|
|
35
|
+
npm run typecheck --workspaces
|
|
36
|
+
env:
|
|
37
|
+
CI: true
|
|
38
|
+
- name: check eik json schema is up to date
|
|
39
|
+
run: |
|
|
40
|
+
npm run schema:outdated --workspace=packages/schemas
|
|
41
|
+
env:
|
|
42
|
+
CI: true
|
|
43
|
+
- name: run tests
|
|
44
|
+
run: |
|
|
45
|
+
npm test --workspaces
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"trailingComma": "all",
|
|
4
|
+
"tabWidth": 4,
|
|
5
|
+
"overrides": [
|
|
6
|
+
{
|
|
7
|
+
"files": [
|
|
8
|
+
".prettierrc",
|
|
9
|
+
"*.json",
|
|
10
|
+
"*.yml",
|
|
11
|
+
".travis.yml",
|
|
12
|
+
".eslintrc",
|
|
13
|
+
"release.config.js"
|
|
14
|
+
],
|
|
15
|
+
"options": {
|
|
16
|
+
"tabWidth": 2
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
+
# [4.0.0-next.6](https://github.com/eik-lib/common/compare/v4.0.0-next.5...v4.0.0-next.6) (2022-07-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* lint ([edc595f](https://github.com/eik-lib/common/commit/edc595f6f4baf465e736bed8a4cb2e0eb8efe382))
|
|
7
|
+
|
|
8
|
+
# [4.0.0-next.5](https://github.com/eik-lib/common/compare/v4.0.0-next.4...v4.0.0-next.5) (2022-07-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update dependency glob to v8 ([#225](https://github.com/eik-lib/common/issues/225)) ([fd01a56](https://github.com/eik-lib/common/commit/fd01a566b404164bdc847cc7a1803b124e131e41))
|
|
14
|
+
* **deps:** update dependency validate-npm-package-name to v4 ([#222](https://github.com/eik-lib/common/issues/222)) ([c3721ab](https://github.com/eik-lib/common/commit/c3721abf058c93d4e500945c3c014c748c1f2acd))
|
|
15
|
+
|
|
16
|
+
## [3.0.1](https://github.com/eik-lib/common/compare/v3.0.0...v3.0.1) (2022-05-04)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **deps:** update dependency glob to v8 ([#225](https://github.com/eik-lib/common/issues/225)) ([fd01a56](https://github.com/eik-lib/common/commit/fd01a566b404164bdc847cc7a1803b124e131e41))
|
|
22
|
+
* **deps:** update dependency validate-npm-package-name to v4 ([#222](https://github.com/eik-lib/common/issues/222)) ([c3721ab](https://github.com/eik-lib/common/commit/c3721abf058c93d4e500945c3c014c748c1f2acd))
|
|
23
|
+
|
|
24
|
+
# [3.0.0](https://github.com/eik-lib/common/compare/v2.0.3...v3.0.0) (2021-08-12)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* ensure absolute file paths work as expected ([4f6ce5e](https://github.com/eik-lib/common/commit/4f6ce5e251dcbf0df0b51cc36f73b10585b96538))
|
|
30
|
+
* include eik json schema file in package when publishing ([f0c3c45](https://github.com/eik-lib/common/commit/f0c3c45439a637e8a3cb3a475bca70f2a77c1901))
|
|
31
|
+
* update require statements to avoid circular dependencies ([4359bec](https://github.com/eik-lib/common/commit/4359bec140539c6144be48f7b9ff774b9601d068))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* add extension, mime-type and content-type to file location ([a9b4fe1](https://github.com/eik-lib/common/commit/a9b4fe15cf39425070b9bd260183656933d94c5d))
|
|
37
|
+
* Add hapi support for local assets ([7528c32](https://github.com/eik-lib/common/commit/7528c3277c537e7e0a4228c949988bc7e7a90074))
|
|
38
|
+
* add mappings() method to eik config object ([f989ae0](https://github.com/eik-lib/common/commit/f989ae0e2de0aa5646fd33d0f5854bc7e74c8734)), closes [/github.com/eik-lib/issues/issues/2#issuecomment-779099732](https://github.com//github.com/eik-lib/issues/issues/2/issues/issuecomment-779099732)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
* refactor!: packageURL removed, localAssets fixed and updated ([90fd181](https://github.com/eik-lib/common/commit/90fd1818f69384d4edeb056dc2c8367e51b21d44))
|
|
42
|
+
* refactor!: remove pathsAndFiles methods ([90d8a12](https://github.com/eik-lib/common/commit/90d8a12e4df8e3a37f295c6136e94bf4ade68cb4))
|
|
43
|
+
* feat!: preserve directory structure when globbing in config ([dff2830](https://github.com/eik-lib/common/commit/dff28301f9bc6e37ef9db32455fa64f5a7a9e80a))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### BREAKING CHANGES
|
|
47
|
+
|
|
48
|
+
* packageURL was removed as it no longer makes sense given the changes to eik json files config
|
|
49
|
+
|
|
50
|
+
localAssets has been refactored to use the new mappings method of eik config
|
|
51
|
+
* Consumers of the Eik Config class will all need to be updated to use the newer .mappings() method instead.
|
|
52
|
+
* directory structures are no longer flattened
|
|
53
|
+
|
|
54
|
+
# [4.0.0-next.4](https://github.com/eik-lib/common/compare/v4.0.0-next.3...v4.0.0-next.4) (2021-02-23)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Bug Fixes
|
|
58
|
+
|
|
59
|
+
* include eik json schema file in package when publishing ([f0c3c45](https://github.com/eik-lib/common/commit/f0c3c45439a637e8a3cb3a475bca70f2a77c1901))
|
|
60
|
+
|
|
1
61
|
# [4.0.0-next.3](https://github.com/eik-lib/common/compare/v4.0.0-next.2...v4.0.0-next.3) (2021-02-23)
|
|
2
62
|
|
|
3
63
|
|
package/eikjson.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface EikjsonSchema {
|
|
9
|
+
/**
|
|
10
|
+
* The URL address of the Eik server where packages are published to.
|
|
11
|
+
*/
|
|
12
|
+
server: string;
|
|
13
|
+
/**
|
|
14
|
+
* The name of the Eik package. Follows the same rules as for NPM package names. Must be parseable by validate-npm-package-name package, which is bundled with npm as a dependency.
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* The version of the Eik package. Follows the same rules as for NPM package versions. Must be parseable by node-semver, which is bundled with npm as a dependency.
|
|
19
|
+
*/
|
|
20
|
+
version: string;
|
|
21
|
+
/**
|
|
22
|
+
* The type of the Eik package. Must be one of 'package', 'npm' or 'map'. Setting this value changes the URL publish namespace between '/pkg' (default), '/npm' and '/map', use 'npm' when publishing NPM packages. Use 'map' when publishing import maps.
|
|
23
|
+
*/
|
|
24
|
+
type?: "package" | "npm" | "map";
|
|
25
|
+
/**
|
|
26
|
+
* File mapping definition for the package. Keys represent files or paths to be created on the Eik Server. Values represent paths to local files to be published.
|
|
27
|
+
*/
|
|
28
|
+
files:
|
|
29
|
+
| {
|
|
30
|
+
[k: string]: string;
|
|
31
|
+
}
|
|
32
|
+
| string;
|
|
33
|
+
/**
|
|
34
|
+
* Import map files given by URL(s) to be used during package bundling. Specified as a URL or array of URLs. URLs are locations of import map files that follow the W3C import map spec.
|
|
35
|
+
*/
|
|
36
|
+
"import-map"?: string | string[];
|
|
37
|
+
/**
|
|
38
|
+
* Location of local Eik build directory (defaults to .eik). Used by Eik client.
|
|
39
|
+
*/
|
|
40
|
+
out?: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable import/no-unresolved */
|
|
2
|
+
|
|
3
|
+
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
4
|
+
|
|
5
|
+
const main = () => {
|
|
6
|
+
// eslint-disable-next-line no-undef
|
|
7
|
+
const node = document.getElementById('hero');
|
|
8
|
+
|
|
9
|
+
scrollIntoView(node, {
|
|
10
|
+
scrollMode: 'if-needed',
|
|
11
|
+
block: 'nearest',
|
|
12
|
+
inline: 'nearest',
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
main();
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="26">
|
|
2
|
+
<defs>
|
|
3
|
+
<rect id="checkboxes-a" width="20" height="20" rx="4"/>
|
|
4
|
+
<path id="checkboxes-b" d="M4.42 7.6L3 9.03l4.45 4.47 7.05-7.07L13.08 5l-5.63 5.64z"/>
|
|
5
|
+
<rect id="checkboxes-d" width="20" height="20" x="3" y="3" rx="4"/>
|
|
6
|
+
<rect id="checkboxes-e" width="20" height="20" x="3" y="3" rx="4"/>
|
|
7
|
+
<path id="checkboxes-f" d="M4.42 7.6L3 9.03l4.45 4.47 7.05-7.07L13.08 5l-5.63 5.64z"/>
|
|
8
|
+
<rect id="checkboxes-h" width="20" height="20" x="3" y="3" rx="4"/>
|
|
9
|
+
</defs>
|
|
10
|
+
<g fill="none" fill-rule="evenodd">
|
|
11
|
+
<g transform="translate(81 3)">
|
|
12
|
+
<use fill="#FFF" xlink:href="#checkboxes-a"/>
|
|
13
|
+
<rect width="21" height="21" x="-.5" y="-.5" stroke="#DFE4E8" rx="4"/>
|
|
14
|
+
<g transform="translate(1 1)">
|
|
15
|
+
<path d="M0 0h18v18H0z"/>
|
|
16
|
+
<mask id="checkboxes-c" fill="#fff">
|
|
17
|
+
<use xlink:href="#checkboxes-b"/>
|
|
18
|
+
</mask>
|
|
19
|
+
<use fill="#767676" fill-rule="nonzero" xlink:href="#checkboxes-b"/>
|
|
20
|
+
<g fill="#DFE4E8" mask="url(#checkboxes-c)">
|
|
21
|
+
<rect width="18" height="18" rx="4"/>
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
</g>
|
|
25
|
+
<g transform="translate(52)">
|
|
26
|
+
<use fill="#FFF" xlink:href="#checkboxes-d"/>
|
|
27
|
+
<rect width="21" height="21" x="2.5" y="2.5" stroke="#DFE4E8" rx="4"/>
|
|
28
|
+
</g>
|
|
29
|
+
<g transform="translate(26)">
|
|
30
|
+
<use fill="#FFF" xlink:href="#checkboxes-e"/>
|
|
31
|
+
<rect width="21" height="21" x="2.5" y="2.5" stroke="#767676" rx="4"/>
|
|
32
|
+
<g transform="translate(4 4)">
|
|
33
|
+
<path d="M0 0h18v18H0z"/>
|
|
34
|
+
<mask id="checkboxes-g" fill="#fff">
|
|
35
|
+
<use xlink:href="#checkboxes-f"/>
|
|
36
|
+
</mask>
|
|
37
|
+
<use fill="#767676" fill-rule="nonzero" xlink:href="#checkboxes-f"/>
|
|
38
|
+
<g fill="#767676" mask="url(#checkboxes-g)">
|
|
39
|
+
<rect width="18" height="18" rx="4"/>
|
|
40
|
+
</g>
|
|
41
|
+
</g>
|
|
42
|
+
</g>
|
|
43
|
+
<use fill="#FFF" xlink:href="#checkboxes-h"/>
|
|
44
|
+
<rect width="21" height="21" x="2.5" y="2.5" stroke="#767676" rx="4"/>
|
|
45
|
+
</g>
|
|
46
|
+
</svg>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,66 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eik/common",
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"CHANGELOG.md",
|
|
9
|
-
"package.json",
|
|
10
|
-
"lib",
|
|
11
|
-
"types"
|
|
3
|
+
"workspaces": [
|
|
4
|
+
"packages/config-loader",
|
|
5
|
+
"packages/utils",
|
|
6
|
+
"packages/schemas",
|
|
7
|
+
"packages/validators"
|
|
12
8
|
],
|
|
13
|
-
"
|
|
14
|
-
"test": "tap --test-regex=.test.js --test-ignore=node_modules",
|
|
15
|
-
"lint:fix": "eslint --fix .",
|
|
16
|
-
"lint": "eslint .",
|
|
17
|
-
"schema:types": "json2ts lib/schemas/eikjson.schema.json > eikjson.d.ts",
|
|
18
|
-
"schema:outdated": "npm run schema:types && git diff --exit-code HEAD:eikjson.d.ts eikjson.d.ts",
|
|
19
|
-
"style:check": "prettier -c .",
|
|
20
|
-
"style:format": "prettier -w .",
|
|
21
|
-
"typecheck": "tsc",
|
|
22
|
-
"prepublish": "npm run typecheck"
|
|
23
|
-
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/eik-lib/common.git"
|
|
27
|
-
},
|
|
28
|
-
"keywords": [],
|
|
29
|
-
"author": "",
|
|
30
|
-
"license": "ISC",
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/eik-lib/common/issues"
|
|
33
|
-
},
|
|
34
|
-
"homepage": "https://github.com/eik-lib/common#readme",
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"ajv": "^7.0.0",
|
|
37
|
-
"ajv-formats": "^1.5.1",
|
|
38
|
-
"glob": "^7.1.6",
|
|
39
|
-
"is-glob": "^4.0.1",
|
|
40
|
-
"mime-types": "^2.1.29",
|
|
41
|
-
"node-fetch": "^2.6.1",
|
|
42
|
-
"semver": "^7.0.0",
|
|
43
|
-
"validate-npm-package-name": "^3.0.0"
|
|
44
|
-
},
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"@hapi/hapi": "^20.1.0",
|
|
47
|
-
"@semantic-release/changelog": "5.0.1",
|
|
48
|
-
"@semantic-release/commit-analyzer": "8.0.1",
|
|
49
|
-
"@semantic-release/git": "9.0.0",
|
|
50
|
-
"@semantic-release/github": "7.2.0",
|
|
51
|
-
"@semantic-release/npm": "7.0.10",
|
|
52
|
-
"@semantic-release/release-notes-generator": "9.0.1",
|
|
53
|
-
"eslint": "7.20.0",
|
|
54
|
-
"eslint-config-airbnb-base": "14.2.1",
|
|
55
|
-
"eslint-config-prettier": "7.2.0",
|
|
56
|
-
"eslint-plugin-import": "2.22.1",
|
|
57
|
-
"eslint-plugin-prettier": "3.3.1",
|
|
58
|
-
"express": "4.17.1",
|
|
59
|
-
"fastify": "3.12.0",
|
|
60
|
-
"json-schema-to-typescript": "^10.1.3",
|
|
61
|
-
"prettier": "2.2.1",
|
|
62
|
-
"semantic-release": "17.3.9",
|
|
63
|
-
"stoppable": "1.1.0",
|
|
64
|
-
"tap": "14.11.0"
|
|
65
|
-
}
|
|
9
|
+
"version": "4.0.0-next.6"
|
|
66
10
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const ReadFile = require('./src/classes/read-file.js');
|
|
2
|
+
const EikConfig = require('./src/eik-config.js');
|
|
3
|
+
const getDefaults = require('./src/get-defaults.js');
|
|
4
|
+
const configStore = require('./src/config-store.js');
|
|
5
|
+
const localAssets = require('./src/local-assets');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
ReadFile,
|
|
9
|
+
EikConfig,
|
|
10
|
+
getDefaults,
|
|
11
|
+
configStore,
|
|
12
|
+
localAssets,
|
|
13
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eik/common-config-loader",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared config loader for Eik packages",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "tap --no-check-coverage",
|
|
8
|
+
"test:snapshots:update": "tap --snapshot",
|
|
9
|
+
"lint:fix": "eslint --fix .",
|
|
10
|
+
"lint": "eslint .",
|
|
11
|
+
"style:check": "prettier -c .",
|
|
12
|
+
"style:format": "prettier -w .",
|
|
13
|
+
"typecheck": "tsc"
|
|
14
|
+
},
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@eik/common-schemas": "1.0.0",
|
|
18
|
+
"@eik/common-utils": "1.0.0",
|
|
19
|
+
"glob": "8.0.3",
|
|
20
|
+
"is-glob": "4.0.3",
|
|
21
|
+
"mime-types": "2.1.35",
|
|
22
|
+
"node-fetch": "2.6.6"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@babel/eslint-parser": "7.16.5",
|
|
26
|
+
"@hapi/hapi": "20.2.2",
|
|
27
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
28
|
+
"@semantic-release/git": "^10.0.1",
|
|
29
|
+
"@types/node": "18.0.6",
|
|
30
|
+
"eslint": "7.32.0",
|
|
31
|
+
"eslint-config-airbnb-base": "14.2.1",
|
|
32
|
+
"eslint-config-prettier": "8.5.0",
|
|
33
|
+
"eslint-plugin-import": "2.26.0",
|
|
34
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
35
|
+
"express": "4.18.1",
|
|
36
|
+
"fastify": "3.29.0",
|
|
37
|
+
"prettier": "2.5.1",
|
|
38
|
+
"stoppable": "1.1.0",
|
|
39
|
+
"tap": "15.2.3",
|
|
40
|
+
"typescript": "4.7.4"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @type {(value: unknown, message?: string) => asserts value}
|
|
5
5
|
*/
|
|
6
6
|
const assert = require('assert');
|
|
7
|
-
const LocalFileLocation = require('./local-file-location');
|
|
8
|
-
const RemoteFileLocation = require('./remote-file-location');
|
|
7
|
+
const LocalFileLocation = require('./local-file-location.js');
|
|
8
|
+
const RemoteFileLocation = require('./remote-file-location.js');
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Class containing a local file system source location and remote server destination location for a file.
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { isReadableStream } = require('
|
|
1
|
+
const { isReadableStream } = require('@eik/common-utils');
|
|
2
2
|
|
|
3
3
|
const ReadFile = class ReadFile {
|
|
4
4
|
constructor({ mimeType = '', etag = '' } = {}) {
|
|
@@ -29,4 +29,5 @@ const ReadFile = class ReadFile {
|
|
|
29
29
|
return 'ReadFile';
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
+
|
|
32
33
|
module.exports = ReadFile;
|
|
File without changes
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* @type {(value: unknown, message?: string) => asserts value}
|
|
3
3
|
*/
|
|
4
4
|
const assert = require('assert');
|
|
5
|
-
const LocalFileLocation = require('./local-file-location');
|
|
6
5
|
const {
|
|
7
6
|
removeLeadingSlash,
|
|
8
7
|
removeTrailingSlash,
|
|
9
|
-
} = require('
|
|
8
|
+
} = require('@eik/common-utils');
|
|
9
|
+
|
|
10
|
+
const LocalFileLocation = require('./local-file-location');
|
|
10
11
|
|
|
11
12
|
const originalFiles = Symbol('files');
|
|
12
13
|
|
|
@@ -2,10 +2,10 @@ const { readFileSync, writeFileSync } = require('fs');
|
|
|
2
2
|
const { join } = require('path');
|
|
3
3
|
const homedir = require('os').homedir();
|
|
4
4
|
|
|
5
|
-
const EikConfig = require('
|
|
6
|
-
const MissingConfigError = require('
|
|
7
|
-
const MultipleConfigSourcesError = require('
|
|
8
|
-
const InvalidConfigError = require('
|
|
5
|
+
const EikConfig = require('./eik-config.js');
|
|
6
|
+
const MissingConfigError = require('./errors/missing-config-error.js');
|
|
7
|
+
const MultipleConfigSourcesError = require('./errors/multiple-config-sources-error.js');
|
|
8
|
+
const InvalidConfigError = require('./errors/invalid-config-error.js');
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Read a file at a given path and parse it
|
|
@@ -5,14 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
const assert = require('assert');
|
|
7
7
|
const { extname, join, isAbsolute } = require('path');
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
8
|
+
const { typeSlug, removeTrailingSlash } = require('@eik/common-utils');
|
|
9
|
+
|
|
10
|
+
const schemas = require('@eik/common-schemas');
|
|
11
|
+
|
|
12
|
+
const resolveFiles = require('./utils/resolve-files.js');
|
|
13
|
+
|
|
14
|
+
const RemoteFileLocation = require('./classes/remote-file-location.js');
|
|
15
|
+
const FileMapping = require('./classes/file-mapping.js');
|
|
16
|
+
const SingleDestMultipleSourcesError = require('./errors/single-dest-multiple-source-error.js');
|
|
17
|
+
const NoFilesMatchedError = require('./errors/no-files-matched-error.js');
|
|
16
18
|
|
|
17
19
|
const _config = Symbol('config');
|
|
18
20
|
const _tokens = Symbol('tokens');
|
|
@@ -31,7 +33,7 @@ const normalizeFilesDefinition = (files) =>
|
|
|
31
33
|
* @typedef {import ("../../eikjson").EikjsonSchema} EikjsonSchema
|
|
32
34
|
*/
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
class EikConfig {
|
|
35
37
|
/**
|
|
36
38
|
* @param {EikjsonSchema?} configHash
|
|
37
39
|
* @param {[string, string][]?} tokens
|
|
@@ -162,4 +164,6 @@ module.exports = class EikConfig {
|
|
|
162
164
|
});
|
|
163
165
|
});
|
|
164
166
|
}
|
|
165
|
-
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
module.exports = EikConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
class CustomError extends Error {
|
|
2
2
|
/**
|
|
3
3
|
* @param {string} message
|
|
4
4
|
*/
|
|
@@ -7,4 +7,6 @@ module.exports = class CustomError extends Error {
|
|
|
7
7
|
this.name = this.constructor.name;
|
|
8
8
|
Error.captureStackTrace(this, this.constructor);
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = CustomError;
|