Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"typescriptreact"
],
"eslint.workingDirectories": ["./Composer"],
"typescript.tsdk": "./Composer/node_modules/typescript/lib",
Expand Down
31 changes: 19 additions & 12 deletions Composer/packages/electron-server/scripts/copy-artifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@ const { log } = require('./common');
const oneauthSource = () => {
const oneauthPath = path.resolve(__dirname, '../oneauth-temp');
if (['win32', 'darwin'].includes(process.platform) && fs.existsSync(oneauthPath)) {
return { source: oneauthPath, dest: 'oneauth', force: true };
return { source: oneauthPath, dest: 'oneauth', opts: { force: true } };
} else {
log.info('Skipping OneAuth. Either on an unsupported platform or it has not been installed to %s.', oneauthPath);
}
};

const sources = [
// extensions
{ source: path.resolve(__dirname, '../../../../extensions'), dest: 'extensions' },
{
source: path.resolve(__dirname, '../../../../extensions'),
dest: 'extensions',
// ignore hostedBots in localPublish extension
opts: { exclude: [/^node_modules/, /^src/, /^hostedBots/] },
},
// runtimes
{ source: path.resolve(__dirname, '../../../../runtime'), dest: 'runtime' },
{ source: path.resolve(__dirname, '../../../../runtime'), dest: 'runtime', opts: { exclude: [/^node_modules/] } },
// form-dialog templates
{
source: path.resolve(__dirname, '../../../node_modules/@microsoft/bf-generate-library/templates'),
Expand Down Expand Up @@ -56,28 +61,30 @@ switch (process.platform) {
process.exit(1);
}

const filterOutTS = (src) => {
// true keeps the file, false omits it
return !src.endsWith('.ts') || !src.endsWith('.ts.map');
};

async function copyArtifacts(source, dest, force = false) {
async function copyArtifacts(source, dest, opts = {}) {
log.info('-------- %s --------', dest);
log.info('Copying %s from: %s', dest, source);
for (const entry of fs.readdirSync(source, { withFileTypes: true })) {
if (force || entry.isDirectory()) {
if (opts.force || entry.isDirectory()) {
const extPath = path.join(source, entry.name);
const output = path.join(destinationDir, dest, entry.name);
log.info('Copying %s', entry.name);

await fs.copy(extPath, output, { filter: filterOutTS });
const filter = opts.exclude
? (src) => {
const relPath = path.relative(extPath, src);
return !opts.exclude.some((pattern) => pattern.test(relPath));
}
: undefined;

await fs.copy(extPath, output, { filter });
}
}
}

async function copyAll() {
for (const source of sources) {
await copyArtifacts(source.source, source.dest, source.force);
await copyArtifacts(source.source, source.dest, source.opts);
}
}

Expand Down
21 changes: 0 additions & 21 deletions extensions/authTest/package-lock.json

This file was deleted.

8 changes: 6 additions & 2 deletions extensions/authTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "authtest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "webpack"
},
"composer": {
"enabled": false
Expand All @@ -13,5 +13,9 @@
"license": "ISC",
"dependencies": {
"passport-local": "^1.0.0"
},
"devDependencies": {
"webpack": "^5.4.0",
"webpack-cli": "^4.2.0"
}
}
16 changes: 16 additions & 0 deletions extensions/authTest/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { resolve } = require('path');

module.exports = {
entry: './index.js',
mode: 'production',
devtool: 'source-map',
target: 'node',
output: {
path: resolve(__dirname, 'lib'),
filename: 'index.js',
libraryTarget: 'commonjs2',
},
resolve: {
extensions: ['.js', '.ts', '.tsx', '.json'],
},
};
Loading