Skip to content

Commit

Permalink
feat: setup tests, rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
fkakatie committed Aug 28, 2023
1 parent d06e165 commit eed36b7
Show file tree
Hide file tree
Showing 3 changed files with 207 additions and 4 deletions.
146 changes: 146 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"version": "0.0.1",
"description": "AEM Library",
"scripts": {
"build": "rollup --config --environment NODE_ENV:development",
"lint:js": "eslint .",
"lint:css": "stylelint blocks/**/*.css styles/*.css",
"lint": "npm run lint:js && npm run lint:css"
"lint": "npm run lint:js && npm run lint:css",
"test": "wtr test/**/*.test.js --node-resolve"
},
"repository": {
"type": "git",
Expand All @@ -21,13 +23,15 @@
"devDependencies": {
"@babel/core": "7.21.0",
"@babel/eslint-parser": "7.19.1",
"@esm-bundle/chai": "4.3.4-fix.0",
"@web/test-runner": "0.15.1",
"@web/test-runner-commands": "0.6.5",
"chai": "4.3.7",
"eslint": "8.35.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.27.5",
"@esm-bundle/chai": "4.3.4-fix.0",
"@web/test-runner": "0.15.1",
"@web/test-runner-commands": "0.6.5",
"rollup": "^2.79.1",
"rollup-plugin-cleanup": "^3.2.1",
"sinon": "15.0.1",
"stylelint": "15.2.0",
"stylelint-config-standard": "30.0.1"
Expand Down
53 changes: 53 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright 2022 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

import cleanup from 'rollup-plugin-cleanup';

const banner = `/*
* Copyright ${new Date().getFullYear()} Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
`;

const bundles = [
{
source: 'src/lib-franklin.js',
outputFile: 'dist/aem-lib',
},
];

export default [...bundles.map(({ outputFile, source }) => ({
input: source,
inlineDynamicImports: true,
output: [
{
file: `${outputFile}.js`,
format: 'es',
sourcemap: false,
exports: 'auto',
banner,
},
].filter((m) => m),
plugins: [
cleanup({
comments: ['eslint', 'jsdoc', /^\//],
maxEmptyLines: -1,
}),
],
}))];

0 comments on commit eed36b7

Please sign in to comment.