mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
Allow Prettier default for trailing commas, run Prettier on repo
per convo with @claviska
This commit is contained in:
@@ -23,7 +23,7 @@ const packageData = JSON.parse(await readFile(join(rootDir, 'package.json'), 'ut
|
||||
const version = JSON.stringify(packageData.version.toString());
|
||||
let buildContexts = {
|
||||
bundledContext: {},
|
||||
unbundledContext: {}
|
||||
unbundledContext: {},
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -112,15 +112,15 @@ async function generateStyles() {
|
||||
'themes/default.css',
|
||||
'forms.css',
|
||||
'utilities',
|
||||
'utilities.css'
|
||||
'utilities.css',
|
||||
];
|
||||
|
||||
await Promise.all(
|
||||
alphaStyles.map(file =>
|
||||
copy(join(rootDir, `src/styles/${file}`), join(cdnDir, `styles/${file}.css`), {
|
||||
overwrite: true
|
||||
})
|
||||
)
|
||||
overwrite: true,
|
||||
}),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
await copy(join(rootDir, 'src/styles'), join(cdnDir, 'styles'), { overwrite: true });
|
||||
@@ -172,20 +172,20 @@ async function generateBundle() {
|
||||
// Translations
|
||||
...(await globby('./src/translations/**/*.ts')),
|
||||
// React wrappers
|
||||
...(await globby('./src/react/**/*.ts'))
|
||||
...(await globby('./src/react/**/*.ts')),
|
||||
],
|
||||
outdir: cdnDir,
|
||||
chunkNames: 'chunks/[name].[hash]',
|
||||
define: {
|
||||
'process.env.NODE_ENV': '"production"' // required by Floating UI
|
||||
'process.env.NODE_ENV': '"production"', // required by Floating UI
|
||||
},
|
||||
bundle: true,
|
||||
splitting: true,
|
||||
minify: false,
|
||||
plugins: [replace({ __WEBAWESOME_VERSION__: version }), litCssPlugin()],
|
||||
loader: {
|
||||
'.css': 'text'
|
||||
}
|
||||
'.css': 'text',
|
||||
},
|
||||
};
|
||||
|
||||
const unbundledConfig = {
|
||||
@@ -194,7 +194,7 @@ async function generateBundle() {
|
||||
treeShaking: true,
|
||||
// Don't inline libraries like Lit etc.
|
||||
packages: 'external',
|
||||
outdir: distDir
|
||||
outdir: distDir,
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -297,8 +297,8 @@ if (isDeveloping) {
|
||||
server: {
|
||||
baseDir: siteDir,
|
||||
routes: {
|
||||
'/dist/': './dist-cdn/'
|
||||
}
|
||||
'/dist/': './dist-cdn/',
|
||||
},
|
||||
},
|
||||
callbacks: {
|
||||
ready: (_err, instance) => {
|
||||
@@ -319,13 +319,13 @@ if (isDeveloping) {
|
||||
|
||||
res.end();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
() => {
|
||||
spinner.succeed();
|
||||
console.log(`\nThe dev server is running at ${chalk.cyan(url)}\n`);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Rebuild and reload when source files change
|
||||
|
||||
@@ -5,7 +5,7 @@ import { docsDir, siteDir } from './utils.js';
|
||||
|
||||
const elev = new Eleventy(docsDir, siteDir, {
|
||||
quietMode: true,
|
||||
configPath: join(docsDir, '.eleventy.js')
|
||||
configPath: join(docsDir, '.eleventy.js'),
|
||||
});
|
||||
|
||||
// Cleanup
|
||||
|
||||
@@ -65,8 +65,8 @@ for await (const component of components) {
|
||||
export default reactWrapper
|
||||
`,
|
||||
Object.assign(prettierConfig, {
|
||||
parser: 'babel-ts'
|
||||
})
|
||||
parser: 'babel-ts',
|
||||
}),
|
||||
);
|
||||
|
||||
index.push(`export { default as ${component.name} } from './${tagWithoutPrefix}/index.js';`);
|
||||
|
||||
@@ -26,30 +26,30 @@ export default function (plop) {
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
type: 'add',
|
||||
path: '../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.ts',
|
||||
templateFile: 'templates/component/component.hbs'
|
||||
templateFile: 'templates/component/component.hbs',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: '../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.styles.ts',
|
||||
templateFile: 'templates/component/styles.hbs'
|
||||
templateFile: 'templates/component/styles.hbs',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: '../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.test.ts',
|
||||
templateFile: 'templates/component/tests.hbs'
|
||||
templateFile: 'templates/component/tests.hbs',
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: '../../docs/docs/components/{{ tagWithoutPrefix tag }}.md',
|
||||
templateFile: 'templates/component/docs.hbs'
|
||||
}
|
||||
]
|
||||
templateFile: 'templates/component/docs.hbs',
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user